cucumber-jvm-extentreport
A custom cucumber-jvm
report formatter using ExtentReports
The current version is only compatible with latest cucumber 2.0.1+
.
Note: Use version 2.0.1
with cucumber 1.2.5
.
Preconditions
- Maven / Java 8
Usage
Add the following to your list of dependencies in pom.xml
<dependency>
<groupId>com.sitture</groupId>
<artifactId>cucumber-jvm-extentreport</artifactId>
<version>3.1.0</version>
</dependency>
Add the following if you're using gradle to your build.gradle
file.
compile 'com.sitture:cucumber-jvm-extentreport:3.1.0'
Setup - Cucumber Runner
Add the following to your cucumber runner class:
@RunWith(Cucumber.class)
@CucumberOptions(
features = {"src/test/resources"},
plugin = {"com.sitture.ExtentFormatter:output/extent-report/index.html", "html:output/html-report"})
public class RunCukesTest {
@AfterClass
public static void setup() {
// Loads the extent config xml to customize on the report.
ExtentReporter.setConfig("src/test/resources/config.xml");
// adding system information
ExtentReporter.setSystemInfo("Browser", "Chrome");
ExtentReporter.setSystemInfo("Selenium", "v2.53.1");
}
}
Reports Location
The ExtentFormatter takes the location of reports directory as the parameter. E.g. com.sitture.ExtentFormatter:output/extent-report/index.html
will generate the report at output/extent-report/index.html
.
Configuration file
Refer here to create the config xml file: ExtentReports Configuration To load the config file:
ExtentReporter.setConfig(new File("your config xml file path"));
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request