Skip to content
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

Undefined snapshot on test failure #15816

Closed
bahmutov opened this issue Apr 6, 2021 · 5 comments · Fixed by #16015
Closed

Undefined snapshot on test failure #15816

bahmutov opened this issue Apr 6, 2021 · 5 comments · Fixed by #16015
Labels
type: bug v7.0.0 🐛 Issue present since 7.0.0

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Apr 6, 2021

Testing Cypress v7

Reproduction in https://github.com/bahmutov/cypress-spy

The test fails, but when I hover over the failed command shows our failure

snapshot.mp4

The stack:

Screen Shot 2021-04-06 at 12 34 12 PM

Relevant code:

Screen Shot 2021-04-06 at 12 34 34 PM

Setting the breakpoint:

Screen Shot 2021-04-06 at 12 34 56 PM

@bahmutov bahmutov added type: bug 7.0 Release v7.0.0 🐛 Issue present since 7.0.0 labels Apr 6, 2021
@bahmutov
Copy link
Contributor Author

bahmutov commented Apr 6, 2021

Maybe because the error happens inside cy.on callback?

cy.on('window:before:load', (win) => {
    console.log('win before load')
    Object.defineProperty(win, 'gtag', {
        // configurable: false,
        get: () => gtag,
        set: () => { },
    })
})
cy.visit('/index.html')

@bahmutov
Copy link
Contributor Author

bahmutov commented Apr 6, 2021

Using v6.8.0 - no problem

Screen Shot 2021-04-06 at 3 53 18 PM

@github-actions
Copy link
Contributor

Internal Jira issue: TR-762

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 15, 2021

The code for this is done in cypress-io/cypress#16015, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 26, 2021

Released in 7.2.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v7.2.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug v7.0.0 🐛 Issue present since 7.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants