cucumber-compatibility-kit 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +56 -0
- data/features/attachments/attachments.feature +41 -0
- data/features/attachments/attachments.feature.ndjson +77 -0
- data/features/attachments/attachments.feature.rb +51 -0
- data/features/attachments/cucumber.png +0 -0
- data/features/data-tables/data-tables.feature +12 -0
- data/features/data-tables/data-tables.feature.ndjson +15 -0
- data/features/data-tables/data-tables.feature.rb +7 -0
- data/features/examples-tables/examples-tables.feature +28 -0
- data/features/examples-tables/examples-tables.feature.ndjson +68 -0
- data/features/examples-tables/examples-tables.feature.rb +11 -0
- data/features/hooks/cucumber.svg +7 -0
- data/features/hooks/hooks.feature +20 -0
- data/features/hooks/hooks.feature.ndjson +66 -0
- data/features/hooks/hooks.feature.rb +28 -0
- data/features/markdown/markdown.feature.md +46 -0
- data/features/markdown/markdown.feature.md.ndjson +35 -0
- data/features/minimal/minimal.feature +10 -0
- data/features/minimal/minimal.feature.ndjson +12 -0
- data/features/minimal/minimal.feature.rb +2 -0
- data/features/parameter-types/parameter-types.feature +9 -0
- data/features/parameter-types/parameter-types.feature.ndjson +13 -0
- data/features/parameter-types/parameter-types.feature.rb +21 -0
- data/features/pending/pending.feature +19 -0
- data/features/pending/pending.feature.ndjson +30 -0
- data/features/pending/pending.feature.rb +11 -0
- data/features/retry/retry.feature +22 -0
- data/features/retry/retry.feature.ndjson +59 -0
- data/features/retry/retry.feature.rb +23 -0
- data/features/rules/rules.feature +27 -0
- data/features/rules/rules.feature.ndjson +45 -0
- data/features/rules/rules.feature.rb +26 -0
- data/features/skipped/skipped.feature +19 -0
- data/features/skipped/skipped.feature.ndjson +33 -0
- data/features/skipped/skipped.feature.rb +15 -0
- data/features/stack-traces/stack-traces.feature +11 -0
- data/features/stack-traces/stack-traces.feature.ndjson +12 -0
- data/features/stack-traces/stack-traces.feature.rb +3 -0
- data/features/undefined/undefined.feature +17 -0
- data/features/undefined/undefined.feature.ndjson +29 -0
- data/features/undefined/undefined.feature.rb +7 -0
- data/features/unknown-parameter-type/unknown-parameter-type.feature +6 -0
- data/features/unknown-parameter-type/unknown-parameter-type.feature.ndjson +12 -0
- data/features/unknown-parameter-type/unknown-parameter-type.feature.rb +3 -0
- data/lib/cucumber-compatibility-kit.rb +55 -0
- data/lib/keys_checker.rb +24 -0
- data/lib/messages_comparator.rb +83 -0
- data/lib/shared_examples.rb +63 -0
- data/spec/capture_warnings.rb +74 -0
- data/spec/cucumber-compatibility-kit_spec.rb +71 -0
- data/spec/keys_checker_spec.rb +77 -0
- metadata +165 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"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\n @with-attachment\n Scenario: with an attachment in the hook\n When a step passes","mediaType":"text/x.cucumber.gherkin+plain","uri":"features/hooks/hooks.feature"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"7","keyword":"Scenario","location":{"column":3,"line":5},"name":"no tags, passed step","steps":[{"id":"6","keyword":"When ","location":{"column":5,"line":6},"text":"a step passes"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"9","keyword":"Scenario","location":{"column":3,"line":8},"name":"no tags, failed step","steps":[{"id":"8","keyword":"When ","location":{"column":5,"line":9},"text":"a step throws an exception"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"11","keyword":"Scenario","location":{"column":3,"line":11},"name":"no tags, undefined step","steps":[{"id":"10","keyword":"When ","location":{"column":5,"line":12},"text":"a step throws an exception"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"14","keyword":"Scenario","location":{"column":3,"line":15},"name":"with a tag, passed step","steps":[{"id":"12","keyword":"When ","location":{"column":5,"line":16},"text":"a step passes"}],"tags":[{"id":"13","location":{"column":3,"line":14},"name":"@some-tag"}]}},{"scenario":{"description":"","examples":[],"id":"17","keyword":"Scenario","location":{"column":3,"line":19},"name":"with an attachment in the hook","steps":[{"id":"15","keyword":"When ","location":{"column":5,"line":20},"text":"a step passes"}],"tags":[{"id":"16","location":{"column":3,"line":18},"name":"@with-attachment"}]}}],"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","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Hooks","tags":[]},"uri":"features/hooks/hooks.feature"}}
|
4
|
+
{"pickle":{"astNodeIds":["7"],"id":"19","language":"en","name":"no tags, passed step","steps":[{"astNodeIds":["6"],"id":"18","text":"a step passes"}],"tags":[],"uri":"features/hooks/hooks.feature"}}
|
5
|
+
{"pickle":{"astNodeIds":["9"],"id":"21","language":"en","name":"no tags, failed step","steps":[{"astNodeIds":["8"],"id":"20","text":"a step throws an exception"}],"tags":[],"uri":"features/hooks/hooks.feature"}}
|
6
|
+
{"pickle":{"astNodeIds":["11"],"id":"23","language":"en","name":"no tags, undefined step","steps":[{"astNodeIds":["10"],"id":"22","text":"a step throws an exception"}],"tags":[],"uri":"features/hooks/hooks.feature"}}
|
7
|
+
{"pickle":{"astNodeIds":["14"],"id":"25","language":"en","name":"with a tag, passed step","steps":[{"astNodeIds":["12"],"id":"24","text":"a step passes"}],"tags":[{"astNodeId":"13","name":"@some-tag"}],"uri":"features/hooks/hooks.feature"}}
|
8
|
+
{"pickle":{"astNodeIds":["17"],"id":"27","language":"en","name":"with an attachment in the hook","steps":[{"astNodeIds":["15"],"id":"26","text":"a step passes"}],"tags":[{"astNodeId":"16","name":"@with-attachment"}],"uri":"features/hooks/hooks.feature"}}
|
9
|
+
{"stepDefinition":{"id":"1","pattern":{"source":"a step passes","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":8},"uri":"features/hooks/hooks.feature.ts"}}}
|
10
|
+
{"stepDefinition":{"id":"2","pattern":{"source":"a step throws an exception","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":12},"uri":"features/hooks/hooks.feature.ts"}}}
|
11
|
+
{"hook":{"id":"0","sourceReference":{"location":{"line":4},"uri":"features/hooks/hooks.feature.ts"}}}
|
12
|
+
{"hook":{"id":"3","sourceReference":{"location":{"line":16},"uri":"features/hooks/hooks.feature.ts"}}}
|
13
|
+
{"hook":{"id":"4","sourceReference":{"location":{"line":20},"uri":"features/hooks/hooks.feature.ts"},"tagExpression":"@some-tag or @some-other-tag"}}
|
14
|
+
{"hook":{"id":"5","sourceReference":{"location":{"line":24},"uri":"features/hooks/hooks.feature.ts"},"tagExpression":"@with-attachment"}}
|
15
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
16
|
+
{"testCase":{"id":"31","pickleId":"19","testSteps":[{"hookId":"0","id":"28"},{"id":"29","pickleStepId":"18","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"hookId":"3","id":"30"}]}}
|
17
|
+
{"testCase":{"id":"35","pickleId":"21","testSteps":[{"hookId":"0","id":"32"},{"id":"33","pickleStepId":"20","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"hookId":"3","id":"34"}]}}
|
18
|
+
{"testCase":{"id":"39","pickleId":"23","testSteps":[{"hookId":"0","id":"36"},{"id":"37","pickleStepId":"22","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"hookId":"3","id":"38"}]}}
|
19
|
+
{"testCase":{"id":"44","pickleId":"25","testSteps":[{"hookId":"0","id":"40"},{"id":"41","pickleStepId":"24","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"hookId":"4","id":"42"},{"hookId":"3","id":"43"}]}}
|
20
|
+
{"testCase":{"id":"49","pickleId":"27","testSteps":[{"hookId":"0","id":"45"},{"id":"46","pickleStepId":"26","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"hookId":"5","id":"47"},{"hookId":"3","id":"48"}]}}
|
21
|
+
{"testCaseStarted":{"attempt":0,"id":"50","testCaseId":"31","timestamp":{"nanos":1000000,"seconds":0}}}
|
22
|
+
{"testStepStarted":{"testCaseStartedId":"50","testStepId":"28","timestamp":{"nanos":2000000,"seconds":0}}}
|
23
|
+
{"testStepFinished":{"testCaseStartedId":"50","testStepId":"28","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
24
|
+
{"testStepStarted":{"testCaseStartedId":"50","testStepId":"29","timestamp":{"nanos":4000000,"seconds":0}}}
|
25
|
+
{"testStepFinished":{"testCaseStartedId":"50","testStepId":"29","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":5000000,"seconds":0}}}
|
26
|
+
{"testStepStarted":{"testCaseStartedId":"50","testStepId":"30","timestamp":{"nanos":6000000,"seconds":0}}}
|
27
|
+
{"testStepFinished":{"testCaseStartedId":"50","testStepId":"30","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in hook\nfeatures/hooks/hooks.feature:5","status":"FAILED"},"timestamp":{"nanos":7000000,"seconds":0}}}
|
28
|
+
{"testCaseFinished":{"testCaseStartedId":"50","timestamp":{"nanos":8000000,"seconds":0},"willBeRetried":false}}
|
29
|
+
{"testCaseStarted":{"attempt":0,"id":"51","testCaseId":"35","timestamp":{"nanos":9000000,"seconds":0}}}
|
30
|
+
{"testStepStarted":{"testCaseStartedId":"51","testStepId":"32","timestamp":{"nanos":10000000,"seconds":0}}}
|
31
|
+
{"testStepFinished":{"testCaseStartedId":"51","testStepId":"32","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":11000000,"seconds":0}}}
|
32
|
+
{"testStepStarted":{"testCaseStartedId":"51","testStepId":"33","timestamp":{"nanos":12000000,"seconds":0}}}
|
33
|
+
{"testStepFinished":{"testCaseStartedId":"51","testStepId":"33","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/hooks/hooks.feature:9","status":"FAILED"},"timestamp":{"nanos":13000000,"seconds":0}}}
|
34
|
+
{"testStepStarted":{"testCaseStartedId":"51","testStepId":"34","timestamp":{"nanos":14000000,"seconds":0}}}
|
35
|
+
{"testStepFinished":{"testCaseStartedId":"51","testStepId":"34","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in hook\nfeatures/hooks/hooks.feature:8","status":"FAILED"},"timestamp":{"nanos":15000000,"seconds":0}}}
|
36
|
+
{"testCaseFinished":{"testCaseStartedId":"51","timestamp":{"nanos":16000000,"seconds":0},"willBeRetried":false}}
|
37
|
+
{"testCaseStarted":{"attempt":0,"id":"52","testCaseId":"39","timestamp":{"nanos":17000000,"seconds":0}}}
|
38
|
+
{"testStepStarted":{"testCaseStartedId":"52","testStepId":"36","timestamp":{"nanos":18000000,"seconds":0}}}
|
39
|
+
{"testStepFinished":{"testCaseStartedId":"52","testStepId":"36","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":19000000,"seconds":0}}}
|
40
|
+
{"testStepStarted":{"testCaseStartedId":"52","testStepId":"37","timestamp":{"nanos":20000000,"seconds":0}}}
|
41
|
+
{"testStepFinished":{"testCaseStartedId":"52","testStepId":"37","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/hooks/hooks.feature:12","status":"FAILED"},"timestamp":{"nanos":21000000,"seconds":0}}}
|
42
|
+
{"testStepStarted":{"testCaseStartedId":"52","testStepId":"38","timestamp":{"nanos":22000000,"seconds":0}}}
|
43
|
+
{"testStepFinished":{"testCaseStartedId":"52","testStepId":"38","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in hook\nfeatures/hooks/hooks.feature:11","status":"FAILED"},"timestamp":{"nanos":23000000,"seconds":0}}}
|
44
|
+
{"testCaseFinished":{"testCaseStartedId":"52","timestamp":{"nanos":24000000,"seconds":0},"willBeRetried":false}}
|
45
|
+
{"testCaseStarted":{"attempt":0,"id":"53","testCaseId":"44","timestamp":{"nanos":25000000,"seconds":0}}}
|
46
|
+
{"testStepStarted":{"testCaseStartedId":"53","testStepId":"40","timestamp":{"nanos":26000000,"seconds":0}}}
|
47
|
+
{"testStepFinished":{"testCaseStartedId":"53","testStepId":"40","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":27000000,"seconds":0}}}
|
48
|
+
{"testStepStarted":{"testCaseStartedId":"53","testStepId":"41","timestamp":{"nanos":28000000,"seconds":0}}}
|
49
|
+
{"testStepFinished":{"testCaseStartedId":"53","testStepId":"41","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":29000000,"seconds":0}}}
|
50
|
+
{"testStepStarted":{"testCaseStartedId":"53","testStepId":"42","timestamp":{"nanos":30000000,"seconds":0}}}
|
51
|
+
{"testStepFinished":{"testCaseStartedId":"53","testStepId":"42","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in conditional hook\nfeatures/hooks/hooks.feature:15","status":"FAILED"},"timestamp":{"nanos":31000000,"seconds":0}}}
|
52
|
+
{"testStepStarted":{"testCaseStartedId":"53","testStepId":"43","timestamp":{"nanos":32000000,"seconds":0}}}
|
53
|
+
{"testStepFinished":{"testCaseStartedId":"53","testStepId":"43","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in hook\nfeatures/hooks/hooks.feature:15","status":"FAILED"},"timestamp":{"nanos":33000000,"seconds":0}}}
|
54
|
+
{"testCaseFinished":{"testCaseStartedId":"53","timestamp":{"nanos":34000000,"seconds":0},"willBeRetried":false}}
|
55
|
+
{"testCaseStarted":{"attempt":0,"id":"54","testCaseId":"49","timestamp":{"nanos":35000000,"seconds":0}}}
|
56
|
+
{"testStepStarted":{"testCaseStartedId":"54","testStepId":"45","timestamp":{"nanos":36000000,"seconds":0}}}
|
57
|
+
{"testStepFinished":{"testCaseStartedId":"54","testStepId":"45","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":37000000,"seconds":0}}}
|
58
|
+
{"testStepStarted":{"testCaseStartedId":"54","testStepId":"46","timestamp":{"nanos":38000000,"seconds":0}}}
|
59
|
+
{"testStepFinished":{"testCaseStartedId":"54","testStepId":"46","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":39000000,"seconds":0}}}
|
60
|
+
{"testStepStarted":{"testCaseStartedId":"54","testStepId":"47","timestamp":{"nanos":40000000,"seconds":0}}}
|
61
|
+
{"attachment":{"body":"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNsYXNzPSJtbC0zIG1sLW1kLTAiIHZpZXdCb3g9IjAgMCA0MC41OSA0Ni4zMSIgd2lkdGg9IjQwLjU5IiBoZWlnaHQ9IjQ2LjMxIj4KICAgIDxnPgogICAgICAgIDxwYXRoIGZpbGw9IiMyM2Q5NmMiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTMwLjI4MyAzLjY0NXEtLjUyOC0uMzE3LTEuMDgtLjU5M2ExNi4xNjQgMTYuMTY0IDAgMDAtMS4xNTQtLjUxOGMtLjEyNC0uMDUyLS4yNDctLjEtLjM3Mi0uMTQ5LS4zNDMtLjEyNy0uNjg5LS4yNjgtMS4wNDItLjM3MWExOS40MjcgMTkuNDI3IDAgMTAtOS43OTIgMzcuNTF2NS41NmMxMS42NzYtMS43NTMgMjIuMDE2LTEwLjk3OSAyMi43ODctMjMuMDkzLjQ1OS03LjI4OS0zLjE5My0xNC43My05LjM0Ny0xOC4zNDZ6Ii8+CiAgICAgICAgPHBhdGggZmlsbD0iIzE3MzY0NyIgZD0iTTE1Ljc4NyA0Ni4zMDd2LTUuOTM1QTIwLjQ3MiAyMC40NzIgMCAxMTI2Ljk1OSAxLjAxNWMuMjc0LjA4LjU1Ny4xODcuODMyLjI5MWwuMjQ4LjA5M2MuMTY1LjA2NC4yOTEuMTEzLjQxNy4xNjcuMzQ4LjEzNy43MzkuMzEzIDEuMjA4LjU0M3EuNTg5LjI5NSAxLjE1My42MzNjNi4zOTMgMy43NTYgMTAuMzU0IDExLjUxOCA5Ljg1NyAxOS4zMTYtLjc2MyAxMi0xMC43MjIgMjIuMTIyLTIzLjY3OSAyNC4wNjd6bTQuOC00NC4yMTRoLS4wMjZhMTguMzY2IDE4LjM2NiAwIDAwLTMuNTI0IDM2LjQwOGwuODUuMTY1djUuMThjMTEuMzkyLTIuMjI0IDIwLjAwOS0xMS4yNzIgMjAuNjg2LTIxLjkyMi40NDgtNy4wMzMtMy4xLTE0LjAxOC04LjgzLTE3LjM4M2wtLjAwOC0uMDA1QTE0LjY5MSAxNC42OTEgMCAwMDI3LjY1NCAzLjVhNS43NCA1Ljc0IDAgMDAtLjM0NC0uMTM4bC0uMjctLjFhOS40OSA5LjQ5IDAgMDAtLjcwOC0uMjQ5IDE4LjQyNSAxOC40MjUgMCAwMC01Ljc0My0uOTJ6Ii8+CiAgICAgICAgPHBhdGggZmlsbD0iIzE3MzY0NyIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTYuNjY2IDEwLjU4YTEuOCAxLjggMCAwMTEuNTgzLjYwOCA0LjE4NCA0LjE4NCAwIDAxLjcyOCAxLjEwN2MuNjQ1IDEuNDIyIDEuMDI3IDMuNDYxLjIzIDQuNjA1YTYuMzM0IDYuMzM0IDAgMDEtMy45ODEtMy4wODcgMy4yMzYgMy4yMzYgMCAwMS0uMzQ3LTEuMzM5IDEuOTU3IDEuOTU3IDAgMDExLjc4Ny0xLjg5NHptLTUuNjgzIDguMDI1YTcuNzQyIDcuNzQyIDAgMDAxLjIxOC43MzcgNS43ODkgNS43ODkgMCAwMDQuODgzLS4xMzggNi4xMTYgNi4xMTYgMCAwMC0zLjM0NS0zLjQ1IDMuNjY0IDMuNjY0IDAgMDAtMS40NDItLjMyMSAxLjg4NCAxLjg4NCAwIDAwLS4zMTkgMCAxLjc2NiAxLjc2NiAwIDAwLS45OTUgMy4xNzJ6bTYuMSAzLjQzM2MtLjc3Ny0uNTE4LTIuMzc5LS4zMDktMy4zMTItLjI5MmE0LjQxNiA0LjQxNiAwIDAwLTEuNjY2LjM1MiAzLjUgMy41IDAgMDAtMS4yMTguNzM4IDEuODE3IDEuODE3IDAgMDAxLjQwOSAzLjE3MSAzLjMgMy4zIDAgMDAxLjQ0Mi0uMzIxYzEuNDM2LS42MiAzLjE0MS0yLjMyIDMuMzQ2LTMuNjQ4em0yLjYxIDJhNi41NTYgNi41NTYgMCAwMC0zLjcyNCAzLjUwNiAzLjA5MSAzLjA5MSAwIDAwLS4zMjEgMS4zMTQgMS45MDcgMS45MDcgMCAwMDMuMyAxLjM0NiA3LjQyMiA3LjQyMiAwIDAwLjctMS4yMThjLjYyMS0xLjMzMy44NjYtMy43Mi4wNDYtNC45NDh6bTIuNTU3LTcuMTY3YTUuOTQxIDUuOTQxIDAgMDAzLjctMy4xNjcgMy4yNDMgMy4yNDMgMCAwMC4zMTktMS4zNDYgMS45MTUgMS45MTUgMCAwMC0xLjc5NC0xLjk1NCAxLjgzMiAxLjgzMiAwIDAwLTEuNi42NDEgNy4zODIgNy4zODIgMCAwMC0uNzA1IDEuMjE4Yy0uNjIgMS40MzQtLjg0MiAzLjQ4LjA4MSA0LjYwM3ptNC4yMDggMTIuMTE1YTMuMjQ0IDMuMjQ0IDAgMDAtLjMyMS0xLjM0NSA1Ljg2OSA1Ljg2OSAwIDAwLTMuNTU0LTMuMjY5IDUuMzg2IDUuMzg2IDAgMDAtLjIyNiA0LjcxMSA0LjE0NyA0LjE0NyAwIDAwLjcgMS4xMjFjMS4xMzMgMS4yMyAzLjUwNS4zMiAzLjQwMi0xLjIxOHptNC4yLTYuMjhhNy40NjYgNy40NjYgMCAwMC0xLjIxNy0uNyA0LjQyNSA0LjQyNSAwIDAwLTEuNjY2LS4zNTIgNi40IDYuNCAwIDAwLTMuMTg4LjU1NSA1Ljk1OSA1Ljk1OSAwIDAwMy4zMTYgMy4zODYgMy42NzIgMy42NzIgMCAwMDEuNDQyLjMyIDEuOCAxLjggMCAwMDEuMzEtMy4yMDl6Ii8+CiAgICA8L2c+Cjwvc3ZnPg==","contentEncoding":"BASE64","mediaType":"image/svg+xml","testCaseStartedId":"54","testStepId":"47"}}
|
62
|
+
{"testStepFinished":{"testCaseStartedId":"54","testStepId":"47","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":41000000,"seconds":0}}}
|
63
|
+
{"testStepStarted":{"testCaseStartedId":"54","testStepId":"48","timestamp":{"nanos":42000000,"seconds":0}}}
|
64
|
+
{"testStepFinished":{"testCaseStartedId":"54","testStepId":"48","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in hook\nfeatures/hooks/hooks.feature:19","status":"FAILED"},"timestamp":{"nanos":43000000,"seconds":0}}}
|
65
|
+
{"testCaseFinished":{"testCaseStartedId":"54","timestamp":{"nanos":44000000,"seconds":0},"willBeRetried":false}}
|
66
|
+
{"testRunFinished":{"success":false,"timestamp":{"nanos":45000000,"seconds":0}}}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
def attach_or_embed(world, data, media_type)
|
2
|
+
# Backward compatibility as the steps are also used by cucumber-ruby 3 which does not support `attach`
|
3
|
+
world.respond_to?(:attach) ? attach(data, media_type) : embed(data, media_type)
|
4
|
+
end
|
5
|
+
|
6
|
+
Before do
|
7
|
+
# no-op
|
8
|
+
end
|
9
|
+
|
10
|
+
When('a step passes') do
|
11
|
+
# no-op
|
12
|
+
end
|
13
|
+
|
14
|
+
When('a step throws an exception') do
|
15
|
+
raise StandardError, 'Exception in step'
|
16
|
+
end
|
17
|
+
|
18
|
+
After do
|
19
|
+
raise StandardError, 'Exception in hook'
|
20
|
+
end
|
21
|
+
|
22
|
+
After('@some-tag or @some-other-tag') do
|
23
|
+
raise StandardError, 'Exception in conditional hook'
|
24
|
+
end
|
25
|
+
|
26
|
+
After('@with-attachment') do
|
27
|
+
attach_or_embed(self, File.open("#{__dir__}/cucumber.svg"), 'image/svg+xml')
|
28
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Feature: Cheese
|
2
|
+
|
3
|
+
This table is not picked up by Gherkin (not indented 2+ spaces)
|
4
|
+
|
5
|
+
| foo | bar |
|
6
|
+
| --- | --- |
|
7
|
+
| boz | boo |
|
8
|
+
|
9
|
+
|
10
|
+
## Rule: Nom nom nom
|
11
|
+
|
12
|
+
I love cheese, especially fromage macaroni cheese. Rubber cheese ricotta caerphilly blue castello who moved my cheese queso bavarian bergkase melted cheese.
|
13
|
+
|
14
|
+
### Scenario Outline: Ylajali!
|
15
|
+
|
16
|
+
* Given some TypeScript code:
|
17
|
+
```typescript
|
18
|
+
type Cheese = 'reblochon' | 'roquefort' | 'rocamadour'
|
19
|
+
```
|
20
|
+
* And some classic Gherkin:
|
21
|
+
```gherkin
|
22
|
+
Given there are 24 apples in Mary's basket
|
23
|
+
```
|
24
|
+
* When we use a data table and attach something and then <what>
|
25
|
+
| name | age |
|
26
|
+
| ---- | --: |
|
27
|
+
| Bill | 3 |
|
28
|
+
| Jane | 6 |
|
29
|
+
| Isla | 5 |
|
30
|
+
* Then this might or might not run
|
31
|
+
|
32
|
+
#### Examples: because we need more tables
|
33
|
+
|
34
|
+
This table is indented 2 spaces, so Gherkin will pick it up
|
35
|
+
|
36
|
+
| what |
|
37
|
+
| ---- |
|
38
|
+
| fail |
|
39
|
+
| pass |
|
40
|
+
|
41
|
+
And oh by the way, this table is also ignored by Gherkin because it doesn't have 2+ space indent:
|
42
|
+
|
43
|
+
| cheese |
|
44
|
+
| -------- |
|
45
|
+
| gouda |
|
46
|
+
| gamalost |
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"data":"# Feature: Cheese\n\nThis table is not picked up by Gherkin (not indented 2+ spaces)\n\n| foo | bar |\n| --- | --- |\n| boz | boo |\n\n\n## Rule: Nom nom nom\n\nI love cheese, especially fromage macaroni cheese. Rubber cheese ricotta caerphilly blue castello who moved my cheese queso bavarian bergkase melted cheese.\n\n### Scenario Outline: Ylajali!\n\n* Given some TypeScript code:\n ```typescript\n type Cheese = 'reblochon' | 'roquefort' | 'rocamadour'\n ```\n* And some classic Gherkin:\n ```gherkin\n Given there are 24 apples in Mary's basket\n ```\n* When we use a data table and attach something and then <what>\n | name | age |\n | ---- | --: |\n | Bill | 3 |\n | Jane | 6 |\n | Isla | 5 |\n* Then this might or might not run\n\n#### Examples: because we need more tables\n\nThis table is indented 2 spaces, so Gherkin will pick it up\n\n | what |\n | ---- |\n | fail |\n | pass |\n\nAnd oh by the way, this table is also ignored by Gherkin because it doesn't have 2+ space indent:\n\n| cheese |\n| -------- |\n| gouda |\n| gamalost |\n","mediaType":"text/x.cucumber.gherkin+markdown","uri":"features/markdown/markdown.feature.md"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"rule":{"children":[{"scenario":{"description":"","examples":[{"description":"","id":"15","keyword":"Examples","location":{"column":6,"line":32},"name":"because we need more tables","tableBody":[{"cells":[{"location":{"column":5,"line":38},"value":"fail"}],"id":"13","location":{"column":3,"line":38}},{"cells":[{"location":{"column":5,"line":39},"value":"pass"}],"id":"14","location":{"column":3,"line":39}}],"tableHeader":{"cells":[{"location":{"column":5,"line":36},"value":"what"}],"id":"12","location":{"column":3,"line":36}},"tags":[]}],"id":"16","keyword":"Scenario Outline","location":{"column":5,"line":14},"name":"Ylajali!","steps":[{"docString":{"content":"type Cheese = 'reblochon' | 'roquefort' | 'rocamadour'","delimiter":"```","location":{"column":3,"line":17},"mediaType":"typescript"},"id":"4","keyword":"Given ","location":{"column":3,"line":16},"text":"some TypeScript code:"},{"docString":{"content":"Given there are 24 apples in Mary's basket","delimiter":"```","location":{"column":3,"line":21},"mediaType":"gherkin"},"id":"5","keyword":"And ","location":{"column":3,"line":20},"text":"some classic Gherkin:"},{"dataTable":{"location":{"column":3,"line":25},"rows":[{"cells":[{"location":{"column":5,"line":25},"value":"name"},{"location":{"column":12,"line":25},"value":"age"}],"id":"6","location":{"column":3,"line":25}},{"cells":[{"location":{"column":5,"line":27},"value":"Bill"},{"location":{"column":14,"line":27},"value":"3"}],"id":"7","location":{"column":3,"line":27}},{"cells":[{"location":{"column":5,"line":28},"value":"Jane"},{"location":{"column":14,"line":28},"value":"6"}],"id":"8","location":{"column":3,"line":28}},{"cells":[{"location":{"column":5,"line":29},"value":"Isla"},{"location":{"column":14,"line":29},"value":"5"}],"id":"9","location":{"column":3,"line":29}}]},"id":"10","keyword":"When ","location":{"column":3,"line":24},"text":"we use a data table and attach something and then <what>"},{"id":"11","keyword":"Then ","location":{"column":3,"line":30},"text":"this might or might not run"}],"tags":[]}}],"description":"","id":"17","keyword":"Rule","location":{"column":4,"line":10},"name":"Nom nom nom","tags":[]}}],"description":"","keyword":"Feature","language":"en","location":{"column":3,"line":1},"name":"Cheese","tags":[]},"uri":"features/markdown/markdown.feature.md"}}
|
4
|
+
{"pickle":{"astNodeIds":["16","13"],"id":"22","language":"en","name":"Ylajali!","steps":[{"argument":{"docString":{"content":"type Cheese = 'reblochon' | 'roquefort' | 'rocamadour'","mediaType":"typescript"}},"astNodeIds":["4","13"],"id":"18","text":"some TypeScript code:"},{"argument":{"docString":{"content":"Given there are 24 apples in Mary's basket","mediaType":"gherkin"}},"astNodeIds":["5","13"],"id":"19","text":"some classic Gherkin:"},{"argument":{"dataTable":{"rows":[{"cells":[{"value":"name"},{"value":"age"}]},{"cells":[{"value":"Bill"},{"value":"3"}]},{"cells":[{"value":"Jane"},{"value":"6"}]},{"cells":[{"value":"Isla"},{"value":"5"}]}]}},"astNodeIds":["10","13"],"id":"20","text":"we use a data table and attach something and then fail"},{"astNodeIds":["11","13"],"id":"21","text":"this might or might not run"}],"tags":[],"uri":"features/markdown/markdown.feature.md"}}
|
5
|
+
{"pickle":{"astNodeIds":["16","14"],"id":"27","language":"en","name":"Ylajali!","steps":[{"argument":{"docString":{"content":"type Cheese = 'reblochon' | 'roquefort' | 'rocamadour'","mediaType":"typescript"}},"astNodeIds":["4","14"],"id":"23","text":"some TypeScript code:"},{"argument":{"docString":{"content":"Given there are 24 apples in Mary's basket","mediaType":"gherkin"}},"astNodeIds":["5","14"],"id":"24","text":"some classic Gherkin:"},{"argument":{"dataTable":{"rows":[{"cells":[{"value":"name"},{"value":"age"}]},{"cells":[{"value":"Bill"},{"value":"3"}]},{"cells":[{"value":"Jane"},{"value":"6"}]},{"cells":[{"value":"Isla"},{"value":"5"}]}]}},"astNodeIds":["10","14"],"id":"25","text":"we use a data table and attach something and then pass"},{"astNodeIds":["11","14"],"id":"26","text":"this might or might not run"}],"tags":[],"uri":"features/markdown/markdown.feature.md"}}
|
6
|
+
{"stepDefinition":{"id":"0","pattern":{"source":"some TypeScript code:","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":4},"uri":"features/markdown/markdown.feature.md.ts"}}}
|
7
|
+
{"stepDefinition":{"id":"1","pattern":{"source":"some classic Gherkin:","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":8},"uri":"features/markdown/markdown.feature.md.ts"}}}
|
8
|
+
{"stepDefinition":{"id":"2","pattern":{"source":"we use a data table and attach something and then {word}","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":12},"uri":"features/markdown/markdown.feature.md.ts"}}}
|
9
|
+
{"stepDefinition":{"id":"3","pattern":{"source":"this might or might not run","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":23},"uri":"features/markdown/markdown.feature.md.ts"}}}
|
10
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
11
|
+
{"testCase":{"id":"32","pickleId":"22","testSteps":[{"id":"28","pickleStepId":"18","stepDefinitionIds":["0"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"29","pickleStepId":"19","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"30","pickleStepId":"20","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"children":[],"start":50,"value":"fail"},"parameterTypeName":"word"}]}]},{"id":"31","pickleStepId":"21","stepDefinitionIds":["3"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
12
|
+
{"testCase":{"id":"37","pickleId":"27","testSteps":[{"id":"33","pickleStepId":"23","stepDefinitionIds":["0"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"34","pickleStepId":"24","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"35","pickleStepId":"25","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"children":[],"start":50,"value":"pass"},"parameterTypeName":"word"}]}]},{"id":"36","pickleStepId":"26","stepDefinitionIds":["3"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
13
|
+
{"testCaseStarted":{"attempt":0,"id":"38","testCaseId":"32","timestamp":{"nanos":1000000,"seconds":0}}}
|
14
|
+
{"testStepStarted":{"testCaseStartedId":"38","testStepId":"28","timestamp":{"nanos":2000000,"seconds":0}}}
|
15
|
+
{"testStepFinished":{"testCaseStartedId":"38","testStepId":"28","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
16
|
+
{"testStepStarted":{"testCaseStartedId":"38","testStepId":"29","timestamp":{"nanos":4000000,"seconds":0}}}
|
17
|
+
{"testStepFinished":{"testCaseStartedId":"38","testStepId":"29","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":5000000,"seconds":0}}}
|
18
|
+
{"testStepStarted":{"testCaseStartedId":"38","testStepId":"30","timestamp":{"nanos":6000000,"seconds":0}}}
|
19
|
+
{"attachment":{"body":"We are logging some plain text (fail)","contentEncoding":"IDENTITY","mediaType":"text/x.cucumber.log+plain","testCaseStartedId":"38","testStepId":"30"}}
|
20
|
+
{"testStepFinished":{"testCaseStartedId":"38","testStepId":"30","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"You asked me to fail\nfeatures/markdown/markdown.feature.md:24\nfeatures/markdown/markdown.feature.md:38","status":"FAILED"},"timestamp":{"nanos":7000000,"seconds":0}}}
|
21
|
+
{"testStepStarted":{"testCaseStartedId":"38","testStepId":"31","timestamp":{"nanos":8000000,"seconds":0}}}
|
22
|
+
{"testStepFinished":{"testCaseStartedId":"38","testStepId":"31","testStepResult":{"duration":{"nanos":0,"seconds":0},"status":"SKIPPED"},"timestamp":{"nanos":9000000,"seconds":0}}}
|
23
|
+
{"testCaseFinished":{"testCaseStartedId":"38","timestamp":{"nanos":10000000,"seconds":0},"willBeRetried":false}}
|
24
|
+
{"testCaseStarted":{"attempt":0,"id":"39","testCaseId":"37","timestamp":{"nanos":11000000,"seconds":0}}}
|
25
|
+
{"testStepStarted":{"testCaseStartedId":"39","testStepId":"33","timestamp":{"nanos":12000000,"seconds":0}}}
|
26
|
+
{"testStepFinished":{"testCaseStartedId":"39","testStepId":"33","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":13000000,"seconds":0}}}
|
27
|
+
{"testStepStarted":{"testCaseStartedId":"39","testStepId":"34","timestamp":{"nanos":14000000,"seconds":0}}}
|
28
|
+
{"testStepFinished":{"testCaseStartedId":"39","testStepId":"34","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":15000000,"seconds":0}}}
|
29
|
+
{"testStepStarted":{"testCaseStartedId":"39","testStepId":"35","timestamp":{"nanos":16000000,"seconds":0}}}
|
30
|
+
{"attachment":{"body":"We are logging some plain text (pass)","contentEncoding":"IDENTITY","mediaType":"text/x.cucumber.log+plain","testCaseStartedId":"39","testStepId":"35"}}
|
31
|
+
{"testStepFinished":{"testCaseStartedId":"39","testStepId":"35","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":17000000,"seconds":0}}}
|
32
|
+
{"testStepStarted":{"testCaseStartedId":"39","testStepId":"36","timestamp":{"nanos":18000000,"seconds":0}}}
|
33
|
+
{"testStepFinished":{"testCaseStartedId":"39","testStepId":"36","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":19000000,"seconds":0}}}
|
34
|
+
{"testCaseFinished":{"testCaseStartedId":"39","timestamp":{"nanos":20000000,"seconds":0},"willBeRetried":false}}
|
35
|
+
{"testRunFinished":{"success":false,"timestamp":{"nanos":21000000,"seconds":0}}}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"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","uri":"features/minimal/minimal.feature"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"2","keyword":"Scenario","location":{"column":3,"line":9},"name":"cukes","steps":[{"id":"1","keyword":"Given ","location":{"column":5,"line":10},"text":"I have 42 cukes in my belly"}],"tags":[]}}],"description":" Cucumber doesn't execute this markdown, but @cucumber/react renders it\n \n * This is\n * a bullet\n * list","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"minimal","tags":[]},"uri":"features/minimal/minimal.feature"}}
|
4
|
+
{"pickle":{"astNodeIds":["2"],"id":"4","language":"en","name":"cukes","steps":[{"astNodeIds":["1"],"id":"3","text":"I have 42 cukes in my belly"}],"tags":[],"uri":"features/minimal/minimal.feature"}}
|
5
|
+
{"stepDefinition":{"id":"0","pattern":{"source":"I have {int} cukes in my belly","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":4},"uri":"features/minimal/minimal.feature.ts"}}}
|
6
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
7
|
+
{"testCase":{"id":"6","pickleId":"4","testSteps":[{"id":"5","pickleStepId":"3","stepDefinitionIds":["0"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"children":[],"start":7,"value":"42"},"parameterTypeName":"int"}]}]}]}}
|
8
|
+
{"testCaseStarted":{"attempt":0,"id":"7","testCaseId":"6","timestamp":{"nanos":1000000,"seconds":0}}}
|
9
|
+
{"testStepStarted":{"testCaseStartedId":"7","testStepId":"5","timestamp":{"nanos":2000000,"seconds":0}}}
|
10
|
+
{"testStepFinished":{"testCaseStartedId":"7","testStepId":"5","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
11
|
+
{"testCaseFinished":{"testCaseStartedId":"7","timestamp":{"nanos":4000000,"seconds":0},"willBeRetried":false}}
|
12
|
+
{"testRunFinished":{"success":true,"timestamp":{"nanos":5000000,"seconds":0}}}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Parameter Types
|
2
|
+
Cucumber lets you define your own parameter types, which can be used
|
3
|
+
in Cucumber Expressions. This lets you define a precise domain-specific
|
4
|
+
vocabulary which can be used to generate a glossary with examples taken
|
5
|
+
from your scenarios. They also let you transform strings and tables into
|
6
|
+
rich types.
|
7
|
+
|
8
|
+
Scenario: flights
|
9
|
+
Given LHR-CDG has been delayed 45 minutes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"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","uri":"features/parameter-types/parameter-types.feature"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"3","keyword":"Scenario","location":{"column":3,"line":8},"name":"flights","steps":[{"id":"2","keyword":"Given ","location":{"column":5,"line":9},"text":"LHR-CDG has been delayed 45 minutes"}],"tags":[]}}],"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.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Parameter Types","tags":[]},"uri":"features/parameter-types/parameter-types.feature"}}
|
4
|
+
{"pickle":{"astNodeIds":["3"],"id":"5","language":"en","name":"flights","steps":[{"astNodeIds":["2"],"id":"4","text":"LHR-CDG has been delayed 45 minutes"}],"tags":[],"uri":"features/parameter-types/parameter-types.feature"}}
|
5
|
+
{"parameterType":{"id":"0","name":"flight","preferForRegularExpressionMatch":false,"regularExpressions":["([A-Z]{3})-([A-Z]{3})"],"useForSnippets":true}}
|
6
|
+
{"stepDefinition":{"id":"1","pattern":{"source":"{flight} has been delayed {int} minutes","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":16},"uri":"features/parameter-types/parameter-types.feature.ts"}}}
|
7
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
8
|
+
{"testCase":{"id":"7","pickleId":"5","testSteps":[{"id":"6","pickleStepId":"4","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"children":[{"children":[],"start":0,"value":"LHR"},{"children":[],"start":4,"value":"CDG"}],"start":0,"value":"LHR-CDG"},"parameterTypeName":"flight"},{"group":{"children":[],"start":25,"value":"45"},"parameterTypeName":"int"}]}]}]}}
|
9
|
+
{"testCaseStarted":{"attempt":0,"id":"8","testCaseId":"7","timestamp":{"nanos":1000000,"seconds":0}}}
|
10
|
+
{"testStepStarted":{"testCaseStartedId":"8","testStepId":"6","timestamp":{"nanos":2000000,"seconds":0}}}
|
11
|
+
{"testStepFinished":{"testCaseStartedId":"8","testStepId":"6","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
12
|
+
{"testCaseFinished":{"testCaseStartedId":"8","timestamp":{"nanos":4000000,"seconds":0},"willBeRetried":false}}
|
13
|
+
{"testRunFinished":{"success":true,"timestamp":{"nanos":5000000,"seconds":0}}}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Flight
|
2
|
+
attr_reader :from, :to
|
3
|
+
|
4
|
+
def initialize(from, to)
|
5
|
+
@from = from
|
6
|
+
@to = to
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
ParameterType(
|
11
|
+
name: 'flight',
|
12
|
+
regexp: /([A-Z]{3})-([A-Z]{3})/,
|
13
|
+
transformer: -> (from, to) { Flight.new(from, to) }
|
14
|
+
)
|
15
|
+
|
16
|
+
Given('{flight} has been delayed {int} minutes') do |flight, delay|
|
17
|
+
expect(flight.from).to eq('LHR')
|
18
|
+
expect(flight.to).to eq('CDG')
|
19
|
+
expect(delay).to eq(45)
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Feature: Pending steps
|
2
|
+
|
3
|
+
During development, step definitions can signal at runtime that they are
|
4
|
+
not yet implemented (or "pending") by returning or throwing a particular
|
5
|
+
value.
|
6
|
+
|
7
|
+
This causes subsequent steps in the scenario to be skipped, and the overall
|
8
|
+
result to be treated as a failure.
|
9
|
+
|
10
|
+
Scenario: Unimplemented step signals pending status
|
11
|
+
Given a step that isnt implemented yet
|
12
|
+
|
13
|
+
Scenario: Steps before unimplemented steps are executed
|
14
|
+
Given an implemented step
|
15
|
+
When a step that isnt implemented yet
|
16
|
+
|
17
|
+
Scenario: Steps after unimplemented steps are skipped
|
18
|
+
Given a step that isnt implemented yet
|
19
|
+
Then a step that we expect to be skipped
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"data":"Feature: Pending steps\n\n During development, step definitions can signal at runtime that they are\n not yet implemented (or \"pending\") by returning or throwing a particular\n value.\n\n This causes subsequent steps in the scenario to be skipped, and the overall\n result to be treated as a failure.\n\n Scenario: Unimplemented step signals pending status\n Given a step that isnt implemented yet\n\n Scenario: Steps before unimplemented steps are executed\n Given an implemented step\n When a step that isnt implemented yet\n\n Scenario: Steps after unimplemented steps are skipped\n Given a step that isnt implemented yet\n Then a step that we expect to be skipped\n","mediaType":"text/x.cucumber.gherkin+plain","uri":"features/pending/pending.feature"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"4","keyword":"Scenario","location":{"column":3,"line":10},"name":"Unimplemented step signals pending status","steps":[{"id":"3","keyword":"Given ","location":{"column":5,"line":11},"text":"a step that isnt implemented yet"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"7","keyword":"Scenario","location":{"column":3,"line":13},"name":"Steps before unimplemented steps are executed","steps":[{"id":"5","keyword":"Given ","location":{"column":5,"line":14},"text":"an implemented step"},{"id":"6","keyword":"When ","location":{"column":5,"line":15},"text":"a step that isnt implemented yet"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"10","keyword":"Scenario","location":{"column":3,"line":17},"name":"Steps after unimplemented steps are skipped","steps":[{"id":"8","keyword":"Given ","location":{"column":5,"line":18},"text":"a step that isnt implemented yet"},{"id":"9","keyword":"Then ","location":{"column":5,"line":19},"text":"a step that we expect to be skipped"}],"tags":[]}}],"description":" During development, step definitions can signal at runtime that they are\n not yet implemented (or \"pending\") by returning or throwing a particular\n value.\n\n This causes subsequent steps in the scenario to be skipped, and the overall\n result to be treated as a failure.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Pending steps","tags":[]},"uri":"features/pending/pending.feature"}}
|
4
|
+
{"pickle":{"astNodeIds":["4"],"id":"12","language":"en","name":"Unimplemented step signals pending status","steps":[{"astNodeIds":["3"],"id":"11","text":"a step that isnt implemented yet"}],"tags":[],"uri":"features/pending/pending.feature"}}
|
5
|
+
{"pickle":{"astNodeIds":["7"],"id":"15","language":"en","name":"Steps before unimplemented steps are executed","steps":[{"astNodeIds":["5"],"id":"13","text":"an implemented step"},{"astNodeIds":["6"],"id":"14","text":"a step that isnt implemented yet"}],"tags":[],"uri":"features/pending/pending.feature"}}
|
6
|
+
{"pickle":{"astNodeIds":["10"],"id":"18","language":"en","name":"Steps after unimplemented steps are skipped","steps":[{"astNodeIds":["8"],"id":"16","text":"a step that isnt implemented yet"},{"astNodeIds":["9"],"id":"17","text":"a step that we expect to be skipped"}],"tags":[],"uri":"features/pending/pending.feature"}}
|
7
|
+
{"stepDefinition":{"id":"0","pattern":{"source":"an implemented step","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":3},"uri":"features/pending/pending.feature.ts"}}}
|
8
|
+
{"stepDefinition":{"id":"1","pattern":{"source":"a step that isnt implemented yet","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":7},"uri":"features/pending/pending.feature.ts"}}}
|
9
|
+
{"stepDefinition":{"id":"2","pattern":{"source":"a step that we expect to be skipped","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":11},"uri":"features/pending/pending.feature.ts"}}}
|
10
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
11
|
+
{"testCase":{"id":"20","pickleId":"12","testSteps":[{"id":"19","pickleStepId":"11","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
12
|
+
{"testCase":{"id":"23","pickleId":"15","testSteps":[{"id":"21","pickleStepId":"13","stepDefinitionIds":["0"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"22","pickleStepId":"14","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
13
|
+
{"testCase":{"id":"26","pickleId":"18","testSteps":[{"id":"24","pickleStepId":"16","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"25","pickleStepId":"17","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
14
|
+
{"testCaseStarted":{"attempt":0,"id":"27","testCaseId":"20","timestamp":{"nanos":1000000,"seconds":0}}}
|
15
|
+
{"testStepStarted":{"testCaseStartedId":"27","testStepId":"19","timestamp":{"nanos":2000000,"seconds":0}}}
|
16
|
+
{"testStepFinished":{"testCaseStartedId":"27","testStepId":"19","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PENDING"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
17
|
+
{"testCaseFinished":{"testCaseStartedId":"27","timestamp":{"nanos":4000000,"seconds":0},"willBeRetried":false}}
|
18
|
+
{"testCaseStarted":{"attempt":0,"id":"28","testCaseId":"23","timestamp":{"nanos":5000000,"seconds":0}}}
|
19
|
+
{"testStepStarted":{"testCaseStartedId":"28","testStepId":"21","timestamp":{"nanos":6000000,"seconds":0}}}
|
20
|
+
{"testStepFinished":{"testCaseStartedId":"28","testStepId":"21","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":7000000,"seconds":0}}}
|
21
|
+
{"testStepStarted":{"testCaseStartedId":"28","testStepId":"22","timestamp":{"nanos":8000000,"seconds":0}}}
|
22
|
+
{"testStepFinished":{"testCaseStartedId":"28","testStepId":"22","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PENDING"},"timestamp":{"nanos":9000000,"seconds":0}}}
|
23
|
+
{"testCaseFinished":{"testCaseStartedId":"28","timestamp":{"nanos":10000000,"seconds":0},"willBeRetried":false}}
|
24
|
+
{"testCaseStarted":{"attempt":0,"id":"29","testCaseId":"26","timestamp":{"nanos":11000000,"seconds":0}}}
|
25
|
+
{"testStepStarted":{"testCaseStartedId":"29","testStepId":"24","timestamp":{"nanos":12000000,"seconds":0}}}
|
26
|
+
{"testStepFinished":{"testCaseStartedId":"29","testStepId":"24","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PENDING"},"timestamp":{"nanos":13000000,"seconds":0}}}
|
27
|
+
{"testStepStarted":{"testCaseStartedId":"29","testStepId":"25","timestamp":{"nanos":14000000,"seconds":0}}}
|
28
|
+
{"testStepFinished":{"testCaseStartedId":"29","testStepId":"25","testStepResult":{"duration":{"nanos":0,"seconds":0},"status":"SKIPPED"},"timestamp":{"nanos":15000000,"seconds":0}}}
|
29
|
+
{"testCaseFinished":{"testCaseStartedId":"29","timestamp":{"nanos":16000000,"seconds":0},"willBeRetried":false}}
|
30
|
+
{"testRunFinished":{"success":false,"timestamp":{"nanos":17000000,"seconds":0}}}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Feature: Retry
|
2
|
+
|
3
|
+
Some Cucumber implementations support a Retry mechanism, where test cases that fail
|
4
|
+
can be retried up to a limited number of attempts in the same test run.
|
5
|
+
|
6
|
+
Non-passing statuses other than FAILED don't trigger a retry - they are not going to pass
|
7
|
+
however many times we attempt them.
|
8
|
+
|
9
|
+
Scenario: test case passes on the first attempt
|
10
|
+
Given a step that always passes
|
11
|
+
|
12
|
+
Scenario: test case passes on the second attempt
|
13
|
+
Given a step that passes the second time
|
14
|
+
|
15
|
+
Scenario: test case passes on the final attempt
|
16
|
+
Given a step that passes the third time
|
17
|
+
|
18
|
+
Scenario: test case fails on every attempt
|
19
|
+
Given a step that always fails
|
20
|
+
|
21
|
+
Scenario: don't retry on UNDEFINED
|
22
|
+
Given a non-existent step
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{"meta":{"cpu":{"name":"x64"},"implementation":{"name":"fake-cucumber","version":"15.0.0"},"os":{"name":"linux","version":"5.11.0-34-generic"},"protocolVersion":"17.1.1","runtime":{"name":"node.js","version":"14.17.3"}}}
|
2
|
+
{"source":{"data":"Feature: Retry\n\n Some Cucumber implementations support a Retry mechanism, where test cases that fail\n can be retried up to a limited number of attempts in the same test run.\n\n Non-passing statuses other than FAILED don't trigger a retry - they are not going to pass\n however many times we attempt them.\n\n Scenario: test case passes on the first attempt\n Given a step that always passes\n\n Scenario: test case passes on the second attempt\n Given a step that passes the second time\n\n Scenario: test case passes on the final attempt\n Given a step that passes the third time\n\n Scenario: test case fails on every attempt\n Given a step that always fails\n\n Scenario: don't retry on UNDEFINED\n Given a non-existent step\n","mediaType":"text/x.cucumber.gherkin+plain","uri":"features/retry/retry.feature"}}
|
3
|
+
{"gherkinDocument":{"comments":[],"feature":{"children":[{"scenario":{"description":"","examples":[],"id":"5","keyword":"Scenario","location":{"column":3,"line":9},"name":"test case passes on the first attempt","steps":[{"id":"4","keyword":"Given ","location":{"column":5,"line":10},"text":"a step that always passes"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"7","keyword":"Scenario","location":{"column":3,"line":12},"name":"test case passes on the second attempt","steps":[{"id":"6","keyword":"Given ","location":{"column":5,"line":13},"text":"a step that passes the second time"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"9","keyword":"Scenario","location":{"column":3,"line":15},"name":"test case passes on the final attempt","steps":[{"id":"8","keyword":"Given ","location":{"column":5,"line":16},"text":"a step that passes the third time"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"11","keyword":"Scenario","location":{"column":3,"line":18},"name":"test case fails on every attempt","steps":[{"id":"10","keyword":"Given ","location":{"column":5,"line":19},"text":"a step that always fails"}],"tags":[]}},{"scenario":{"description":"","examples":[],"id":"13","keyword":"Scenario","location":{"column":3,"line":21},"name":"don't retry on UNDEFINED","steps":[{"id":"12","keyword":"Given ","location":{"column":5,"line":22},"text":"a non-existent step"}],"tags":[]}}],"description":" Some Cucumber implementations support a Retry mechanism, where test cases that fail\n can be retried up to a limited number of attempts in the same test run.\n\n Non-passing statuses other than FAILED don't trigger a retry - they are not going to pass\n however many times we attempt them.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Retry","tags":[]},"uri":"features/retry/retry.feature"}}
|
4
|
+
{"pickle":{"astNodeIds":["5"],"id":"15","language":"en","name":"test case passes on the first attempt","steps":[{"astNodeIds":["4"],"id":"14","text":"a step that always passes"}],"tags":[],"uri":"features/retry/retry.feature"}}
|
5
|
+
{"pickle":{"astNodeIds":["7"],"id":"17","language":"en","name":"test case passes on the second attempt","steps":[{"astNodeIds":["6"],"id":"16","text":"a step that passes the second time"}],"tags":[],"uri":"features/retry/retry.feature"}}
|
6
|
+
{"pickle":{"astNodeIds":["9"],"id":"19","language":"en","name":"test case passes on the final attempt","steps":[{"astNodeIds":["8"],"id":"18","text":"a step that passes the third time"}],"tags":[],"uri":"features/retry/retry.feature"}}
|
7
|
+
{"pickle":{"astNodeIds":["11"],"id":"21","language":"en","name":"test case fails on every attempt","steps":[{"astNodeIds":["10"],"id":"20","text":"a step that always fails"}],"tags":[],"uri":"features/retry/retry.feature"}}
|
8
|
+
{"pickle":{"astNodeIds":["13"],"id":"23","language":"en","name":"don't retry on UNDEFINED","steps":[{"astNodeIds":["12"],"id":"22","text":"a non-existent step"}],"tags":[],"uri":"features/retry/retry.feature"}}
|
9
|
+
{"stepDefinition":{"id":"0","pattern":{"source":"a step that always passes","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":3},"uri":"features/retry/retry.feature.ts"}}}
|
10
|
+
{"stepDefinition":{"id":"1","pattern":{"source":"a step that passes the second time","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":8},"uri":"features/retry/retry.feature.ts"}}}
|
11
|
+
{"stepDefinition":{"id":"2","pattern":{"source":"a step that passes the third time","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":16},"uri":"features/retry/retry.feature.ts"}}}
|
12
|
+
{"stepDefinition":{"id":"3","pattern":{"source":"a step that always fails","type":"CUCUMBER_EXPRESSION"},"sourceReference":{"location":{"line":23},"uri":"features/retry/retry.feature.ts"}}}
|
13
|
+
{"testRunStarted":{"timestamp":{"nanos":0,"seconds":0}}}
|
14
|
+
{"testCase":{"id":"25","pickleId":"15","testSteps":[{"id":"24","pickleStepId":"14","stepDefinitionIds":["0"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
15
|
+
{"testCase":{"id":"27","pickleId":"17","testSteps":[{"id":"26","pickleStepId":"16","stepDefinitionIds":["1"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
16
|
+
{"testCase":{"id":"29","pickleId":"19","testSteps":[{"id":"28","pickleStepId":"18","stepDefinitionIds":["2"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
17
|
+
{"testCase":{"id":"31","pickleId":"21","testSteps":[{"id":"30","pickleStepId":"20","stepDefinitionIds":["3"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}]}}
|
18
|
+
{"testCase":{"id":"33","pickleId":"23","testSteps":[{"id":"32","pickleStepId":"22","stepDefinitionIds":[],"stepMatchArgumentsLists":[]}]}}
|
19
|
+
{"testCaseStarted":{"attempt":0,"id":"34","testCaseId":"25","timestamp":{"nanos":1000000,"seconds":0}}}
|
20
|
+
{"testStepStarted":{"testCaseStartedId":"34","testStepId":"24","timestamp":{"nanos":2000000,"seconds":0}}}
|
21
|
+
{"testStepFinished":{"testCaseStartedId":"34","testStepId":"24","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":3000000,"seconds":0}}}
|
22
|
+
{"testCaseFinished":{"testCaseStartedId":"34","timestamp":{"nanos":4000000,"seconds":0},"willBeRetried":false}}
|
23
|
+
{"testCaseStarted":{"attempt":0,"id":"35","testCaseId":"27","timestamp":{"nanos":5000000,"seconds":0}}}
|
24
|
+
{"testStepStarted":{"testCaseStartedId":"35","testStepId":"26","timestamp":{"nanos":6000000,"seconds":0}}}
|
25
|
+
{"testStepFinished":{"testCaseStartedId":"35","testStepId":"26","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:13","status":"FAILED"},"timestamp":{"nanos":7000000,"seconds":0}}}
|
26
|
+
{"testCaseFinished":{"testCaseStartedId":"35","timestamp":{"nanos":8000000,"seconds":0},"willBeRetried":true}}
|
27
|
+
{"testCaseStarted":{"attempt":1,"id":"36","testCaseId":"27","timestamp":{"nanos":9000000,"seconds":0}}}
|
28
|
+
{"testStepStarted":{"testCaseStartedId":"36","testStepId":"26","timestamp":{"nanos":10000000,"seconds":0}}}
|
29
|
+
{"testStepFinished":{"testCaseStartedId":"36","testStepId":"26","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":11000000,"seconds":0}}}
|
30
|
+
{"testCaseFinished":{"testCaseStartedId":"36","timestamp":{"nanos":12000000,"seconds":0},"willBeRetried":false}}
|
31
|
+
{"testCaseStarted":{"attempt":0,"id":"37","testCaseId":"29","timestamp":{"nanos":13000000,"seconds":0}}}
|
32
|
+
{"testStepStarted":{"testCaseStartedId":"37","testStepId":"28","timestamp":{"nanos":14000000,"seconds":0}}}
|
33
|
+
{"testStepFinished":{"testCaseStartedId":"37","testStepId":"28","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:16","status":"FAILED"},"timestamp":{"nanos":15000000,"seconds":0}}}
|
34
|
+
{"testCaseFinished":{"testCaseStartedId":"37","timestamp":{"nanos":16000000,"seconds":0},"willBeRetried":true}}
|
35
|
+
{"testCaseStarted":{"attempt":1,"id":"38","testCaseId":"29","timestamp":{"nanos":17000000,"seconds":0}}}
|
36
|
+
{"testStepStarted":{"testCaseStartedId":"38","testStepId":"28","timestamp":{"nanos":18000000,"seconds":0}}}
|
37
|
+
{"testStepFinished":{"testCaseStartedId":"38","testStepId":"28","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:16","status":"FAILED"},"timestamp":{"nanos":19000000,"seconds":0}}}
|
38
|
+
{"testCaseFinished":{"testCaseStartedId":"38","timestamp":{"nanos":20000000,"seconds":0},"willBeRetried":true}}
|
39
|
+
{"testCaseStarted":{"attempt":2,"id":"39","testCaseId":"29","timestamp":{"nanos":21000000,"seconds":0}}}
|
40
|
+
{"testStepStarted":{"testCaseStartedId":"39","testStepId":"28","timestamp":{"nanos":22000000,"seconds":0}}}
|
41
|
+
{"testStepFinished":{"testCaseStartedId":"39","testStepId":"28","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"status":"PASSED"},"timestamp":{"nanos":23000000,"seconds":0}}}
|
42
|
+
{"testCaseFinished":{"testCaseStartedId":"39","timestamp":{"nanos":24000000,"seconds":0},"willBeRetried":false}}
|
43
|
+
{"testCaseStarted":{"attempt":0,"id":"40","testCaseId":"31","timestamp":{"nanos":25000000,"seconds":0}}}
|
44
|
+
{"testStepStarted":{"testCaseStartedId":"40","testStepId":"30","timestamp":{"nanos":26000000,"seconds":0}}}
|
45
|
+
{"testStepFinished":{"testCaseStartedId":"40","testStepId":"30","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:19","status":"FAILED"},"timestamp":{"nanos":27000000,"seconds":0}}}
|
46
|
+
{"testCaseFinished":{"testCaseStartedId":"40","timestamp":{"nanos":28000000,"seconds":0},"willBeRetried":true}}
|
47
|
+
{"testCaseStarted":{"attempt":1,"id":"41","testCaseId":"31","timestamp":{"nanos":29000000,"seconds":0}}}
|
48
|
+
{"testStepStarted":{"testCaseStartedId":"41","testStepId":"30","timestamp":{"nanos":30000000,"seconds":0}}}
|
49
|
+
{"testStepFinished":{"testCaseStartedId":"41","testStepId":"30","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:19","status":"FAILED"},"timestamp":{"nanos":31000000,"seconds":0}}}
|
50
|
+
{"testCaseFinished":{"testCaseStartedId":"41","timestamp":{"nanos":32000000,"seconds":0},"willBeRetried":true}}
|
51
|
+
{"testCaseStarted":{"attempt":2,"id":"42","testCaseId":"31","timestamp":{"nanos":33000000,"seconds":0}}}
|
52
|
+
{"testStepStarted":{"testCaseStartedId":"42","testStepId":"30","timestamp":{"nanos":34000000,"seconds":0}}}
|
53
|
+
{"testStepFinished":{"testCaseStartedId":"42","testStepId":"30","testStepResult":{"duration":{"nanos":1000000,"seconds":0},"message":"Exception in step\nfeatures/retry/retry.feature:19","status":"FAILED"},"timestamp":{"nanos":35000000,"seconds":0}}}
|
54
|
+
{"testCaseFinished":{"testCaseStartedId":"42","timestamp":{"nanos":36000000,"seconds":0},"willBeRetried":false}}
|
55
|
+
{"testCaseStarted":{"attempt":0,"id":"43","testCaseId":"33","timestamp":{"nanos":37000000,"seconds":0}}}
|
56
|
+
{"testStepStarted":{"testCaseStartedId":"43","testStepId":"32","timestamp":{"nanos":38000000,"seconds":0}}}
|
57
|
+
{"testStepFinished":{"testCaseStartedId":"43","testStepId":"32","testStepResult":{"duration":{"nanos":0,"seconds":0},"status":"UNDEFINED"},"timestamp":{"nanos":39000000,"seconds":0}}}
|
58
|
+
{"testCaseFinished":{"testCaseStartedId":"43","timestamp":{"nanos":40000000,"seconds":0},"willBeRetried":false}}
|
59
|
+
{"testRunFinished":{"success":false,"timestamp":{"nanos":41000000,"seconds":0}}}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Given('a step that always passes') do
|
2
|
+
# no-op
|
3
|
+
end
|
4
|
+
|
5
|
+
second_time_pass = 0
|
6
|
+
Given('a step that passes the second time') do
|
7
|
+
second_time_pass += 1
|
8
|
+
if second_time_pass < 2
|
9
|
+
raise StandardError, 'Exception in step'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
third_time_pass = 0
|
14
|
+
Given('a step that passes the third time') do
|
15
|
+
third_time_pass += 1
|
16
|
+
if third_time_pass < 3
|
17
|
+
raise StandardError, 'Exception in step'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Given('a step that always fails') do
|
22
|
+
raise StandardError, 'Exception in step'
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Rules
|
2
|
+
You can place scenarios inside rules. This makes is possible to structure
|
3
|
+
Gherkin documents in the same way as [example maps](https://cucumber.io/blog/bdd/example-mapping-introduction/).
|
4
|
+
You can also use the Examples synonym for Scenario to make them even more similar.
|
5
|
+
|
6
|
+
Rule: a sale cannot happen if change cannot be returned
|
7
|
+
# sad path
|
8
|
+
Example: no change
|
9
|
+
Given there are 5 0.20 coins inside
|
10
|
+
When the customer tries to buy a 0.85 chocolate with a 1 coin
|
11
|
+
Then the sale should not happen
|
12
|
+
|
13
|
+
# happy path
|
14
|
+
Example: exact change
|
15
|
+
Given there are 5 0.20 coins inside
|
16
|
+
And there are 3 chocolates inside
|
17
|
+
When the customer tries to buy a 0.80 chocolate with a 1 coin
|
18
|
+
Then the customer's change should be 1 0.20 coin
|
19
|
+
|
20
|
+
@some-tag
|
21
|
+
Rule: a sale cannot happen if we're out of stock
|
22
|
+
# sad path
|
23
|
+
Example: no chocolates left
|
24
|
+
Given there are no chocolates inside
|
25
|
+
But there are 10 0.5 coins inside
|
26
|
+
When the customer tries to buy a 0.85 chocolate with a 1 coin
|
27
|
+
Then the sale should not happen
|