Dcucumber.options, how to have multiple tags

孤街醉人 提交于 2019-11-30 11:52:48

问题


I am trying run cucumber tests using maven with following command

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

This command works fine, however if i try something like following, i get error

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

Is there a way to pass in multiple tag names with cucumber run-time options?


回答1:


To run scenarios with @debug1 and @debug2:

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

To run scenarios with @debug1 or @debug2:

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



回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/34538571/dcucumber-options-how-to-have-multiple-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!