我的一些 cucumber 场景失败了,我想将它们标记为@wip,这样我仍然可以在 Runner.java 类中标记它们,但不能实际运行它们。
我在 .feature 文件中标记失败场景,如下所示:
@wip
Scenario Outline: BR001 - NEGATIVE - Description
我在 Runner 类中指定标签,如下所示:
@RunWith(Cucumber.class)
@CucumberOptions(
plugin = {"progress",
"html:build/report/cucumber/html",
"junit:build/report/cucumber/junit/cucumber.xml",
"json:build/report/cucumber/json/cucumber.json"
},
glue = {"qa"},
features = {"src/test/java/features"},
tags = {"@BR000,@BR004b, @BR007, @BR008, @BR009, not@wip"}
)
public class QARunner {
如果我删除 not@wip,那么其他 5 个测试就可以顺利通过。
我需要进行哪些更改才能包含正在进行的测试,但不运行它们?
最佳答案
解决了这个问题,更新了上面 Runner.java 类中的以下行,如下所示:
tags = {"@BR000,@BR004b, @BR007, @BR008, @BR009", "~@wip"}
这将执行第一个引号 ("") 内的所有测试,& 不会执行第二对引号内的标记。
关于java - 如何包含正在进行的 Cucumber 测试,但不执行它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51038042/