Cucumber Extent Report using Cucumber 6 Adapter

Recently in June 2020, Cucumber 6 has been launched. Cucumber 4 or 5 adapter libraries will not work with cucumber 6. Grasshopper team is very fast in launching the latest adapter, within couple of days of launching cucumber they have launched their adapter.

To integrate extent report using cucumber 5 adapter follow below steps:

Step 1: In pom.xml add following dependency, you can check the latest version of depedency from their official website by clicking here:

<dependency>
   <groupId>tech.grasshopper</groupId>
   <artifactId>extentreports-cucumber6-adapter</artifactId>
   <version>1.0.0</version>
</dependency>

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

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

You need to 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=../

After switching to cucumber 6 you are getting some error in cucumber runner class, you need to remove strict option or set its value to true. Also use round () brackets for tags instead of curly brackets {}. For example:

tags = ("@SmokeTest")
Sun, 08/30/2020 - 23:22
Tarun Goswami is a highly experienced professional, currently serving as Technical Lead at a well-established IT services company. With over 12 years of experience across multiple domains, he demonstrates his expertise and passion for the industry through his engaging and informative blog writing in his spare time.

Comments