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
Background steps are reported without keyword Background in json report #2388
Comments
This JSON output has been in maintenance mode for some time. Have you been using another version of cucumber-js that produces for format you expect from the JSON formatter? If so, can you say which version? |
Hello,
Now, we are automating front projects and we use cucumber": "10.3.1". In generated Json report, background steps are not flagged with keyword Background as per cucumber-java.
Hope my explanation is clear for you |
Thanks, that makes sense now. Let me come back to you shortly on this. |
@usertest2024 unfortunately the JSON output was developed before things like JSON Schema got popular and so different Cucumber implementations have come to differ over time. It is worth looking at test data from cucumber-js and cucumber-jvm in the cucumber-json-converter:
For cucumber-jvm backgrounds are represented as their own unique element with While we are slowly working on a common output format with a schema, you may be better of fixing your custom reporting tool to be lenient enough to accept both formats. The samples in the testdata folder should be able to help you with that. |
@mpkorstanje thank you for the answer and the explanations |
Then I am afraid you will have the unenviable task of reimplementing the json formatter from cucumber-jvm in javascript. Or perhaps a less involved solution would be to try and post process the json report and convert it to the jvm flavour. The Finally, we are (and have been for a long time) planning to rewrite the json formatter used by cucumber-jvm to use the message protocol - similar to the junit-xml-formatter. This should allow you to consume the message protocol from cucumber-js and render that as a json report. But the timeline on this is indefinite, so I don't think this will meet your needs. |
This issue is stale because it has been open for 3 weeks with no activity. Remove the stale label or comment or this will be closed in another 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
Sorry for the bot-triggered closure here. But as per @mpkorstanje earlier comments, this would be a breaking change if we were to make it, and with this formatter a) in maintenance mode and b) widely relied upon that's not something we can do unfortunately. Post-processing the JSON as suggested is probably the way to go. |
👓 What did you see?
In json report, steps coming from Background section are not identified as background steps.
So, the tool we are using internally to generate custom report, is not working any more.(cannot find keyword: Background)
I have in json report:
✅ What did you expect to see?
I expect to see something like:
📦 Which tool/library version are you using?
"@cucumber/cucumber": "^10.3.1"
🔬 How could we reproduce it?
No response
📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: