一、配置 allure 环境变量
1、下载
allure
是一个命令行工具,可以去 github
下载最新版:https://github.com/allure-framework/allure2/releases

2、解压到本地

3、配置环境变量
-
复制路径如:F:\allure-2.13.7\bin
-
环境变量、Path、添加 F:\allure-2.13.7\bin、保存

- cmd 中输入 where allure ,查看是否能找到

二、Jenkins配置Allure
1、安装allure插件
系统管理-->插件管理-->可安装插件 搜索allure
进行安装

2、安装Allure Commandline
安装完allure
插件后,进入系统管理-->全局工具配置,安装Allure Commandline

3、Jenkins 任务配置构建操作
新建job
-->增加构建步骤-->Windows
批处理命令,输入如下命令:
#!/bin/bash
cd .jenkins\workspace\allure-test\allure-results
pytest -s -q --alluredir=allure-test/allure-results --clean-alluredir
exit 0
注意:新增构建后操作,Allure report
,输入report
所在目录名称:与Windows
批处理命令中设置的报告目录名称保持一致(这里使用的是report
名称)
4、执行构建,查看报告

5、查看报告详情

最后感谢每一个认真阅读我文章的人,礼尚往来总是要有的,虽然不是什么很值钱的东西,如果你用得到的话可以直接拿走:

