-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
contains
doesn't work with a selector that contains a comma
#2407
Comments
So what happens under the hood when you pass in a 'selector' to The current implementation of |
Thanks for the explanation! That makes sense. We're still considering it a bug, yes? |
We will have to decide whether we want to change the implementation to support this. |
Supporting this would be very useful to me, because it handles the very common case where the test author sees a link, but it's actually implemented as a link-colored button due to cy.contains('a,button.btn-link', 'Click Me').click() It's not the end of the world for the test author to inspect the element, but if I want to write a cucumber step such as If you don't change the implementation, then my vote would be to fail the step if the selector contains a (There are other cases such as |
We can probably just @jennifer-shehane maybe you can take a shot at it and submit a PR |
The code for this is done in cypress-io/cypress#4077, but has yet to be released. |
Thank you @jennifer-shehane and @brian-mann for prioritizing a fix for this issue; it'll simplify my test cases significantly. |
Released in |
Current behavior:
I expect the second line to have equivalent behaviour to the first:
Instead, it finds the first
a
and ignores the value. It appears the,
is causing issues.I'm very new to Cypress, so perhaps this expectation is unfounded.
Versions
3.1.0, Chrome 68, Ubuntu 18
The text was updated successfully, but these errors were encountered: