游戏和应用程序的跨平台UI自动化框架
跨平台的ui自动化框架,适用于游戏和app (中文版点这里)

写一次,在任何地方运行: airtest提供跨平台API,包括应用程序安装,模拟输入,断言等。 Airtest使用图像识别技术来定位UI元素,以便您可以在不注入任何代码的情况下自动化游戏和应用程序。
完全可扩展的:使用Commandline或Python API,可以在大型设备农场上轻松运行Airtest Case。 HTML报告带有详细信息和屏幕记录的报告允许您快速找到故障点。 NetEase在Airtest项目的顶部建造了Airlab。
AirTestide: Airtestide是一个盒子内GUI工具,可帮助以用户友好的方式创建和运行案例。 AirTestide支持完整的自动化工作流程: create -> run -> report 。
POCO: POCO增加了直接访问主要平台和游戏引擎访问对象(UI小部件)层次结构的能力。它允许在Python中写作说明,以实现更高级的自动化。
从airtest主页开始
使用pip安装呼吸python库。
pip install -U airtest在MacOS/Linux平台上,您需要授予ADB执行权限。
# for mac
cd {your_python_path}/site-packages/airtest/core/android/static/adb/mac
# for linux
# cd {your_python_path}/site-packages/airtest/core/android/static/adb/linux
chmod +x adb如果您需要使用GUI工具,请从我们的主页下载AirTestide。
您可以在readThedocs上找到完整的Airtest文档。
Airtest旨在提供与平台无关的API,以便您可以编写一次自动化案例并在多个设备和平台上运行。
from airtest . core . api import *
# connect an android phone with adb
init_device ( "Android" )
# or use connect_device api
# connect_device("Android:///")
install ( "path/to/your/apk" )
start_app ( "package_name_of_your_apk" )
touch ( Template ( "image_of_a_button.png" ))
swipe ( Template ( "slide_start.png" ), Template ( "slide_end.png" ))
assert_exists ( Template ( "success.png" ))
keyevent ( "BACK" )
home ()
uninstall ( "package_name_of_your_apk" )有关更多详细信息,请参阅Airtest Python API参考或查看API代码
.air使用Airtestide,您可以轻松地将自动化案例作为.air目录。 Airtest CLI提供了在不同的主机机器和目标设备平台上执行案例的可能性,而无需使用AirTestide本身。
# run cases targeting on Android phone connected to your host machine via ADB
airtest run " path to your .air dir " --device Android:///
# run cases targeting on Windows application whose title matches Unity.*
airtest run " path to your .air dir " --device " Windows:///?title_re=Unity.* "
# generate HTML report after running cases
airtest report " path to your .air dir "
# or use as a python module
python -m airtest run " path to your .air dir " --device Android:///尝试运行提供的示例案例: airtest/playground/test_blackjack.air ,并查看CLI的用法。这是一个多设备的跑步者样本。
拉力请求非常欢迎。
感谢所有这些使该项目变得更好的伟大作品。