webdriverio/visual-testing

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

Sam55555 opened this issue · 4 comments

  • Node.js version: v16.13.2
  • Browser name and version: Chrome 98/latest
  • Platform name and version: Linux 5.13.0-28-generic 31-Ubuntu
  • WebdriverIO version: 7.16.14
  • wdio-image-comparison-service version: 3.1.0

Describe the bug
Screenshots shifted after scrollIntoView under Linux

To Reproduce
Steps to reproduce the behavior:

LinuxIssue.zip

Hi @Sam55555

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

Same on:

  • node.js 16.13.1
  • chrome 98
  • windows 11
  • wdio 7.16.15
  • wdio-image-comparison-service version 3.1.0 AND 2.3.0
    also tested on some ubuntu (16 i think) with node 14.?.?, and same result

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

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. -.-'

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!