Skip to content

Json output format issue. The steps are being skipped when background is used #62

Description

@AleksKovalenko

👓 What did you see?

cucumber --format json is working incorrectly skipping steps, when Background section is present ( but works correctly when Rule sections is present)

  • cucumber invoke side
    cucumber --format json --tag "@demo01" [{"id":"demofeature","uri":"features/Demo.feature","keyword":"Feature","name":"DemoFeature","description":" As a development team\n we want to demonstrate the cpp step implementations","line":2,"tags":[{"name":"@Demo","line":1}],"elements":[{"id":"demofeature;wait-and-trace","keyword":"Scenario Outline","name":"Wait and trace","description":" This is a good weather scenario.","line":11,"type":"scenario","steps":[],"tags":[{"name":"@Demo","line":1},{"name":"@demo01","line":10}]}]}]

  • cucumber request handler side

` ./build/cucumber_wire_proxy/cucumber_test.cucumber_wire_proxy

2023-05-17T07:54:20.980834 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T07:54:20.981011 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:54:20.983639 ["step_matches",{"name_to_match":"I wait 5 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"5", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ] `

✅ What did you expect to see?

Same steps being processed as when a defualt format is being used or when the Rule section is present in the Feature
Using default format

  • cucumber side

`cucumber --tag "@demo01"
@demo
Feature: DemoFeature
As a development team
we want to demonstrate the cpp step implementations

Background: Test Background # features/Demo.feature:6
Background setup for demonstration
Given I wait 1 seconds test # DemoSteps.cpp:26

@demo01
Scenario Outline: Wait and trace # features/Demo.feature:11
This is a good weather scenario.
When I wait 5 seconds test # DemoSteps.cpp:26

1 scenario (1 passed)
2 steps (2 passed)
0m10.517s`

  • cucumber request handler side

`
2023-05-17T08:07:58.085245 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T08:07:58.085365 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T08:07:58.087540 ["step_matches",{"name_to_match":"I wait 5 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"5", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T08:07:58.166488 ["begin_scenario",{"tags":["Demo","demo01"]}]
[ "success", [ ] ]

2023-05-17T08:07:58.168553 ["invoke",{"id":"0","args":["1"]}]

2023-05-17T08:07:58.168649 Waiting for 1 seconds[ "success", [ ] ]

2023-05-17T08:07:59.173326 ["invoke",{"id":"0","args":["5"]}]

2023-05-17T08:07:59.173523 Waiting for 5 seconds[ "success", [ ] ]

2023-05-17T08:08:08.605159 ["end_scenario",{"tags":["Demo","demo01"]}]
[ "success", [ ] ]`

With feature file containing rule section

  • cucumber side

cucumber --format json --tag "@demo_b01" [{"id":"demofeature","uri":"features/DemoRule.feature","keyword":"Feature","name":"DemoFeature","description":" As a development team\n we want to demonstrate the cpp step implementations","line":2,"tags":[{"name":"@DemoRule","line":1}],"elements":[{"id":"demofeature;wait-and-trace","keyword":"Scenario Outline","name":"Wait and trace","description":" This is a good weather scenario.","line":14,"type":"scenario","steps":[{"keyword":"Given ","name":"I wait 1 seconds test","line":11,"match":{"location":"DemoSteps.cpp:26"},"result":{"status":"passed","duration":1005075700}},{"keyword":"When ","name":"I wait 3 seconds test","line":16,"match":{"location":"DemoSteps.cpp:26"},"result":{"status":"passed","duration":3003355200}}],"tags":[{"name":"@DemoRule","line":1},{"name":"@demo_b01","line":13}],"before":[{"match":{"location":"wire"},"result":{"status":"passed","duration":3498600}}],"after":[{"match":{"location":"wire"},"result":{"status":"passed","duration":2025100}}]}]}]

  • cucumber request handler side

`root@9a49fcc40bc3:/workspaces/cucumber_test# ./build/cucumber_wire_proxy/cucumber_test.cucumber_wire_proxy

2023-05-17T07:57:15.068438 CucumberWireProtocolServer connection accepted from: 127.0.0.1
2023-05-17T07:57:15.068848 ["step_matches",{"name_to_match":"I wait 1 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"1", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:57:15.071259 ["step_matches",{"name_to_match":"I wait 3 seconds test"}]
[ "success", [ { "id":"0", "args":[ { "val":"3", "pos":7 } ], "source":"DemoSteps.cpp:26" } ] ]

2023-05-17T07:57:15.150092 ["begin_scenario",{"tags":["DemoRule","demo_b01"]}]
[ "success", [ ] ]

2023-05-17T07:57:15.154718 ["invoke",{"id":"0","args":["1"]}]

2023-05-17T07:57:15.156274 Waiting for 1 seconds[ "success", [ ] ]

2023-05-17T07:57:16.160083 ["invoke",{"id":"0","args":["3"]}]

2023-05-17T07:57:16.160243 Waiting for 3 seconds[ "success", [ ] ]

2023-05-17T07:57:19.163339 ["end_scenario",{"tags":["DemoRule","demo_b01"]}]
[ "success", [ ] ]`

📦 Which tool/library version are you using?

cucumber-ruby 7.1
cucumber-ruby-wire 6.2.1
cucumber-wire-proxy (in-house c++ implementation of the steps and cucumber request handler to be connected to)

🔬 How could we reproduce it?

You can use a repository with the setup
https://github.com/AleksKovalenko/cucumber-wire-test

  1. Install the dependencies using bundle with Gemfile provided
  2. Build the cucumber-wire-proxy using the container and run it inside the container ( will expose port 90 for connections)
  3. Run the cucumber --format json --tag "@demo01" from the host system

📚 Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions