Cypress + Reporter Plugin in nested projects. Could not load reporter by name: reporter
See original GitHub issueCurrent 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:
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:
- Created 4 years ago
- Reactions:22
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Setting the relative path to mochawesome.js worked fine for me:
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.