RF+Allure+Jenkins 自動(dòng)化持續(xù)集成環(huán)境搭建

前言

前期篇章主要講解了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+以上

jdk版本

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 工具后,如下圖:

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 了。

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源碼路徑

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

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容