如何在Cucumber-JVM中实现AND OR关系

时间:2016-01-13 11:52:26

标签: java bdd cucumber-jvm cucumber-junit

我有一个如下所示的功能文件:

Feature: This is a sample feature file
@tag1
    Scenario: This is a scenario one.
        Given scenario one
        When @tag1
        Then execute @tag1
@tag2   
    Scenario: This is a scenario two.
        Given scenario two
        When @tag2
        Then execute @tag2

@tag3
    Scenario: This is a scenario three.
        Given scenario three
        When @tag3
        Then execute @tag3  
@tag2 @tag3
    Scenario: This is a scenario two and three.
        Given scenario two and three
        When @tag2 @tag3
        Then execute @tag2 @tag3

现在我只需要@tag1@tag2 @tag3不要运行单@tag2和单@tag3代码

那么我怎样才能提到@CucumberOptions上的标记,只有@tag1@tag2 @tag3方案将运行其他标记才能运行。

1 个答案:

答案 0 :(得分:0)

制作一个新标签来代表2和3的组合,例如@tag2and3