Closed sylwek845 closed 3 years ago
Cucumber is built on top of Junit but in general it is recommended to use cucumber's @Before
@After
annotations. I think that junit rules will not work here - maybe they could work with some modifications in CucumberJUnitRunner
. You can try to invoke hilt rule methods in @io.cucumber.java.Before
and @io.cucumber.java.After
hooks to simulate normal junit behaviour.
@lsuski Thanks, I think the problem is that the rule needs Statement
and Description
which usually is taken from TestRule
apply method. It would be good to have a Rule.
Will be available in 4.9.0
Describe the bug Trying to run Dagger Hilt Rule and Cucumber tests, and it seems like the Hilt Rule is not getting invoked. Hilt Injection seems to be working without cucumber with exact the same setup.
Thats my custom runner
Additional context Add any other context about the problem here.