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

Error when calling .shadow() on element without shadow root needs improvement #8530

Closed
chrisbreiding opened this issue Sep 9, 2020 · 2 comments · Fixed by #8538
Closed
Assignees

Comments

@chrisbreiding
Copy link
Contributor

chrisbreiding commented Sep 9, 2020

Current behavior:

If you call .shadow() on an element that doesn't have a shadow root, it fails with the following:

Timed out retrying: Expected to find element: undefined, but never found it.

Screen Shot 2020-09-09 at 9 36 53 AM

Desired behavior:

The error should make it clear the subject for .shadow() needs to be a shadow root host.

Test code to reproduce

test.html

<html>
<body>
  <div>Lorem ipsum...</div>
</body>
</body>

spec.js

cy.visit('test.html')
cy.get('div').shadow()

Versions

Cypress 4.8.0+

@chrisbreiding chrisbreiding self-assigned this Sep 9, 2020
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review and removed stage: work in progress There is an open PR for this issue [WIP] labels Sep 9, 2020
@cypress-bot cypress-bot bot added stage: pending release There is a closed PR for this issue and removed stage: needs review The PR code is done & tested, needs review labels Sep 10, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Sep 10, 2020

The code for this is done in cypress-io/cypress#8538, 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 Sep 15, 2020

Released in 5.2.0.

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

@cypress-bot cypress-bot bot removed the stage: pending release There is a closed PR for this issue label Sep 15, 2020
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Sep 15, 2020
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.

1 participant