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

Typings for cy.contains do not support includeShadowDom #17066

Closed
ashblox opened this issue Jun 22, 2021 · 4 comments · Fixed by #17080
Closed

Typings for cy.contains do not support includeShadowDom #17066

ashblox opened this issue Jun 22, 2021 · 4 comments · Fixed by #17080

Comments

@ashblox
Copy link

ashblox commented Jun 22, 2021

Current behavior

I'm using Cypress with Typescript and while I can pass options to cy.get() with includeShadowDom: true, I cannot do so with cy.contains(). It appears the typings differ, where cy.get() allows a Partial<Cypress.Shadow> and cy.contains() does not. I have tried this using both Cypress v 6.8.0 and v 7.3.0.

Screenshot 1 (Works with cy.get()):

cy-get works

Screenshot 2 (Doesn't work with cy.contains()):

cy-contain doesnt work

Desired behavior

I should be able to pass the includeShadowDom argument to cy.contains(). My current workaround is to enable includeShadowDom in the cypress.json but of course that enables it globally.

Test code to reproduce

Example repo: https://github.com/ashblox/cypress-issue

This is the file with the issue.

Versions

Confirmed this does not work with 7.5.0 either.

@jennifer-shehane
Copy link
Member

Yes, this option is not included on the types but should be.

Screen Shot 2021-06-23 at 10 06 14 AM

Screen Shot 2021-06-23 at 10 06 21 AM

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 24, 2021

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

@ashblox
Copy link
Author

ashblox commented Jun 24, 2021

Much appreciated. Thank you!

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 7, 2021

Released in 7.7.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants