Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude cucumber tags

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.

like image 227
JavaMan Avatar asked Feb 09 '15 11:02

JavaMan


1 Answers

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")
like image 139
Tiago Mendes Avatar answered Sep 28 '22 20:09

Tiago Mendes