trivago / cluecumber

Clear and concise reporting for the Cucumber BDD JSON format.
https://www.softwaretester.blog
Apache License 2.0
271 stars 90 forks source link

Align Cluecumber reporting to the official Cucumber BDD ruleset #68

Closed bischoffdev closed 6 years ago

bischoffdev commented 6 years ago
bischoffdev commented 6 years ago

Contacted Cucumber OSS Community in order to clarify this. Waiting for replies.

bischoffdev commented 6 years ago

If an after hook fails, then Cucumber-Ruby, Cucumber-JVM will mark that scenario as failed in the summary, that is a summary like:

1 Scenario (1 Failed)
3 Steps (3 Passed)
bischoffdev commented 6 years ago

Consider step hook failures and skipped steps in calculating scenario failures:

Don't modify step results when step hooks fail!

bischoffdev commented 6 years ago

Implemented and ready for release.

mpkorstanje commented 7 months ago

@bischoffdev this doesn't look correct

scenario which consists of only passing and skipped steps

-- PASSED

The result of a scenario is the worst result of it's steps (hook steps and pickle steps are both steps). So this should be skipped.

bischoffdev commented 7 months ago

Thanks for the comment, @mpkorstanje ! Is skipped considered worse than passed in any case? If yes, then I need to revise this. It was probably due to us never having skipped steps without prior failures. Or all skipped in case of a deliberate scenario skip. I will check and change this depending on your input.

mpkorstanje commented 7 months ago

Yes. The order is exactly this:

https://github.com/cucumber/cucumber-jvm/blob/main/cucumber-java/src/main/java/io/cucumber/java/Status.java

So you can use Collections.max or Stream.max on the collection of all states to find it. If there are no steps, the scenario passes by definition.

All steps van be skipped by using Junits Assume or Assumption class in the first step.