meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
497 stars 117 forks source link

Question about fixed elements #69

Open Emiliano-Bucci opened 4 years ago

Emiliano-Bucci commented 4 years ago

Hello! I've recently started to use both Cypress and cypress-plugin-snapshots and i have a doubt regarding fixed elements, like for example a fixed Header at the top of the page. In the docs says:

When passing fullPage to the capture option, Cypress scrolls the application under test from top to bottom, takes screenshots at each point and stitches them together. Due to this, elements that are position: fixed or position: sticky will appear multiple times in the final screenshot

for some reason, in different pages (which share some fixed components - in my case a fixed menu on the left) i'm getting different results, like this:

image

image

The first screen is correct: during scroll, the elements of the menu aren't repeated. On the second screen, after cypress scroll to the bottom, he's repeating some elements of the left fixed menu. Screen were taken using cypress open

The weird part is that, sometimes, result changes if for example during test running, chrome is opened in fullscreen or not. Could be that cypress have difficults, during screenshot elaboration, to mix repeated elements?