The Cucumber Report generation is actually an extension of the existing plugin with the only one new feature: the final output
This report uses artifacts generated during Cucumber tests execution. So, in order to make this goal working you need:
First point is done by adding the following dependencies:
<dependencies>
....
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-picocontainer</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
....
<dependencies>Second point is about configuring the test class itself. E.g. it should have annotations with the content like:
@RunWith(Cucumber.class)
@Cucumber.Options(
format = {"json:target/cucumber.json"}
)
public class SystemOperationsTest {
}Once these settings are available the Cucumber report generation goal can be invoked.
The following example shows generation of the Cucumber results report:
<reporting>
<plugins>
<plugin>
<groupId>com.github.mkolisnyk</groupId>
<artifactId>sirius-maven-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<configuration>
<jsonFile>target/cucumber.json</jsonFile>
</configuration>
<reportSets>
<reportSet>
<configuration />
<reports>
<report>cucumber</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>The final report will be generated if we invoke the following Maven command:
mvn site:cucumber