pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试 (13)

新建job,配置如下,比如保留7天以内的build,并规定最多只保留10个build

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


编写构建脚本

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


在命令后,换行,写上 exit 0 (加上exit 0表示执行完成退出)
添加allure report插件

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


配置生成的xml路径和生成html报告的路径

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

设置邮件通知

安装插件Email Extension

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

进入jenkins的系统管理-系统设置,进行相关配置

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

修改Default Content的内容,具体内容如下:

$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: Check console output at ${BUILD_URL}allure/ to view the results.

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

再进入【系统管理-系统设置】拉到最下面,设置问题追踪,在Allure Report下选择增加:

Key: allure.issues.tracker.pattern Value: %s

对构建的job添加邮件发送

job配置页面,添加构建后步骤“Editable Email Notification”,如图

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

以下可以使用默认配置:

pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试


pytest+requests+Python3.7+yaml+Allure+Jenkins+docker实现接口自动化测试

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwjpgg.html