grasshopper7 / extentreports-cucumber6-adapter

Cucumber-JVM 6 Adapter for Extent Framework
https://ghchirp.online/2098/
MIT License
16 stars 15 forks source link

Failed parameterised scenario is getting reported along with the another feature file scenario with similar Parameterisation and ScenarioOutline #18

Open ritunegi04 opened 4 years ago

ritunegi04 commented 4 years ago

I have two feature files which have a common scenario with same parameter values :

Feature File 1 :

@featureone
Feature: FreeCRM login feature

 @TestOne @Regression @Smoke @TestRun
    Scenario: Test increasedCount IssueOne

        Given User is on login pageOne
        When Login page title is displayedOne
        Then user enters uname and passwordOne
        Then user clicks on login buttonOne
        And user is navigated to HomePageOne
        And browser is closedOne
    @TestOne @Regression
    Scenario: Test increasedCount IssueTwo

        Given User is on login pageTwo
        When Login page title is displayedTwo
        Then user enters uname and passwordTwo
        Then user clicks on login buttonTwo
        And user is navigated to HomePageTwo
        And browser is closedTwo
    @Regression @Smoke
    Scenario: Test increasedCount IssueThree

        Given User is on login pageThree
        When Login page title is displayedThree
        Then user enters uname and passwordThree
        Then user clicks on login buttonThree
        And user is navigated to HomePageThree
        And browser is closedThree
    @Smoke
    Scenario: Test increasedCount IssueFour

        Given User is on login pageFour
        When Login page title is displayedFour
        Then user enters uname and passwordFour
        Then user clicks on login buttonFour
        And user is navigated to HomePageFour
        And browser is closedFour
    @TestOne
    Scenario: Test increasedCount IssueFive

        Given User is on login pageFive
        When Login page title is displayedFive
        Then user enters uname and passwordFive
        Then user clicks on login buttonFive
        And user is navigated to HomePageFive
        And browser is closedFive
@TestTwo
    Scenario: Test increasedCount IssueSix

        Given User is on login pageSix
        When Login page title is displayedSix
        Then user enters uname and passwordSix
        Then user clicks on login buttonSix
        And user is navigated to HomePageSix
        And browser is closedSix

**_//Common scenario with feature file 2 with same parameter_**     
@TestTwo
    Scenario Outline: FreeCRM login scenario "<username>"

        Given User is on login page
        When Login page title is displayed
        Then user enters "<username>" and "<password>"
        Then user clicks on login button
        And user is navigated to HomePage
        And browser is closed

        Examples:
            | username | password |
            | testuser@gmail.com | test|

Feature File 2 :

@feature2
Feature: Home Page Feature

 @Regression @Smoke @TestRun
    Scenario: Test HomePage SenarioOne

        Given User is on home pageOne
        When Home page title is displayedOne
        Then user homepage uname and passwordOne
        Then user homepage on login buttonOne
        And user is navigated to HomePageOne
        And browser homepage is closedOne
    @TestOne @Regression
    Scenario: Test HomePage SenarioTwo

        Given User is on home pagetwo
        When Home page title is displayedtwo
        Then user homepage uname and passwordtwo
        Then user homepage on login buttontwo
        And user is navigated to HomePagetwo
        And browser homepage is closedtwo

**_//Common scenario with feature file 1 with same parameter values_**  
@TestTwo
    Scenario Outline: FreeCRM login scenario "<username>"

        Given User is on login page
        When Login page title is displayed
        Then user enters "<username>" and "<password>"
        Then user clicks on login button
        And user is navigated to HomePage
        And browser is closed

        Examples:
            | username | password |
            | testuser@gmail.com | test|

Now on executing the Runner File, the failed scenario : Scenario Outline: FreeCRM login scenario "" of feature file 1 is clubbed with feature file 2 common scenario Scenario Outline: FreeCRM login scenario "". And the Feature 1 is displayed as passed in the report.

Feature 1 report section :

Screenshot 2020-10-15 at 4 50 02 PM

Feature 2 report section :

Screenshot 2020-10-15 at 4 53 43 PM
grasshopper7 commented 4 years ago

Scenarios are collected based on the logic that feature\scenario outline names will be unique across the test project. If there are two features with same names the scenarios in them will get clubbed and result will be mixed up. Similar for a scenario outlines with same name. Simple way is to make sure that u have unique names. This is the logic for previous three or four versions of the cucumber and extent adapter.

What is the criterion for having the same scenario outline in two different feature files?