garris / garris/BackstopJS

In Chrome a resize event is always fired just before the screenshot

Open
#1,604 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

...Which is a problem if there is a state on the screen that reacts to that event, e.g. a menu is open which is supposed to be on the screenshot, but it is not.

No amount of delays can help with that, because the resize event is triggered as the last thing before the image is taken.

I have looked at it with `debugWindow: true` numerous times, but there are no visible size change, still with `window.addEventListener('resize', myHandler);` `myHandler` always fires.

It is not critical, I've worked around it by disabling the menu closing behaviour for test runs, but it caused me substantial headache to figure out what was going on, also it is a smell to put extra checks into the main code to accommodate tests, so it'd be preferable to not have it there.

I am also running the same tests using Firefox, that does not have this issue.

Info:
backstopjs v6.3.25 + playwright v1.52.0 running natively in MacOS on Apple Silicon

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.