我的一些黄瓜场景失败了,我想将它们标记为 @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"}
这将执行第一个引号 (" ") 内的所有测试,& 不执行第二对引号内的标签。
早上好。当我通常单独编写这些标签时,例如: (标签=“不是@wip,也不是@quarentena”)