0

I tried to run a Cucumber test with multiple tags.

But got this error.

I am using Cucumber version 5.7.0.

How can i run multiple tags now?

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;


@RunWith(Cucumber.class)                
@CucumberOptions
(
        features = {"src/main/java/com/project1/features"},
        glue = {"com/project1/stepDefinitions"},
        plugin = {"pretty"},
        tags = {"@User1Login", "@User2Login"},
        monochrome = true
        )
3

In Cucumber 5.7.0 the support of tags is handled in different way so that expression(infix boolean expression) can also be used in the same way. You can pass the multiple tags like

@CucumberOptions(tags = "@smoke and @positive")
public class RunCucumberTest {}

Another way to manage the tags by JVM System Property

mvn test -Dcucumber.filter.tags="@smoke and @positive"

Option --scenario or pattern file.feature:line is a way to run a subset of scenarios

Ref: https://github.com/cucumber/cucumber-jvm/pull/1955

Here the Changelog of 5.7.0 https://github.com/cucumber/cucumber-jvm/blob/master/CHANGELOG.md

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.