-
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
Succeeds finding a button but says it's not visible #21288
Comments
For debugging visibility problems, I suggest watching first https://www.youtube.com/watch?v=nSmHxxwceDU |
Ha, I see, thanks for your answer. So, if I understand correctly, |
Aaaaaaah, that explains a lot. Thank you |
Sorry but I have to reopen this issue. This time, no The button is found as existing in the DOM, but not visible. I have tried Code :
HTML code of the button as rendered in the DOM (Angular) :
The images were resized down and are difficult to read, here are the original ones : |
... and another example. Next test, trying to check a checkbox, "This element is not visible" although it clearly is. Tesed with and without Cypress code :
This is what the view looks like in the browser, when it's not being scrolled down by Cypress : Same behaviour when picking Chrome, Firefox or Edge. |
So looking at the error message it's generating more closely, it says that a parent element ( This rule may not be correct - not saying there isn't a bug, just that Cypress' visibility checks are fairly complicated, and the error message tries to explain why it thinks it's not visible. I understand you can't release the full app, but without a reproducible example, it's hard to figure out exactly what's going on. Can you create a minimal example which shows it that you can share, such as via https://github.com/cypress-io/cypress-test-tiny? |
Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please open a new issue with a reproducible example and link to this issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
Current behavior
Cypress finds the button I want to click. It is visible on the snapshot and highlighted when hovering the corresponding line of test in the left part.
However, it says "This element is not visible" despite it being really visible and even highlighted by Cypress.
The next step, .click(), times out.
Desired behavior
Cypress should see a button or any other element which is unquestionably visible
Test code to reproduce
Unfortunately I can't provide a test URL or the full code to reproduce, because the app is under development and not yet released. But whatever the code is, the button is visible and clickable, both in the browser and in the Cypress snapshot.
Basically the two problematic lines of code are :
Cypress Version
9.5.0
Other
I had opened a similar issue abour a year ago, with all the material I could find to troubleshoot it, which was never addressed and apparently diappeared. Back then, Cypress failed to see checkboxes, despite them totally being present and visible on the snapshot. This made me abandon working with Cypress. I'm giving it another go, and again I'm getting the same problem with a button.
The text was updated successfully, but these errors were encountered: