LironEr / cypress-mochawesome-reporter

Zero config Mochawesome reporter for Cypress with screenshots and videos
MIT License
158 stars 49 forks source link

Bug: Report is failing to get generated if the the test is passed on retry #152

Closed sarojsarab closed 11 months ago

sarojsarab commented 1 year ago

Environment

- OS:   Ubuntu 22.04.2 LTS 
- Node: 16.14.0
- cypress-mochawesome-reporter: ^3.5.1
- cypress: 12.16.0

What happened?

Enhance report fails with below error

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

The error we received was:

Error: ENOENT: no such file or directory, open /home/runner/work/appsmith/appsmith/app/client/cypress/screenshots/home/runner/work/appsmith/appsmith/app/client/cypress/snapshots/Regression/ClientSide/VisualTests/AppPageLayout_spec.js/apppage.snap.png'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at convertImageToBase64 (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:150:52)
    at /home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:133:13
    at Array.map (<anonymous>:null:null)
    at createScreenshotsContextList (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:124:22)
    at attachMediaToTestContext (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:77:9)
    at /home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:35:24
    at Array.forEach (<anonymous>:null:null)
    at /home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:33:19
    at Array.forEach (<anonymous>:null:null)
    at attachMediaToSuiteTestsContext (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:32:12)
    at /home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:17:7
    at Array.forEach (<anonymous>:null:null)
    at enhanceReport (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/enhanceReport.js:8:18)
    at mergeAndCreate (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/generateReport.js:19:3)
    at Function.all (<anonymous>:null:null)
    at generateReport (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/generateReport.js:64:22)
    at afterRunHook (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/lib/index.js:35:3)
    at Object.handler (/home/runner/work/appsmith/appsmith/app/client/node_modules/cypress-mochawesome-reporter/plugin.js:9:5)

Config file

NA

Relevant log output

No response

Anything else?

No response

LironEr commented 1 year ago

Please create a repo with the problem and steps to reproduce the issue so I can have a look.

Thanks.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.