cucumber-reports-plugin/README.md

74 lines
3.5 KiB
Markdown
Raw Normal View History

2012-04-14 07:28:04 +00:00
# Publish pretty [cucumber-jvm](https://github.com/cucumber/cucumber-jvm) reports on [Jenkins](http://jenkins-ci.org/)
This is a Java Jenkins plugin which publishes pretty html reports showing the results of cucumber-jvm runs. It also works for the ruby versions of cucumber - not just the cucumber-jvm. To use with regular cucumber just make sure to run cucumber like this: cucumber --format json -o cucumber.json
2012-04-14 07:28:04 +00:00
## Background
Cucumber-JVM 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 plugin allows Jenkins to publish the results as pretty html reports hosted by the Jenkins build server. In order for this plugin to work you must be using the JUnit runner and generating a json report. The plugin converts the json report into an overview html linking to separate feature file htmls with stats and results.
## Install
1. [Get](https://jenkins-ci.org/) Jenkins.
2. Install the [cucumber-jvm-reports-java]
2012-04-16 07:36:08 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/downloads) plugin.
2012-04-14 07:28:04 +00:00
3. Restart Jenkins.
2012-05-22 19:43:30 +00:00
Read this if you need further [detailed install and configuration]
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/wiki/Detailed-Configuration) instructions
2012-04-14 07:28:04 +00:00
## Use
2012-04-26 08:54:47 +00:00
You must use a Freestyle project type in jenkins.
2012-04-14 07:28:04 +00:00
With the cucumber-jvm-reports plugin installed in Jenkins, you simply check the "Publish cucumber results as a report" box in the
publish section of the build config and enter the path to the json reports relative to the workspace:
![check the publish cucumber-jvm-reports box]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/publish-box.png)
2012-04-14 07:28:04 +00:00
When a build runs that publishes cucumber-jvm results it will put a link in the sidepanel to the cucumber reports. There is a feature overview page:
![feature overview page]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/feature-overview.png)
2012-04-14 07:28:04 +00:00
And there are also feature specific results pages:
![feature specific page passing]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/feature-passed.png)
2012-04-14 07:28:04 +00:00
And useful information for failures:
![feature specific page passing]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/feature-failed.png)
2012-04-14 07:28:04 +00:00
If you have tags in your cucumber features you can see a tag overview:
![Tag overview]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/tag-overview.png)
And you can drill down into tag specific reports:
2012-05-10 08:54:14 +00:00
![Tag report]
2012-05-10 08:58:19 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java/raw/master/.README/tag-report.png)
Make sure you have configured cucumber-jvm to run with the JUnit runner and to generate a json report: (note - you can add other formatters in if you like e.g. pretty - but only the json formatter is required for the reports to work)
2012-04-14 07:28:04 +00:00
package net.masterthought.example;
import cucumber.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@Cucumber.Options(format = {"json:target/cucumber.json"})
2012-04-14 07:28:04 +00:00
public class ATMTest {
}
## Develop
Interested in contributing to the Jenkins cucumber-jvm-reports plugin? Great! Start [here]
2012-04-16 07:36:08 +00:00
(https://github.com/masterthought/jenkins-cucumber-jvm-reports-plugin-java).