I am writing tests using cucumber-jvm and I want the system to stop running tests on the first scenario that fails. I found example code written for Cucumber Ruby that does this via an After hook. I am searching for the correct java class and method to call that will be the equivalent of setting Cucumber.wants_to_quit = true in Ruby.
Here is my example code:
@After
public void quitOnErrors(Scenario scenario) {
if (scenario.isFailed()) {
// Need the correct class/method/property to call here.
cucumber.api.junit.Cucumber.wants_to_quit = true;
}
}