Cucumber Extent Report 

Cucumber Extent Report produces awesome reports with test logs and better visual graphics. It is named a Cucumber Extent Reporter.


Steps to add Cucumber Extent Report

Step 1: Add Cucumber Extent Reporter dependency to Maven Project

<!-- -->







Step 2: Create an extent config to the project

Extent Config file will be used by the Cucumber Extent Report plugin to read the report configuration. Create extent-config.xml file and set various factors like :

Report Theme: It will set the theme of the report. It can be standard or dark. It is set by <theme>

Document Encoding: <encoding> : UFT-8

Title of the Report: This will display the title of the document on the Browser Tab. It is set by <documentTitle>

Name of the Report: This will display at the top of the Report. It is set by <reportName>

Global Date Format: It sets the date in yyyy-MM-dd. Format. It is set by <dateFormat>

Global Time Format: It sets the time in Like this HH:mm:ss. It is set by <timeFormat>

<?xml version="1.0" encoding="UTF-8"?>



    <!-- report theme --> <!-- standard, dark -->


    <!-- document encoding -->  <!-- defaults to UTF-8 -->


    <!-- protocol for script and stylesheets -->   <!-- defaults to https -->


    <!-- title of the document -->

    <documentTitle>TEQuality - Cucumber Test Report</documentTitle>

    <!-- report name - displayed at top-nav -->

    <reportName> TEQuality - Cucumber Report</reportName>

    <!-- global date format override -->  <!-- defaults to yyyy-MM-dd -->


    <!-- global time format override -->   <!-- defaults to HH:mm:ss -->


    <!-- custom javascript -->



        $(document).ready(function() {




    <!-- custom styles -->








Step 3: Make an entry for the Path of the config in the file.



Step 4: Create a class ConfigFileReader which will read the configuration property



import java.util.Properties;

public class ConfigFileReader {

public String getReportConfigPath(){

    Properties prop = new Properties();

    InputStream input = null;




        String reportConfigPath = prop.getProperty("reportConfigPath");

        if(reportConfigPath!= null) return reportConfigPath;

        else throw new RuntimeException("Report Config Path not specified in the file for the Key:reportConfigPath");       


    catch (IOException io) {


    }finally {

        if (input != null) {

            try {


            } catch (IOException e) {





   return null;


Step 5: Modify the Test Runner to implement Extent Report



import java.text.SimpleDateFormat;

import java.time.LocalDateTime;

import java.time.format.DateTimeFormatter;

import java.util.Date;


import org.junit.AfterClass;

import org.junit.BeforeClass;

import org.junit.runner.RunWith;

import com.cucumber.listener.ExtentProperties;

import com.cucumber.listener.Reporter;

import cucumber.api.CucumberOptions;

import cucumber.api.junit.Cucumber;



plugin = {"com.cucumber.listener.ExtentCucumberFormatter:"},       

features = {"/Users/cucumber/BDD/feature"},

tags= {"@SmokeTest"},

monochrome = true


public class Runner {


    public static void setup() {

        String timeStamp = new SimpleDateFormat("").format(new Date());

        ExtentProperties extentProperties = ExtentProperties.INSTANCE;




    public static void writeExtentReport() {

                   Reporter.loadXMLConfig(new File("/Users/cucumber/BDD/extent-config.xml"));

                   Reporter.setSystemInfo("User Name", System.getProperty(""));

                    Reporter.setSystemInfo("Time Zone", System.getProperty("user.timezone"));

                    Reporter.setSystemInfo("Machine", "Windows 10" + "64 Bit");

                    Reporter.setSystemInfo("Selenium", "3.7.0");

                    Reporter.setSystemInfo("Maven", "3.5.2");

                    Reporter.setSystemInfo("Java Version", "1.8.0_151");     


Step 6: Right Click on TestRunner class and Click Run As  >> JUnit Test.