I have a bunch of IT cases with various cucumber tags. In my main runner class I want to exclude all the scenarios which have either @one or @two. So, below are the options I tried Option 1
@CucumberOptions(tags=Array("~@one,~@two"), .....)
or option 2
@CucumberOptions(tags=Array("~@one","~@two").....
When I tried with option one, test cases tagged with @two started executing while with second option it did not.
As per cucumber documentation an OR will be maintained when tags are mentioned as "@One,@Two"
. If this is the case why doesn't exclude work the same way i.e. the first option?
Update: This piece of code is written in scala.
How to exclude/ignore one Tag
(this answer can help other users who just want to ignore one tag)
Terminal:
mvn clean test -Dcucumber.filter.tags="not @one"
Junit:
@CucumberOptions(tags = "not @one")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With