Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serenity BDD - For a failed scenario the report is showing skipped gherkin step as another scenario #3089

Closed
LetsCodeANewWorld opened this issue Mar 17, 2023 · 9 comments

Comments

@LetsCodeANewWorld
Copy link

LetsCodeANewWorld commented Mar 17, 2023

Serenity-version - 3.6.12

I'm running a test suite using the {Serenity-version} and is working fine when all tests are passed. But in case of a failure, when i check the report it shows the failed scenario as well as the skipped step of that fail scenario under scenario column of report.
Hence, impacting the whole execution data and giving the incorrect number of test case.

Can anyone please suggest if there is any config property that i need to define to ignore the the skipped steps? I assumer it should not be the case and it should not displayed the skipped steps as tests/scenarios.
{NOTE} - It was working fine with the previous version and it is observed only after migrating to 3.6.7 or later

Serenity.conf

headless.mode=true

webdriver {
    driver = chrome
    autodownload = true
    timeouts {
      implicitlywait = 10000
      fluentwait = 5000
    }
    capabilities {
        "goog:chromeOptions" {
            args = ["--remote-allow-origins=*", "--no-sandbox", "ignore-certificate-errors", "--window-size=1260,860"
                       "incognito", "disable-infobars", "disable-gpu", "disable-default-apps", "disable-popup-blocking"]
        }
    }
}

serenity {
    tag.failures = true
    linked.tags = issue
    full.page.screenshot.strategy = true
    restart.browser.for.each = example
    use.unique.browser = false
    dry.run = false
    reports.show.step.details = true
    keep.unscaled.screenshots = true
    take.screenshots=FOR_FAILURES
}

Screenshot
serenity-report-issue.pdf

POM.XML
`

4.0.0

>

1.0.0-SNAPSHOT
jar

<name></name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>3.6.12</serenity.version>
    <browserstack.local.version>1.0.6</browserstack.local.version>
    <parallel.tests>8</parallel.tests>
    <per.core.thread.count>false</per.core.thread.count>
    <encoding>UTF-8</encoding>
    <tags></tags>

    <!-- SONAR related properties -->
    <sonar.projectKey>****</sonar.projectKey>
    <sonar.projectName>${project.artifactId}</sonar.projectName>
    <sonar.language>java</sonar.language>
    <sonar.organization>>******</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-core</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-junit</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-screenplay-webdriver</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-ensure</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.6.2</version>
        <scope>test</scope>
    </dependency>        
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>browserstack-local-java</artifactId>
        <version>${browserstack.local.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <includes>
                    <include>**/features/**/*.java</include>
                    <include>**/cucumber/*.java</include>
                    <include>**/CucumberTestSuite.java</include>
                </includes>
                <threadCount>${parallel.tests}</threadCount>
                <forkCount>${parallel.tests}</forkCount>
                <parallel>methods</parallel>
                <perCoreThreadCount>${per.core.thread.count}</perCoreThreadCount>
                <useUnlimitedThreads>false</useUnlimitedThreads>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.0.0-M5</version>
            <configuration>
                <skip>true</skip>
                <includes>
                    <include>**/features/**/*.java</include>
                    <include>**/cucumber/*.java</include>
                    <include>**/CucumberTestSuite.java</include>
                </includes>
                <excludes>
                    <exclude>**/*WithFailures.java</exclude>
                </excludes>
                <parallel>methods</parallel>
                <threadCount>${parallel.tests}</threadCount>
                <forkCount>${parallel.tests}</forkCount>
                <useUnlimitedThreads>true</useUnlimitedThreads>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
                <release>11</release>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <configuration>
                <tags>${tags}</tags>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-core</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.maven.shared</groupId>
                    <artifactId>maven-shared-utils</artifactId>
                    <version>3.3.4</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<repositories>
    <repository>
        <id>>******</id>
        <url>>******</url>
    </repository>
</repositories>
`
@wakaleo
Copy link
Member

wakaleo commented Mar 18, 2023

Can you provide a sample project that reproduces this issue?

@ag-gggp
Copy link

ag-gggp commented Mar 19, 2023

@wakaleo
Thanks for the quick response, attached is the sample cucumber project having 2 failed features (one failed and one error).

the command used - **mvn clean verify -Dcucumber.filter.tags="@Test2"**

serenity-cucumber-starter.zip

@wakaleo
Copy link
Member

wakaleo commented Mar 19, 2023

This should be fixed in version 3.6.15

@LetsCodeANewWorld
Copy link
Author

LetsCodeANewWorld commented Mar 19, 2023

@wakaleo Thanks for your quick response to the issue observed.
I can see 3.6.15 version in mvn repository (screenshot), so i'm assuming that the fix should be included in this. Please correct me, if this is not the release with the fix.
However, i've tested this 3.6.15 and i can still experience the same issue in this version too. Please suggest.
serenity-3.6.15-mvn-repository.pdf

@wakaleo
Copy link
Member

wakaleo commented Mar 19, 2023

Can you provide a sample project that reproduces the issue? I reproduced a similar issue which was fixed in 3.6.15 so it may be a different issue.

@LetsCodeANewWorld
Copy link
Author

LetsCodeANewWorld commented Mar 19, 2023

@wakaleo Thanks for the quick response, attached is the sample cucumber project having 2 failed features (one failed and one error).

the command used - **mvn clean verify -Dcucumber.filter.tags="@Test2"**

serenity-cucumber-starter.zip

I 'm using the 👆 same project, the only change i made is updated serenity version in pom.xml to 3.6.15.
Command used is still same - i.e. mvn clean verify -Dcucumber.filter.tags="@test2"

@wakaleo
Copy link
Member

wakaleo commented Mar 19, 2023

That's odd - I tested the change with that project and it worked correctly with 3.6.15

@LetsCodeANewWorld
Copy link
Author

LetsCodeANewWorld commented Mar 19, 2023

Here is the report screenshot highlighted 👇

serenityreport-error-3 6 15

Also, since there are only 2 scenarios with tag @test2, the Total test cases executed count should remain 2 but serenity log in console it shows 3 .

2023-03-19_23-26-09

@wakaleo
Copy link
Member

wakaleo commented Mar 29, 2023

Fixed in 3.6.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants