前言
前期篇章主要講解了Robot Framework的環(huán)境搭建,基本配置和一些實(shí)例教程。隨著行業(yè)的發(fā)展和項(xiàng)目的快速迭代過(guò)程,持續(xù)交付、持續(xù)集成和持續(xù)測(cè)試迫不及待。上面有篇文章講到Robot Framework+Jenkins的環(huán)境配置,為優(yōu)化測(cè)試結(jié)果顯示,本篇增加了Allure。完整的展現(xiàn)RF+Allure+Jenkins 自動(dòng)化持續(xù)集成。一起往下看
一、首先在?RF 中集成?Allure
安裝?Allure 需要的環(huán)境:
1)JDK的安裝:JDK1.8.0+以上

2)安裝?Allure 有兩種方式,官網(wǎng)(https://docs.qameta.io/allure/#_installing_a_commandline)有介紹:
?>.下載安裝包,配置?allure 環(huán)境

>.通過(guò)?scoop 進(jìn)行安裝
首先需要安裝scoop,在windows 安裝scoop 需要使用powershell 工具,這個(gè)在我的windows7 64位旗艦版上是自帶的工具(在運(yùn)行對(duì)話框輸入powershell,調(diào)出powershell---這個(gè)可以檢查電腦是否已帶有powershell工具,如沒(méi)有安裝,請(qǐng)參考網(wǎng)址:http://www.xiazaijidi.com/jc/4426.html)。打開(kāi)?powershell 工具后,如下圖:

執(zhí)行?iex (new-object net.webclient).downloadstring('https://get.scoop.sh')開(kāi)始下載?scoop 并安裝,如果報(bào)錯(cuò)的話執(zhí)行?Set-ExecutionPolicy RemoteSigned -scope CurrentUser,然后再次安裝?scoop。安裝完?scoop 后,就可以按照官方文檔安裝?allure 了。

這里需要注意的是第二條命令\bin\checkver.ps1 allure -u。這里需要找到?scoop 的安裝目錄,找到對(duì)應(yīng)的?checkver.ps1 文件。
3)安裝?allure-robotframework
在https://github.com/allure-framework/allure-python/tree/master/allure-robotframework地址下找到allure-robotframework源碼路徑

解析:上邊?pip 安裝完?allure-robotframework 后,執(zhí)行?robot 命令生成?allure 報(bào)告的時(shí)候后邊的./my_robot_test 是自己運(yùn)行RF 用例的目錄位置,請(qǐng)根據(jù)自己的環(huán)境進(jìn)行更換。比如我的路徑為:D:\Python36\testproject\Test\Suite.robot
二、在?jenkins 中集成?RF 插件
要想?jenkins 中集成?RF 和?Allure,我們分步進(jìn)行集成,先介紹下?jenkins 的安裝和在?jenkins中安裝?RF 插件,詳情步驟見(jiàn)《Robot Framework+Jenkins構(gòu)建集成環(huán)境的搭建》篇。
參考資料:
1.Pytest 和?Allure 集成
https://blog.csdn.net/liuchunming033/article/details/79624474?utm_source=blogxgwz8
2.?[endif]allure 與?Robot Framework 集成?
http://www.itdecent.cn/p/6a3837232042
3.jenkins 與?RF 集成
https://www.cnblogs.com/saryli/p/7262388.html
4.jenkins 郵件設(shè)置
https://blog.csdn.net/galen2016/article/details/77975965
5.jenkins 定時(shí)任務(wù)
http://www.itdecent.cn/p/509c59391b3b