Saturday, April 10, 2021

Generate most preferred Cucumber JVM report

Today, We will see how to generate cucumber report using maven cucumber reporting plugins, So basically cucumber is very popular tool to do Behavioral-driven development. In cucumber there are number of plugins available for different reporting like Extent report, PDF report, and Cucumber json report etc.

To generate cucumber report from maven cucumber reporting plugins we need to make the necessary changes in POM.xml file. You can find out the cucumber plugins here https://cucumber.io/docs/cucumber/reporting/

To generate the cucumber report we need to generate JSON report from which cucumber reporting plugins read .json file and will generate the report.

So, basically we need to generate two report

a. JSON report
b. Cucumber JVM report

In order to generate cucumber JSON report we need to add below plugins in TestRunnner.java also we need to update the plugins in POM.xml file as shown below.class

Below is the code snipped of complete TestRunnerClass.java class POM.xml to be updated as below.
Now in order to run the project right click on project, select Run as Maven build and then click on maven build
Specify the maven goal as “clean install” as shown below

Once the execution is done, refresh the project and check if report generated you would see to two report generated shown as below.
Now right click on “feature-overview.html” and open with web browser.

You will see beautiful cucumber jvm report with all details.

Actually, There is a cucumber JVM report plugin which can be used to generate pretty HTML reports with charts showing the results of cucumber runs. This is mainly used to publish cucumber reports on the Jenkins build server. There is a maven plugin also to generate the same report in the local directory. We will see both here.
Here is the git hub project for the pretty cucumber HTML repor https://github.com/damianszczepanik/cucumber-reporting

 

Here is the detailed instruction on publishing the cucumber report on the Jenkins build server: https://github.com/jenkinsci/cucumber-reports-plugin/wiki/Detailed-Configuration

No comments:

Post a Comment

How to install Java on EC2

***************************************** How to install Java on EC2 ***************************************** To be continued, In this post...

All Time Popular Post