I am using cucumber for ui testing written in java. I am trying to implement the cucumber plugin for rerunning failed scenarios, and created a second class to be the runner for those scenarios:
first class
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
strict = true,
tags = {"@lakeisha"},
features = ".",
format = {"html:target/cucumber", "json:target/cucumber.json"},
plugin = {
"pretty", "html:target/cucumber-reports",
"json:target/cucumber.json",
"rerun:src/test/resources/rerun.txt" //Creates a text file with failed scenarios
})
public class RunCukeTestsIT extends BaseCucumberRunner {
}
second class:
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
tags = {"@lakeisha"},
features = "@src/test/resources/rerun.txt", //Cucumber picks the failed scenarios from this file
format = {"html:target/cucumber", "json:target/cucumber.json"}
)
public class ReRunCukeTestsIT extends BaseCucumberRunner{
}
and i am running the tests using
mvn clean verify -Dcucumber.options=" --tags @lakeisha"
the problem is that running it through terminal doesn't seem to generate anything in the rerun.txt, but running it through IJ does. I also tried putting the plugin into Dcucumber.options portion of command, to no avail . Help much appreciated!