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;

	@RunWith(Cucumber.class)
	@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 is marked as failed or unstable.

    • Type: String
  • classifications (optional)

    Configure additional information as key-value displayed on main page of the report.

      Array / List of 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. Hyperlink, HTML code and Jenkins variable can be used for values, check Token Macro Plugin for details.

      • Type: String
  • classificationsFilePattern (optional)

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

    • Type: String
  • customCssFiles (optional)

    Comma separated list of CSS files or patterns (relative to workspace) to include into all report pages.

    • Type: String
  • customJsFiles (optional)

    Comma separated list of JS files or patterns (relative to workspace) to include into all report pages.

    • Type: String
  • expandAllSteps (optional)
    • Type: boolean
  • failedAsNotFailingStatus (optional)

    Failed statuses for the step is counted as not failing status and does not fail scenario.

    • Type: boolean
  • failedFeaturesNumber (optional)

    Maximum number of failed features above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • failedFeaturesPercentage (optional)

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

    • Type: double
  • failedScenariosNumber (optional)

    Maximum number of failed scenarios above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • failedScenariosPercentage (optional)

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

    • Type: double
  • failedStepsNumber (optional)

    Maximum number of failed steps above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • failedStepsPercentage (optional)

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

    • Type: double
  • fileExcludePattern (optional)

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

    • Type: String
  • hideEmptyHooks (optional)
    • Type: boolean
  • 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
  • mergeFeaturesWithRetest (optional)

    Merge features and scenarios from different JSON files of different runs into a single report by features and scenarios ids.

    Example:
    Original cucumber report is "cucumber.json". Let's look a situation when couple of tests failed there. Cucumber runner generates a new report, for example, cucumber-rerun.json as a result of rerun the failed tests.
    In that case you will have a merged report where all failed tests from the original cucumber.json file are overridden with the results from the cucumber-rerun.json.

    • Type: boolean
  • pendingAsNotFailingStatus (optional)

    Pending statuses for the step is counted as not failing status and does not fail scenario.

    • Type: boolean
  • pendingStepsNumber (optional)

    Maximum number of pending steps above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • pendingStepsPercentage (optional)

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

    • Type: double
  • reportTitle (optional)
    • Type: String
  • skipEmptyJSONFiles (optional)

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

    • Type: boolean
  • skippedAsNotFailingStatus (optional)

    Skipped statuses for the step is counted as not failing status and does not fail scenario.

    • Type: boolean
  • skippedStepsNumber (optional)

    Maximum number of skipped steps above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • skippedStepsPercentage (optional)

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

    • Type: double
  • 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
  • undefinedAsNotFailingStatus (optional)

    Undefined statuses for the step is counted as not failing status and does not fail scenario.

    • Type: boolean
  • undefinedStepsNumber (optional)

    Maximum number of undefined steps above which build result is triggered. Provide value -1 if the rule should be skipped.

    • Type: int
  • undefinedStepsPercentage (optional)

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

    • Type: double

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.