Cucumber `--tags` options from command line?

我是研究僧i 提交于 2019-12-23 11:46:10

问题


What i would like to do is to pass cucumber options from command line to execute scenarios with tag name @extecuteThese but also i wanted to exclude scenarios that are with tag name @WIP so what am i doing so far is

-Dcucumber.options='--tags @executeThese --tags ~@WIP' 

But unfortunately, it's not considering ~@WIP tag option

Any help, much appreciated!!


回答1:


Lets pretend this is your feature:

Feature ABC

@executeThese
Scenario: abc1

@WIP @executeThese
Scenario: abc2

What you are currently doing is equivalent to an AND operation. so only abc2 will be run

In order to run both you need to do an OR operation equivalent to do this run:

cucumber -t @WIP,@executeThese This will run abc1 and abc2

If you want to execute all that are @executeThese But Not @WIP you need to do this:

cucumber -t @executeThese -t ~@WIP

This will run abc1 only



来源:https://stackoverflow.com/questions/37841594/cucumber-tags-options-from-command-line

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