Skip to content

Commit

Permalink
Update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Jan 4, 2024
1 parent 3282ba2 commit 7726e65
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void validateAgainstJenkins(TestCase testCase) throws IOException {

static final List<String> testCasesWithMissingException = Arrays.asList(
"examples-tables.feature",
"hooks.feature",
"pending.feature",
"retry.feature",
"undefined.feature",
Expand Down
3 changes: 3 additions & 0 deletions testdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ the [`fake-cucumber` reference implementation](https://github.com/cucumber/fake-

We ensure the `.ndjson` files stay up to date by running `npm install` in CI
and verifying nothing changed.

Should there be changes, these tests can be used to update the expected data:
* Java: `MessagesToJunitXmlWriterAcceptanceTest.updateExpectedXmlReportFiles`
33 changes: 24 additions & 9 deletions testdata/attachments.feature.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.043" tests="7" skipped="0" failures="0" errors="0">
<testsuite name="Cucumber" time="0.061" tests="10" skipped="0" failures="0" errors="0">
<testcase classname="Attachments" name="Strings can be attached with a media type" time="0.005">
<system-out><![CDATA[
When the string "hello" is attached as "application/octet-stream"...........passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Log JSON" time="0.005">
<system-out><![CDATA[
When the following string is attached as "application/json":................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Log text" time="0.005">
<system-out><![CDATA[
When the string "hello" is logged...........................................passed
Expand All @@ -20,19 +15,39 @@ When the string "hello" is logged...........................................pass
When text with ANSI escapes is logged.......................................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Log JSON" time="0.005">
<system-out><![CDATA[
When the following string is attached as "application/json":................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Byte arrays are base64-encoded regardless of media type" time="0.005">
<system-out><![CDATA[
When an array with 10 bytes is attached as "text/plain".....................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Streams are always base64-encoded" time="0.005">
<testcase classname="Attachments" name="Attaching JPEG images" time="0.005">
<system-out><![CDATA[
When a JPEG image is attached...............................................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Attaching images in examples - Example #1.1" time="0.005">
<testcase classname="Attachments" name="Attaching PNG images" time="0.005">
<system-out><![CDATA[
When a PNG image is attached................................................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Attaching images in an examples table - Example #1.1" time="0.005">
<system-out><![CDATA[
When a JPEG image is attached...............................................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Attaching images in an examples table - Example #1.2" time="0.005">
<system-out><![CDATA[
When a PNG image is attached................................................passed
]]></system-out>
</testcase>
<testcase classname="Attachments" name="Attaching PDFs with a different filename" time="0.005">
<system-out><![CDATA[
When the cucumber.png png is attached.......................................passed
When a PDF document is attached and renamed.................................passed
]]></system-out>
</testcase>
</testsuite>
20 changes: 10 additions & 10 deletions testdata/examples-tables.feature.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.049" tests="6" skipped="0" failures="4" errors="0">
<testcase classname="Examples Tables" name="eating cucumbers - These are passing - Example #1.1" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are passing - Example #1.1" time="0.007">
<system-out><![CDATA[
Given there are 12 cucumbers................................................passed
When I eat 5 cucumbers......................................................passed
Then I should have 7 cucumbers..............................................passed
]]></system-out>
</testcase>
<testcase classname="Examples Tables" name="eating cucumbers - These are passing - Example #1.2" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are passing - Example #1.2" time="0.007">
<system-out><![CDATA[
Given there are 20 cucumbers................................................passed
When I eat 5 cucumbers......................................................passed
Then I should have 15 cucumbers.............................................passed
]]></system-out>
</testcase>
<testcase classname="Examples Tables" name="eating cucumbers - These are failing - Example #2.1" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are failing - Example #2.1" time="0.007">
<failure type="AssertionError" message="Expected values to be strictly equal:
-8 !== 0
Expand All @@ -23,16 +23,16 @@ Then I should have 15 cucumbers.............................................pass
-8 !== 0
samples/examples-tables/examples-tables.feature:10
samples/examples-tables/examples-tables.feature:21]]>
samples/examples-tables/examples-tables.feature:9
samples/examples-tables/examples-tables.feature:20]]>
</failure>
<system-out><![CDATA[
Given there are 12 cucumbers................................................passed
When I eat 20 cucumbers.....................................................passed
Then I should have 0 cucumbers..............................................failed
]]></system-out>
</testcase>
<testcase classname="Examples Tables" name="eating cucumbers - These are failing - Example #2.2" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are failing - Example #2.2" time="0.007">
<failure type="AssertionError" message="Expected values to be strictly equal:
-1 !== 0
Expand All @@ -41,24 +41,24 @@ Then I should have 0 cucumbers..............................................fail
-1 !== 0
samples/examples-tables/examples-tables.feature:10
samples/examples-tables/examples-tables.feature:22]]>
samples/examples-tables/examples-tables.feature:9
samples/examples-tables/examples-tables.feature:21]]>
</failure>
<system-out><![CDATA[
Given there are 0 cucumbers.................................................passed
When I eat 1 cucumbers......................................................passed
Then I should have 0 cucumbers..............................................failed
]]></system-out>
</testcase>
<testcase classname="Examples Tables" name="eating cucumbers - These are undefined because the value is not an {int} - Example #3.1" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are undefined because the value is not an {int} - Example #3.1" time="0.007">
<failure/>
<system-out><![CDATA[
Given there are 12 cucumbers................................................passed
When I eat banana cucumbers.................................................undefined
Then I should have 12 cucumbers.............................................skipped
]]></system-out>
</testcase>
<testcase classname="Examples Tables" name="eating cucumbers - These are undefined because the value is not an {int} - Example #3.2" time="0.007">
<testcase classname="Examples Tables" name="Eating cucumbers - These are undefined because the value is not an {int} - Example #3.2" time="0.007">
<failure/>
<system-out><![CDATA[
Given there are 0 cucumbers.................................................passed
Expand Down
33 changes: 11 additions & 22 deletions testdata/hooks.feature.xml
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.055" tests="5" skipped="0" failures="5" errors="0">
<testcase classname="Hooks" name="no tags, passed step" time="0.009">
<failure type="Error" message="Exception in hook">
<![CDATA[Exception in hook
samples/hooks/hooks.feature:5]]>
</failure>
<testsuite name="Cucumber" time="0.055" tests="5" skipped="0" failures="3" errors="0">
<testcase classname="Hooks" name="No tags and a passed step" time="0.009">
<system-out><![CDATA[
When a step passes..........................................................passed
]]></system-out>
</testcase>
<testcase classname="Hooks" name="no tags, failed step" time="0.009">
<testcase classname="Hooks" name="No tags and a failed step" time="0.009">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/hooks/hooks.feature:9]]>
samples/hooks/hooks.feature:10]]>
</failure>
<system-out><![CDATA[
When a step throws an exception.............................................failed
When a step fails...........................................................failed
]]></system-out>
</testcase>
<testcase classname="Hooks" name="no tags, undefined step" time="0.009">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/hooks/hooks.feature:12]]>
</failure>
<testcase classname="Hooks" name="No tags and a undefined step" time="0.009">
<failure/>
<system-out><![CDATA[
When a step throws an exception.............................................failed
When a step does not exist..................................................undefined
]]></system-out>
</testcase>
<testcase classname="Hooks" name="with a tag, passed step" time="0.011">
<testcase classname="Hooks" name="With a tag, a failure in the hook and a passed step" time="0.011">
<failure type="Error" message="Exception in conditional hook">
<![CDATA[Exception in conditional hook
samples/hooks/hooks.feature:15]]>
samples/hooks/hooks.feature:16]]>
</failure>
<system-out><![CDATA[
When a step passes..........................................................passed
]]></system-out>
</testcase>
<testcase classname="Hooks" name="with an attachment in the hook" time="0.011">
<failure type="Error" message="Exception in hook">
<![CDATA[Exception in hook
samples/hooks/hooks.feature:19]]>
</failure>
<testcase classname="Hooks" name="With an tag, an valid attachment in the hook and a passed step" time="0.011">
<system-out><![CDATA[
When a step passes..........................................................passed
]]></system-out>
Expand Down
4 changes: 2 additions & 2 deletions testdata/parameter-types.feature.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.005" tests="1" skipped="0" failures="0" errors="0">
<testcase classname="Parameter Types" name="flights" time="0.003">
<testcase classname="Parameter Types" name="Flight transformer" time="0.003">
<system-out><![CDATA[
Given LHR-CDG has been delayed 45 minutes...................................passed
Given LHR-CDG has been delayed..............................................passed
]]></system-out>
</testcase>
</testsuite>
22 changes: 14 additions & 8 deletions testdata/pending.feature.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.017" tests="3" skipped="0" failures="3" errors="0">
<testcase classname="Pending steps" name="Unimplemented step signals pending status" time="0.003">
<failure/>
<failure>
<![CDATA[TODO]]>
</failure>
<system-out><![CDATA[
Given a step that isnt implemented yet......................................pending
Given an unimplemented pending step.........................................pending
]]></system-out>
</testcase>
<testcase classname="Pending steps" name="Steps before unimplemented steps are executed" time="0.005">
<failure/>
<failure>
<![CDATA[TODO]]>
</failure>
<system-out><![CDATA[
Given an implemented step...................................................passed
When a step that isnt implemented yet.......................................pending
Given an implemented non-pending step.......................................passed
And an unimplemented pending step...........................................pending
]]></system-out>
</testcase>
<testcase classname="Pending steps" name="Steps after unimplemented steps are skipped" time="0.005">
<failure/>
<failure>
<![CDATA[TODO]]>
</failure>
<system-out><![CDATA[
Given a step that isnt implemented yet......................................pending
Then a step that we expect to be skipped....................................skipped
Given an unimplemented pending step.........................................pending
And an implemented step that is skipped.....................................skipped
]]></system-out>
</testcase>
</testsuite>
32 changes: 16 additions & 16 deletions testdata/retry.feature.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.041" tests="10" skipped="0" failures="7" errors="0">
<testcase classname="Retry" name="test case passes on the first attempt" time="0.003">
<testcase classname="Retry" name="Test cases that pass aren't retried" time="0.003">
<system-out><![CDATA[
Given a step that always passes.............................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case passes on the second attempt" time="0.003">
<testcase classname="Retry" name="Test cases that fail are retried if within the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:13]]>
samples/retry/retry.feature:12]]>
</failure>
<system-out><![CDATA[
Given a step that passes the second time....................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case passes on the second attempt" time="0.003">
<testcase classname="Retry" name="Test cases that fail are retried if within the --retry limit" time="0.003">
<system-out><![CDATA[
Given a step that passes the second time....................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case passes on the final attempt" time="0.003">
<testcase classname="Retry" name="Test cases that fail will continue to retry up to the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:16]]>
samples/retry/retry.feature:15]]>
</failure>
<system-out><![CDATA[
Given a step that passes the third time.....................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case passes on the final attempt" time="0.003">
<testcase classname="Retry" name="Test cases that fail will continue to retry up to the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:16]]>
samples/retry/retry.feature:15]]>
</failure>
<system-out><![CDATA[
Given a step that passes the third time.....................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case passes on the final attempt" time="0.003">
<testcase classname="Retry" name="Test cases that fail will continue to retry up to the --retry limit" time="0.003">
<system-out><![CDATA[
Given a step that passes the third time.....................................passed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case fails on every attempt" time="0.003">
<testcase classname="Retry" name="Test cases won't retry after failing more than the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:19]]>
samples/retry/retry.feature:18]]>
</failure>
<system-out><![CDATA[
Given a step that always fails..............................................failed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case fails on every attempt" time="0.003">
<testcase classname="Retry" name="Test cases won't retry after failing more than the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:19]]>
samples/retry/retry.feature:18]]>
</failure>
<system-out><![CDATA[
Given a step that always fails..............................................failed
]]></system-out>
</testcase>
<testcase classname="Retry" name="test case fails on every attempt" time="0.003">
<testcase classname="Retry" name="Test cases won't retry after failing more than the --retry limit" time="0.003">
<failure type="Error" message="Exception in step">
<![CDATA[Exception in step
samples/retry/retry.feature:19]]>
samples/retry/retry.feature:18]]>
</failure>
<system-out><![CDATA[
Given a step that always fails..............................................failed
]]></system-out>
</testcase>
<testcase classname="Retry" name="don't retry on UNDEFINED" time="0.003">
<testcase classname="Retry" name="Test cases won't retry when the status is UNDEFINED" time="0.003">
<failure/>
<system-out><![CDATA[
Given a non-existent step...................................................undefined
Expand Down
27 changes: 14 additions & 13 deletions testdata/rules.feature.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="Cucumber" time="0.029" tests="3" skipped="0" failures="0" errors="0">
<testcase classname="Rules" name="a sale cannot happen if change cannot be returned - no change" time="0.007">
<testsuite name="Cucumber" time="0.031" tests="3" skipped="0" failures="0" errors="0">
<testcase classname="Usage of a `Rule`" name="A sale cannot happen if the customer does not have enough money - Not enough money" time="0.009">
<system-out><![CDATA[
Given there are 5 0.20 coins inside.........................................passed
When the customer tries to buy a 0.85 chocolate with a 1 coin...............passed
Given the customer has 100 cents............................................passed
And there are chocolate bars in stock.......................................passed
When the customer tries to buy a 125 cent chocolate bar.....................passed
Then the sale should not happen.............................................passed
]]></system-out>
</testcase>
<testcase classname="Rules" name="a sale cannot happen if change cannot be returned - exact change" time="0.009">
<testcase classname="Usage of a `Rule`" name="A sale cannot happen if the customer does not have enough money - Enough money" time="0.009">
<system-out><![CDATA[
Given there are 5 0.20 coins inside.........................................passed
And there are 3 chocolates inside...........................................passed
When the customer tries to buy a 0.80 chocolate with a 1 coin...............passed
Then the customer's change should be 1 0.20 coin............................passed
Given the customer has 100 cents............................................passed
And there are chocolate bars in stock.......................................passed
When the customer tries to buy a 75 cent chocolate bar......................passed
Then the sale should happen.................................................passed
]]></system-out>
</testcase>
<testcase classname="Rules" name="a sale cannot happen if we're out of stock - no chocolates left" time="0.009">
<testcase classname="Usage of a `Rule`" name="a sale cannot happen if there is no stock - No chocolates left" time="0.009">
<system-out><![CDATA[
Given there are no chocolates inside........................................passed
But there are 10 0.5 coins inside...........................................passed
When the customer tries to buy a 0.85 chocolate with a 1 coin...............passed
Given the customer has 100 cents............................................passed
And there are no chocolate bars in stock....................................passed
When the customer tries to buy a 1 cent chocolate bar.......................passed
Then the sale should not happen.............................................passed
]]></system-out>
</testcase>
Expand Down
Loading

0 comments on commit 7726e65

Please sign in to comment.