Cucumber: how to add default tags AND append tags passed from command line to the default tags

Viewed 17

My Cucumber Options looks like this

@CucumberOptions(
    dryRun = false,
    plugin = {
            "pretty",
            "html:src/test/java/testresult/cucumber-report/index.html",
            "junit:src/test/java/testresult/cucumber-report/cucumber.xml",
            "json:src/test/java/testresult/cucumber-report/cucumber.json",
            "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:",
            },
    features = { "src/test/java/features" }, 
    glue = { "Hooks","stepDefinitions" },
    tags = "not @ignore",
    monochrome = true
)

when I run from command line, I use mvn test -Dcucumber.filter.tags="@regression", all the regression scenarios are running including the @ignore scenarios

Is there any way, we can assign default tags AND append tags from Command Line to the CucumberOptions?

I dont want to pass "and not @ignore" everytime from command line.

0 Answers
Related