The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Cucumber reports

cucumber: Cucumber reports

Publishes Cucumber results

This plugin requires that you use cucumber library to generate a json report. The plugin uses the json report to produce html reports that are available from jenkins on the build page after a build has run.

	import cucumber.junit.Cucumber;
	import org.junit.runner.RunWith;

	@Cucumber.Options(format = {"pretty", "html:target/cucumber", "json:target/cucumber.json"})
	public class MyTest {

  • fileIncludePattern

    Filter for the files that should be processed. Leave empty to use default pattern **/*.json.

    • Type: String
  • buildStatus (optional)

    Build result to which the build should be set when the report becomes failed or unstable.

    • Type: String
  • classifications (optional)

    Configure additional information as key-value displayed on main page of the report. Hyperlink, HTML code and Jenkins variable can be used for values, check for details.

      Nested Object

      Pairs key-value which are passed to the report to be displayed.

    • key

      Name of the classification.

      • Type: String
    • value

      Value of the classification. Can be plain text, hyperlink or macro.

      • Type: String
  • classificationsFilePattern (optional)

    Filter for the properties files that should be processed as classifications. Leave empty to use default pattern **/*.properties.

    • Type: String
  • failedFeaturesNumber (optional)

    Maximum number of failed features above which build result is changed.

    • Type: int
  • failedScenariosNumber (optional)

    Maximum number of failed scenarios above which build result is changed.

    • Type: int
  • failedStepsNumber (optional)

    Maximum number of failed steps above which build result is changed.

    • Type: int
  • fileExcludePattern (optional)

    Filter for the files that should be excluded from the report.

    • Type: String
  • jsonReportDirectory (optional)

    Directory where the JSON cucumber reports are located. By default and for empty value whole workspace is scanned.

    • Type: String
  • mergeFeaturesById (optional)

    Merge features with different JSON files that have same ID so scenarios are be stored in single feature.

    • Type: boolean
  • pendingStepsNumber (optional)

    Maximum number of pending steps above which build result is changed.

    • Type: int
  • skipEmptyJSONFiles (optional)

    Skip empty JSON reports. If this flag is not selected then report generation fails on empty file.

    • Type: boolean
  • skippedStepsNumber (optional)

    Maximum number of skipped steps above which build result is changed.

    • Type: int
  • sortingMethod (optional)

    This section allows to configure what is default sorting method for features:

    • NATURAL - keeps same order as it was in JSON file
    • ALPHABETICAL - sorts rows alphabetically
    • Type: String
  • stopBuildOnFailedReport (optional)

    The default behaviour is to carry on with the build even if the cucumber report contains failures. This option stops the build. Particularly useful when for example there is a need for all tests to pass before deploying to production. Note that this overrides the Build Status option, and it always marks the build as failed.

    • Type: boolean
  • trendsLimit (optional)

    Number of historical reports that should be presented.

    • set to -1 so trends won't be displayed and history won't be stored
    • set to 0 then all historical reports will be stored and displayed
    • set to other positive value to decide how many historical reports should be presented by trends.
    • Type: int
  • undefinedStepsNumber (optional)

    Maximum number of undefined steps above which build result is changed.

    • Type: int

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?


See existing feedback here.