使用uiautomator2+pytest+allure进行Android的UI自动化测试
pip install pytest==3.7
命令:
py.test --alluredir=reports
allure generate reports
allure generate reports --clean
allure generate --clean reports -o myreport
用火狐浏览器打开,chrome会404
https://github.com/openatx/uiautomator2
pip uninstall uiautomator2
pip install --pre uiautomator2
python -m uiautomator2 init
pip install weditor
python -m weditor
测试单个方法: pytest -k test_home_search --alluredir=reports -s
测试单个用例:pytest -s testcase/test_find.py
测试PO级Case: pytest -v -m "P0" --alluredir=reports
不测试PO级Case: pytest -v -m "not P0" --alluredir=reports
allure generate --clean reports -o myreport
手机的ip地址需要和pc电脑的ip地址在一个网段上
d = ut2.connect("192.168.129.93")
https://docs.pytest.org/en/latest/example/simple.html
查看设备中app列表 ideviceinstaller -u 86616cbaa40e52d3f9236ec982dd6f1e933a44bd -l
浅谈自动化测试工具 python-uiautomator2 https://testerhome.com/topics/11357