Open neerjain opened 5 years ago
@neerjain I need some additional information: Please provide:
Please find below teh details:
`const CucumberJSAllureFormatter = require("cucumberjs-allure2-reporter").CucumberJSAllureFormatter; const AllureRuntime = require("cucumberjs-allure2-reporter").AllureRuntime;
class Reporter extends CucumberJSAllureFormatter { constructor(options) { super( options, new AllureRuntime({ resultsDir: "./out/allure-results" }), { labels: { issue: [/@bug_(.)/], epic: [/@feature:(.)/] } } ); } }
module.exports = Reporter;`
Stack Trace:
[14:21:54] E/launcher - Error: TypeError: Class constructor Formatter cannot be invoked without 'new'
at new CucumberJSAllureFormatter (D:\Protractor Cucumber\withpageWiseObjectRepository\node_modules\cucumberjs-allure2-reporter\src\CucumberJSAllureReporter.ts:54:3)
at new Reporter (D:/Protractor Cucumber/withpageWiseObjectRepository/util/AllureReporter.js:6:9)
at Function.build (D:\Protractor Cucumber\withpageWiseObjectRepository\node_modules\cucumber\lib\formatter\builder.js:49:12)
at D:\Protractor Cucumber\withpageWiseObjectRepository\node_modules\cucumber\lib\cli\index.js:121:35
at Generator.next (
Node version: 8.11.3
I am running this through protractor conf.js file
cucumberOpts: { strict: true, format: ['node_modules/cucumber-pretty', 'json:./reports/json/cucumber_report.json', './util/AllureReporter.js'], require: ["../testSpecifications/.js", "../util/.js"],
},
@neerjain After some experiments, it looks like there were some incompatible changes in Cucumber version 5.
Latest supported version is "cucumber": "^4.2.1"
for now.
I've tested that your example works well after downgrade.
I will try to work on the support for cucumber 5, but can not promise any timeline.
@neerjain possibly you need to fix tsconfig.json, here working example https://github.com/sseliverstov/allurejs-examples/tree/master/cucumber-js5-allure2. Also we copy @korobochka 's code to our organization https://github.com/allure-framework/allure-js.
@korobochka can you release a new version of cucumberjs-allure2-reporter
with the fix?
Thank you so much
@fescobar : I am not maintaining this project anymore (everything moved to main Allure repo, but that version is not released yet). If you can test tsconfig changes and submit PR here -- I'll release the hotfix.
@korobochka I'll try to create the PR. What main Allure repo? can you share the link? @sseliverstov can you give access to the example? or upload it here, please?
@fescobar https://github.com/allure-framework/allure-js - main repot https://github.com/sseliverstov/allurejs-examples - some examples
Hi,
I have written the code mentioned in READme in both syntax ES6 and non ES6 but it is throwing below error:
TypeError: Class constructor Formatter cannot be invoked without 'new'