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

Canvas elements not captured and shown during Test Replay, shows striped placeholder #28289

Closed
mblasco opened this issue Nov 9, 2023 · 16 comments
Labels
prevent-stale mark an issue so it is ignored by stale[bot] Test Replay type: feature New feature that does not currently exist

Comments

@mblasco
Copy link

mblasco commented Nov 9, 2023

Current behavior

Cypress tests are being executed without issues, both locally and remotely, but when we try to review the test execution in Test Replay, after some seconds, one particular canvas in the HTML rendered completely hides the test execution, preventing to see what is happening in the screen.

Inspecting the HTML during Test Replay, we found that this component:

<canvas data-cy-replay-is-placeholder="" data-v-25b03cc4="" class="guided-tour-canvas" width="1920" height="1080" title="Test Replay: unsupported content type" style="width: 1920px; height: 1080px;"></canvas>

is the one covering the whole screen.

image

If I manually remove the canvas from the HTML, I can see the screen of the test execution, but as soon as I click the play to resume the execution, the canvas is added back and coverts the screen again.

This started happening some days after upgrading to Cypress 13.4.0. Reverting to Cypress 13.3.0 or upgrading to Cypress 13.5.0 is not fixing the issue. I don't think it's related to Cypress version itself, but to the cloud service that takes care of replaying the test.

Desired behavior

That canvas should not hide test execution.

Test code to reproduce

https://cloud.cypress.io/projects/3pahs1/runs/14754/overview/16526418-5237-4e8b-8287-f9e8e4f9f4bf/replay?att=1&roarHideRunsWithDiffGroupsAndTags=0&ts=1699515442815.4143

Cypress Version

13.4.0

Node version

20

Operating System

Ubuntu

Debug Logs

No response

Other

No response

@jennifer-shehane
Copy link
Member

@mblasco Capturing of canvas elements are not currently supported, but it's on our roadmap.

@jennifer-shehane jennifer-shehane changed the title Static Image during Test Replay hides screen Canvas elements not captured and shown during Test Replay, shows striped placeholder Nov 9, 2023
@mblasco
Copy link
Author

mblasco commented Nov 9, 2023

I think the problem is that this canvas in our app is a transparent element whose size is the whole screen, but it's transparent, allowing to see all the elements in the screen. But from the Test Replay execution, the canvas is appearing as an opaque element covering the whole screen.

@izabelahotala
Copy link

@mblasco Capturing of canvas elements are not currently supported, but it's on our roadmap.

Is it possible to predict when this functionality will initially work again?

@jennifer-shehane
Copy link
Member

@mblasco Interesting, I'll relay this feedback.

@whitespacecode
Copy link

whitespacecode commented Jan 15, 2024

Thank you for this ticket.
We are reverting back to v12 because of this.
Our test are failing because we need to interact with the canvas and for some reason v13 can't handle it anymore?
https://cloud.cypress.io/projects/yzkmsw/runs/410/overview/5787671b-18f8-434b-85dd-6b5af96091bb/replay?roarHideRunsWithDiffGroupsAndTags=1&ts=1705310246885.3005&att=1

@jennifer-shehane
Copy link
Member

@whitespacecode There should be no change to the interaction of canvas elements within your test. The canvas elements are simply not represented in the Test Replay. If you record a video or take screenshots of the run with canvas - you will see that it is rendered and interacted with in Cypress, so you're likely encountering another issue.

@whitespacecode
Copy link

whitespacecode commented Jan 24, 2024

@whitespacecode There should be no change to the interaction of canvas elements within your test. The canvas elements are simply not represented in the Test Replay. If you record a video or take screenshots of the run with canvas - you will see that it is rendered and interacted with in Cypress, so you're likely encountering another issue.

Thank you for the reply.
Very strange that on v13 the single test where i click the canvas failed each time. Going back to v12 fixes it.

@jennifer-shehane
Copy link
Member

@whitespacecode Could you open a new issue with a reproducible example so we can track down the issue? It could indeed be a separate v13 related issue.

@mentaman
Copy link

@jennifer-shehane Any ETA? I see this issue exists for half year. Where can we follow it?
Unfortunately we couldn't downgrade to v12, since until we noticed this issue we already became dependent on v13 ( once we downgraded to v12 we started having a lot of flakyness )

@jennifer-shehane
Copy link
Member

@mentaman The lack of canvas being captured on Test Replay should have zero effect on how your tests run and the output of your tests. The canvas however will not be represented in the Test Replay. If you require seeing the Canvas for review after a test is run, we recommend turning video on.

This is still on our roadmap to provide.

@mentaman
Copy link

mentaman commented May 2, 2024

@jennifer-shehane I'm aware. Sorry I wasn't clear enough, but the issue for us is that our canvas is above other elements and most of the canvas is transparent in real life.
While in Replay it shows it this way instead of transparent
image
so it just hides everything behind it and we can't know what happens there. and when we try to research flakyness it makes it more challenging.

If it could be transparent at least instead of showing this white/gray pattern, this would also work for us.

@jennifer-shehane jennifer-shehane moved this from Understanding to Designing / Scoping in Cypress App Priorities May 21, 2024
@jennifer-shehane jennifer-shehane moved this from Designing / Scoping to Building in Cypress App Priorities Jun 3, 2024
@varunraorao
Copy link

varunraorao commented Aug 26, 2024

Screenshot 2024-08-20 at 9 47 12 AM

I am facing the same issue @jennifer-shehane, this makes us difficult to verify the failed test cases during test replay mode.

@jennifer-shehane jennifer-shehane added the prevent-stale mark an issue so it is ignored by stale[bot] label Sep 18, 2024
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Oct 3, 2024

We're excited to announce that canvas elements can now be captured and displayed in Cypress Test Replay. When enabled, Cypress will take a screenshot representation of any canvas element and rehydrate those images within the existing live DOM during replay.

If you'd like canvas capture enabled for your Test Replays, let us know (comment here or email support@cypress.io) —it is currently behind a feature flag that we have to enable on our side. (We intend to have this feature flag be user facing in the future, but want to get this out as soon as possible to customers.)

To get started capturing canvas, you’ll need to be aware of a few things:

  • You need to use Cypress App 13.15.0 or greater.
  • Since capturing canvas elements requires additional capturing during a test run, it may affect performance, particularly if your app has many or large canvas elements or if you are on a resource constrained machine. Once enabled, we recommend monitoring for any performance issues and reaching out so we can help address them.

Note for UI Coverage and Accessibility customers: Canvas display for UI Coverage and Accessibility is not yet available, but it’s on the way!

@github-project-automation github-project-automation bot moved this from Building to Generally Available in Cypress App Priorities Oct 3, 2024
@varunraorao
Copy link

Wow wonderful, Thank you @jennifer-shehane.

@varunraorao
Copy link

varunraorao commented Oct 9, 2024 via email

@nrutman
Copy link

nrutman commented Oct 22, 2024

@jennifer-shehane any update on the ability to test contents of canvas elements? Is that coming at any point in the near future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent-stale mark an issue so it is ignored by stale[bot] Test Replay type: feature New feature that does not currently exist
Projects
Status: Generally Available
Development

No branches or pull requests

7 participants