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

fix: bug where cy.createSnapshot would interact with documents using custom elements #8080

Merged
merged 9 commits into from
Jul 28, 2020

Conversation

panzarino
Copy link
Contributor

@panzarino panzarino commented Jul 23, 2020

User facing changelog

  • Fixes a bug where cy.createSnapshot would interact with documents using custom elements
    • Fixes an issue many users were having where Cypress would get stuck in an infinite XHR loop on documents that used custom elements

Additional details

See the following test case as reported in the issue

Before:

it('hangs', () => {
  cy.visit('https://evryplace.com/panel/');
})

In Cypress during cypress open

The cy.visit() does not resolve and the browser locks up in all browsers (Chrome, Electron) during cypress open. There are infinite requests that go out every second to GET /panel/i18n/7fa71d4/app-webvr_en.json.

screen shot 2018-04-19 at 8 22 46 pm

In Cypress during cypress run

The behavior is actually different during cypress run. The cy.visit() resolves and the test passes (although it looks like the page doesn't load exactly right still).

ezgif-6-76c96ca00058

After:

The page loads properly as expected

Screen Shot 2020-07-24 at 6 01 32 AM

PR Tasks

  • Have tests been added/updated?
  • Has the original issue been tagged with a release in ZenHub?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 23, 2020

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jul 23, 2020



Test summary

7912 0 130 2


Run details

Project cypress
Status Passed
Commit b67e291
Started Jul 28, 2020 4:26 PM
Ended Jul 28, 2020 4:33 PM
Duration 06:25 💡
OS Linux Debian - 10.1
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@panzarino panzarino marked this pull request as ready for review July 24, 2020 10:05
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panzarino So nice. I confirmed manually that this fixes the original bug.

This actually fixes this other issue also, where calling clone would trigger an attributeChangedCallback within the application. #7187 (comment) This case may be more testable - seems you could ensure this isn't called if snapshots are on. I wonder if it's the same reason that's causing the polymer issue?

@chrisbreiding may have some advice on writing a test case or assessing why this is happening.

packages/driver/src/cy/snapshots.js Outdated Show resolved Hide resolved
@flotwig
Copy link
Contributor

flotwig commented Jul 24, 2020

@chrisbreiding added you for review since this seems to be fixing a Shadow DOM-related issue, apparently unrelated to the new Shadow DOM changes

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panzarino please add a test case here that demonstrates what is happening to shadow DOM elements on clone and that it is no longer happening

also, wow, shadow DOM? that was NOT my guess at all as to why this was happening 🤣

@panzarino panzarino changed the title fix: prevent XHR requests from getting stuck in an infinite retry loop fix: bug where cy.createSnapshot would interact with documents using custom elements / shadow dom Jul 27, 2020
@panzarino panzarino changed the title fix: bug where cy.createSnapshot would interact with documents using custom elements / shadow dom fix: bug where cy.createSnapshot would interact with documents using custom elements Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants