Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
protractor-cucumber-framework
Advanced tools
This framework was originally part of angular/protractor and is now a separate module to decouple cucumber.js.
The project relies on Serenity/JS to enable integration between Protractor and Cucumber 1.x - 7.x and offer support for both Cucumber.js-native and Serenity/JS reporters.
To see Serenity/JS reports in action, check out the demo project and the reports it produces.
To install this module, run the following command in your computer terminal:
npm install --save-dev protractor-cucumber-framework
Please note that to use protractor-cucumber-framework
you'll need a recent Long-Term Support versions of Node.js, so 12, 14, or 16.
Odd-numbered Node.js releases (11, 13, 15, etc.) are not on the LTS line, should be considered experimental, and should not be used in production.
To implement this framework, utilize the protractor
custom framework config option:
exports.config = {
// set to "custom" instead of cucumber.
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),
// require feature files
specs: [
'path/to/feature/files/**/*.feature' // accepts a glob
],
cucumberOpts: {
// require step definitions
require: [
'path/to/step/definitions/**/*.steps.js' // accepts a glob
]
}
};
To configure Serenity/JS reporting services, check out the demo project and consult the Serenity/JS Handbook.
All of the cucumberOpts
will be passed to cucumberjs
as arguments.
For example, to call cucumberjs with the --strict
, --no-colors
, and to specify custom formatters:
cucumberOpts: {
strict: true,
'no-colors': true,
format: ['progress', 'pretty:output.txt'],
// ...
}
The following parameters have special behavior:
require
- globs will be expanded to multiple --require
argumentsrerun
- value is passed as an argument; for use with the rerun featureIf you have a formatter that outputs to a path and your tests are sharded or you have multi capabilities then this library will add the PID to the path to make them unique. The reason for this is multiple processes can write to the same path which ends up clobbering each other. You'll end up with 1 file per process that protractor spawns.
exports.config = {
capabilities: {
shardTestFiles: true,
// ...
},
cucumberOpts: {
format: 'json:results.json',
// ...
}
};
If there were 2 feature files then you can expect the following output files...
results.11111.json
results.22222.json
...where the numbers will be the actual PIDs.
If your process abruptly stops with an exit code 199
then your steps most likely threw an uncaught
exception. Protractor is capturing these and exiting the process in this situation. The solution is
to upgrade to at least protractor version 4.0.10 and add the following to your protractor conf...
ignoreUncaughtExceptions: true
This allows cucumber to handle the exception and record it appropriately.
Pull requests are welcome. Commits should have an appropriate message and be squashed.
Ensure that the following dependencies are installed:
Clone the github repository:
git clone https://github.com/protractor-cucumber-framework/protractor-cucumber-framework
cd protractor-cucumber-framework
npm install
Start a selenium server:
npm run webdriver
Start the test app that tests will be run against in a separate shell:
npm start
Run the tests in a separate shell:
npm test
npm publish
git tag vx.x.x && git push origin master --tags
)npx release
)FAQs
Protractor framework for Cucumber.js
The npm package protractor-cucumber-framework receives a total of 20,046 weekly downloads. As such, protractor-cucumber-framework popularity was classified as popular.
We found that protractor-cucumber-framework demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.