wswebcreation / webdriver-image-comparison

MIT License
43 stars 36 forks source link

autoElementScroll in v4 is breaking tests, unable to disable it. #144

Closed wbigno closed 10 months ago

wbigno commented 10 months ago

Describe your question with as much detail as possible Recently upgraded to v4, trying to disable this auto scroll as it is causes a lot of issues. Tried adding it as document to the config like this.

[ 'image-comparison', { baselineFolder: join(process.cwd(), 'visual-regression/'), formatImageName: process.env.DOM_BUILD_ENV + '--{browserName}--{browserVersion}-{tag}', screenshotPath: join(process.cwd(), 'tmp/'), savePerInstance: true, autoSaveBaseline: true, blockOutStatusBar: true, blockOutToolBar: true, clearRuntimeFolder: true, autoElementScroll: false } ]

If it's about a specific piece of code, try and include some of it to support your question. When I watch the video of the test run, I see that as the Screenshot command is being sent the page is scrolling back tot he top of the page, and as a result the element is no longer visible so we get various errors depending on what the test is doing.. or we get bad baselines that are just back checkerboards...

Environment (please complete the following information):

Additional context I have tried to add it in the spec file too.. as a method option.. nothing works to disable this, and this scrolling to the top of the page based on the logs is exactly when the Screenshot is being taken another scroll occurs but not to the element.. to the top of the page? Screenshot 2023-10-25 at 10 03 40 AM Screenshot 2023-10-25 at 10 04 04 AM