damianszczepanik / maven-cucumber-reporting

maven mojo for cucumber reporting
GNU Lesser General Public License v2.1
120 stars 111 forks source link

"mergeFeaturesWithRetest" functionality is not working as expected. #184

Open AnjanaKulasinghe opened 3 years ago

AnjanaKulasinghe commented 3 years ago

I have an Automation FW with following setup.

Java: 11 Cucumber: 6.6.0 TestNG: 7.1.0 Cucumber Maven Reporting: 5.3.0

I use Cucumber ReRun with a file mechanism and by the end of the execution I have two json files (If there are any retry tests) cucumber.json cucumber-retry.json (Files attached) Archive.zip

Here's my CucumberReporting plugin

        <plugin>
            <artifactId>maven-cucumber-reporting</artifactId>
            <executions>
                <execution>
                    <configuration>
                        <classifications>
                            <Environment>${run.env}</Environment>
                            <ExcludedTags>${exclude.tag}</ExcludedTags>
                            <IncludedTags>${include.tag}</IncludedTags>
                            <Platform>${platform}</Platform>
                        </classifications>
                        <inputDirectory>${project.build.directory}</inputDirectory>
                        <jsonFiles>
                            <param>*.json</param>
                        </jsonFiles>
                        <outputDirectory>${project.build.directory}/cucumberReport</outputDirectory>
                        <projectName>${project.name}</projectName>
                        <mergeFeaturesWithRetest>true</mergeFeaturesWithRetest>
                        <mergeFeaturesById>true</mergeFeaturesById>
                        <checkBuildResult>false</checkBuildResult>
                        <skipEmptyJSONFiles>true</skipEmptyJSONFiles>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <id>report-generation</id>
                    <phase>package</phase>
                </execution>
            </executions>
            <groupId>net.masterthought</groupId>
            <version>${cucumber.reporting.version}</version>
        </plugin>

Expected: Based on the comments, if there's a test with same ID in different json files; report should display only the latest execution with these configs are true.

<mergeFeaturesWithRetest>true</mergeFeaturesWithRetest>
<mergeFeaturesById>true</mergeFeaturesById>

Actual: Generated report still shows the retry attempts.

konarx commented 3 years ago

any progress with this? I'm facing the same issue.

damianszczepanik commented 3 years ago

No progress so far. Have you tried to use https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/test/java/LiveDemoTest.java to verify whether this is maven problem or core library it self?

tarasmytlovych commented 8 months ago

@AnjanaKulasinghe @konarx

I had the same issue. I have managed to resolve it by removing mergeFeaturesById and leaving just mergeFeaturesWithRetest.

This removed the duplicated scenarios from the report, but the Jenkins pipeline is still marked as failed even though all tests pass after rerun

JithinPillai1592 commented 2 months ago

I think this is similar to: #914 and #940