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

未关闭
#1,604 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript, playwright
领域
testing-qa

调研方向

首先,在 macOS 上的 Chrome 中使用 debugWindow 和 resize handler,通过 BackstopJS v6.3.25 与 Playwright v1.52.0 重现报告的案例,然后在 Firefox 中比较相同的运行结果。完成的标准是:截图不再触发由 resize 驱动的不必要状态变化,同时不向应用程序添加仅用于测试的检查。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
JavaScript
星标
7.2k
派生
617
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

garris/BackstopJS 的其他 Issue

查看 garris/BackstopJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。