Search code examples
extent

Is there any way not to report re-run failed test case (in extent report) as part of <rerunFailingTestsCount>


Environment - Cucumber V. 4.0.0 | Selenium V.3.8.1 | JUnit V.4.12 | Extent Report 3.0/4.0 (anyone)

Using below Surefire configuration to re-run failed test case. In case, test case gets failed then it would have one more attempt and lets say, test case got passed in 2nd attempt.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire.plugin.version}</version>
        <configuration>
            <parallel>methods</parallel>
            <threadCount>1</threadCount>
            <reuserForks>false</reuserForks>
            <testErrorIgnore>true</testErrorIgnore>   
            <testFailureIgnore>true</testFailureIgnore>
            <includes>
                <include>**/*RunCukeTest.java</include>
            </includes>
            <rerunFailingTestsCount>1</rerunFailingTestsCount>
        </configuration>
    </plugin>

Once overall build is completed and If I check Cucumber-Maven & Cluecumber Report, then these would have details of only Passed attempt not of 1st attempt in which test case was failed. Which sounds perfect. But,

When i check extent report there i am getting details of both attempts (failed & passed).

enter image description here

enter image description here

Can someone guide me on the below 2 implementations -

1. What thought i shall bring to report only pass test case (in extent report) after launching re-run failed as part of (With or without adapter, any one would work), do not want to report failed attempt if test case got passed at nth attempt.

2. Sometimes we would need to do analysis why few test cases are getting passed in 2nd/3rd attempt. So is there any way to report failed test in some separate report after launching re-run failed as part of

Any thought would be much appreciated as it would bring innovation in report and we get the best report in terms of failed/passed test case analysis when doing re-run of failed test cases.


Solution

  • As per my best knowledge, it was possible using @extendedcucumberoptions in 1.2.5, there one was able to generate a separate report for failed test cases but not possible from 4.0.0 onwards.