-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screenshot/video is not creating folder structure from tests #24052
Comments
Can confirm that I ran into the same problem. The path of the screenshot will be the correct But if I run cypress with a more targeted config with in 'after:screenshot' I have And if I run cypress in dev mode with the GUI, I chose the 'button.component.spec.ts' file, I get Didn't have this problem in 9.7.0, but I do now in 10.10.0 |
This was a fantastic feature in Cypress 9. I hope it can be fixed soon. |
We are running into the same sort of problems when we try to collect all screenshots in the Besides that, we've also noticed that the video of a failed test is stored in a different directory than the screenshots of the failed test. In our opinion it would be best to store screenshots and videos in the same directory structure as is defined for the test files itself (as suggested by the original poster). |
Any update on this? |
Still no update or fix? I am also having issue with this bug |
This was an intentional change in Cypress 10.0.0 - see Migration Guide - Generated Files. That being said, I will surface to the team that the original behavior is preferred. This won't guarantee this behavior will change. |
Example {
testAttemptIndex: 0,
size: 319081,
takenAt: '2023-03-15T20:03:35.940Z',
dimensions: { width: 1000, height: 4913 },
multipart: true,
pixelRatio: 1,
specName: '',
path: '/Users/marknoonan/Sites/examples/cy-validators-example/cypress/screenshots/the homepage -- renders error if a query param is passed.png',
scaled: false,
blackout: [],
duration: 1713
} test code: it('renders error if a query param is passed', () => {
cy.visit('https://example.cypress.io')
cy.screenshot()
}) cypress.config.js const { defineConfig } = require("cypress");
module.exports = defineConfig({
'e2e': {
setupNodeEvents(on) {
on('after:screenshot', (details) => {
console.log(details)
})
}
}); |
@GoushiRam provided an in-test workaround to this issue and the bug with the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@erikmom said:
I agree, I have the same problem in #18543. |
Any update regarding the issue? |
@s0me0nelv No updates on this issue, sorry. |
Current behavior
When we have a test folder structure like this:
And screenshots are taken within the above tests, we get screenshots added the following way:
Desired behavior
How it used to work and how all visual regression tools need it to work:
And screenshots are taken within the above tests, we get screenshots added the following way:
If it's too much work to fix the above, can you please include
specName
back to the after:screenshot details object?Cypress 9.x
after:screenshot
details object:Cypress 10.x
after:screenshot
details object:Test code to reproduce
Just take any screenshot within a folder structure above to replicate...
Cypress Version
10.x
Node version
16.x
Operating System
mac
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: