jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
888 stars 160 forks source link

Duplicated bottom of image #92

Closed baronvonbirra closed 5 years ago

baronvonbirra commented 5 years ago

Hi!

When taking snapshots, it looks like the bottom of the image of the screenshots are duplicated. Here an example: image There should be just 3 buttons at the bottom of the page, not 6: the other 3 are duplicated. The same is happening to me in all screenshots I take.

Why is this happening?

Thanks!

jackjocross commented 5 years ago

Huh that is strange, does this also happen when you use cy.screenshot() directly?

baronvonbirra commented 5 years ago

Yep, I'm afraid... I managed to "fix" this and now is working as a gem. I'll leave you some info as I'm not sure what could be failing, in case someone else finds the same problem, but I was using macbook-15 | 1440 | 900 viewport dimensions for my tests, and after changing it for something more generic (1280x720) it now works perfectly! Thanks!

Robo-Rin commented 1 year ago

To others coming here, what I found worked for me was explicitly setting { capture: 'viewport' } which is a native Cypress cy.screenshot() option that gets passed through.

i.e.:

cy.matchImageSnapshot('SomeName', { capture: 'viewport' })