cypress-image-snapshot
cypress-image-snapshot copied to clipboard
snapshot image is cutoff
why is the the snapshot image get's cut off. only capturing the half of the image.
I'm getting an issue like this as well actually, full-page screenshots are inconsistently captured mid-paint. One of them even had the Cypress UI present in the bottom half of the render and marked that as a diff, which seems uh, very questionable.
I may be able to wait for elements to be on-screen but I wonder if something can be done to mitigate this? It doesn't seem like anyone would want screenshots mid-paint.
Curious if you're getting this type of error
Error: Image size (1872x1256) different than saved snapshot size (936x628).
Example screen - https://github.com/cypress-io/cypress/issues/3324#issuecomment-535181285
or if you have a different issue.
We do not recommend comparing screenshots across environments (aka comparing screenshots taken in cypress open versus cypress run)
That's an interesting thread, but not sure if it's the same problem for me. These issues come up during the same Cypress open invocation. I'd include screenshots, but it's workplace stuff.
If it's a screenshot of an element, it could be that it's not fully scrolled into view?
We have faced similar issue recently. What helped us is to set browser viewport to be equal to Xvfb screen size used for running headless Cypress:
cy.viewport(1280, 720);
We have also tried to scroll element into view, and to scroll parent container of the element - it would not help - it just produced screenshots cut even in a more bizarre way
This is probably some issue with Cypress - I will try to reproduce on simple example and report to them