Screenshot path is different when running headless and open
See original GitHub issueCurrent behavior
While using cypress-image-snapshot I noticed that, since Cypress v10, the path where screenshots (or snapshots in this case) are saved differs when Cypress is run in headless and open modes. I only noticed this issue when having features organised inside folders. So, imagine I have this structure for my tests:
- cypress
- e2e
- testFolder1
- testFeature1.cy.feature
- testFolder2
- testFeature2.cy.feature
Now, if I run testFeature1 in open mode, snapshot is saved at cypress/snapshots/testFeature1.png, but when I ran headless mode, the snapshot is saved at cypress/snapshots/testFolder1/testFeature1.cy.feature/testFeature1.png .
An issue is open an cypress-image-snapshot board, but it looks like this is the expected behaviour?
Desired behavior
Screenshots should be stored in the same folder, no matter if it’s launched in open or headless mode.
Test code to reproduce
Simply execute:
cy.matchImageSnapshot(snapshot);
Cypress Version
10.2.0
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hi @baronvonbirra, you’re correct that as of Cypress 10 and the switch from
testFiles
tospecPattern
this is currently expected. You’re not the first person to mention this change is confusing so I’m going to keep this issue open as a feature request – or possibly convert it to a GH discussion.@nagash77 @marktnoonan Can you suggest any workaround for now? Our internal test reports were broken as screenshots and videos are not loading.