问题描述
背景
我们可以使用.feature
插件并行运行teymyers Cucumber Parallel
个文件。这将为每个.feature
文件创建一个Java文件,例如Parallel01IT.java,Parallel02IT.java ... ...
问题:如果运行失败,如何重新运行/重试这些ParallexxIT.java文件?
我没有什么可以尝试的。我在SO中找不到空手道黄瓜,红宝石黄瓜的链接,但在Serenity黄瓜上却找不到。
解决方法
- 虽然全新运行通过重新运行插件作为参数
"-p","rerun:target/cucumber/rerun.txt"
。这会产生黄瓜 重新运行包含失败方案行号的文件。 - 然后下一次代替功能目录传递重新运行文本文件
"@target/cucumber-reports/rerun.txt"
- 这只会重新运行失败的场景
如果您正在通过junitRunner使用黄瓜选项[我不确定(但是我想这是计划淘汰的)黄瓜,请执行以下操作。
新运行:
@CucumberOptions(features = {"src/test/resources/"},plugin = {"pretty","json:target/cucumber/cucumber.json","rerun:target/cucumber-reports/rerun.txt"})
重新运行:
@CucumberOptions(
features = {"@target/cucumber/rerun.txt"},rerun:target/cucumber/rerun.txt"})