Cucumber maven 1 does not rerun failed tests and crashes generating pretty cucumber reports

I want to rerun failed cucumber tests.

If I set the following option to value 1 <rerunFailingTestsCount>1</rerunFailingTestsCount> then

net.masterthought
maven-cucumber-reporting
throws error and does not generate pretty cucumber error.

net.masterthought.cucumber.ReportBuilder generateErrorPage
INFO: Unexpected error 
net.masterthought.cucumber.ValidationException: File 'cucumber-report.json' is not a valid Cucumber report! No content to map due to end of input

If I set
the following option to value 0 <rerunFailingTestsCount>0</rerunFailingTestsCount> then net.masterthought
maven-cucumber-reporting generates pretty cucumber report properly but does not rerun failed tests.

Could you help me where is the problem ?

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.17.0</version>
</dependency>

<dependency>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>5.7.7</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>7.15.0</version>
</dependency>


<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>7.15.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.1</version>
</dependency>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<rerunFailingTestsCount>1</rerunFailingTestsCount>
<testFailureIgnore>true</testFailureIgnore>
<reportsDirectory>${project.build.directory}/jsonReports</reportsDirectory>
</configuration>
</plugin>


<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>5.7.7</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<projectName>Cucumber</projectName>
<!-- optional, per documentation set this to "true" to bypass generation of Cucumber Reports entirely, defaults to false if not specified -->
<skip>false</skip>
<!-- output directory for the generated report -->
<outputDirectory>${project.build.directory}</outputDirectory>
<!-- optional, defaults to outputDirectory if not specified -->
<inputDirectory>${project.build.directory}/jsonReports</inputDirectory>
<jsonFiles>
<!-- supports wildcard or name pattern -->
<param>**/*.json</param>
</jsonFiles>
<!-- optional, defaults to outputDirectory if not specified -->

<!-- optional, set true to group features by its Ids -->
<mergeFeaturesById>false</mergeFeaturesById>
<!-- optional, set true to get a final report with latest results of the same test from different test runs -->
<mergeFeaturesWithRetest>false</mergeFeaturesWithRetest>
<!-- optional, set true to fail build on test failures -->
<checkBuildResult>false</checkBuildResult>
</configuration>
</execution>
</executions>
</plugin>



</plugins>
</build>

  • Are you actually running this configuration? The selection of your test report files, <param>**/*.json</param> and the reportedly broken file 'cucumber-report.josn don’t match.

    – 




  • it was typographical error of course. I corrected it.

    – 

  • Then I don’t see anything wrong unfortunately. This should work. If I try this myself, it does work. Do you have an example project in a GitHub repo that reproduces the problem?

    – 




Leave a Comment