serenity-bdd / serenity-cucumber

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

Serenity Report : Serenity fails to generate tests report when a scenario with two examples table is run by tags #107

Closed Ram-Raghu closed 6 years ago

Ram-Raghu commented 6 years ago

Desccription:

Serenity fails to generate tests report when a scenario with two examples table is run by tags.

Steps to Reproduce:

  1. Write a Gherkin scenario outline with Examples split into two like in the below example.
  2. Ensure the second example table for the scenario contains more than one row (excluding the title row)
  3. Run the test from maven (mvn clean verify -Dcucumber.options="--tags @add --tags @bank_account") and check the report.This would run the scenario that has @add AND @bank_account tags.

Expected:

The example table row that is tagged with both @add and @bank_account should be run and Serenity should generate report containing the outcome of those tests.

Actual:

The example table row that is tagged with both @add and @bank_account is executed successfully but Serenity fails to include the tests in the report.

Note: This happens only when the number of rows in the second example table for a scenario is greater than one (excluding the title row).

Environment:

1.8.1 1.8.0 1.6.5 **Scenario details:** @add Scenario Outline: Add account Given the account with following details: ,, When I update the acccount to a Then I should be informed of the successful account update @bank_account Examples: Add bank account |accountType|heldBy |servicesSupported | |bankaccount|individual|Deposit,Withdrawal | @card_account Examples: Add card account |accountType|heldBy |servicesSupported | |cardaccount|business |Deposit,Withdrawal | |cardaccount|business |Deposit,Withdrawal | **Project to replicate:** [sample.zip](https://github.com/serenity-bdd/serenity-cucumber/files/1502797/sample.zip)
Ram-Raghu commented 6 years ago

Hi John and @cliviu ,

Sorry to bother. I can see a pull request and a merge about 12 days ago for this ticket but do not see a newer version available in maven. Just wondering whats happening.

Thanks & Regards Ram

cliviu commented 6 years ago

hi @rraghuna , try with

<dependency>
  <groupId>net.serenity-bdd</groupId>
  <artifactId>serenity-cucumber</artifactId>
  <version>1.6.7</version>
  <type>pom</type>
</dependency>

it should work now

Ram-Raghu commented 6 years ago

Hi @cliviu

Thank you very much for fixing this. I tested this in serneity cucumber version 1.6.7.

Now Serenity report is generated with correct number of tests when the tests are triggered via maven command.

However, when I populate the tags attribute as {"@add and @bank_account"} or as {"@add or @bank_account"} in the @CucumberOptions annotation in the Junit Runner class, then I see the issue occuring. That is when I am not popuating the tags options in the maven command and instead put it in the junit class and run mvn clean verify, the issue occurs.

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(strict = false, tags= {"@add or @bank_account"},features = "src/test/resources/features",glue= {"org.stepdefinitions"},
plugin = { "pretty", "json:target/cucumber-json-report.json","html:target/cucumber-html-report"})
public class AcceptanceTest {

}
wakaleo commented 6 years ago

Maybe take a look at the code yourself and propose a PR? If it works for command line options, it could be a simple fix

Ram-Raghu commented 6 years ago

Hi @wakaleo , @cliviu

The serenity report issue when tags in cucumber options contains logical Or, And and Not is fixed and the code is merged with the master branch. I need your kind assistance in publishing this code to the maven central repo.

Ram-Raghu commented 6 years ago

closed by #110 & #118

vishalm commented 6 years ago

Do not start by ~(Not opertaor in Gradle cucumber option)

For example : -Dserenity.properties=test-properties/chrome.properties -Dcucumber.options="--tags ~@hybris" Observer this cucumber.option started with NOT operator so serenity failed to generate report

-Dserenity.properties=test-properties/chrome.properties -Dcucumber.options="--tags @positiveTag --tags ~@hybris"
Now your reports will work

Bit wired but true :)

pavitrajainqt commented 6 years ago

Facing this issue, below is the serenity version i am using:

1.9.14 1.9.14 1.9.5
wakaleo commented 6 years ago

This is a closed issue - please read the thread and ensure you are using the new Cucumber tag syntax

ebbesandslevin commented 3 years ago

I got this error after first try:

image\