Skipped tests are not displayed in the Cucumber Report

Viewed 288

I'm running my Cucumber tests using mvn clean verify. I have annotated a test scenario with the @Skip tag and then provided this tag inside @CucumberOptions(tags = "not @Skip") in order to skip that scenario.

After running the tests I get the following log: [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0.
What am I missing in order to show that the test was skipped?
I would expect to see: [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 1.

1 Answers

When using a tag filter with Cucumber and JUnit 4, scenarios are excluded (filtered) from execution. So JUnit doesn't even tell Surefire about their existence and so they don't get counted.

Why? Mostly a coincidence of history that takes too long to explain.

When using cucumbers tag filters with JUnit 5 scenarios are correctly marked as skipped. Though oddly enough when using JUnit5s own tag filters they're not included. Though the semantics are such that both behaviors are correct now.

https://github.com/cucumber/cucumber-jvm/tree/main/junit-platform-engine

Related