Tuesday, April 13, 2021

Generate Cucumber JVM report by bat file/ without running project as Mvn clean install



Generate Cucumber JVM report without running project as Mvn clean install: 


Please refer previous post for generating Cucumber JVM report - Generate most preferred Cucumber JVM report
Here we will discuss about generating the Cucumber JVM report without running the project as Maven clean install.

It is not feasible every time running the test by specifying clean install on Run configuration.

So, I thought of creating the Cucumber JVM report by running the test runner.

Here we will create .bat file where we will specify the cucumber sandwich.jar file location and your Cucumber report location. In addition, we need to create the utility to read .bat file after the test execution so that .bat will read the jars and create the Cucumber JVM report.

We can achieve this using Cucumber Sandwich Jar.

Follow the below steps:
1. Go to the URL to download jar file https://mvnrepository.com/artifact/net.masterthought/cucumber-sandwich/3.7.0
2.   Download Cucumber sandwich Jar
3. Create generateReport.bat file under your project, provide your jar file and report location

For example : 4. Create the utility say “ReadbatFile” to read the .bat file
5. Call “ReadbatFile” in @BeforeClass so that this will call after your test execution.

5. Run the runner.java class, while finishing the execution your .bat file will execute and you will command prompt as below

6. Refresh the project
7. Go to the location where gets generated and there you will find Cucumber jvm report generated.

 

For more information – please go to official GIT Hub https://github.com/damianszczepanik/cucumber-sandwich

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