Cucumber Sandwich Reporting

Cucumber Sandwich Reporting

This project generates pretty cucumber html reports on the fly. It monitors your cucumber json report directory for change and then publishes a new report if your report json files change.


Install

  1. download the jar from (http://grepcode.com/snapshot/repo1.maven.org/maven2/net.masterthought/cucumber-sandwich/0.0.4/)
  2. You should see a file like this: cucumber-sandwich-0.0.4-SNAPSHOT-jar-with-dependencies.jar rename this file to cucumber-sandwich.jar
  3. I assume that you have followed previous blog on cucumber setup and create a simple feature that runs successfully. 
  4. Create Runner Class (RuncukesforReports) so that it created cucumber.json file

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(strict = false, features = "your path to feature file/Login.feature", format = { "pretty",
        "html:target/site/cucumber-pretty",
        "json:target/cucumber.json" }, tags = {})


public class RuncukesforReports {

}

 


Generate Report

Go to command prompt where cucumber sandwich jar located and run the following command 

Here make sure that you point the correct path where cucumber.json located (If we observe from above class we are creating that under target folder) and also specify the output folder where you want to generate sandwich report.

$ java -jar cucumber-sandwich-0.0.4.jar -n -f your project path/target/ -o your project path/target/cucumber-html-report/

Once executed successfully go to the folder to access the report. 






 

Open the feature-overview.html in any browser and should be able to see the detailed report.



Feature Statistic Details :





Thanks

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.