[mochawesome] Error: Unable to save mochawesome-reports/mochawesome.html
See original GitHub issueHi
I am not able to get the json/html reports in the reports folder.
I run the tests using this command:
mocha test --reporter mochawesome (all my tests are inside the "test" folder)
And, I get this error:
[mochawesome] Error: Unable to save mochawesome-reports/mochawesome.json Error: ENOENT: no such file or directory, open ‘mochawesome-reports/mochawesome.json’ [mochawesome] Error: Unable to save mochawesome-reports/mochawesome.html Error: ENOENT: no such file or directory, open ‘mochawesome-reports/mochawesome.html’ [mochawesome] Report saved to mochawesome-reports/mochawesome.html
And the mochawesome-reports contains:
tree mochawesome-reports/
mochawesome-reports/
|-- css
| |-- mochawesome-64.css
| `-- mochawesome.css
|-- fonts
| |-- mochawesome.eot
| |-- mochawesome.svg
| |-- mochawesome.ttf
| |-- mochawesome.woff
| |-- Roboto+Condensed_300_normal.ttf
| |-- Roboto+Condensed_300_normal.woff
| |-- Roboto+Condensed_400_normal.svg
| |-- Roboto+Condensed_400_normal.ttf
| |-- Roboto+Condensed_400_normal.woff
| |-- Roboto+Condensed_700_normal.ttf
| |-- Roboto+Condensed_700_normal.woff
| |-- Roboto+Slab_400_normal.svg
| |-- Roboto+Slab_400_normal.ttf
| `-- Roboto+Slab_400_normal.woff
`-- js
|-- mochawesome.js
`-- vendor.js
3 directories, 18 files
How can i get this working?
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Name of the mochawesome report is not saving as expected ...
when I ran my tests, the reports are generated with name 'sample.html' which is expected as I have defined my report title as...
Read more >mochawesome - npm
Start using mochawesome in your project by running `npm i mochawesome`. ... html, boolean, true, Save the HTML output for the test run....
Read more >Using Mochawesome Reporter with Cypress
Mochawesome reporter is a custom reporter which generates a standalone HTML/CSS report to help visualize your test runs.
Read more >mochawesome/general - Gitter
Hi , I am trying mochawesome and it is overwriting the json and html file . ... I am getting this error -...
Read more >How to use the mochawesome-report-generator.create ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
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
@codeSasquatch Thanks for the test code. I was able to use it to debug. The issue actually lies in how selenium-webdriver is wrapping the test function. They don’t seem to properly handle pending tests.
If you replace
with
everything will work properly and your test will still be labeled as pending.
@ramyaa Thanks for the sample. It fails for you because you are changing the working directory during the test. The initial reporter directory and files are created/copied before the tests begin to run so when that happens the working directory is
sample/
. After your tests run, the working directory has changed toprivate/var/folders/...
and so the reporter cannot find thesample/mochawesome-reports
directory and nothing is saved.If you need to change the working directory inside your tests, make sure you change them back in the
after()
method and it should work.