I am trying run cucumber tests using maven with following command
mvn test -Dcucumber.options="--tag @debug1"
This command works fine, however if i try something like following, i get error
mvn test -Dcucumber.options="--tag @debug1 @debug2"
Is there a way to pass in multiple tag names with cucumber run-time options?
Adding multiple tag parameters can be achieved by separating each tag (sometimes with numeric value) with a comma, to the end of the URL.
We can define each scenario with a useful tag. Later, in the runner file, we can decide which specific tag (and so as the scenario(s)) we want Cucumber to execute. Tag starts with “@”. After “@” you can have any relevant text to define your tag like @SmokeTests just above the scenarios you like to mark.
When we define multiple tags in runner class in below form ,it will be defined with the use of logical operator: 1. tags = {“@tag”, “@tag1”} : means AND condition. –It says that scenarios matching both these tag needs to be executed.
@debug1
and @debug2
:Old version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags @debug1 --tags @debug2"
Actual version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags '@debug1 and @debug2'"
@debug1
or @debug2
:Old version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags @debug1,@debug2"
Actual version of Cucumber-jvm:
mvn test -Dcucumber.options="--tags '@debug1 or @debug2'"
In Cucumber 6, property name has changed. Use:
mvn verify -Dcucumber.filter.tags="@debug1 or @debug2"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With