Skip to content

Commit

Permalink
feature: update allure-cucumberjs to 3.0.0-beta.3 (but loose custom r…
Browse files Browse the repository at this point in the history
…eports location config)
  • Loading branch information
YakovL committed Jun 11, 2024
1 parent c7d3a6d commit 6121dcd
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
features/allure-results/
allure-results/
23 changes: 12 additions & 11 deletions features/reporter.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
const { CucumberJSAllureFormatter, AllureRuntime } = require("allure-cucumberjs");
const AllureCucumberReporter = require("allure-cucumberjs/reporter");
const { AllureRuntime } = require("allure-cucumberjs");
const path = require("path");

class Reporter extends CucumberJSAllureFormatter {
constructor(options) {
super(
options,
new AllureRuntime({
resultsDir: path.resolve(__dirname, "allure-results"),
}),
{},
);
}
class Reporter extends AllureCucumberReporter {
// constructor(options) {
// super(
// options,
// new AllureRuntime({
// resultsDir: path.resolve(__dirname, "allure-results"),
// }),
// {},
// );
// }
}

module.exports = Reporter;
10 changes: 5 additions & 5 deletions features/support/steps.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const assert = require('assert')
const { Given, When, Then, setWorldConstructor } = require('@cucumber/cucumber')
const { CucumberAllureWorld } = require('allure-cucumberjs')
const { LabelName } = require('allure-js-commons')
// const { AllureCucumberWorld } = require('allure-cucumberjs')
const { suite, parentSuite } = require('allure-js-commons')
const Petstore = require('../../src/petstore')

setWorldConstructor(CucumberAllureWorld)
// setWorldConstructor(AllureCucumberWorld)

var petstore = new Petstore()

Expand All @@ -18,8 +18,8 @@ When('I add a pet', async function() {

Then('The pet is added', async function() {
// this.epic("REST api")
this.parentSuite("REST api")
this.suite("Petstore")
await parentSuite("REST api")
await suite("Petstore")
// this.label(LabelName.PACKAGE, "cucumber.features.petstore")

assert.equal(true, true)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "cucumber-js",
"report": "allure serve features/allure-results"
"report": "allure serve allure-results"
},
"keywords": [],
"author": "",
Expand All @@ -16,6 +16,6 @@
},
"devDependencies": {
"allure-commandline": "^2.29.0",
"allure-cucumberjs": "2.15.1"
"allure-cucumberjs": "3.0.0-beta.3"
}
}
Loading

0 comments on commit 6121dcd

Please sign in to comment.