Although Cucumber has several built in reporting options which are perfectly serviceable for technical users, they are not the beautiful and simple reports that are easy to understand for less technical users or clients.

Extent reports is a lovely, fairly simple to set up reporting plugin. It shows the simple colour coded view that is easy to take in at a glance and makes it easy to understand the data presented.

Here we describe how to add and produce extent reports for IntelliJ with Cucumber and Java, and what to update in the Jenkinsfile to get the Extent reports generated as part of Continuous Integration.

Add dependencies

Add the dependencies for cucumber extent reports and and the extent report libraries. These versions have been tested and they work together. Check maven repositories for the latest versions, however be aware later versions may not play nicely together.


Create extent-config.xml

In the folder structure, Right click on the "src" folder and select new > file
Name it extent-config.xml
Enter the following information:

<?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>ToolsList - Cucumber Framework</documentTitle>

        <!-- report name - displayed at top-nav -->
        <reportName>ToolsList - 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 -->


Update the plugin

In your Cucumber Runner (RunCukes), change the plugin in the CucumberOptions to show:

 plugin = {"com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html"},

Code to generate the report

In your RunCukes, we will use the Testng annotation @AfterClass to create a method that will generate the report after the tests have completed.

In the class, enter the following:

    public static void writeExtentReport() {

Run tests and view report

Run your tests, using either the test runner in IntelliJ or Maven from the command line. The report will be generated in your target folder, under cucumber-reports

Right click on the file (report.html) in the folder and opt to open in browser.

Generating Extent Reports with Jenkins CI

In order to generate the Extent report from your Jenkins continuous integration pipeline, you need to update the reportDir and reportFiles in the publishHTML stage. These need to match the paths we defined in our test runner (RunCukes).

            post {
                always {
                            allowMissing         : false,
                            alwaysLinkToLastBuild: false,
                            keepAll              : false,
                            reportDir            : 'target/cucumber-reports',
                            reportFiles          : 'report.html',
                            reportName           : 'BDD report',
                            reportTitles         : ''