I\'m using cucumber-jvm in my integration tests and I need to execute some code after all scenarios are finished, just once.
After reading carefully som
As of Cucumber 2.4.0, the following class gave me the equivalent of @BeforeClass in Junit.
You can place this in test/java/cucumber/runtime.
package cucumber.runtime; //cannot change. can be under /test/java
import cucumber.runtime.io.ResourceLoader;
import cucumber.runtime.snippets.FunctionNameGenerator;
import gherkin.pickles.PickleStep;
import java.util.List;
public class NameThisClassWhatever implements Backend {
private Glue glue;
private List gluePaths;
@Override
public void loadGlue(Glue glue, List gluePaths) {
this.glue = glue;
this.gluePaths = gluePaths;
//Any before steps here
}
@Override
public void disposeWorld() {
//any after steps here
}
@Override
public void setUnreportedStepExecutor(UnreportedStepExecutor executor) { }
@Override
public void buildWorld() { }
@Override
public String getSnippet(PickleStep p, String s, FunctionNameGenerator fng) {
return null;
}
public NameThisClassWhatever(ResourceLoader resourceLoader) { }
}