Dcucumber.options, how to have multiple tags

前端 未结 6 677
无人共我
无人共我 2020-12-24 03:28

I am trying run cucumber tests using maven with following command

mvn test -Dcucumber.options=\"--tag @debug1\"

This command works fine, ho

相关标签:
6条回答
  • 2020-12-24 03:44

    I using this commandline to run multiple tags

    mvn test  -Dcucumber.options="--tags '@tag1 or @tag2' --plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm --plugin rerun:rerun/failed_scenarios.txt"
    

    Cucumber version 4.2.6

    0 讨论(0)
  • 2020-12-24 03:45

    mvn clean verify -D tags="tagName"

    0 讨论(0)
  • 2020-12-24 03:46

    In Cucumber 6, property name has changed. Use:

    mvn verify -Dcucumber.filter.tags="@debug1 or @debug2"
    
    0 讨论(0)
  • 2020-12-24 03:54

    In cucumber v5.X, only mvn test -Dcucumber.options="--tags '@debug1 or @debug2'" is supported and working. mvn test -Dcucumber.options="--tags '@debug1 and @debug2'" is not working and either scenarios won't get executed

    0 讨论(0)
  • 2020-12-24 03:55

    Little late to the party, but I am using something like:

    mvn test -D tags="debug1 and debug2"
    

    I am on Cucumber 2.4.

    The @ symbol is optional. You can use a tags Maven property. And you can use boolean logic to hook up multiple tags - official docs.

    Reduces the amount of typing little bit.

    0 讨论(0)
  • 2020-12-24 04:08
    • To run scenarios with @debug1 and @debug2:

    Old version of Cucumber-jvm:

    mvn test -Dcucumber.options="--tags @debug1 --tags @debug2"
    

    Actual version of Cucumber-jvm:

    mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"
    
    • To run scenarios with @debug1 or @debug2:

    Old version of Cucumber-jvm:

    mvn test -Dcucumber.options="--tags @debug1,@debug2"
    

    Actual version of Cucumber-jvm:

    mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"
    
    0 讨论(0)
提交回复
热议问题