airtest有很多方法可以进行图片断言,但是感觉都不太好用,会出现图片不存在时执行中断,报异常,因此封装了一个断言方法:
#断言图片是否存在 def existspct(pct): try: if exists(Template(pct)): return True else: return False except Exception as e: print(e) print('图片检测异常') return False
airtest自带的断言方法:
airtest的api信息:api地址:https://airtest.readthedocs.io/zh_CN/latest/all_module/airtest.core.api.html
本文参考了部分:https://airtest.readthedocs.io/zh_CN/latest/all_module/airtest.core.api.html