cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.42k stars 3.14k forks source link

Test replay inspector remounts web components #22153

Open alexkrolick opened 2 years ago

alexkrolick commented 2 years ago

Current behavior

When using the interactive test runner UI, if you hover over the chained cypress commands in the left panel, Cypress attempts to restore the DOM state at the given time.

With webcomponents/custom elements, restoring the DOM state causes a new instance of the component to be created each time, which retriggers side-effects such as initial network calls, leading to extremely high request volume. It also fails to restore the actual component state at the time if it uses shadow dom.

Possibly related: https://github.com/cypress-io/cypress/issues/5898

Desired behavior

Hovering previous states in the test runner should restore the state of custom elements' shadow DOM, instead of creating new top-level instances.

OR

There should be some way to use temporary image- or video-based snapshots instead of DOM captures in the replay UI.

Test code to reproduce


Cypress Version

10

Other

No response

AtofStryker commented 2 years ago

Hey @alexkrolick. Thank you for filing an issue. I believe I was able to reproduce some of the behavior you are seeing with this reproduction repository. Can you confirm this is the behavior you are seeing?

alexkrolick commented 2 years ago

Yep, the incrementing counter is a good repro side-effect.

ThijSlim commented 1 year ago

I am experiencing the same issues in e2e. Also experiencing this with the new Cypress 10 Component Testing.

borislav-minchev commented 1 year ago

Hello, in our project we are using Cypress 12.8.1 and this issue still occurs. Have there been any updates on this?

L-Ignatova commented 1 year ago

We are experiencing these issues in e2e testing in Cypress 12. Is there a workaround we can implement for the time being or is a solution planned for a future release we can expect?

AtofStryker commented 1 year ago

Hi @borislav-minchev & @L-Ignatova. We currently don't have this issue prioritized, but are always willing to accept contributions to fix the issue!

cypress-app-bot commented 9 months ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

alexkrolick commented 9 months ago

Issue still exists

cypress-app-bot commented 1 month ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

AtofStryker commented 1 month ago

still an issue