password
URL
type
status
date
slug
summary
tags
category
icon
标签
是否汉化
没有人不会走,也没有人会一直在。人一旦有了期待,心情就会忽明忽暗。
背景
针对App移动端、PC/H5 UI自动化测试在基本断言规则的基础上,扩展通过图片对比来校验页面是否准确,通过自动化检测界面变化,及时发现潜在的视觉问题,有助于改善用户体验和确保界面一致性。
设计思路
- 截图保存基础数据
- 通过UI自动化运行过程中自动化保存需要验证的场景图片
- 封装python vc2库相关函数,检测图片的相似度
- 差值较大时,将图片进行标注并输出
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F68202bb5-9faf-4bfe-9cc4-aaf29bc1fbcc%2Fc3245e65-7415-4b95-850b-47e9423e69de%2FUntitled.png?table=block&id=d5e35e8e-1862-4224-851b-71e49887945a&t=d5e35e8e-1862-4224-851b-71e49887945a&width=1660&cache=v2)
代码实现
标注输出的效果图
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F68202bb5-9faf-4bfe-9cc4-aaf29bc1fbcc%2F12d41028-64ec-4805-9a41-d3a89ae1af1a%2FUntitled.png?table=block&id=ccec2242-3c48-40bf-85eb-a13eeded223f&t=ccec2242-3c48-40bf-85eb-a13eeded223f&width=958&cache=v2)
Py之cv2:cv2库详解
离开乏味的皮囊,自由的灵魂在路上
- Name: Alan Hsu
- Tag: 随感、技术、经验、旅行、推荐、生活、音乐、电影 etc.
- Email:xulanzhong521gmail.com
- Twitter:@AlanHsu521
- Telegram:@AlanHsu521
- WeChat: Alan_Hsu_521
- Github: https://github.com/xsoway/
![notion image](https://cdn.jsdelivr.net/gh/xsoway/xmylog_imgs@main/wechat.jpeg?t=66e367c6-d0ed-458f-8b5d-582d579d0a3d)
![notion image](https://cdn.jsdelivr.net/gh/xsoway/xmylog_imgs@main/%E5%85%AC%E4%BC%97%E5%8F%B7.jpeg?t=f4f5ea70-3561-4563-a484-4807b1f348fd)
- Author:Alan_Hsu
- URL:https://xmylog.com/article/articles_pytest_images
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts