AirtestProject
AirtestProject
AirtestProject是由网易游戏推出的一款自动化测试框架。
Airtest
一个跨平台的、基于图像识别的UI自动化测试框架,适用于游戏和App,支持平台有Windows、Android和iOS。
Airtest官方文档:https://airtest.readthedocs.io/zh_CN/latest/
安装命令:pip install -U airtest
连接安卓设备:connect_device("android:12344321")
常用的api:
touch
touch(Template(r"tpl1614914523361.png", record_pos=(-0.206, 0.189), resolution=(1080, 1920)),times=1,duration=0.01)
swipe
swipe(Template(r"tpl1614914905026.png", record_pos=(-0.064, 0.675), resolution=(1080, 1920)), vector=[0.0272, -0.5581])
text
text("c测试text输入")
keyevent
设备操作,只能应用在Android和Windows
keyevent("BACK")
snapshot
snapshot(msg="请填写测试点.")
wait
wait(Template(r"tpl1614915394025.png", record_pos=(-0.403, 0.81), resolution=(1080, 1920)))
断言常用的方法:
assert_exists
assert_exists(Template(r"tpl1614922752951.png", record_pos=(-0.392, 0.815), resolution=(1080, 1920)), "请填写测试点")
assert_not_exists
assert_not_exists(Template(r"tpl1614922833487.png", record_pos=(-0.406, 0.801), resolution=(1080, 1920)), "请填写测试点")
assert_equal
assert_equal("1", "1", "1等于1.")
assert_not_equal
assert_not_equal("1", "2", "1不等于2.")
Poco
一款基于UI控件识别的自动化测试框架,目前支持Unity3D/cocos2dx-*/Android原生app/iOS原生app/微信小程序,也可以在其他引擎中自行接入poco-sdk来使用。
Poco官方文档:https://poco.readthedocs.io/zh_CN/latest/
AirtestIDE
跨平台的UI自动化测试编辑器,内置了Airtest和Poco的相关插件功能,能够使用它快速简单地编写Airtest和Poco代码。