question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress + Reporter Plugin in nested projects. Could not load reporter by name: reporter

See original GitHub issue

Current behavior:

Based on the project: https://github.com/cypress-io/cypress-test-nested-projects I’m trying to use a reporter (In these case mochawesome)to generate report logs of my runs in cypress, but it always expected the reporter was installed inside the nested project so cypress never run the tests.

Image with the error that throw: image

Here is a example repo where you can test this behavior: https://github.com/danyfu/cy_mocha_awesome_nested_folders_tests

Desired behavior:

Cypress runs with the desired reporter without the nested level of the project.

Steps to reproduce: (app code and test code)

Execute npm run cy:run:foo

This is what nested project foo/cypress.json has:

{
    "reporter": "mochawesome",
    "reporterOptions": {
        "mochaFile": "cypress/results/results-[hash].xml"
    }
}

Versions

cypress: ^3.3.1 Chrome: Version 74.0.3729.169 (Official Build) (64-bit) OS: MacOS 10.14.5 (Mojave)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:22
  • Comments:7

github_iconTop GitHub Comments

50reactions
mihalcancommented, Oct 3, 2019

Setting the relative path to mochawesome.js worked fine for me:

"reporter": "../../node_modules/mochawesome/src/mochawesome.js",
"reporterOptions": {
    ...
 }`
7reactions
adamtaycommented, Jul 24, 2019

Thanks for sharing @danyfu but this workaround would mean having to rely on a run script and losing the ability to run default cli commands.

Would be great if cypress could also search for node_modules at the project root directory instead of just looking at the nested project directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load reporter by name · Issue #1192 - GitHub
Bug. Current behavior: When specifying any custom reporter (tried with mocha-multi-reporters and mochawesome ) in cypress.
Read more >
Could not load reporter by name: cypress-testrail-reporter
I reverted the cypress-testrail-reporter version to 1.2. 2 which didn't use deasync as a dependency and it seems to work.
Read more >
Reporters | Cypress Documentation
You can load custom Mocha reporters through a relative or absolute path. These can be specified in your Cypress configuration file or via...
Read more >
Using Mochawesome Reporter with Cypress
Generate multiple mocha reports in a single mocha execution. mochawesome. Mochawesome is a custom reporter for use with the Javascript testing ...
Read more >
cypress-io/cypress - Gitter
... start with cypress run it launch automatically with mocha but whe in 'cypress run' it happend this error : Could not load...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found