Gathering detailed insights and metrics for protractor-multiple-cucumber-html-reporter-plugin
Gathering detailed insights and metrics for protractor-multiple-cucumber-html-reporter-plugin
Gathering detailed insights and metrics for protractor-multiple-cucumber-html-reporter-plugin
Gathering detailed insights and metrics for protractor-multiple-cucumber-html-reporter-plugin
A protractor plugin to use multiple-cucumber-html-reporter with CucumberJS
npm install protractor-multiple-cucumber-html-reporter-plugin
Typescript
Module System
Node Version
NPM Version
Fix locking files during copy
Updated on Jun 02, 2019
Update multiple-cucumber-html-reporter to latest version
Updated on Aug 17, 2018
Update dependencies
Updated on Aug 17, 2018
Add extra options
Updated on Aug 17, 2018
Update dependencies
Updated on Aug 17, 2018
Add new feature
Updated on Aug 17, 2018
JavaScript (98.76%)
Gherkin (1.01%)
CSS (0.23%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
48 Stars
44 Commits
14 Forks
7 Watchers
2 Branches
1 Contributors
Updated on Jan 25, 2025
Latest Version
1.8.1
Package Id
protractor-multiple-cucumber-html-reporter-plugin@1.8.1
Unpacked Size
1.86 MB
Size
882.18 kB
File Count
42
NPM Version
6.9.0
Node Version
10.15.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
6
This plugin will connect Protractor, CucumberJS and protractor-cucumber-framework to generate unique JSON files per feature with only a few lines of code. It will also replace the extra CucumberJS hook you needed to make in CucumberJS 1 and 2 to generate unique JSON report files.
It was born when CucucmberJS 3 removed the
registerHandler
andregisterListener
. As of version 3 Protractor and CucumberJS users don't have the possibility to generate and create unique JSON report files. With this module they have.
You will also get multiple-cucumber-html-reporter as a dependency and use it on the fly to generate beautiful reports. A sample can be found here
Node.js | Protractor | CucumberJS | protractor-cucumber-framework | multiple-cucumber-html-reporter |
---|---|---|---|---|
6.x | 4.x | 1.x | 3.1.2 or higher | 1.0.0 or higher |
7.x | 5.x | 2.x | ||
3.x |
npm install protractor-multiple-cucumber-html-reporter-plugin --save-dev
You need to do 2 things.
format: 'json:.tmp/results.json'
to your cucumberOpts
in the config. This will tell CucumbjerJS to generate a JSON-file. As of protractor-cucumber-framework
version 3.1.2 you will get unique JSON files, see also here.protractor-multiple-cucumber-html-reporter-plugin
in the plugins
block inside
protractor.config.js
.!!The path that is defined in the
format
is the path where all files and reports are saved. Advice is not to save the CucumberJS JSON report fil in the root of the project but in for example a.tmp/
folder!!
Here is a short config example of both steps.
1const path = require('path'); 2 3exports.config = { 4 5 framework: 'custom', 6 frameworkPath: require.resolve('protractor-cucumber-framework'), 7 cucumberOpts: { 8 require: [ 9 path.resolve(process.cwd(), './**/*.steps.js') 10 ], 11 // Tell CucumberJS to save the JSON report 12 format: 'json:.tmp/results.json', 13 strict: true 14 }, 15 16 specs: [ 17 '*.feature' 18 ], 19 20 multiCapabilities: [{ 21 browserName: 'chrome', 22 shardTestFiles: true, 23 maxInstances: 2, 24 chromeOptions: { 25 args: ['disable-infobars'] 26 } 27 }], 28 29 // Here the magic happens 30 plugins: [{ 31 package: 'protractor-multiple-cucumber-html-reporter-plugin', 32 options:{ 33 // read the options part 34 } 35 }] 36}; 37
If you don't provide options
the pluging will use the defaults as mentioned below. Options can be added by creating an object like this:
1 plugins: [{ 2 package: 'protractor-multiple-cucumber-html-reporter-plugin', 3 options:{ 4 // read the options part for more options 5 automaticallyGenerateReport: true, 6 removeExistingJsonReportFile: true 7 } 8 }]
automaticallyGenerateReport
boolean
false
Setting this option will autimatically generate a new report with multiple-cucumber-html-reporter
. It will generate a log at the end of the testexection where you can find the report and looks like this. This means that you don't need to call the report module in a seperate node process. For the options of the report see the options openReportInBrowser
, reportPath
and saveCollectedJSON
1===================================================================================================== 2 Multiple Cucumber HTML report generated in: 3 4 /Users/wswebcreation/protractor-multiple-cucumber-html-reporter-plugin/.tmp/report/index.html 5=====================================================================================================
customData
object
You can add a custom data block to the report like this
1customData: { 2 title: 'Run info', 3 data: [ 4 {label: 'Project', value: 'Custom project'}, 5 {label: 'Release', value: '1.2.3'}, 6 {label: 'Cycle', value: 'B11221.34321'} 7 ] 8}
THIS WILL ONLY WORK WITH
automaticallyGenerateReport:true
. IF YOU GENERATE THE REPORT LATER PLEASE LOOK AT multiple-cucumber-html-reporter
customMetadata
boolean
It is possible to provide custom metadata by setting this variable to true
. Custom metadata will override the regular metadata completely and potentially have strange formatting bugs if too many (10+) variables are used.
The columns will be in the order defined by the order of the list.
Adding the metadata is done in the same way as with normal metadata. The metadata is formed as a list of key-value pairs to preserve order:
1metadata: [ 2 {name: 'Environment v.', value: '12.3'}, 3 {name: 'Plugin v.', value: '32.1'}, 4 {name: 'Variable set', value: 'Foo'} 5 ]
customStyle
path
If you need add some custom style to your report. Add it like this customStyle: 'your-path-where/custom.css'
disableLog
boolean
false
This will disable the log so will NOT see this.
1===================================================================================================== 2 Multiple Cucumber HTML report generated in: 3 4 /Users/wswebcreation/protractor-multiple-cucumber-html-reporter-plugin/.tmp/report/index.html 5=====================================================================================================
displayDuration
boolean
If set to true
the duration of steps, scenarios and features is displayed on the Features overview and single feature page in an easily readable format.
This expects the durations in the report to be in nanoseconds, which might result in incorrect durations when using a version of Cucumber(JS 2 and 3) that does not report in nanoseconds but in milliseconds. This can be changed to milliseconds by adding the parameter durationInMS: true
, see below
NOTE: Only the duration of a feature can be shown in the features overview. A total duration over all features CAN NOT be given because the module doesn't know if all features have been run in parallel
durationInMS
boolean
false
If set to true
the duration of steps will be expected to be in milliseconds, which might result in incorrect durations when using a version of Cucumber(JS 1 or 4) that does report in nanaseconds.
This parameter relies on displayDuration: true
jsonOutputPath
string
json-output-folder
The directory that will hold all the unique generated JSON files, relative from where the script is started.
N.B.: If you use a npm script from the command line, like for example npm run generate-report
the jsonOutputPath
will be relative from the path where the script is executed. Executing it from the root of your project will also search for the jsonOutputPath
from the root of you project.
If you DON'T provide this it will generate a json-output-folder
-folder in the path
that it defined the cucumberOpts.format
.
metadataKey
string
metadata
This will be the key
reference in the capabilities
or multiCapabilities
that will refer to where the instance specific data is saved. The metadata is used for the report that will be generated, see also metadata.
If for example all the metadata is already present in the capabilities
but with the key
called deviceProperties
you can add the option metadataKey: 'deviceProperties'
and the plugin will automatically copy the deviceProperties
-object to the metadata
of the report.
openReportInBrowser
boolean
false
Settign this option will automatically open the generated report in the default browser of the operating system. See also here.
overrideStyle
path
If you need replace default style for your report. Add it like this overrideStyle: 'your-path-where/custom.css'
pageFooter
string
You can customise Page Footer if required. You just need to provide a html string like <div><p>A custom footer in html</p></div>
pageTitle
string
You can change the report title in the HTML head Tag
removeExistingJsonReportFile
boolean
false
Settign this option will remove the previous unique JSON report file if it exists. It will prevent double reports of 1 feature + browser execution combination when generating te report with multiple-cucumber-html-reporter
. This may come in handy when you rerun your flakey features with for example protractor-flake
removeOriginalJsonReportFile
boolean
false
Setting this option will remove the original json report file, defined in the cucumberOpts.format
. It will clean up the folder where you save all your results and may be needed if you have a lot of JSON-files with screenshots in it.
reportName
string
You can change the report name to a name you want.
THIS WILL ONLY WORK WITH
automaticallyGenerateReport:true
. IF YOU GENERATE THE REPORT LATER PLEASE LOOK AT multiple-cucumber-html-reporter
reportPath
string
report
The directory in which the report needs to be saved, relative from where the script is started. See also here.
If you DON'T provide this it will generate a report
-folder in the path
that it defined the cucumberOpts.format
.
N.B.: If you use a npm script from the command line, like for example npm run generate-report
the reportPath
will be relative from the path where the script is executed. Executing it from the root of your project will also save the report in the reportPath
in the root of you project.
saveCollectedJSON
boolean
false
multiple-cucumber-html-reporter
will first merge all the JSON-files to 1 file and then enrich it with data that is used for the report. If saveCollectedJSON :true
the merged JSON AND the enriched JSON will be saved in the reportPath
. They will be saved as:
merged-output.json
enriched-output.json
See also here
The report can also show on which browser / device a feature has been executed. It is shown on the featurs overview in the table as well as on the feature overview in a container. You can add this by adding the following object to your capabilities
or multiCapabilities
1 capabilities: { 2 browserName: 'chrome', 3 chromeOptions: { 4 args: ['disable-infobars'] 5 }, 6 // Add this 7 metadata: { 8 browser: { 9 name: 'chrome', 10 version: '58' 11 }, 12 device: 'MacBook Pro 15', 13 platform: { 14 name: 'OSX', 15 version: '10.12.6' 16 } 17 } 18 } 19 20 // Or 21 multiCapabilities: [{ 22 browserName: 'chrome', 23 chromeOptions: { 24 args: ['disable-infobars'] 25 }, 26 // Add this 27 metadata: { 28 browser: { 29 name: 'chrome', 30 version: '58' 31 }, 32 device: 'MacBook Pro 15', 33 platform: { 34 name: 'OSX', 35 version: '10.12.6' 36 } 37 } 38 } 39
See the metadata information here for the correct values.
If you don't provide a
browser.name
or abrowser.version
the module will try to determine this automatically. The rest will be shown as questionmarks in the report
report/features
-folder, but they are not shown in the overview-page: See the answer in issue 13The Changelog/Releases can be found here
How to contribute can be found here
When creating this plugin I got a lot of inspiration from:
If this plugin was helpful for you, please give it a ★ Star on Github and npm
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
project is archived
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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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