cy.get fails once in a while with "expected undefined to be enabled"
See original GitHub issueAfter upgrading to 6.0.1
tests that weren’t flaky became flaky and I believe it’s not an issue with our code.
Current behavior
Desired behavior
If an element is not found I expect Cypress to fail as it normally does when it cannot find an element. (“Timed out retrying: Expected to find element: input[name=email], but never found it.”) And if an element is found it expect it not to fail 8)
Versions
Cypress 6.x
(6.0.0
exhibited the same issue)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:22 (2 by maintainers)
Top Results From Across the Web
Error Messages | Cypress Documentation
Getting this error means you've tried to interact with a "dead" DOM element - meaning the current subject has been removed from the...
Read more >Retry-ability - Cypress Documentation
To learn how to enable Cypress' test retries functionality, which retries tests that fail, check out our official guide on Test Retries.
Read more >Assertions | Cypress Documentation
These chainers are available when asserting about a DOM object. You will commonly use these chainers after using DOM commands like: cy.get() ,...
Read more >should | Cypress Documentation
Assertions are automatically retried until they pass or time out. ... cy.get('.error').should('be.empty') // Assert that '.error' is empty ...
Read more >task | Cypress Documentation
The command will fail if undefined is returned or if the promise is resolved ... You can increase the time allowed to execute...
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
This’s comeback in Cypress 7x (I checked on
7.0.0
and7.0.1
):It marks test as flaky, because it passes the second time.
This has been happening intermittently for me for quite a while, always very early in my tests. Forcing a
cy.wait(10 * 1000)
after loading the webapp doesn’t help (I thought it might be related to the webapp taking too long to load).I don’t believe it’s related to
cy.intercept
- though I recently added this, it was happening long before this addition to my tests.Currently on Cypress v9.6.1.