-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to parse cucumberjs output into json - error while generating the report with Cucumber-html-reporter #3
Comments
Interesting, ok. Do you have a copy oft he JSON it rendered? If you could send that, I can try to run locally to. Also, can you use a relative path to see if it works? Instead of:
Try:
|
I am also facing same issue. Protractor.config.jsconst path = require('path'); exports.config = {
}, Reporter.jsconst fs = require("fs"); const cucumberReportOptions = { class Reporter { static createDirectory(dirName) { /**
} module.exports = Reporter; ERROR: |
Just ignore me.. My json was empty.. should have checked that first :P |
I am also getting the same issue: Unable to parse cucumberjs output into json: 'reports/cucumber-report.json' SyntaxError: reports/cucumber-report.json: Unexpected end of JSON input. Please help me to resolve this issue. |
Any solution to this problem? I am using cucumber-html-reporter too and stuck with this issue " Unable to parse cucumberjs output into json: '\e2e\reports\json\cucumber_report.json' { Error: \e2e\reports\json\cucumber_report.json: ENOENT: no such file or directory, open '\e2e\reports\json\cucumber_report.json' |
I am facing the same issue. The thing which I could figure out from this is. Till the time we are expecting the html-reporter to read the updated report.json file and generate an Html report out of it, the cucumber-js process has not finished writing the test report. And hence, it fails to parse the file. In my case, I am calling the report generation utility in Afterall hook. And running the tests in parallel. However, when I run the test in a single thread. Then this works fine and generates the report at the end of the execution |
I am facing the same issue. Any solution to the problem? |
any update on this? |
1 similar comment
any update on this? |
Update the options to use html format, it should work let options = [ |
I am trying to execute the test in Protractor and generate the results in JSON format and integrationg Cucumber-html-reporter to take this JSON as input and generate the HTML report with Bootstrap options. But Not sucessfull
Below is my config file:
var reporter = require('cucumber-html-reporter');
exports.config = {
seleniumAddress: 'http://172.17.205.173:4444/wd/hub',
seleniumSessionId: '1bcc031df0fa1a241b0fd06445af324d',
capabilities: {
'browserName': 'chrome'
},
specs: ['Login_ZRPE.js'],
resultJsonOutputFile:'G:/Protractor/ZPlatform_Script/protractor-reports/cucumber_report.json',
onComplete: function() {
var options = {
theme: 'bootstrap',
jsonFile: 'G:/Protractor/ZPlatform_Script/protractor-reports/cucumber_report.json',
output: 'G:/Protractor/ZPlatform_Script/protractor-reports/cucumber_report.html',
reportSuiteAsScenarios: true,
launchReport: true,
metadata: {
"App Version":"0.3.2",
"Test Environment": "STAGING",
"Browser": "Chrome 54.0.2840.98",
"Platform": "Windows 10",
"Parallel": "Scenarios",
"Executed": "Remote"
}
};
reporter.generate(options);
}
};
Execute the above config file, Test executed successfully but while report generation the below error is displays. I have tried various options which is available in various forum but the below is not resolved. Please let me know how to solve this issue
Error:
1 spec, 0 failures
Finished in 11.412 seconds
Finished suite
Unable to parse cucumberjs output into json: 'G:/Protractor/ZPlatform_Script/protractor-reports/cucumber_report.json'
{ Error: G:/Protractor/ZPlatform_Script/protractor-reports/cucumber_report.json: ENOENT: no such file or directory, open 'G:\Protractor\ZPlatform_Script\protractor-reports\cucumber_r
eport.json'
at Object.fs.openSync (fs.js:653:18)
at Object.fs.readFileSync (fs.js:554:33)
at Object.readFileSync (C:\Users\zafin\AppData\Roaming\npm\node_modules\cucumber-html-reporter\node_modules\jsonfile\index.js:67:22)
at isValidJsonFile (C:\Users\zafin\AppData\Roaming\npm\node_modules\cucumber-html-reporter\lib\reporter.js:404:48)
at Object.generate (C:\Users\zafin\AppData\Roaming\npm\node_modules\cucumber-html-reporter\lib\reporter.js:426:9)
at Object.generateReport [as generate] (C:\Users\zafin\AppData\Roaming\npm\node_modules\cucumber-html-reporter\index.js:30:21)
at onComplete (G:\Protractor\ZPlatform_Script\config.js:37:14)
at C:\Users\zafin\AppData\Roaming\npm\node_modules\protractor\built\frameworks\jasmine.js:115:27
at module.exports.jasmineDone (C:\Users\zafin\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine\lib\reporters\completion_reporter.js:15:5)
at dispatch (C:\Users\zafin\AppData\Roaming\npm\node_modules\protractor\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:4366:28)
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'G:\Protractor\ZPlatform_Script\protractor-reports\cucumber_report.json' }
[16:26:04] I/launcher - 0 instance(s) of WebDriver still running
[16:26:04] I/launcher - chrome #1 passed
The text was updated successfully, but these errors were encountered: