Failsafe html reports in Jenkins

I have some integration tests (with Selenium) that run with the fail-safe maven plugin. Failsafe only generates XML report files.

1) I want to generate HTML reports

2) I want to have a link in Jenkins in html reports

For 1) I installed "maven-surefire-report-plugin" to use the goal of a non-stop report.

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.13</version> <executions> <execution> <phase>post-integration-test</phase> <goals> <goal>failsafe-report-only</goal> </goals> </execution> </executions> </plugin> 

But nothing is created in the standard output:

 [INFO] [INFO] >>> maven-surefire-report-plugin:2.13:failsafe-report-only (default) @ BaseContrats >>> [INFO] [INFO] <<< maven-surefire-report-plugin:2.13:failsafe-report-only (default) @ BaseContrats <<< [INFO] [INFO] --- maven-surefire-report-plugin:2.13:failsafe-report-only (default) @ BaseContrats --- 

In my fault tolerant reporting directory, I only have XML report files, but not HTML files.

Is this a good html fault tolerance plugin?

For 2) I installed the Jenkins plugin "Selenium HTML report" and added the post build action "Publish Selenium HTML report" and configured it with the "target / failafe-reports" parameter for the "Selenium Results Search Results" parameter, but nothing is displayed in the interface Jenkins (of course, because my html report file is not generated ...).

Could you help me for these 2 points?

+6
source share
1 answer

Answer for part 1) for creating HTML reports for Failsafe.

Add the following to pom.xml

 <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.18.1</version> <configuration> <skipSurefireReport>${skipSurefireReport}</skipSurefireReport> <reportsDirectories> <reportsDirectory>${basedir}/target/failsafe-reports</reportsDirectory> </reportsDirectories> </configuration> </plugin> </plugins> </reporting> <properties> <skipSurefireReport>true</skipSurefireReport> </properties> 

I assume that you are using mvn verify to run integration tests with a failover plugin. By default, this generates reports ( *.txt and *.xml ) in reports {basedir} / target / failafe. This must be specified in <reportDirectories> . You can specify any directory in which there are TEST - * reports. Xml

And then run cmd

 mvn site 

This would create html reports for the Failsafe integration tests. By default, the files will be located in {basedir} /target/site/failsafe-report.html. This location will be changed.

+5
source

All Articles