Closed mariostephan closed 2 years ago
Duplicate issue, when I tried with Cypress v10 it worked as expected. Please refer to: https://github.com/LironEr/cypress-mochawesome-reporter/issues/85#issuecomment-1179748126
I can not confirm that. Same issue with Cypress v10.6.0 for me.
Same issue here
Environment
What happened?
The path for the embedded snapshots seems to be wrong:
C:\screenshotsFolder\C:\full\path\to\snapshots...>
This leads to the error:
Error: ENOENT: no such file or directory, open 'C:\Users\stephanm\Projects\ConfigEditor\E2E\screenshots\C:\Users\stephanm\Projects\ConfigEditor\E2E\snapshots\process-flow\story273618\tc289099.spec.js__diff_output__\289099 [SUTC] Template visualization - SaveResetCancel -- 289099 [SUTC] Template visualization - SaveResetCancel (failed).diff.png'
I guess the path.join(screenshotsDir, imagePath); in enhanceReport.js convertImageToBase64() is wrong/ unnessary
This wrong joinment of the path doesn't matter if the screenshotsDir and the starting of the imagePath are equal, like it is for normal screenshots. But for snapshots, where the paths are different, it fails.
Config file
Relevant log output
Anything else?
the same error happens also on the server CI
If I remove the path.join then Snapshots work fine and are embedded
But then Screenshots doesn't work due to the normalized screenshot path in register.js
const normalizedScreenshotPath = details.path.replace(screenshotsFolder, '');
It only works for me if I remove the replacement of the screenshotFolder in register.js and the path.join in enhanceReport.js