Can't generate report from cucumber json files.
Hello everyone. Thanks for the cool reporter.
But on my new project, I need a framework with cypress + ts + cucumber. With colorful reports. And have some problem with generating reports.
I use cypress-cucumber-preprocessor with settings to receive reports in json:
"cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true, "cucumberJson": { "generate": true, "outputFolder": "cypress/cucumber-json", "filePrefix": "", "fileSuffix": ".cucumber" } }
As the result, I have 2 json files:
Aslo cucumber-html-reporter.js to generate html:
const {generate} = require('cucumber-html-reporter');
const options = { theme: 'hierarchy', jsonDir: '/cypress/cucumber-json', output: '/cypress/reports/report.html', reportSuiteAsScenarios: true, scenarioTimestamp: true, launchReport: true, ignoreBadJsonFile: true, metadata: { "App Version": "1.0.0", "Test Environment": "STAGING", "Browser": "Chrome 54.0.2840.98", "Platform": "Windows 10", "Parallel": "Scenarios", "Executed": "Remote" } };
generate(options);
But when I use script to generate html report - receive error: ` node cucumber-html-reporter.js
D:\ocean.e2e\node_modules\cucumber-html-reporter\lib\jsonDir.js:13
throw new Error(''options.jsonDir' does not exist. ' + e);
^
Error: 'options.jsonDir' does not exist. Error: /cypress/cucumber-json does not exist.
at Object.collectJSONS (D:\ocean.e2e\node_modules\cucumber-html-reporter\lib\jsonDir.js:13:15)
at Object.generate (D:\ocean.e2e\node_modules\cucumber-html-reporter\lib\reporter.js:492:17)
at generateReport (D:\ocean.e2e\node_modules\cucumber-html-reporter\index.js:30:21)
at Object.
Have I missed something? Don't understand what's wrong. Files can be found inside fileSync method.
@llwch Make sure the folder /cypress/reports/ exists; else, it's not generating html reports.