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 specific tags mentioned in cucumber.feature file. #63

Open vpachpute062 opened 2 years ago

vpachpute062 commented 2 years ago

Hi I have 7-8 tags in feature file. I want to run only 2 tags using Maven. But not able to do so

I tried as follows

  1. mvn clean verify -Dcucumber.filter.tags="(@CargoLogin,@CargoPrintSticker)" Result: It does not run any tag and shows build success with 0 tests run. Shows result as Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  2. mvn clean verify -Dcucumber.filter.tags="(@CargoLogin)" => SUCCESS i.e. Runs only one test as expected
  3. mvn clean verify -Dcucumber.options="--tags=@CargoLogin" => Runs all available 8 tags although I specified only one as @CargoLogin
  4. mvn clean verify -P cucumber -Dtags=@CargoLogin,@CargoPrintSticker In runner file, added line tags = {"@Cargo"} and tried with this maven command. But NOT runs tests and shows BUILD success with result as Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

Can you please help me if I am missing something. Thanks Referred this: https://github.com/serenity-bdd/serenity-cucumber-starter/issues/46 B2BCargo_login.txt

Attached my feature file. Note renamed as .txt was not able to upload with .feature extension.

deepasajin commented 2 years ago

I tried the below option and getting either format error or no test run. Could you please help.

  1. mvn clean verify -Dcucumber.filter.tags="(@e2e)" == class not identified for e2e
  2. mvn clean verify -Dcucumber.options="--tags=@CargoLogin" == All test run ( that is the issue I want to resolve)
mukesh4567 commented 1 year ago

Please help @wakaleo , I need this commands to manage the multiple feature file and multiple tags. Even below commands are not working with Serenity latest Versions.

2.4.51 2.4.51 2.4.51 1.2.3 4.3.3 I am using cucumber6 and resAssured with JUnit net.serenity-bdd serenity-cucumber6 ${serenity.cucumber.version} test In My Runner File I don't want to mentioned any file or if I mentioned that should be ignore If I run from the command prompt. Runner.java @RunWith(CucumberWithSerenity.class) @CucumberOptions( plugin = {"pretty"}, monochrome = true, dryRun = true, features = {"classpath:feature"} Command- mvn clean verify -Dcucumber.options="src/test/resources/test.feature" mvn clean test -Dcucumber.filter.tags="@BDDTEST-PE-68" I checked with older version and it is working fine. This is the project I checked with above commands and it's working https://github.com/rajeshkumargit/cucumber-serenity-restassured 1.9.26 1.9.8 1.9.26