该项目是为了让手机应用的一些常规测试可以自动化起来,让测试人员摆脱那些枯燥的重复性工作。 基于OpenCV的图像识别技术,有点类似于SikuliX(这东西挺好用的,只是没说要支持手机端)
This project is to make mobile test automated, free people from the boring of repeated job. AutomatorX is a python library base on python-opencv
and a lot of outstanding python libs.
ATX is short for AutomatorX
If you are new to atx, it better to start from Quick start tutorial or just view API documentation link
- 完全的黑盒测试框架,无需知道项目代码,非侵入式
- 支持iOS, Android的自动化测试,两个平台都支持测试第三方应用
- 对于iOS的真机,安卓模拟器都能很好的支持
- 可以用来测试Windows应用
- 对于游戏的测试使用了图像识别
- 同一个测试脚本可以通过图像的缩放算法,适配到其他分辨率的手机上
面向游戏行业测试人员,当然也开放给国际友人(PS:中文不知道他们看得懂不)
- Gitter Chat Room
- QQ:
497460177
PS: 因为我们公司上不了QQ, 所以不会经常上 - 网易内部用户目前请直接联系
hzsunshx
或加群1347390
- 只支持Python2的测试脚本
- Android 4.1+
- iOS 9.0+
- iOS测试必须要有一个Mac
-
安装ATX
注: iOS的测试一定需要一个Mac 装完之后测试下安装是否成功,
python -m atx version
查看atx版本号 -
安卓的设备上还需要安装一个ATX手机助手
可以下载APK到手机, 或者手机连接到电脑上用命令行安装
python -m atx install atx-assistant
该App为自动化提供了输入法的功能,屏幕常量等功能
To get started, it is better to look at the Quick Start
More about the ATX API here
There is also a doc for professional users. here
There are a lot of command tools along with atx, eg
- Screenshot
- Screenrecord
- Install minicap to android
- Apk file parser
- Show phone info with JSON
- Enable iPhone developer mode
etc... To see the whole list click here
If you are having some issues please checkout wiki first.
该部分属于atx的扩展插件实现的功能
插件说明
-
利用此插件可以在ATX自动化跑完之后,自动生成可以HTML报告,详细记录每一步的执行情况
-
Performance record (For Android)
性能测试直接使用了腾讯开源的GT
PS: 刚写好没多久,你只能在最新的开发版中看到。有可能以后还会修改。
使用方法
-
首先需要去腾讯GT的主页上,将GT安装到手机上
-
代码中引入GT扩展
import atx from atx.ext.gt import GT d = atx.connect() gt = GT(d) gt.start_test('com.netease.my') # start test # ... do click touch test ... gt.stop_and_save()
-
运行完测试后,代码会保存到
/sdcard/GT/GW/
+包名(com.netease.my)
目录下,直接使用adb pull
下载下来并解析$ adb pull /sdcard/GT/GW/com.netease.my/
该部分代码位于 atx/ext/gt.py, 这部分代码目前在我看来,易用性一般般,希望使用者能根据具体情况,进行修改,如果是修改具有通用性,欢迎提交PR,我们会负责Review代码。
-
connect
函数负责根据平台返回相应的类(AndroidDevice or IOSDevice)
图像识别依赖于另一个库 aircv, 虽然这个库还不怎么稳定,也还凑合能用吧
每个平台相关的库都放到了 目录 atx/device
下,公用的方法在atx/device/device_mixin.py
里实现。第三方扩展位于atx/ext
目录下。
-
基于opencv的图像识别库 https://github.com/netease/aircv
-
感谢作者 https://github.com/xiaocong 提供的uiautomator的python封装,相关项目已经fork到了
-
Android input method https://github.com/macacajs/android-unicode
-
SikuliX http://sikulix-2014.readthedocs.org/en/latest/index.html
- Platform Versions, Screen Size, Open GL Version http://developer.android.com/intl/zh-cn/about/dashboards/index.html
如何才能让软件变的更好,这其中也一定需要你的参与才行,发现问题去在github提个issue, 一定会有相应的开发人员看到并处理的。文档有错误的话,直接提Issue,或者提PR都可以。 由于我平常使用该项目的概率并不怎么高,所有不少问题即使存在我也不会发现,请养成看到问题提Issue的习惯,所有的Issue我都会去处理的,即使当时处理不了,等技术成熟了,我还是会处理。但是如果不提交Issue,说不定我真的会忘掉。
BTW: 有开发能力的也可以先跟开发者讨论下想贡献的内容,并提相应的PR由开发人员审核。
This project is under the Apache 2.0 License. See the LICENSE file for the full license text.