cucumber-junit
cucumber-junit copied to clipboard
Scenario as single testcase, rather than Given/When/Then
I don't know if this is intended or not. Basically, each step (Given/When/Then/And) component of a scenario is counted as a testcase. I would prefer each scenario within a feature to be treated as a testcase. The reason being, that I re-use each Given, When and Then often, which in the report artificially increases the actual test count.
Do you think this would be a reasonable change (I would try to implement it)? Or is this an optional feature?
Well the output from Cucumber contains timing and status for each step, so I felt that would be the best translation. There is no overall scenario status or timing, so you would have to assemble it from the step data.
I'm not opposed to this, I would just want to see it as an option. Something like --scope=scenario
default to step
Sample cucumber json for you: https://github.com/stjohnjohnson/cucumber-junit/blob/a5d7aff1da03e01c7ef15141cdf1dadbf62026be/tests/mocks/input.json
This reporter handles it like I suggested: https://github.com/davidparsson/junit-report-builder
Actually, the cucumber junit reporter in other languages works like rafaelcichocki describes
I vote for this. TestCase == Scenario, not step. Time should be sum up for all step in scenario. This is the most wanted way, I even do it be default and make parameter for TC == Step.
Thanks!
@znevrly like I said, if you want to give a PR to add this feature, I'm all for it (but please make it optional, we can make it default eventually).
Sorry, but code it's unnecessary complex. Why involve XML when there is JUnit builder. I have made very simple implementation https://www.npmjs.com/package/cucumber-junit-convert