在jenkins中完成自动打包利用appium自动化测试
项目地址:
https://github.com/qq1403332591/AndroidSampleApp
在pycharm中运行需设置Additional Arguments如下图
在额外的配置中写入:
--tc-file /Users/yaoyingdong/hogwarts_test/iAppBVT_Python/iAppBVT_Python.json --tc-format json
1.执行shell
. ~/.bash_profile
pwd=`pwd`
echo $pwd
# 当前位置回退一级,回到iAppBVT_Bale项目下的apk文件所在的路径
apk=$pwd/../iAppBVT_Bale/AndroidSampleApp/app/build/outputs/apk/debug/app-debug.apk
# 不管设备是否存在此包名,卸载都不会报错
{ adb uninstall com.appsflyer.androidsampleapp
} || {
echo "The package com.appsflyer.androidsampleapp does not exist!"
}
adb install $apk
cd iAppBVT_Python
pip3.9 install -r requirements.txt
pytest -sv test/bvt_test.py --tc-file ~/iAppBVT_Python.json --tc-format json
注意:构建时运行的节点需开启appium server服务