I have multiple scenarios in a cucumber feature file. When a step in the first scenario fails, the next scenario will start to execute, but sometimes I want the test to stop execution on the failing scenario. I tried using an @After hook but I am not sure how to tell cucumber to stop the execution in java.
I tried this, but the code could not compile as CucumberHooks could not be resolved
@After
public void after(Scenario scenario) throws Exception {
CucumberHooks.wantsToQuit = true == s.isFailed();
}
How can I tell cucumber java to stop execution after a scenario fails?