需要安装python、Jenkins、git
1、在Jenkins上新建一个自由风格的项目
2、构建
环境构建前,输入测试项目的运行文件,绝对路径,前面加python运行环境(这里需要把python的环境变量从用户变量加到系统变量的path里面)
执行windows批处理
@rem python -m uiautomator2 init
echo “%WORKSPACE%”
cd /d %WORKSPACE%
if exist ywAutoTest (
cd ywAutoTest
git clean -fd
git reset --hard HEAD
git pull
) else (
git clone ssh://[email protected]:29418/ywAutoTest && scp -p -P 29418 [email protected]:hooks/commit-msg ywAutoTest/.git/hooks/
cd ywAutoTestt
)
cd T6A
@rem “settings,ebook,music,movie,fileManagement”
python OnHookTest.py %device_serial% “settings,btMusic,movie”
3、构建后操作也就是生成测试报告,这里填写报告文件的绝对路径和报告名。