Creating Allure report with cucumber 6 (TestNG):

Praveen David Mathew
2 min readJul 11, 2021

Introduction:

In my previous article (link), I have explained how you can create custom reports by overriding the concurrentListner class. This is handy knowledge as an engineer as it shows how reporters are actually implemented in the cucumber framework.

But when implementing projects you don’t have to repeat these boilerplates codes, most common reporting tools like allure, extent report etc publishes report adapters that is nothing but the implementation of the concurrent Listener class. Meaning, all listener class implementation boilerplate codes are already written for you and provided as a package.

You can see the implementation of this adaptor at: Github , so its the same thing that we learned in the previous article.

Now keep reading to know how to use this adaptor,

Maven Dependencies:

https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber6-jvm

<!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-cucumber6-jvm --><dependency><groupId>io.qameta.allure</groupId><artifactId>allure-cucumber6-jvm</artifactId><version>2.14.0</version></dependency>

Now just use it as plugin the testNGRunner:

package cucumber_Runner;import io.cucumber.testng.AbstractTestNGCucumberTests;import io.cucumber.testng.CucumberOptions;import org.testng.annotations.DataProvider;@CucumberOptions(plugin = { "cucumberHooks.customReportListener","io.qameta.allure.cucumber6jvm.AllureCucumber6Jvm" }, monochrome = true, glue = { "stepDefinitions","cucumberHooks" }, // Packagenamefeatures = { "src\\featureFiles" } // FolderName)public class RunnerCucumber extends AbstractTestNGCucumberTests {

--

--

Praveen David Mathew

An open source advocator/WebdriverIO Projectcommiter/Postman Supernova/Postman-html-extra contributor/Stack overflow sqa moderator/Speaker