-
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
Cypress is confusing cy.clear() with cy.click() #26152
Comments
Hi. Thanks for the bug report - I agree, we should improve this error messaging. I wonder if If you are interested in making a PR to fix this, let me know and I can point you in the right direction. |
It's a pleasure. I wonder if |
Sure! All the code relating to the It looks like $errUtils.throwErrByPath('click.multiple_elements', {
args: { cmd: eventName, num: options.$el.length },
}) As long as you are using To develop this, I think you would just add a test case in the relevant test. If you need a specific scenario, you would just create it using HTML and put it in As for actually coding this, the way I usually develop is grab the repo, Alternatively, if your machine struggles with all those processes, I think you can do:
This will only watch the driver and runner files, which should be more lightweight and faster. Let me know if you need any other pointers! |
Thanks! I'll get going and try to reproduce the error. I'll let you know if there's an issue. |
Current behavior
I've selected a few input fields and told cypress to clear all of them using the
multiple: true
flag but cypress fails to clear them while sayingcy.click() can only be called on a single element. Your subject contained 34 elements. Pass { multiple: true }
.Desired behavior
In this situation, cypress should display the correct error and mention the method that's actually used - the cy.clear() method, instead, it's mentioning
cy.click()
and asking me to pass themultiple: true
flag, which is already there.Test code to reproduce
It's a simple form with about 32 fields, here's the failing code:
Cypress Version
12.8.1
Node version
16.19.0
Operating System
Elementary OS 7
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: