serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
180 stars 285 forks source link

Not able to run the selected scenarios using tags. #46

Open ChakravarthiS opened 3 years ago

ChakravarthiS commented 3 years ago

Hi Team,

I am trying to run the selected scenarios using tags from command line but its triggering all the test suites. I am using the below tag mvn clean verify -P UatEllipse -P local -Dcucumber.options="--tags @SVRegression"

Please help me to resolve this issue.

Thanks, Chakri

mayank-kapoor commented 3 years ago

@ChakravarthiS tags needs to be passed like this -Dcucumber.filter.tags="(@tagName)"

Hope this helps

rakeshhp commented 3 years ago

@wakaleo @mayank-kapoor Filter tags is not working now : On trying with -Dcucumber.filter.tags="@tagname" runs ZERO scenarios where as on using older way -Dcucumber.options ="--tags " ALL scenarios gets executed . Without filtering tags it makes it hard to run specific tests in runtime

mayank-kapoor commented 3 years ago

@rakeshhp have you tried -Dcucumber.options="--tags=@" ? Sorry but are you using maven as a build tool ?

ref: https://serenity-bdd.github.io/theserenitybook/latest/filtering-reports.html

rakeshhp commented 3 years ago

Yes using maven build tool ,serenity-cucumber6 , serenity.version 2.3.33, As @ChakravarthiS pointed above and I have tried both ways cucumber.filter.tags and cucumber.options , it doesn't filter the suite.

deepasajin commented 2 years ago

Do we have a solution for this issue. I am also facing the same issue. Please help is we have a solution for this.

-Dcucumber.options='--tags @tagName' = Runs all the scenarios -Dcucumber.filter.tags="@TagName" = Giving error while building unexpected token : @

Using Serenity2.5.1 and Cucumber 1.0.0.202

baskarcsb commented 2 years ago

use the below format - it works (tested in 3.1.15 version)

mvn verify -Dcucumber.filter.tags="@Help" - this will run only the specific test

mvn verify -Dcucumber.filter.tags="@Help or @test" - this will run the combination of test

mvn verify -Dcucumber.filter.tags="@Help and not @flaky" if you want to ignore the test then use "not"

wakaleo commented 2 years ago

Something like this should work with the latest versions of Serenity and Cucumber:

mvn clean verify -Dcucumber.filter.tags="@smoke"