-
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
cy.get fails once in a while with "expected undefined to be enabled" #9404
Comments
I also experience this issue randomally accross my tests, happened in previous cypress versions when I've enabled route2, now this is enabled by default and I cannot use cypress (v6) |
What's the last version you used where this was working correctly? It likely has something to do with the timing of the app where the input disappears after it's queried. We'd need a reproducible example to investigate it fully though. Can either of you provide a reproducible example? Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
I checked with |
I can no longer reproduce this with |
I see this with version 8.3.0.
This happens when the initial pageload (first paint) is slow |
Does anyone have some pointers on how I can provide the required information that you need in order to look into this? |
We are using Cypress 8.3.1. Last week, we migrated from routes to intercepts and began seeing this issue. Like the others mentioned above, reproducing it has been difficult. |
Is there anything worth enabling in the debug logs? We're seeing it regularly in our CI pipeline, but I cannot reproduce it locally - even when running the test in a loop 50 times. |
Does cypress "hang onto" or keep a record of anything relating to a cy.get()? I'm imagining something like a record of what's already been found in the DOM via a cy.get('.mySelector') so that actions like "type", "click" etc. can be run on the same selector at different points within an Could there be a scenario between cy.visits()'s, where Cypress retains knowledge of a selector for a brief moment, allowing cy.get('.mySelector') to think that the selector was found, but by the time actions like "type" or "click" are attempted, it is gone? Possible Scenario:
|
@jrchongo what you are describing is exactly what I was thinking and is also the scenario we see. In our case
|
Any update on this issue or work around. This is a pain!! |
I also saw this issue happens randomly in 9.5.0
as a quick fix I used Test Retries functionality |
This issue still happens to me in 9.6.0. I have a loading spinner on page, that appears and disappears as stuff loads on screen, so I wait for the spinner to appear and then disappear, and when waiting for it to disappear the 'undefined' problem occurs.
Interesting enough, it does NOT reach the 'undefined' straight away, but waits a bit before reaching the 'undefined' log message Waiting for the element to be visible, working 100% correct all the time Waiting for the element to disappear, it processes for 1-2 seconds And then this is the result while waiting for the element to disappear |
This also happened a lot to us recently after we added some global We now removed this intercept and since then no fails anymore 🤔 🤷♂️ |
This has been happening intermittently for me for quite a while, always very early in my tests. Forcing a I don't believe it's related to Currently on Cypress v9.6.1. |
We have the same kind of issues here. We tried all Cypress 10.2, 10.4 & 10.5 |
This keeps happening to me after updating to 10.X from 8.X and its driving me absolutely nuts! This: Returns this: |
I get this error message, occasionally, when a previous step or command in the test failed. For me, the solution is not to solve the failing step. Instead, the solution is to identify any other steps failing prior to the one throwing this error message For example, look for the first step highlighted in red in the spec: That might be the culprit. |
This should be resolved in Cypress 12 - see #24628 for the big refactor of how subjects are determined and commands chain together / retry. Sorry it took us so long to get to this - this is pretty fundamental to how Cypress executes commands, retries things, and chains subjects together. #7306 has a ton of discussion around the subject (and around how Cy12 is going to solve it), so I'm going to refer people there and close this one, just to keep things a bit more centralized. |
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
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)The text was updated successfully, but these errors were encountered: