question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cy.get fails once in a while with "expected undefined to be enabled"

See original GitHub issue

After 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

Screen Shot 2020-12-01 at 6 33 46 PM

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:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:22 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
bukharovcommented, Apr 8, 2021

This’s comeback in Cypress 7x (I checked on 7.0.0 and 7.0.1):

Screen Shot 2021-04-08 at 4 23 34 PM

It marks test as flaky, because it passes the second time.

1reaction
rlyttlecommented, May 21, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found