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(selector, content) incorrectly parses arguments when content regexp #801

Closed
dwelle opened this issue Oct 24, 2017 · 4 comments
Closed
Labels
good first issue Good for newcomers pkg/driver This is due to an issue in the packages/driver directory type: bug
Milestone

Comments

@dwelle
Copy link

dwelle commented Oct 24, 2017

  • Cypress Version: 1.0.2
  • Browser Version: CH 61

Is this a Feature or Bug?

bug

Current behavior:

cy.contains( selector, content ) regards selector as content, when content is regexp.

Desired behavior:

Should query selector and find content within it.

How to reproduce/Test code:

<div class="someClass">
    <div>Confirm</div>
</div>
cy.contains( ".someClass", /confirm/i );

image

Works as intended when content is supplied as string, and not regex:

cy.contains( ".someClass", "Confirm" );
@dwelle dwelle changed the title cy.contains( selector, content ) incorrectly parses arguments when content regexp cy.contains(selector, content) incorrectly parses arguments when content regexp Oct 24, 2017
@brian-mann
Copy link
Member

Good find. Should be a 2 liner + a single test to fix

@jennifer-shehane jennifer-shehane added good first issue Good for newcomers pkg/driver This is due to an issue in the packages/driver directory labels Oct 24, 2017
@jennifer-shehane
Copy link
Member

@brian-mann
Copy link
Member

Fixed by #848.

@brian-mann
Copy link
Member

Released in 1.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pkg/driver This is due to an issue in the packages/driver directory type: bug
Projects
None yet
Development

No branches or pull requests

3 participants