我使用用java编写的用于ui测试的黄瓜。我正在尝试实现黄瓜插件来重新运行失败的场景,并创建了第二个类作为这些场景的跑步者:
头等舱
@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 {
}
第二课:
@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{
}
我正在使用
运行测试mvn clean verify -Dcucumber.options=" --tags @lakeisha"
问题是通过终端运行它似乎不会在rerun.txt中生成任何内容,但是通过IJ运行它。我也尝试将插件放入命令的Dcucumber.options部分,但无济于事。非常感谢!