天天看點

pytest allure——allure環境配置搭建 (1)

Allure環境安裝

簡介 

Allure Framework是一種靈活的輕量級多語言測試報告工具,可以添加螢幕截圖,日志等。它提供了子產品化的體系結構和簡潔的Web報告,并能夠存儲​​附件​​​,​​步驟​​​,​​參數​​等。基于标準xUnit結果輸出,但添加了一些補充資料。任何報告都是通過兩個步驟生成的。

第一步, 連接配接到測試架構的稱為擴充卡的小型庫 将有關已執行測試的資訊儲存到XML檔案中。我們已經為流行的Java,Python測試架構提供了擴充卡。

第二步,XML檔案将轉換為HTML報告。這可以通過指令行工具,CI插件或建構工具來完成。有關更多詳細資訊,請參見示例​和文檔。

環境安裝

​​https://docs.qameta.io/allure/#_installing_a_commandline​​

本文僅基于windows7, 其他環境檢視官網安裝說明

安裝allure要求:需要通過scoop安裝,安裝scoop需要powershell版本在5.0以上,.NetworkFramework4.5以上。打開CMD,運作powershell,get-host檢視powershell的版本要在5.0以上。打開控制台檢視.networkFramework4.5

Microsoft Windows [版本 6.1.7601]
版權所有 (c) 2009 Microsoft Corporation。保留所有權利。

C:\Users\tester03>powershell
Windows PowerShell
版權所有 (C) 2009 Microsoft Corporation。保留所有權利。

PS C:\Users\tester03> get-host


Name             : ConsoleHost
Version          : 2.0
InstanceId       : 584ed29b-2ef6-46e1-aa75-1b9251b3f27c
UI               : System.Management.Automation.Internal.Host.InternalHostUserI
                   nterface
CurrentCulture   : zh-CN
CurrentUICulture : zh-CN
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace      

 以上結果版本是2.0,下載下傳 ​​https://www.microsoft.com/en-us/download/details.aspx?id=54616​​

pytest allure——allure環境配置搭建 (1)

下載下傳之後解壓,輕按兩下*.msu安裝,重新開機計算機,打開CMD,輸入powershell回車,輸入get-host回車檢視,已成功更新到5.1

pytest allure——allure環境配置搭建 (1)
pytest allure——allure環境配置搭建 (1)

 安裝scoop:

cmd執行
# powershell
# Set-ExecutionPolicy RemoteSigned -scope CurrentUser
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')      
pytest allure——allure環境配置搭建 (1)

 這個原因是無法解析https://get.scoop.sh導緻的,打開電腦全局代理。上圖最後一次執行成功了,我的已經安裝了報already installed,這裡不解釋。

pytest allure——allure環境配置搭建 (1)

安裝allure, allure --version檢視安裝版本。

scoop install allure      
pytest allure——allure環境配置搭建 (1)

繼續閱讀