Is there a way in JAVA to listen for a specific annotation that is being called, and run a method before / after the annotation, specifically in a Cucumber / JUnit framework? For example, when the following code is being called due to step in your feature file ("Then something happens"):
@Then("something happens")
public void somethingHappens(){
// run code in method
}
That before / after the somethingHappens() method is called, another method is called like:
public void doSomethingElseBeforeAnnotation(){
// run code in method
}
There is the @BeforeStep and @AfterStep in the Cucumber framework, but i want to be able to run the method only at, for example, the "@Then" annotations. So actually, i neeed something like a @BeforeThen :)
Aucun commentaire:
Enregistrer un commentaire