Skip to content

There is not enough documentation on how to generate and combine reports with multireporters #168

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

Open
turturmurmur opened this issue May 22, 2023 · 3 comments

Comments

@turturmurmur
Copy link

This seems like a very good plugin, however, the documentation is barely there if I am being honest. After you do the configuration and run the specs parallel what do we do with the reports. What do we need to do if we already have a reporter? Do we need to use cypress-multi-reporters, or do I need to use mochawesome marge or something else? I understand you've done some good work but without us being able to use how you expect people to use it. I asked a couple more devs and they were saying the same. We don't expect dev-level documentation for a qa library but I need to be sherlock holmes to figure this out. Very frustrated. Please do document and explain how your plugin can be used with other plugins if your plugin requires direct dependency on others(reporters in this example) @tnicola

@peacetrader
Copy link

Hi, I am using cypress-parallel for parallel execution with cypress-cucumber-preprocessor and multiple-cucumber-html-report. I am able to generate cucumber report after each execution and finally multiple-cucumber-html-report plugin will combine the JSON reports and create an index.html file.

@patoski123
Copy link

patoski123 commented Dec 9, 2024

@peacetrader Please can kindly share your set up code snippet on how you implemented this. because i am struggling to this to work. i have below in my package.json

`

"cy:run": "cypress run --headless --browser chrome --reporter json --reporter-options output=.run/reports/json/cucumber-report.json",
"test:parallel": "cypress-parallel -s cy:run -d cypress/features -t 3 --verbose",
"test:parallel-with-report": "npm run test:parallel && npm run generate-test-report",
"generate-test-report": "node generate-consolidated-html-report.js",
  "cypress-cucumber-preprocessor": {
"json": {
  "enabled": true,
  "generate": true,
  "outputFolder": ".run/reports/json",
  "filePrefix": "",
  "filterSpecs": true,
  "omitFiltered": true,
  "fileSuffix": ".cucumber",
  "formatter": ".bin/cucumber-json-formatter",
  "output": ".run/reports/json/cucumber-report.json"
},
"stepDefinitions": "cypress/src/stepDefinitions/**/*.{js,ts}"

}`

and i have this in my cypress.config.ts file

`async setupNodeEvents(on, config) {
// Add Cucumber Preprocessor Plugin
await addCucumberPreprocessorPlugin(on, config);

  // Set up file preprocessor with esbuild
  on(
    'file:preprocessor',
    createBundler({
      plugins: [createEsbuildPlugin(config)],
    }),
  );

  // After run handler to write test results
  on('after:run', async (results) => {
    if (results) {
      await afterRunHandler(config);
      writeFileSync('.run/results.json', JSON.stringify(results));
    }
  });

  return config;
},
// Use your original specPattern
specPattern: ['cypress/features/**/*.feature'],

},`

@patoski123
Copy link

patoski123 commented Dec 9, 2024

I have followed all the script command in doc to override and use my own 'reporter' but it is still using the 'cypress-multi-reporter' and the configFile.

> cypress run --headless --browser chrome --reporter json --reporter-options output=.run/reports/json/cucumber-report.json --spec cypress/features/e2eTests/login.feature,cypress/features/e2eTests/report.feature --reporter cypress-multi-reporters --reporter-options configFile=/Users/patricko/Documents/cypress-ts-project/multi-reporter-config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants