serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Running individual tests using tags doesn't work #55

Closed MisterKamran-zz closed 8 years ago

MisterKamran-zz commented 8 years ago

When using Serenity with Cucumber-JVM and adding a tag in the .feature file above the Feature or Scenario definition (e.g. @JIRA-123), then it is not possible to run that test by itself using Maven.

mvn clean verify -Dtags="JIRA-123"

Using Serenity Cucumber version 1.1.6 and Serenity Maven Version 1.1.31

Please confirm that this is an issue, alternatively please provide or document correct usage.

wakaleo commented 8 years ago

Had you tried 

mvn clean verify -Dtags=“@JIRA-123"


John Smart | Wakaleo Consulting  |  +44 7398 832273 Making smart teams collaborate better

http://johnfergusonsmart.com  | reachme@johnfergusonsmart.com


On 27 April 2016 at 5:17:06 PM, Kamran Khan (notifications@github.com) wrote:

When using Serenity with Cucumber-JVM and adding a tag in the .feature file above the Feature or Scenario definition (e.g. @JIRA-123), then it is not possible to run that test by itself using Maven.

mvn clean verify -Dtags="JIRA-123"

Using Serenity Cucumber version 1.1.6 and Serenity Maven Version 1.1.31

Please confirm that this is an issue, alternatively please provide or document correct usage.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

MisterKamran-zz commented 8 years ago

Will try first thing tomorrow morning as I have packed up for the day. But this isn't what the documentation suggests: http://thucydides.info/docs/serenity-staging/#_running_scenarios_by_tags

MisterKamran-zz commented 8 years ago

Hi @wakaleo , I can confirm that your suggestion did not work I'm afraid.

wakaleo commented 8 years ago

OK, my bad - if you are running the tests via a Cucumber-JVM runner class, you need to use the cucumber.options system property, e.g.:

mvn clean verify -Dcucumber.options="--tags @current"


John Smart | Wakaleo Consulting  |  +44 7398 832273 Making smart teams collaborate better

http://johnfergusonsmart.com  | reachme@johnfergusonsmart.com


On 28 April 2016 at 10:17:22 AM, Kamran Khan (notifications@github.com) wrote:

Hi @wakaleo , I can confirm that your suggestion did not work I'm afraid.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

cliviu commented 8 years ago

mvn clean verify -Dcucumber.options="--tags @JIRA-123"

MisterKamran-zz commented 8 years ago

Thanks @cliviu , that seems to have done the trick. @wakaleo the runner class is "CucumberWithSerenity.class", not sure whether that's just a wrapper for "Cucumber.class". It would be good for the documentation to be updated also.

YamStranger commented 8 years ago

It seems that issue is solved, will closed this ticket.