Cucumber junit @Rule integration

448 views
Skip to first unread message

Oleksandr

unread,
Oct 24, 2017, 4:20:59 AM10/24/17
to Cukes
Hi all
I am trying to integrate junit @Rule into cucumber scenario. But it didn't work. Did somebody work with it?

MP Korstanje

unread,
Oct 25, 2017, 4:29:58 AM10/25/17
to Cukes
The only supported annotations are `@ClassRule`, `@BeforeClass` and `@AfterClass` in the runner.

The documentation is not yet up todate. :|

https://github.com/cucumber/cucumber-jvm/blob/master/junit/src/main/java/cucumber/api/junit/Cucumber.java

I would however discourage the use of these rules. They are not portable between runners. If you use IDEA to run the tests they wont be triggered.

Reply all
Reply to author
Forward
0 new messages