Gathering detailed insights and metrics for cucumber-html-reporter
Gathering detailed insights and metrics for cucumber-html-reporter
Gathering detailed insights and metrics for cucumber-html-reporter
Gathering detailed insights and metrics for cucumber-html-reporter
protractor-simple-cucumber-html-reporter-plugin
A plugin to use simple-cucumber-html-reporter with CucumberJs 4
yachr
Yet another cucumber html reporter
multiple-cucumber-html-reporter
Generate beautiful Cucumber.js reports for multiple instances (browsers / devices)
multiple-cucumber-html-reporter-ignore-skipped-pending-tests
Generate beautifull cucumberjs reports for multiple instances (browsers / devices) with ability to ignore the skipped/pending tests. This lib is based from original multiple-cucumber-html-reporter
Generates Cucumber HTML reports in three different themes
npm install cucumber-html-reporter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
234 Stars
398 Commits
156 Forks
18 Watching
5 Branches
53 Contributors
Updated on 04 Nov 2024
Minified
Minified + Gzipped
HTML (52.6%)
JavaScript (35.71%)
Gherkin (10.57%)
CSS (1.12%)
Cumulative downloads
Total Downloads
Last day
7.8%
70,959
Compared to previous day
Last week
6.3%
404,070
Compared to previous week
Last month
19.9%
1,660,323
Compared to previous month
Last year
24.3%
15,509,061
Compared to previous year
Generate Cucumber HTML reports with pie charts
Available HTML themes:
['bootstrap', 'hierarchy', 'foundation', 'simple']
Provide Cucumber JSON report file created from your framework and this module will create pretty HTML reports. Choose your best suitable HTML theme and dashboard on your CI with available HTML reporter plugins.
1npm install cucumber-html-reporter --save-dev
Notes:
cucumber-html-reporter@5.5.0
for cucumber version < Cucumber@8
cucumber-html-reporter@2.0.3
for cucumber version < Cucumber@3
cucumber-html-reporter@0.5.0
for cucumber version < Cucumber@2
cucumber-html-reporter@0.4.0
for node version <0.12Let's get you started:
bootstrap
theme:1 2var reporter = require('cucumber-html-reporter'); 3 4var options = { 5 theme: 'bootstrap', 6 jsonFile: 'test/report/cucumber_report.json', 7 output: 'test/report/cucumber_report.html', 8 reportSuiteAsScenarios: true, 9 scenarioTimestamp: true, 10 launchReport: true, 11 metadata: { 12 "App Version":"0.3.2", 13 "Test Environment": "STAGING", 14 "Browser": "Chrome 54.0.2840.98", 15 "Platform": "Windows 10", 16 "Parallel": "Scenarios", 17 "Executed": "Remote" 18 }, 19 failedSummaryReport: true, 20 }; 21 22 reporter.generate(options); 23 24 25 //more info on `metadata` is available in `options` section below. 26 27 //to generate consodilated report from multi-cucumber JSON files, please use `jsonDir` option instead of `jsonFile`. More info is available in `options` section below. 28
Please look at the Options section below for more options
1node index.js
This module converts Cucumber's JSON format to HTML reports.
The code has to be separated from CucumberJS execution (after it).
In order to generate JSON formats, run the Cucumber to create the JSON format and pass the file name to the formatter as shown below,
1$ cucumberjs test/features/ -f json:test/report/cucumber_report.json
Multiple formatter are also supported,
1$ cucumberjs test/features/ -f summary -f json:test/report/cucumber_report.json
Are you using cucumber with other frameworks or running cucumber-parallel? Pass relative path of JSON file to the
options
as shown here
theme
Available: ['bootstrap', 'hierarchy', 'foundation', 'simple']
Type: String
Select the Theme for HTML report.
N.B: Hierarchy theme is best suitable if your features are organized under features-folder hierarchy. Each folder will be rendered as a HTML Tab. It supports up to 3-level of nested folder hierarchy structure.
jsonFile
Type: String
Provide path of the Cucumber JSON format file
jsonDir
Type: String
If you have more than one cucumber JSON files, provide the path of JSON directory. This module will create consolidated report of all Cucumber JSON files.
e.g. jsonDir: 'test/reports'
//where reports directory contains valid *.json
files
N.B.: jsonFile
takes precedence over jsonDir
. We recommend to use either jsonFile
or jsonDir
option.
output
Type: String
Provide HTML output file path and name
reportSuiteAsScenarios
Type: Boolean
Supported in the Bootstrap theme.
true
: Reports total number of passed/failed scenarios as HEADER.
false
: Reports total number of passed/failed features as HEADER.
launchReport
Type: Boolean
Automatically launch HTML report at the end of test suite
true
: Launch HTML report in the default browser
false
: Do not launch HTML report at the end of test suite
ignoreBadJsonFile
Type: Boolean
Report any bad json files found during merging json files from directory option.
true
: ignore any bad json files found and continue with remaining files to merge.
false
: Default option. Fail report generation if any bad files found during merge.
name
Type: String
(optional)
Custom project name. If not passed, module reads the name from projects package.json which is preferable.
brandTitle
Type: String
(optional)
Brand Title is the brand of your report, e.g. Smoke Tests Report, Acceptance Test Report etc as per your need. If not passed, it will be displayed as "Cucumberjs Report"
columnLayout
Available: [1, 2]
Type: Number
Default: 2
Select the Column Layout. One column or Two columns
1 = One Column layout (col-xx-12) 2 = Two Columns Layout (col-xx-6)
storeScreenshots
Type: Boolean
Default: undefined
true
: Stores the screenShots to the default directory. It creates a directory 'screenshot' if does not exists.
false
or undefined
: Does not store screenShots but attaches screenShots as a step-inline images to HTML report
screenshotsDirectory
Type: String
(optional)
Default: options.output/../screenshots
Applicable if storeScreenshots=true
. Relative path for directory where screenshots should be saved. E.g. the below options should store the screenshots to the <parentDirectory>/screenshots/
where as the report would be at <parentDirectory>/report/cucumber_report.html
1{ 2 ... 3 ... 4 output: '/report/cucumber_report.html', 5 screenshotsDirectory: 'screenshots/', 6 storeScreenshots: true 7}
noInlineScreenshots
Type: Boolean
Default: undefined
true
: Applicable if storeScreenshots=true
. Avoids inlining screenshots, uses relative path to screenshots instead (i.e. enables lazy loading of images).
false
or undefined
: Keeps screenshots inlined.
scenarioTimestamp
Type: Boolean
Default: undefined
true
: Applicable if theme: 'bootstrap'
. Shows the starting timestamp of each scenario within the title.
false
or undefined
: Does not show starting timestamp.
metadata
Type: JSON
(optional)
Default: undefined
Print more data to your report, such as browser info, platform, app info, environments etc. Data can be passed as JSON key-value
pair. Reporter will parse the JSON and will show the Key-Value under Metadata
section on HTML report. Checkout the below preview HTML Report with Metadata.
Pass the Key-Value pair as per your need, as shown in below example,
1 2 metadata: { 3 "App Version":"0.3.2", 4 "Test Environment": "STAGING", 5 "Browser": "Chrome 54.0.2840.98", 6 "Platform": "Windows 10", 7 "Parallel": "Scenarios", 8 "Executed": "Remote" 9 } 10
failedSummaryReport
Type: Boolean
A summary report of all failed scenarios will be listed in a grid, which its scenario title, tags, failed step and exception.
true
: Insert failed summary report.
false
: Failed summary report will not be inserted.
Capture and Attach screenshots to the Cucumber Scenario and HTML report will render the screenshot image
for Cucumber V8
1 2 let world = this; 3 4 return driver.takeScreenshot().then((screenShot) => { 5 // screenShot is a base-64 encoded PNG 6 world.attach(screenShot, 'image/png'); 7 }); 8
for Cucumber V2 and V3
1 2 var world = this; 3 4 driver.takeScreenshot().then(function (buffer) { 5 return world.attach(buffer, 'image/png'); 6 }; 7
for Cucumber V1
1 2 driver.takeScreenshot().then(function (buffer) { 3 return scenario.attach(new Buffer(buffer, 'base64'), 'image/png'); 4 }; 5
Attach plain-texts/data to HTML report to help debug/review the results
1 2 scenario.attach('test data goes here'); 3
Attach JSON to HTML report
1 2 scenario.attach(JSON.stringify(myJsonObject, undefined, 4)); 3
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
6 existing vulnerabilities detected
Details
Reason
Found 8/26 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More