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

Cypress hangs when calling .click() on a web component #7679

Closed
elylucas opened this issue Jun 11, 2020 · 4 comments · Fixed by #7692
Closed

Cypress hangs when calling .click() on a web component #7679

elylucas opened this issue Jun 11, 2020 · 4 comments · Fixed by #7692
Assignees
Labels
type: regression A bug that didn't appear until a specific Cy version release v4.8.0 🐛 Issue present since 4.8.0

Comments

@elylucas
Copy link
Contributor

elylucas commented Jun 11, 2020

Current behavior:

This appears to be a regression in 4.8. In 4.7 this functions as expected.

When targeting an Ionic web component like so:

cy.contains('ion-button', 'My Button').click()

The call to the click freezes the Cypress test runner. This appears to happen in Chrome 83, but seems to run fine in Firefox 75.

Desired behavior:

The click event should be fired on the targeted web component.

Test code to reproduce

Repo here: https://github.com/elylucas/ionic-react-cypress-4.8-hang

  1. npm i
  2. npm run start (to start the Ionic React app)
  3. npx cypress open
  4. Run mytest.spec.js against chrome
  5. The first test freezes the runner
  6. Skip the first test and see that the second test targeting a plain button runs fine
  7. Downgrade to Cypress@4.7.0 and see that both tests run fine

Downgrading to 4.7 seems to run fine, even when targeting Chrome 83.

Versions

MacOS Catalina
Cypress 4.8
Chrome 85
Firefox 75

@jennifer-shehane jennifer-shehane added the v4.8.0 🐛 Issue present since 4.8.0 label Jun 12, 2020
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Jun 12, 2020

@elylucas Thanks for providing a reproducible example!

Ionic uses Shadow DOM, and we did make some changes in 4.8.0 concerning Shadow DOM, albeit - all effects should have been isolated to setting the experimentalShadowDomSupport flag to true. #7469

But, my suspicions seem to be true in that some of the changes leaked out and is effecting your app even though you have not turned on the experimental feature.

Test passes on commit before Shadow DOM: 7597bf9

Screen Shot 2020-06-12 at 10 29 17 AM

Test hangs on Shadow DOM commit: a7ff8fd

The test just hangs forever.

Screen Shot 2020-06-12 at 10 48 24 AM

@jennifer-shehane jennifer-shehane added the type: regression A bug that didn't appear until a specific Cy version release label Jun 12, 2020
@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Jun 12, 2020
@JessicaSachs
Copy link
Contributor

@chrisbreiding Can you take a look into this?

@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: needs investigating Someone from Cypress needs to look at this stage: work in progress There is an open PR for this issue [WIP] labels Jun 12, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jun 12, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 12, 2020

The code for this is done in cypress-io/cypress#7692, 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 Jun 23, 2020

Released in 4.9.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v4.8.0 🐛 Issue present since 4.8.0
Projects
None yet
4 participants