我的自动化项目中有两个跑步者,如下所示:
Main runner - 执行所有
@ui-test
标记的测试用例,如果场景失败target/rerun.txt
,将使用场景位置(例如features/Dummy.feature:22
)填充:@RunWith(Cucumber.class) @CucumberOptions( features = "classpath:features", plugin = {"pretty", "html:target/cucumber-html-report", "json:target/cucumber.json", "rerun:target/rerun.txt"}, tags = {"@ui-test", "~@ignore"} ) public class RunCukesTest { }
Secondary runner - 从以下位置重新执行场景
target/rerun.txt
:@RunWith(Cucumber.class) @CucumberOptions( features = "@target/rerun.txt", plugin = {"pretty", "html:target/cucumber-html-report-rerun", "json:target/cucumber_rerun.json"} ) public class ReRunFailedCukesTest { }
执行执行时会创建两个结果 json 文件:
cucumber.json
cucumber_rerun.json
Jenkins 将通过Cucumber-JVM Reports
插件收集结果并创建一个组合报告。
问题是,即使target/rerun.txt
在第二次运行中所有测试都通过了,报告状态仍将保持失败,因为cucumber.json
.
有没有办法(设置Cucumber-JVM Reports
插件或修改上层提供的跑步者)cucumber.json
用结果覆盖cucumber_rerun.json
并仅发布修改后的结果cucumber.json
?
另一个子关键字:maven
, java
, cucumber-java8
, cucumber-junit
,junit