Reputation: 5531
I have a scenario, where I need to run multiple tags and need not run another one when a condition occurs. I don't want to run Feature_1 when the browser is IE.
@run_me @do_not_run
Feature 1
@Tag1 @Tag2
Scenario: Scenario 1
@run_me
Feature 2
@Tag1 @Tag3
Scenario: Scenario 2
Condition:
if(browser == "IE"){
then execute all @run_me tags but don't execute it when there is @do_not_run
else
run all @run_me
Current code:
--tags @run_me
What should be the right way to achieve it?
Note:
I tried --tags @run_me ~@do_not_run
inside the if condition. But not sure it is the correct method or not.
Upvotes: 1
Views: 1624
Reputation: 632
You can follow below approach to execute the tags.
Upvotes: 1