麻烦让黄瓜重新运行插件通过终端工作

时间:2017-12-08 16:16:25

标签: java maven cucumber cucumber-jvm

我使用用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部分,但无济于事。非常感谢!

0 个答案:

没有答案