Skip to content
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.contains does not find the input[type='submit'] by value when using RegExp #21166

Closed
cyberxander90 opened this issue Apr 21, 2022 · 2 comments · Fixed by #21285
Closed

cy.contains does not find the input[type='submit'] by value when using RegExp #21166

cyberxander90 opened this issue Apr 21, 2022 · 2 comments · Fixed by #21285
Labels
pkg/driver This is due to an issue in the packages/driver directory Reproducible Can be reproduced

Comments

@cyberxander90
Copy link

cyberxander90 commented Apr 21, 2022

Current behavior

<form>
    <input type="submit" value="Save Changes" />
</form>
cy.contains('Save Changes') // OK. yields input[type='submit'] element
cy.contains(/Save Changes/) // ERROR. Expected to find content: '/Save Changes/' but never did.

Fails with this error
image

Desired behavior

Expect cy.contains with a RegExp works as with String when looking at input[type="submit"]

Test code to reproduce

Repo with reproduction https://github.com/cyberxander90/cypress-test-tiny/tree/contains-problem

Cypress Version

9.5.4

Other

No response

@davidmunechika davidmunechika added pkg/driver This is due to an issue in the packages/driver directory Reproducible Can be reproduced labels Apr 22, 2022
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: product review and removed stage: backlog stage: needs review The PR code is done & tested, needs review labels May 2, 2022
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: product review labels Jul 11, 2022
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jul 18, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 18, 2022

The code for this is done in cypress-io/cypress#21285, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 19, 2022

Released in 10.3.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.3.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pkg/driver This is due to an issue in the packages/driver directory Reproducible Can be reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants