前言
Airtest IDE 提供了四种快捷断言的方式
- assert_exists 断言存在
- assert_not_exists 断言不存在
- assert_equal 断言相等
- assert_not_equal 断言不相等
断言存在(assert_exists)
assert_exists(*args,**kwargs)设备屏幕上存在断言目标
参数
- v 要检查的目标
- msg 断言的简短描述,它将被记录在报告中
- AssertionError 如果断言失败
返回
- 目标坐标
支持平台:Android,Windows,IOS
示例:assert_exists(Template(r"a.png","assert exists")
使用示例,断言“我的”页面存在“登录/注册”按钮
运行用例后查看测试报告
断言不存在(assert_not_exists)
a