top of page

Cucumber Extent Reporting

To implement cucumber extent reporting you need to follow the steps as mentioned below: 1. Download Java 8+ version . 2. Extent reports version 3.0.6+ is required, you need to add following dependency in pom.xml for maven project: <dependency>
</dependency> If it is a java project ,download the jars from this url. 3. Add dependency for cucumber extent report: <dependency>
</dependency> 4. Make sure maven-complier-plugin  AND maven-surefire-plugin are present in the pom.xml, otherwise add their dependencies as mentioned below: <dependency>
</dependency> <groupId>org.apache.maven.plugins</groupId>
<version>2.18</version> 5. Download extent-config.xml file from  here  & add it to “target” folder of your project. 6. Create a runner class & add the plugin in @CucumberOptions as com.cucumber.listener.ExtentCucumberFormatter:output/report.html followed by the report file as input parameter. A sample example is shown below: import org.junit.runner.RunWith;
import org.testng.annotations.AfterClass;
import com.cucumber.listener.Reporter;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@CucumberOptions(format = { "pretty", "json:target/json/output.json" },
features = {"C:\\Users\\Adminindia\\workspace\\shaurya\\cookies\\src\\test.feature"},
glue = {"step_definitions"}, tags = {"@tag1"},
plugin = {"com.cucumber.listener.ExtentCucumberFormatter:output/report.html"})

public class testrunner {
public static void teardown() {

Reporter.loadXMLConfig(new File("target/extent-config.xml"));
Reporter.setSystemInfo("user", System.getProperty(""));
Reporter.setSystemInfo("os", "Mac OSX");
Reporter.setTestRunnerOutput("Sample test runner output message");
} The above setup will generate the report in  output  directory with the name of  report.html The report will be generated as shown below:

Cucumber Extent Reporting
bottom of page