Jenkins----添加allure 测试报告工具 【配置】

 1.allure 测试报告工具配置

 

1.1 安装Allure 插件

 

 

1.2 使用allure report 需要在代码中添加 allure-pytest 库。

官方文档:https://pypi.org/project/allure-pytest/

# 修改Jenkins的代码执行配置,指定 allure 报告的生成目录

python -m venv venv
venv\Scripts\activate.bat && pip install -r requirements.txt  &&  pytest testcase -s -v --alluredir=allure-results

 

1.3 配置allure report 生成器

 首次使用,还需要安装allure 命令行工具,根据提示,点击 【Global Tool Configuration】 

 

 

 

    点击进入:http://localhost:8080/configureTools/  

    allure-2.13.8.zip 下载

    将附件解压之后 设置文件路径

 

1.4 项目中添加ALLure Report

 

 

1.5 因为我的项目中原来没有添加测试报告,故去项目中添加并提交

pip install allure-pytest        # 安装插件
pip freeze > requirements.txt    # 把项目中用到的库导出到requirements.txt文件夹中

 

1.6.构建测试

 

posted @ 2021-07-08 17:51  Z_sun  阅读(215)  评论(0编辑  收藏  举报