Skip to content

Commit 0bfbf34

Browse files
committed
[CCK] Update compatibility with messages:12.3.2
1 parent 3d26856 commit 0bfbf34

File tree

16 files changed

+112
-71
lines changed

16 files changed

+112
-71
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## [Unreleased] (In Git)
99

1010
### Added
11-
* Include SourceReferences in message output ([#2064](https://github.com/cucumber/cucumber-jvm/issues/2064) M.P. Korstanje)
12-
* Enable searching and filtering in html report ([cucumber/#1111](https://github.com/cucumber/cucumber/pull/1111) Vincent Psarga)
11+
* [Core] Include SourceReferences in message output ([#2064](https://github.com/cucumber/cucumber-jvm/issues/2064) M.P. Korstanje)
12+
* [Core] Enable searching and filtering in html report ([cucumber/#1111](https://github.com/cucumber/cucumber/pull/1111) Vincent Psarga)
1313

1414
### Changed
1515

compatibility/src/test/java/io/cucumber/compatibility/attachments/Attachments.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ public void theStringIsLogged(String text) {
2828
scenario.log(text);
2929
}
3030

31-
@When("an array with {int} bytes are attached as {string}")
31+
@When("text with ANSI escapes is logged")
32+
public void theTextWithANSIEscapesIsLogged() {
33+
scenario.log(
34+
"This displays a \u001b[31mr\u001b[0m\u001b[91ma\u001b[0m\u001b[33mi\u001b[0m\u001b[32mn\u001b[0m\u001b[34mb\u001b[0m\u001b[95mo\u001b[0m\u001b[35mw\u001b[0m");
35+
}
36+
37+
@When("the following string is attached as {string}:")
38+
public void theFollowingStringIsAttachedAs(String mediaType, String text) {
39+
scenario.attach(text, mediaType, null);
40+
}
41+
42+
@When("an array with {int} bytes is attached as {string}")
3243
public void anArrayWithBytesAreAttachedAs(int n, String mediaType) {
3344
byte[] bytes = new byte[n];
3445
for (byte i = 0; i < n; i++) {

compatibility/src/test/java/io/cucumber/compatibility/matchers/AComparableMessage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ private static List<Matcher<?>> extractExpectedFields(GeneratedMessageV3 expecte
8989
case "cpu":
9090
expected.add(hasEntry(is(fieldName), isA(expectedValue.getClass())));
9191
break;
92-
92+
case "ci":
93+
expected.add(not(hasKey(is(fieldName))));
94+
break;
9395
default:
9496
expected.add(hasEntry(is(fieldName), aComparableValue(expectedValue, depth)));
9597
}

compatibility/src/test/resources/features/attachments/attachments.feature

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,26 @@ Feature: Attachments
99

1010
Attachments must have a body and a content type
1111

12-
Scenario: Strings are identity-encoded regardless of media type
12+
Scenario: Strings can be attached with a media type
1313
Beware that some formatters such as @cucumber/react use the media type
1414
to determine how to display an attachment.
15-
15+
1616
When the string "hello" is attached as "application/octet-stream"
1717

18+
Scenario: Log JSON
19+
When the following string is attached as "application/json":
20+
```
21+
{"message": "The <b>big</b> question", "foo": "bar"}
22+
```
23+
1824
Scenario: Log text
1925
When the string "hello" is logged
2026

27+
Scenario: Log ANSI coloured text
28+
When text with ANSI escapes is logged
29+
2130
Scenario: Byte arrays are base64-encoded regardless of media type
22-
When an array with 10 bytes are attached as "text/plain"
31+
When an array with 10 bytes is attached as "text/plain"
2332

2433
Scenario: Streams are always base64-encoded
2534
When a JPEG image is attached

compatibility/src/test/resources/features/attachments/attachments.ndjson

Lines changed: 63 additions & 43 deletions
Large diffs are not rendered by default.

compatibility/src/test/resources/features/data-tables/data-tables.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"meta":{"protocolVersion":"12.0.0","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"13.11.0"},"os":{"name":"darwin","version":"Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64"},"cpu":{"name":"x64"}}}
1+
{"meta":{"protocolVersion":"12.1.1","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"12.16.2"},"os":{"name":"linux","version":"4.19.76-linuxkit"},"cpu":{"name":"x64"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber/cucumber-ruby/actions/runs/140170388","git":{"remote":"https://github.com/cucumber/cucumber-ruby.git","revision":"the-revision","tag":"the-tag"}}}}
22
{"source":{"uri":"features/data-tables/data-tables.feature","data":"Feature: Data Tables\n Data Tables can be places underneath a step and will be passed as the last\n argument to the step definition. They can be used to represent richer data\n structures, and can also be transformed to other types.\n\n Scenario: transposed table\n When the following table is transposed:\n | a | b |\n | 1 | 2 |\n Then it should be:\n | a | 1 |\n | b | 2 |\n","mediaType":"text/x.cucumber.gherkin+plain"}}
33
{"gherkinDocument":{"uri":"features/data-tables/data-tables.feature","feature":{"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Data Tables","description":" Data Tables can be places underneath a step and will be passed as the last\n argument to the step definition. They can be used to represent richer data\n structures, and can also be transformed to other types.","children":[{"scenario":{"location":{"line":6,"column":3},"keyword":"Scenario","name":"transposed table","steps":[{"location":{"line":7,"column":5},"keyword":"When ","text":"the following table is transposed:","dataTable":{"location":{"line":8,"column":7},"rows":[{"location":{"line":8,"column":7},"cells":[{"location":{"line":8,"column":9},"value":"a"},{"location":{"line":8,"column":13},"value":"b"}],"id":"2"},{"location":{"line":9,"column":7},"cells":[{"location":{"line":9,"column":9},"value":"1"},{"location":{"line":9,"column":13},"value":"2"}],"id":"3"}]},"id":"4"},{"location":{"line":10,"column":5},"keyword":"Then ","text":"it should be:","dataTable":{"location":{"line":11,"column":7},"rows":[{"location":{"line":11,"column":7},"cells":[{"location":{"line":11,"column":9},"value":"a"},{"location":{"line":11,"column":13},"value":"1"}],"id":"5"},{"location":{"line":12,"column":7},"cells":[{"location":{"line":12,"column":9},"value":"b"},{"location":{"line":12,"column":13},"value":"2"}],"id":"6"}]},"id":"7"}],"id":"8"}}]}}}
44
{"pickle":{"id":"11","uri":"features/data-tables/data-tables.feature","name":"transposed table","language":"en","steps":[{"text":"the following table is transposed:","argument":{"dataTable":{"rows":[{"cells":[{"value":"a"},{"value":"b"}]},{"cells":[{"value":"1"},{"value":"2"}]}]}},"id":"9","astNodeIds":["4"]},{"text":"it should be:","argument":{"dataTable":{"rows":[{"cells":[{"value":"a"},{"value":"1"}]},{"cells":[{"value":"b"},{"value":"2"}]}]}},"id":"10","astNodeIds":["7"]}],"astNodeIds":["8"]}}

compatibility/src/test/resources/features/examples-tables/examples-tables.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"meta":{"protocolVersion":"12.0.0","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"13.11.0"},"os":{"name":"darwin","version":"Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64"},"cpu":{"name":"x64"}}}
1+
{"meta":{"protocolVersion":"12.1.1","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"12.16.2"},"os":{"name":"linux","version":"4.19.76-linuxkit"},"cpu":{"name":"x64"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber/cucumber-ruby/actions/runs/140170388","git":{"remote":"https://github.com/cucumber/cucumber-ruby.git","revision":"the-revision","tag":"the-tag"}}}}
22
{"source":{"uri":"features/examples-tables/examples-tables.feature","data":"Feature: Examples Tables\n Sometimes it can be desireable to run the same scenario multiple times\n with different data each time. This can be done by placing an Examples\n section with an Examples Table underneath a Scenario, and use <placeholders>\n in the Scenario, matching the table headers.\n\n Scenario Outline: eating cucumbers\n Given there are <start> cucumbers\n When I eat <eat> cucumbers\n Then I should have <left> cucumbers\n\n Examples: These are passing\n | start | eat | left |\n | 12 | 5 | 7 |\n | 20 | 5 | 15 |\n\n Examples: These are failing\n | start | eat | left |\n | 12 | 20 | 0 |\n | 0 | 1 | 0 |\n\n Examples: These are undefined because the value is not an {int}\n | start | eat | left |\n | 12 | banana | 12 |\n | 0 | 1 | apple |\n","mediaType":"text/x.cucumber.gherkin+plain"}}
33
{"gherkinDocument":{"uri":"features/examples-tables/examples-tables.feature","feature":{"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Examples Tables","description":" Sometimes it can be desireable to run the same scenario multiple times\n with different data each time. This can be done by placing an Examples\n section with an Examples Table underneath a Scenario, and use <placeholders>\n in the Scenario, matching the table headers.","children":[{"scenario":{"location":{"line":7,"column":3},"keyword":"Scenario Outline","name":"eating cucumbers","steps":[{"location":{"line":8,"column":5},"keyword":"Given ","text":"there are <start> cucumbers","id":"3"},{"location":{"line":9,"column":5},"keyword":"When ","text":"I eat <eat> cucumbers","id":"4"},{"location":{"line":10,"column":5},"keyword":"Then ","text":"I should have <left> cucumbers","id":"5"}],"examples":[{"location":{"line":12,"column":5},"keyword":"Examples","name":"These are passing","tableHeader":{"location":{"line":13,"column":7},"cells":[{"location":{"line":13,"column":9},"value":"start"},{"location":{"line":13,"column":17},"value":"eat"},{"location":{"line":13,"column":23},"value":"left"}],"id":"6"},"tableBody":[{"location":{"line":14,"column":7},"cells":[{"location":{"line":14,"column":12},"value":"12"},{"location":{"line":14,"column":19},"value":"5"},{"location":{"line":14,"column":26},"value":"7"}],"id":"7"},{"location":{"line":15,"column":7},"cells":[{"location":{"line":15,"column":12},"value":"20"},{"location":{"line":15,"column":19},"value":"5"},{"location":{"line":15,"column":25},"value":"15"}],"id":"8"}],"id":"9"},{"location":{"line":17,"column":5},"keyword":"Examples","name":"These are failing","tableHeader":{"location":{"line":18,"column":7},"cells":[{"location":{"line":18,"column":9},"value":"start"},{"location":{"line":18,"column":17},"value":"eat"},{"location":{"line":18,"column":23},"value":"left"}],"id":"10"},"tableBody":[{"location":{"line":19,"column":7},"cells":[{"location":{"line":19,"column":12},"value":"12"},{"location":{"line":19,"column":18},"value":"20"},{"location":{"line":19,"column":26},"value":"0"}],"id":"11"},{"location":{"line":20,"column":7},"cells":[{"location":{"line":20,"column":13},"value":"0"},{"location":{"line":20,"column":19},"value":"1"},{"location":{"line":20,"column":26},"value":"0"}],"id":"12"}],"id":"13"},{"location":{"line":22,"column":5},"keyword":"Examples","name":"These are undefined because the value is not an {int}","tableHeader":{"location":{"line":23,"column":7},"cells":[{"location":{"line":23,"column":9},"value":"start"},{"location":{"line":23,"column":17},"value":"eat"},{"location":{"line":23,"column":26},"value":"left"}],"id":"14"},"tableBody":[{"location":{"line":24,"column":7},"cells":[{"location":{"line":24,"column":12},"value":"12"},{"location":{"line":24,"column":17},"value":"banana"},{"location":{"line":24,"column":29},"value":"12"}],"id":"15"},{"location":{"line":25,"column":7},"cells":[{"location":{"line":25,"column":13},"value":"0"},{"location":{"line":25,"column":22},"value":"1"},{"location":{"line":25,"column":26},"value":"apple"}],"id":"16"}],"id":"17"}],"id":"18"}}]}}}
44
{"pickle":{"id":"22","uri":"features/examples-tables/examples-tables.feature","name":"eating cucumbers","language":"en","steps":[{"text":"there are 12 cucumbers","id":"19","astNodeIds":["3","7"]},{"text":"I eat 5 cucumbers","id":"20","astNodeIds":["4","7"]},{"text":"I should have 7 cucumbers","id":"21","astNodeIds":["5","7"]}],"astNodeIds":["18","7"]}}

compatibility/src/test/resources/features/hooks/hooks.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"meta":{"protocolVersion":"12.0.0","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"13.11.0"},"os":{"name":"darwin","version":"Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64"},"cpu":{"name":"x64"}}}
1+
{"meta":{"protocolVersion":"12.1.1","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"12.16.2"},"os":{"name":"linux","version":"4.19.76-linuxkit"},"cpu":{"name":"x64"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber/cucumber-ruby/actions/runs/140170388","git":{"remote":"https://github.com/cucumber/cucumber-ruby.git","revision":"the-revision","tag":"the-tag"}}}}
22
{"source":{"uri":"features/hooks/hooks.feature","data":"Feature: Hooks\n Hooks are special steps that run before or after each scenario's steps.\n They can also conditionally target specific scenarios, using tag expressions\n\n Scenario: no tags, passed step\n When a step passes\n\n Scenario: no tags, failed step\n When a step throws an exception\n\n Scenario: no tags, undefined step\n When a step throws an exception\n\n @some-tag\n Scenario: with a tag, passed step\n When a step passes\n","mediaType":"text/x.cucumber.gherkin+plain"}}
33
{"gherkinDocument":{"uri":"features/hooks/hooks.feature","feature":{"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Hooks","description":" Hooks are special steps that run before or after each scenario's steps.\n They can also conditionally target specific scenarios, using tag expressions","children":[{"scenario":{"location":{"line":5,"column":3},"keyword":"Scenario","name":"no tags, passed step","steps":[{"location":{"line":6,"column":5},"keyword":"When ","text":"a step passes","id":"5"}],"id":"6"}},{"scenario":{"location":{"line":8,"column":3},"keyword":"Scenario","name":"no tags, failed step","steps":[{"location":{"line":9,"column":5},"keyword":"When ","text":"a step throws an exception","id":"7"}],"id":"8"}},{"scenario":{"location":{"line":11,"column":3},"keyword":"Scenario","name":"no tags, undefined step","steps":[{"location":{"line":12,"column":5},"keyword":"When ","text":"a step throws an exception","id":"9"}],"id":"10"}},{"scenario":{"location":{"line":15,"column":3},"tags":[{"location":{"line":14,"column":3},"name":"@some-tag","id":"12"}],"keyword":"Scenario","name":"with a tag, passed step","steps":[{"location":{"line":16,"column":5},"keyword":"When ","text":"a step passes","id":"11"}],"id":"13"}}]}}}
44
{"pickle":{"id":"15","uri":"features/hooks/hooks.feature","name":"no tags, passed step","language":"en","steps":[{"text":"a step passes","id":"14","astNodeIds":["5"]}],"astNodeIds":["6"]}}

compatibility/src/test/resources/features/minimal/minimal.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"meta":{"protocolVersion":"12.0.0","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"13.11.0"},"os":{"name":"darwin","version":"Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64"},"cpu":{"name":"x64"}}}
1+
{"meta":{"protocolVersion":"12.1.1","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"12.16.2"},"os":{"name":"linux","version":"4.19.76-linuxkit"},"cpu":{"name":"x64"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber/cucumber-ruby/actions/runs/140170388","git":{"remote":"https://github.com/cucumber/cucumber-ruby.git","revision":"the-revision","tag":"the-tag"}}}}
22
{"source":{"uri":"features/minimal/minimal.feature","data":"Feature: minimal\n \n Cucumber doesn't execute this markdown, but @cucumber/react renders it\n \n * This is\n * a bullet\n * list\n \n Scenario: cukes\n Given I have 42 cukes in my belly\n","mediaType":"text/x.cucumber.gherkin+plain"}}
33
{"gherkinDocument":{"uri":"features/minimal/minimal.feature","feature":{"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"minimal","description":" Cucumber doesn't execute this markdown, but @cucumber/react renders it\n \n * This is\n * a bullet\n * list","children":[{"scenario":{"location":{"line":9,"column":3},"keyword":"Scenario","name":"cukes","steps":[{"location":{"line":10,"column":5},"keyword":"Given ","text":"I have 42 cukes in my belly","id":"1"}],"id":"2"}}]}}}
44
{"pickle":{"id":"4","uri":"features/minimal/minimal.feature","name":"cukes","language":"en","steps":[{"text":"I have 42 cukes in my belly","id":"3","astNodeIds":["1"]}],"astNodeIds":["2"]}}

compatibility/src/test/resources/features/parameter-types/parameter-types.ndjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{"meta":{"protocolVersion":"12.0.0","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"13.11.0"},"os":{"name":"darwin","version":"Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64"},"cpu":{"name":"x64"}}}
1+
{"meta":{"protocolVersion":"12.1.1","implementation":{"name":"fake-cucumber","version":"7.0.0"},"runtime":{"name":"node.js","version":"12.16.2"},"os":{"name":"linux","version":"4.19.76-linuxkit"},"cpu":{"name":"x64"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber/cucumber-ruby/actions/runs/140170388","git":{"remote":"https://github.com/cucumber/cucumber-ruby.git","revision":"the-revision","tag":"the-tag"}}}}
22
{"source":{"uri":"features/parameter-types/parameter-types.feature","data":"Feature: Parameter Types\n Cucumber lets you define your own parameter types, which can be used\n in Cucumber Expressions. This lets you define a precise domain-specific\n vocabulary which can be used to generate a glossary with examples taken\n from your scenarios. They also let you transform strings and tables into\n rich types.\n\n Scenario: flights\n Given LHR-CDG has been delayed 45 minutes\n","mediaType":"text/x.cucumber.gherkin+plain"}}
33
{"gherkinDocument":{"uri":"features/parameter-types/parameter-types.feature","feature":{"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Parameter Types","description":" Cucumber lets you define your own parameter types, which can be used\n in Cucumber Expressions. This lets you define a precise domain-specific\n vocabulary which can be used to generate a glossary with examples taken\n from your scenarios. They also let you transform strings and tables into\n rich types.","children":[{"scenario":{"location":{"line":8,"column":3},"keyword":"Scenario","name":"flights","steps":[{"location":{"line":9,"column":5},"keyword":"Given ","text":"LHR-CDG has been delayed 45 minutes","id":"2"}],"id":"3"}}]}}}
44
{"pickle":{"id":"5","uri":"features/parameter-types/parameter-types.feature","name":"flights","language":"en","steps":[{"text":"LHR-CDG has been delayed 45 minutes","id":"4","astNodeIds":["2"]}],"astNodeIds":["3"]}}

0 commit comments

Comments
 (0)