Screenshot path does not corresponds to the spec path
See original GitHub issueCurrent behavior
I have two spec files, each contains a simple test case where I take a screenshot with cy.screenshot()
. Both screenshots will be saved directly under scressnshots
directory.
Desired behavior
Screenshot from cypress/e2e/deep/deep-example.cy.js
to be saved under cypress/screenshots/deep/deep example --passes.png
Test code to reproduce
https://github.com/odai-alali/cypress-screenshot-issue
Cypress Version
10.0.3
Other
No response
Issue Analytics
- State:
- Created a year ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
File path not getting set using 'save_screenshot' for python ...
I am using python selenium to get a screenshot of test, but in ubuntu the saved screenshot is taking the path name as...
Read more >screenshot - Cypress Documentation
Screenshots are saved inside the screenshots folder. Inside that folder, the screenshot is saved inside a folder structure relative to the path of...
Read more >How to change your screenshot save location in Windows 10 ...
Now select the Location tab from the Screenshot Properties. You can enter the new path where you'd like your images to be saved....
Read more >How to Add Screenshot Testing with Cypress to Your Project
The tests will pass and 5 images will be created under the /snapshots/screenshot.spec.js folder. Test Runner option. Using npm run cypress open ...
Read more >.takeScreenshot() | TestController | Test API | API | Docs
The screenshot file's relative path and name. The path is relative to the root directory specified in the runner.screenshots API method or the...
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
Hello, I understand the idea to get rid of the ancestry folders. But it comes with a big disadvantage, that you can’t be sure the screenshots are in the same place. It depends on which e2e tests you are executing. You can run ALL tests but also only ONE specific test. The directory for the generated files can be different then. This is annoying, especially when you want to test with visual regression and compare snapshots. I will try the ‘after:screenshot’ solution, but I would prefer a configuration to KEEP the directory structure that is defined in the specs directory.
Hi, thanks for reporting this. I believe this is an unavoidable side effect of the change in Cypress 10 from setting an
integrationFolder
for specs to setting aspecPattern
. From the changelog for 10.0.0: