Skip to main content

Cucumber Extent Report using Cucumber 5 Adapter

Cucumber 4 adapter by official extent report site does not work with cucumber 5 libraries. For that you need to use different adapter by Grasshopper. To integrate extent report using cucumber 5 adapter follow below steps:

Step 1: In pom.xml add following dependency:

<dependency>
    <groupId>tech.grasshopper</groupId>
    <artifactId>extentreports-cucumber5-adapter</artifactId>
    <version>1.3.1</version>
</dependency>

Step 2: Update TestRunner file with following plugin, add below line inside @CucumberOptions:

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

Replace with existing plugin.

Step 3: Create extent.properties file in resources folder and paster below code:

extent.reporter.avent.start=false
extent.reporter.bdd.start=false
extent.reporter.cards.start=false
extent.reporter.email.start=false
extent.reporter.html.start=true
extent.reporter.klov.start=false
extent.reporter.logger.start=true
extent.reporter.tabular.start=false

extent.reporter.avent.config=
extent.reporter.bdd.config=
extent.reporter.cards.config=
extent.reporter.email.config=
extent.reporter.html.config=
extent.reporter.klov.config=
extent.reporter.logger.config=
extent.reporter.tabular.config=

extent.reporter.avent.out=test-output/AventReport/
extent.reporter.bdd.out=test-output/BddReport/
extent.reporter.cards.out=test-output/CardsReport/
extent.reporter.email.out=test-output/EmailReport/ExtentEmail.html
extent.reporter.html.out=test-output/HtmlReport/ExtentHtml.html
extent.reporter.logger.out=test-output/LoggerReport/
extent.reporter.tabular.out=test-output/TabularReport/

screenshot.dir=test-output/
screenshot.rel.path=../

That's all you can see the report in test-output folder you specified in extent.properties file.

Submitted by tgoswami on August 30, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.