Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cucumberJson: the report json file only contains the last scenario in feature file #655

Closed
thienthu1410 opened this issue Dec 12, 2021 · 3 comments

Comments

@thienthu1410
Copy link

thienthu1410 commented Dec 12, 2021

Current behavior

Pre-condition
Given I have a feature file with 2 scenarios like below image
image
The feature has tag @feature-example
The first scenario has tag @example-1
The last scenario has tag @example-2

And I have configure cucumberJson as below image:
image

Scenario 1
When I run test with below command:
npx cypress-tags run -e TAGS='@feature-example and @example-1' --headed -b chrome

Then I see that only scenario with tag @example-1 is ran, and the console report as below image:
image

And I check the json file, I see that only the scenario with tag @example-2 is included in the json file
[ { "keyword": "Feature", "name": "Example check have text", "line": 2, "id": "example-check-have-text", "tags": [ { "name": "@feature-example", "line": 1 } ], "uri": "check_have_text.feature", "elements": [ { "id": "example-check-have-text;", "keyword": "Scenario", "line": 10, "name": "", "tags": [ { "name": "@feature-example", "line": 1 }, { "name": "@example-2", "line": 9 } ], "type": "scenario", "steps": [ { "arguments": [], "keyword": "Given ", "line": 11, "name": "I access the github", "result": { "status": "skipped" } }, { "arguments": [], "keyword": "Then ", "line": 12, "name": "I check the have text", "result": { "status": "skipped" } } ] } ] } ]

Just more details: When I run process to generate html report using multiple-cucumber-html-report, the report file only shows the skipped scenario. I understand that this is not in scope of this issue, as the issue comes from cucumber json
image

Scenario 2
When I run test with below command:
npx cypress-tags run -e TAGS='@feature-example' --headed -b chrome

Then I see that all scenarios in feature file are ran, and the console report as below image:
image

And I check the json file, I see that only the scenario with tag @example-2 is included in the json file
[ { "keyword": "Feature", "name": "Example check have text", "line": 2, "id": "example-check-have-text", "tags": [ { "name": "@feature-example", "line": 1 } ], "uri": "check_have_text.feature", "elements": [ { "id": "example-check-have-text;", "keyword": "Scenario", "line": 10, "name": "", "tags": [ { "name": "@feature-example", "line": 1 }, { "name": "@example-2", "line": 9 } ], "type": "scenario", "steps": [ { "arguments": [], "keyword": "Given ", "line": 11, "name": "I access the github", "result": { "status": "passed", "duration": 1934000000 } }, { "arguments": [], "keyword": "Then ", "line": 12, "name": "I check the have text", "result": { "status": "passed", "duration": 87000000 } } ] } ] } ]

Desired behavior

Expected
All the passed/failed scenarios should be included in the cucumber json file

Only the passed/failed scenario should be included in the cucumber json file, we don't want the skipped scenario here, as the html report will populated the skipped scenario unexpectedly

Note
I also have tried run using cytorus, but I got the below issue
image

Test code to reproduce

Versions

  • Cypress version: 9.1.1
  • Preprocessor version: 4.3.1
  • Node version: 16.13.1
@badeball
Copy link
Owner

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.

@ernestorocha
Copy link

Hello,

I think this is still an issue for the newest version, 9.0.5. It least this is happening to my setup the way that was described here.

@thienthu1410, did you have the opportunity to upgrade and check if it was fixed for you?

Thank you!

@badeball
Copy link
Owner

Just chiming in to say that "I think this is still an issue" is not enough and if you need something fixed you have to concrete. I pretty much refrain from getting involved until someone can convince me that it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants