Skip to content
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

Question : Does mochawesome .json not come for parallel runs facing issue , getting an issue in after events (facing this issue in 0.11.0) #153

Open
Infurnia-Nitin-Upadhyaya opened this issue Jan 4, 2023 · 3 comments

Comments

@Infurnia-Nitin-Upadhyaya

No description provided.

@bdimitrovski
Copy link

Same here, getting:

An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: Pattern /Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/cypress/reports/html/.jsons/*.json matched no report files
    at /Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/mochawesome-merge/lib/index.js:14:11
    at Array.map (<anonymous>)
    at /Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/mochawesome-merge/lib/utils.js:3:46
    at merge (/Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/mochawesome-merge/lib/index.js:82:17)
    at mergeAndCreate (/Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/cypress-mochawesome-reporter/lib/generateReport.js:12:24)
    at generateReport (/Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/cypress-mochawesome-reporter/lib/generateReport.js:56:20)
    at afterRunHook (/Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/cypress-mochawesome-reporter/lib/index.js:35:9)
    at Object.handler (/Users/bojandimitrovski/Projects/top/top-web/scripts/tests/cypress/node_modules/cypress-mochawesome-reporter/plugin.js:9:11)
    at invoke (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:183:18)
    at /Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:59:14
    at tryCatcher (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/method.js:39:29)
    at Object.wrapChildPromise (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:58:23)
    at RunPlugins.execute (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:164:21)
    at EventEmitter.<anonymous> (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:56:12)
    at EventEmitter.emit (node:events:527:28)
    at EventEmitter.emit (node:domain:475:12)
    at process.<anonymous> (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:33:22)
    at process.emit (node:events:527:28)
    at process.emit (node:domain:475:12)
    at process.emit.sharedData.processEmitHook.installedValue [as emit] (/Users/bojandimitrovski/Library/Caches/Cypress/12.9.0/Cypress.app/Contents/Resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
    at emit (node:internal/child_process:938:14)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

whenever I want to run test in parallel, configured my script in package.json like:

"tests:parallel": "cypress-parallel -s test -m false -t 2 -d 'cypress/e2e/*.spec.ts'"

@alanschiobairesdev
Copy link

still an issue, happening to me also

@IgorHorta
Copy link

seems like my 'cypress-mochawesome-reporter' was causing some conflicts issues .. with their default "cypress-multi-reporters"

this in cypress.config.ts

fixed for me:

setupNodeEvents(on, config) {
      // eslint-disable-next-line @typescript-eslint/no-var-requires
      if (config?.reporter === 'cypress-mochawesome-reporter') {
        // eslint-disable-next-line @typescript-eslint/no-var-requires
        require('cypress-mochawesome-reporter/plugin')(on)
      }
    },

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

4 participants