我的功能文件中有如下场景:
@tag1
Scenario1
@tag2 @tag1
Scenario2
@tag3 @tag1
Scenario3
所以我想执行只有@tag1 的场景1,但不想执行场景2 和场景3。如何做到这一点。
我尝试过以下选项:
-Dcucumber.options='--tags "((@tag1) and (not @tag2 or not @tag3)"'
但它正在执行所有 3 个场景。
答案 0 :(得分:0)
从 Cucumber v6 开始,您不能再将 cucumber.options
与字符串之类的命令行一起使用。相反,您必须使用单独的属性。
mvn test -Dcucumber.filter.tags="(@cucumber or @gherkin) and not @salad"