webdriverio / visual-testing

Image comparison / visual regression testing for WebdriverIO
https://webdriver.io/docs/visual-testing
MIT License
109 stars 38 forks source link

Screenshots shifted after scrollIntoView under Linux 5.13.0-28-generic 31-Ubuntu #83

Open Sam55555 opened 2 years ago

Sam55555 commented 2 years ago

Describe the bug Screenshots shifted after scrollIntoView under Linux

To Reproduce Steps to reproduce the behavior:

LinuxIssue.zip

wswebcreation commented 2 years ago

Hi @Sam55555

Thanks for the issue, I'm currently on vacation and will check it out when I'm back end of the month

Kacoze commented 2 years ago

Same on:

Also not only scroll causes this issue, but I currently did not reproduce any other trigger.

carvalhoa-ppb commented 1 year ago

I've also had the same behaviour on my tests.

Anytime I've made a scroll or even if the application scrolls by some iteration the screenshots created after that point of moment are shifted. Notice that the shifted amount is the same as initial scroll that application had.

After some debug I believe it's related with this line of code of webdriver-image-comparison. As you can see we are getting top position of an element based on current viewport (getBoundingClientRect and on the moment of scrolling we are ignoring the current scroll of the page. I'm not 100% of implications of changing that line 🙏

To bypass this, until a fix appears, I'm scrolling back application to the top of the page before any checkElement after a scroll. -.-'

christian-bromann commented 8 months ago

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!