(一)在本地整合出报告
1.在cmd分别安装pytest和allure-pytest
pip3 install pytest
pip install allure-pytest
需要allure结合pytest才可以生成很漂亮的测试报告
2.进入需要执行的代码所在的路径
3.运行测试报告,代码如下
pytest -v test/ --alluredir=report/allure_results
此时在pycharm的report下需要生成allure-results的json代码的目录
4.解析此json文件,代码如下(新打开cmd进入路径)
allure generate report/allure_results/ -o report/html --clean
(二)在jenkens平台整合报告
1.启动jenkens,新建项目
打开项目,构建
report是自己写的代码里边存放报告的目录名
value部分是要执行的代码路径,key部分固定输入