maayehkhaled / cucumber-jvm-extentreport

A custom cucumber-jvm formatter using ExtentReports.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cucumber-jvm-extentreport

Build Status Maven Central license

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

A custom cucumber-jvm formatter using ExtentReports.

License:MIT License


Languages

Language:Java 94.8%Language:Gherkin 3.8%Language:Shell 1.4%