-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
having issue with json report generation #759
Comments
Try this , await preprocessor.addCucumberPreprocessorPlugin(on, config); const options = { }; on('file:preprocessor', webpackPreprocessor(options)); |
@oguzhantx, you're placing TS in a JS file. Rename it or remove the type annotations. |
@badeball when I remove type annotations, I am not getting any error as mentioned in original post however, json reports are still not being generated. |
@JomyGeo When I update my setupNode Events function with this code, I am getting the below error. |
Well it's impossible to say why given the provided information. Have you enabled it, as per docs? |
yes, json is enabled in package,json file, also I have tried with and without old config in package.json but did not make any difference. one question I have though, do we need to specify any reporter option in cypress.config file when we define cypress configs. Ex: |
Read the docs thoroughly. https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/json-report.md |
all the steps in this doc are already completed and implemented in the cypress framework. no luck |
Given that you tell me your current configuration looks like {
"cypress-cucumber-preprocessor": {
"cucumberJson": {
"generate": true,
"outputFolder": "cypress/reports/cucumber-json",
"filePrefix": "",
"fileSuffix": ".cucumber"
}
}
} .. then you have absolutely not configured JSON reporting according to the docs. Read them again. |
it is not, you should read my previous message again where you got the idea that I still have it. I have mentioned there I just put it back for testing purpose to see if it will change anything. anyways, I was able to get the json report generated by using esbuild but only one json report is being generated for all test files. Is there a way to have individual json files for each feature file? |
I do not see a solution to this issue. by closing this are you saying that you can generate a json report as used to for every individual test files? |
I have been debugging issues with JSON report output in my repo. You may be coming across this issue which is a regression in cypress v10: cypress-io/cypress#22428 |
@oguzhantx Did you ever get this working? I can run my tests but no JSON is emitted.
console.log
|
check this out. https://www.youtube.com/watch?v=FlQ9Carxeds&t=10s |
@oguzhantx Thanks! Your video and project were very helpful - thank you. My reports are all running again. |
@badeball @bartonhammond @oguzhantx Hey was it solved, were you able to generate json reports, I am not able . I am using Cypress 10, and cucumber preprocessor, Have updated this in cypress.config.json async function setupNodeEvents(on, config) { module.exports = defineConfig({ reporterOptions: { and my package.json "dependencies": {} Please any help much appreciated, Cucumber html reports with test content and screenshots for failed cases is required... |
@badeball @surajwaitz I went through the above issue., I am not maintaining different file cypress-cucumber-preprocessor.config.js, All config related i have put in package.json as i have pasted earlier, |
I can clearly see from the above-mentioned |
Thank you @badeball ,ndJson file got generated after moving this json enabled under "cypress-cucumber-preprocessor": { .. } "cypress-cucumber-preprocessor": { Have downloaded the json formatter as per the instructions given and ran to convert cucmber-messages.ndjson to .json file. was converted it to json, But not able to generate the html reports, Using "multiple-cucumber-html-reporter": "^1.21.4", and created to generate html file report.generate({ and when i ran the file, it throws error to generate html report SyntaxError: Unexpected token � in JSON at position 0 the json file converted luks good but not able to generate html report So will the json report not work with multiple-cucumber-html-reporter?? |
@RoopaShivakumar : It seems your json is generating as empty, could you please check it? "cypress-cucumber-preprocessor": { |
Nope.....json was not empty it was fine...it had all the Scenarios...let me attach that.(the ndJson file which got generated and then i ran cucumber-formatter and got the json report)attaching it.. ... But cudnt get html reports from that json report file, Will try updating in json file which you have mentioned |
the json file created by cat .\cypress\cucumber-json\messages.ndjson | .\cucumber-json-formatter.exe >.\cypress\cucumber-json\adptOrig.json might have some character... Tried cat .\cypress\cucumber-json\messages.ndjson | .\cucumber-json-formatter.exe --format=json >.\cypress\cucumber-json\adptOrig.json but gives this error PLease suggest how to specify format option in cucumber-json-formatter.exe which gives a clean json file |
@badeball @surajwaitz Please Any updates on this...can't we have a json file generated instead of generating messages.ndJson and then converting using json formatter to generate json file?? Also will the json files gets generated??in my case its not...in package.json... reporterOptions: { PLease let me know....or what config is missing |
@surajwaitz @badeball ....Able to generate the html report....Had put the cucumber-json-formatter in the PATH and I had cypress mocha report as well so commented mocha report part and JSON reports were generated without manual step... but it shows Invalid date in the Report..... In Mocha report by default the total time taken for the execution is displayed in the report but not in Cucumber report.... but doesnt look like these options show the proper duration Please let know to include...and also the |
Current behavior
Tests run fine however json reports are stopped generating. everything was working fine with cypress version <10 and also cypress-cucumber-preprocessor <10 (before repo migration).
I have completed the steps mentioned here https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/json-report.md installed json-fomatter but still no luck.
e2e. js (support file)
import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor';
export default async (
on: Cypress.PluginEvents,
config: Cypress.PluginConfigOptions
): Promise<Cypress.PluginConfigOptions> => {
await addCucumberPreprocessorPlugin(on, config);
return config;
};
cypress.config.json
async function setupNodeEvents(on, config) {
await preprocessor.addCucumberPreprocessorPlugin(on, config);
When I run tests getting
if I just comment out the e2e.js file or set support file=false in config then tests run fine but no json reports.
Any suggestion is appreciated.
Desired behavior
json reports are generated when test completes running.
Versions
Checklist
cypress-cucumber-preprocessor@4.3.1
(package name has changed and it is no longer the most recent version, see #689).The text was updated successfully, but these errors were encountered: