0
votes

Multiple tags in the cucumber doesnt run the scenarios.

I have two different tags, tagged to two different scenarios under the same feature file. I try to run both the scenarios that are tagged, using the cucumber tags command

cucumber --tags @billing --tags @important

When I run this, cucumber doesn't recognize the scenarios, it provides the output like

0 scenarios
0 steps
0m0.000s

But when I run the tags individually, like cucumber --t @billing the cucumber is able to recognize and runs the scenario. Any idea why?

Any help is appreciated.

1
Can you add your feature file also? Your tag filter will run scenarios which are tagged with both billing and important tags. Are both the scenarios having both the tags? - Grasshopper
@Grasshopper No! One scenario contains @billing tag and the other @important tag. I didnt realise this command has to have both the tags in the same scenario. Could you please let me know the command, for my case? What I if I have different tags in two scenarios each? for eg: scenario 1 tagged with @important scenario 2 tagged with @billing I want to run both scenario1 and scenario2 - Emjey
Use --tags @billing,@important - Grasshopper
Great! Works! Thanks :) In case if Scenario 1 contains : @billing @important and Scenario 2 contains: @checkout @notimportant Will the above command work ? cucumber --tags @billing,@checkout,@notimportant,@important? - Emjey
Yes it will work... - Grasshopper

1 Answers

0
votes

Simply if you define like above ( cucumber --tags @billing --tags @important ) , there should be a scenario having both @billing and @important tags.

if you are looking for cucumber to pick up when matching any of the tags, use as below.

cucumber --tags @billing , @important