gradle-cucumber-reporting
gradle-cucumber-reporting copied to clipboard
A gradle plugin to generate pretty HTML reports for Cucumber from json report files.
Gradle Cucumber Reporting
Generate pretty HTML files from cucumber report json files. Uses https://github.com/damianszczepanik/cucumber-reporting for generating the reports.
This plugin on the Gradle Plugin Portal
Usage
The plugin will automatically run at the end of your test task. You can also run it manually with the generateCucumberReports task.
Adding the plugin to your build.gradle
plugins {
id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.1.25"
}
Configuration
Somewhere in your build.gradle add the following snippet:
cucumberReports {
outputDir = file('path/for/generated/html')
buildId = '0'
reports = files('path/to/cucumber-report.json', 'another/cucumber-json.json')
}
Optional configuration
classifications: A map with<String, String>pairs that are added to the HTML report, for example os name etc. Use the methodclassificationto add a single classification. Setting this property directly will overwrite old classifications.testTasksFinalizedByReport:trueorfalsedetermines if thegenerateCucumberReportstask finalizes the test tasks.trueby default. Should be set to false if you have other tests that do not create cucumber reports and you want to avoid the failing task.excludeTags: AList<String>of regexes that will filter out tags so they are not present in the generated report.runWithJenkins: Set this totrueif you are running on a Jenkins.falseby default.expandAllSteps: Set this totrueto make all scenarios expanded in the generated report.projectNameOverride: AString. By default, the reports will use the name of your gradle project as the project name. If this property is not null, it will be used instead.trends: File containing a trend store.trendsLimit: Limit the number of past trends used in report generation.notFailingStatuses: (Set<String>) Step statuses that should not be marked as failed in the report generationdirectorySuffix:String. Sets a suffix for directories.reducingMethod:String, one of:MERGE_FEATURES_BY_ID, MERGE_FEATURES_WITH_RETEST, SKIP_EMPTY_JSON_FILES, HIDE_EMPTY_HOOKS. Adds a reducing method.
Example
A working example (with pre-existing reports) can be found in the example directory.
cucumberReports {
//...
//Pass a map
classifications = [Browser: "Firefox"]
//or call the classification method
classification "Browser" "Firefox"
//Pass a list to exclude
excludeTags = [".*"]
//or call the excludeTag method
excludeTag ".*"
}
Properties
skipReports: Pass this via-PskipReportswhen invoking gradle.
License
Just as https://github.com/damianszczepanik/cucumber-reporting, this plugin is available under the terms of the LGPL 2.1 license.