cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.

Home Page:https://cypress.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Screenshot fails to reflect viewable 3D image in canvas element

jwaheed-inunum opened this issue · comments

Current behavior

Currently, when I run in headless mode the cypress screenshot() function ceases to function as expected. Previously, we would save screenshots of the canvas element as we run tests for .dxf and .las image files which are viewable with the canvas element. Cypress does successful take an actual image and saves it to the /cypress/screenshots directory. However, the screenshot does not reflect the actual visualization as provided by the .dxf or .las file. The screenshot saved is an image of the blank canvas.
This current behavior occurs while running headless, with the Chrome browser (Firefox and Electron run successfully) and running Windows operating system (Linux runs successfully).

Desired behavior

In this situation, while running in Cypress headless mode, Windows operating system and using Chrome browser, Cypress should produce a screenshot to reflect the visualization on the canvas as provided from the .las and .dxf files.

Test code to reproduce

My apologies for not providing a fork with a failing test. Our business model is based on providing 3D images for customer viewing while using the canvas element in a browser. Consequently, I cannot produce a fully functioning fork due to proprietary and complexity reasons.

Cypress Version

12.15.0 and 13.8.1

Node version

v18.16.1

Operating System

Windows 11 Pro, (Linux works successfully)

Debug Logs

No response

Other

No response

Did the screenshot used to capture the canvas and it now isn’t? Or have you never seen screenshot capture the canvas?

Thank you for the prompt response. Previously, the screenshots DID reflect .dxf/.las images. It has only been recently that the tests have failed. Considering that the tests run successfully with Firefox and Electron, I have a suspicion, that our failing Chrome tests coincide with the release of Chrome 124. But that is only my hypothesis that unfortunately I cannot disprove.

@jwaheed-inunum Yah, it would be great to have a reproducible example showing the type of canvas usage so we could track it down.

I will try to reproduce on the fork and will revert back. Thanks.