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
Unrecognized expression for regex that ends with /=\s+[0-6]/
#21108
Comments
I tested with the code below. <div>a=2</div>
<div>a</div>
<div>b</div>
<div>5 - 6 = 6</div> it('t', () => {
cy.visit('fixtures/a.html')
cy.contains(/=[0-6]/).should('have.text', 'a=2')
cy.contains(/[56]\s+-\s+[0-6]\s+=\s+[0-6]/)
}) It's working when there is text to find with But when there is no element with |
At first, I thought the bug was about The problem is a bit hard to fix because |
The code for this is done in cypress-io/cypress#21388, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
I have a
cy.contains()
call with the following:And it fails with:
It looks like there are extra single quotes? I'm not sure. The minimal code that throws the same error is:
Desired behavior
Should not throw Error "Syntax error, unrecognized expression".
Test code to reproduce
https://github.com/asartalo/cypress-test-cy-contains-fail
Cypress Version
9.5.4
Other
No response
The text was updated successfully, but these errors were encountered: