cucumber reportsPublish pretty
This is a Java report publisher primarily created to publish cucumber reports on the Jenkins build server. It publishes pretty html reports with charts showing the results of cucumber runs. It has been split out into a standalone package so it can be used for Jenkins and maven command line as well as any other packaging that might be useful. Generated report has no dependency so can be viewed offline.
Cucumber is a test automation tool following the principles of Behavioural Driven Design and living documentation. Specifications are written in a concise human readable form and executed in continuous integration.
This project allows you to publish the results of a cucumber run as pretty html reports. In order for this to work you must generate a cucumber json report. The project converts the json report into an overview html linking to separate feature files with stats and results.
Add a maven dependency to your pom
<dependency> <groupId>net.masterthought</groupId> <artifactId>cucumber-reporting</artifactId> <version>(check version above)</version> </dependency>
Read this if you need further detailed configuration instructions for using the Jenkins version of this project
File reportOutputDirectory = new File("target"); List<String> jsonFiles = new ArrayList<>(); jsonFiles.add("cucumber-report-1.json"); jsonFiles.add("cucumber-report-2.json"); String buildNumber = "1"; String projectName = "cucumberProject"; boolean runWithJenkins = false; Configuration configuration = new Configuration(reportOutputDirectory, projectName); // optional configuration - check javadoc configuration.setRunWithJenkins(runWithJenkins); configuration.setBuildNumber(buildNumber); // addidtional metadata presented on main page configuration.addClassifications("Platform", "Windows"); configuration.addClassifications("Browser", "Firefox"); configuration.addClassifications("Branch", "release/1.0"); // optionally add metadata presented on main page via properties file List<String> classificationFiles = new ArrayList<>(); classificationFiles.add("properties-1.properties"); classificationFiles.add("properties-2.properties"); configuration.addClassificationFiles(classificationFiles); ReportBuilder reportBuilder = new ReportBuilder(jsonFiles, configuration); Reportable result = reportBuilder.generateReports(); // and here validate 'result' to decide what to do if report has failed
There is a feature overview page:
And there are also feature specific results pages:
And useful information for failures:
If you have tags in your cucumber features you can see a tag overview:
And you can drill down into tag specific reports:
Once you developed your new feature or improvement you should test it by providing several unit or integration tests.
We use BrowserStack to examine HTML report against different browsers and platforms.
Interested in contributing to the cucumber-reporting? Great! Start here.