This example demonstrates how works allure-cucumberjs
integration.
- Create a
cucumberjs
reporter usingallure-js-common
andallure-cucumberjs
packages:
const { AllureRuntime } = require('allure-js-commons')
const { CucumberJSAllureFormatter } = require('allure-cucumberjs')
module.exports = class extends CucumberJSAllureFormatter {
constructor(options) {
super(
options,
new AllureRuntime({ resultsDir: "./allure-results" }),
{},
);
}
}
- Add
test
script to the rootpackage.json
file:
{
"name": "allure-js-cucumber-demo",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
+ "scripts": {
+ "test": "cucumber-js -f ./reporter.js"
+ },
"devDependencies": {
"@cucumber/cucumber": "^8.3.1",
"allure-cucumberjs": "^2.0.0-beta.18",
"allure-js-commons": "^2.0.0-beta.18",
"chai": "^4.3.6"
}
}
- Write some features and steps-defs
- Then run the
test
script
- Clone the repository
- Install dependencies:
npm i # for npm users
yarn # for yarn users
- Run the tests script:
npm t # for npm users
yarn test # for yarn users
- Check the result in
allure-results
directory - Upload your results right to the
Launches