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

在Default Content中定义邮件正文,模板如下

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>${ENV, var="JOB_NAME"}-第${BUILD_NUMBER}次构建日志</title> </head> <body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4" offset="0"> <table cellpadding="0" cellspacing="0"> <tr> <td>(本邮件由程序自动下发,请勿回复!)</td> </tr> <tr> <td> <h2><font color="#FF0000">构建结果 - ${BUILD_STATUS}</font></h2> </td> </tr> <tr> <td><br /> <b><font color="#0B610B">构建信息</font></b> <hr size="2" /> </td> </tr> <tr><a href="http://www.likecs.com/${PROJECT_URL}">${PROJECT_URL}</a> <td> <ul> <li>项目名称:${PROJECT_NAME}</li> <li>GIT路径:<a href="http://www.likecs.com/${GIT_URL}">${GIT_URL}</a></li> <li>构建编号:第${BUILD_NUMBER}次构建</li> <li>触发原因:${CAUSE}</li> <li>系统的测试报告 :<a href="http://www.likecs.com/${PROJECT_URL}${BUILD_NUMBER}/allure">${PROJECT_URL}${BUILD_NUMBER}/allure</a></li><br /> <li>构建日志:<a href="http://www.likecs.com/${BUILD_URL}console">${BUILD_URL}console</a></li> </ul> </td> </tr> <tr> <td> <b><font color="#0B610B">变更信息:</font></b> <hr size="2" /> </td> </tr> <tr> <td> <ul> <li>上次构建成功后变化 : ${CHANGES_SINCE_LAST_SUCCESS}</a></li> </ul> </td> </tr> <tr> <td> <ul> <li>上次构建不稳定后变化 : ${CHANGES_SINCE_LAST_UNSTABLE}</a></li> </ul> </td> </tr> <tr> <td> <ul> <li>历史变更记录 : <a href="http://www.likecs.com/${PROJECT_URL}changes">${PROJECT_URL}changes</a></li> </ul> </td> </tr> <tr> <td> <ul> <li>变更集:${JELLY_SCRIPT,template="html"}</a></li> </ul> </td> </tr> <hr size="2" /> </table> </body> </html>

在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实现接口自动化测试

构建完成后,Jenkins自动发送的邮件报告如下(未优化前)

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实现接口自动化测试

CI集成后,产生的Allure报告如下

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

Jenkins中启动测试项目演示

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

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

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