Skip to content

Commit

Permalink
Merge pull request #91 from craigatk/even-larger
Browse files Browse the repository at this point in the history
(feature) Better handle even larger sets of system output
  • Loading branch information
craigatk committed May 14, 2020
2 parents c0d37ee + 08f8901 commit 6b37b19
Show file tree
Hide file tree
Showing 14 changed files with 30,198 additions and 151 deletions.
14 changes: 10 additions & 4 deletions cypress-common/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,24 @@ Cypress.Commands.add("getTestCaseLinkInList", (testSuiteIdx, testCaseIdx) =>
);

Cypress.Commands.add("getCodeText", () => cy.getByTestId("code-text"));
Cypress.Commands.add("getCodeTextLine", lineIdx =>
cy.getByTestId(`code-text-line-${lineIdx}`)
Cypress.Commands.add("getCodeTextLine", (lineIdx, highlighted) =>
cy.getByTestId(`code-text-line-${lineIdx}-${highlighted}`)
);
Cypress.Commands.add("getCodeTextLineNotHighlighted", (lineIdx) =>
cy.getCodeTextLine(lineIdx, false)
);
Cypress.Commands.add("getCodeTextLineHighlighted", (lineIdx) =>
cy.getCodeTextLine(lineIdx, true)
);
Cypress.Commands.add("codeLineShouldBeHighlighted", lineIdx =>
cy
.getCodeTextLine(lineIdx)
.getCodeTextLineHighlighted(lineIdx)
.should("have.css", "background-color")
.and("be.colored", "#F9F9F9")
);
Cypress.Commands.add("codeLineShouldNotBeHighlighted", lineIdx =>
cy
.getCodeTextLine(lineIdx)
.getCodeTextLineNotHighlighted(lineIdx)
.should("have.css", "background-color")
.and("not.be.colored", "#F5F5F5")
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package projektor.example.spock

import spock.lang.Specification

class ReallyLongOutput10000Spec extends Specification {
def "should include lots of system out and system err"() {
given:
String longString = (1..100).collect { "$it" }.join("")
println longString
10000.times { println "System out line $it"}

when:
int actual = 1

then:
10000.times { System.err.println("System err line $it") }
actual == 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package projektor.example.spock

import spock.lang.Specification

class ReallyLongOutput5000Spec extends Specification {
def "should include lots of system out and system err"() {
given:
String longString = (1..100).collect { "$it" }.join("")
println longString
5000.times { println "System out line $it"}

when:
int actual = 1

then:
5000.times { System.err.println("System err line $it") }
actual == 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fun loadAllExamples() {
resultsXmlLoader.longOutput(),
resultsXmlLoader.output(),
resultsXmlLoader.reallyLongOutput(),
resultsXmlLoader.reallyLongOutput5000(),
resultsXmlLoader.reallyLongOutput10000(),
resultsXmlLoader.someIgnored(),
resultsXmlLoader.someIgnoredSomeFailing()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class ResultsXmlLoader {

fun reallyLongOutput() = loadTextFromFile("TEST-projektor.example.spock.ReallyLongOutputSpec.xml")

fun reallyLongOutput5000() = loadTextFromFile("TEST-projektor.example.spock.ReallyLongOutput5000Spec.xml")

fun reallyLongOutput10000() = loadTextFromFile("TEST-projektor.example.spock.ReallyLongOutput10000Spec.xml")

fun output() = loadTextFromFile("TEST-projektor.example.spock.OutputSpec.xml")

fun someIgnored() = loadTextFromFile("TEST-projektor.example.spock.IgnoreSomeMethodsSpec.xml")
Expand Down
Loading

0 comments on commit 6b37b19

Please sign in to comment.