【问题标题】:Is it possible to use puppeteer to compare a screenshot with the ui elements of a webpage and find differences?是否可以使用 puppeteer 将屏幕截图与网页的 ui 元素进行比较并找出差异?
【发布时间】:2019-05-18 03:27:19
【问题描述】:

我正在寻找与此相关的任何文档或帮助。现在为了测试 UI 元素是否出现在屏幕上,我只检查该类或 ID 是否已加载,例如登录表单、标题、徽标、提交按钮、输入字段等。

我想我记得看到 Puppeteer 可以帮助分析屏幕截图,然后加载网页并比较两者,但我可能还差得远。

对于使用 Puppeteer 的任何人来说,验证网页上加载的 UI 元素的最佳方法是什么?

谢谢

【问题讨论】:

    标签: javascript testing jestjs puppeteer


    【解决方案1】:

    您可以使用 Puppeteer 截取屏幕截图,然后使用类似的东西, https://github.com/uber-archive/image-diffhttps://www.npmjs.com/package/imagemagickcompare two images

    【讨论】:

    猜你喜欢
    • 2021-03-03
    • 2018-07-08
    • 2019-10-25
    • 2016-09-05
    • 1970-01-01
    • 2017-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多