Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Time travel doesn't restore the state of custom elements #29335

Closed
xxluke opened this issue Apr 15, 2024 · 1 comment
Closed

Time travel doesn't restore the state of custom elements #29335

xxluke opened this issue Apr 15, 2024 · 1 comment
Labels
type: duplicate This issue or pull request already exists

Comments

@xxluke
Copy link

xxluke commented Apr 15, 2024

Current behavior

When you have a HTML custom element, and use the "time travel" feature of Cypress to see the state of the document during a step, all custom components are rendered as they were initially.

In our case we have a web component for a loading screen which gets emptied when the data is loaded. In the page snapshots it always covers the page, even though it was actually already empty during that point.

On a side node, I didn't find a good documentation about how time travel works, or which JavaScript gets executed and which doesn't.

Desired behavior

Cypress should remember and restore the actual state of the element. In my case the HTML content of the custom element.

Test code to reproduce

This issue is the same as #8787 which got closed due to inactivity, but the issue still exists. It has a test code (I didn't test it again).

Cypress Version

13.7.3

Node version

v18.17.0

Operating System

Windows 11 22H2

Debug Logs

No response

Other

A workaround which might work at least in my case is to avoid all DOM-altering logic inside the custom element. It has to depend on attributes, which do get restored by Cypress.

@jennifer-shehane
Copy link
Member

I've reopened #8787 and we can track it there.

@jennifer-shehane jennifer-shehane closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@jennifer-shehane jennifer-shehane added the type: duplicate This issue or pull request already exists label Apr 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants