Reputation: 447
I am executing cucumber tests using Jenkins pipeline job(Jenkinsfile). But for every job it is overwriting the existing test results in the target/surefire-reports folder.
I would like to display all the cucumber test results for each and every job.
Upvotes: 0
Views: 2270
Reputation: 1804
You should add a timestamp in the reports folder name. Try the following code.
<properties>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy_MM_dd_HH_mm</maven.build.timestamp.format>
<properties>
<plugin>
<groupId>net.masterthought</groupId>
<artifactId>maven-cucumber-reporting</artifactId>
<version>${masterThougth.version}</version>
<executions>
<execution>
<id>execution</id>
<phase>verify</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<checkBuildResult>false</checkBuildResult>
<projectName>${project.artifactId}</projectName>
<buildNumber>${project.build}</buildNumber>
<parallelTesting>true</parallelTesting>
<outputDirectory>target/cucumber-report/${timestamp}</outputDirectory>
<cucumberOutput>target/cucumber-report/</cucumberOutput>
</configuration>
</execution>
</executions>
</plugin>
Upvotes: 1
Reputation: 6537
To display the cucumber test result use cucumber report plugin
https://wiki.jenkins.io/display/JENKINS/Cucumber+Test+Result+Plugin https://wiki.jenkins.io/display/JENKINS/Cucumber+Reports+Plugin
And detailed configuration of cucumber plugin in jenkins
https://wiki.jenkins.io/display/JENKINS/Cucumber+Test+Result+Plugin
Upvotes: 0