GreenTree
GreenTree

Reputation: 53

How to run OR cucumber tags

Feature:

Feature: Free_CRM_LOGIN_FEATURE

@SmokeTest
Scenario: login scenario
Given User is already on login page

Definition:

public class testTAGS {

    WebDriver driver;
    @Given ("^User is already on login page$")
    public void User_already_on_login_page(){
        System.out.println("User is already on login page");
    }

Runner:

@RunWith(Cucumber.class)
@CucumberOptions(
        features = "src/main/java/Features/testTAGS.feature",
        glue="testTAGSdefintion",
        tags = {"@SmokeTest,@RegrTest"}
      )

When I run it, it says "0 Scenarios 0 Steps 0m0.016s " Feature file has one scenario with @SmokeTest tag. Runner file has either @SmokeTest or @RegrTest. When i run it, it should run @SmokeTest scenario but it does not. How can I run the scenario with OR tag?

Upvotes: 0

Views: 1193

Answers (1)

M.P. Korstanje
M.P. Korstanje

Reputation: 12029

If you're on a recent version of Cucumber try using a tag expression for example: tags = "@cucumber and not (@gherkin or @zucchini")

Upvotes: 1

Related Questions