Cucumber Extent Report using Cucumber 7 Adapter

Profile picture for user devraj

Since Cucumber JVM version 7 is out in October 2021. Let’s test this version with the corresponding extent Adapter dependency provided by Grasshopper today.

If you are using TestNG do watch the TestNG specific video, although the steps are quite similar.

Now, if you are working on an older version of Cucumber JVM, on the programsbuzz website you will find a corresponding article for it.

Step 1: Add tech grasshopper cucumber adapter maven dependency

<!-- https://mvnrepository.com/artifact/tech.grasshopper/extentreports-cucumber7-adapter -->
<dependency>
    <groupId>tech.grasshopper</groupId>
    <artifactId>extentreports-cucumber7-adapter</artifactId>
    <version>1.9.2</version>
</dependency>

This article was tested with Cucumber version 7.9.0.

Step 2: Create extent.properties file in src/test/resources/

Note: The original HTML Extent Reporter was deprecated in extent report version 4.1.3 and removed in 5.0.0.  ExtentReports has been updated to version 5, which has resulted in multiple reporters getting deprecated.  So you have to make sure which reporter you are enabling in the extent properties file.

Let’s enable spark report in an extent properties file:

extent.reporter.spark.start=true
extent.reporter.spark.out=test-output/SparkReport/Spark.html

Step 3: Add the plugin

plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"}

Step 4: Execute your code

For screenshot refer Add Screenshot in Cucumber Extent Report.

Video Tutorial: Extent Report Cucumber 7 Adapter