[英]Is there a way to send log.html,report.html and output.xml in email after test completion in robot-framework?
[英]How to add some external links to ROBOT Framework Test Statistics in log.html and output.xml?
如何自定義機器人框架log.html和輸出,以便可以向輸出文件(例如log.html和output.xml文件)添加一些外部鏈接。
您可以在測試套件中使用元數據。 這些元數據可以包含外部鏈接。 用戶指南的“ 免費測試套件元數據 ”部分對此進行了說明。
如果您使用TXT格式進行測試,則外觀如下:
*** Settings ***
Metadata Here is a link http://www.external.com/pages.html
這將包含在您的output.xml和report.html中
有幾種方法可以添加指向機器人框架日志的鏈接。 它們全部記錄在《 Robot框架用戶指南》中 。
您可以使用--tagstatlink選項將鏈接添加到標簽。 這些鏈接將顯示在日志的“按標簽統計”部分中。 以下是機器人框架用戶指南中的示例:
--tagstatlink mytag:http://www.google.com:Google
--tagstatlink jython-bug-*:http://bugs.jython.org/issue_%1:Jython-bugs
--tagstatlink owner-*:mailto:%1@domain.com?subject=Acceptance_Tests:Send_Mail
《機器人框架用戶指南》中標題為從標記名稱創建鏈接的部分中對此進行了說明。
您可以使用特殊的日志級別HTML
添加所需的任何HTML
。 例如:
*** Test Cases ***
| Example
| | log | For more information see <a href='...'>foo</a> | HTML
該信息記錄在《機器人框架用戶指南》中標題為“ 記錄信息”的部分中。
您可以在免費的測試套件元數據中添加鏈接。 例如:
*** Settings ***
| Metadata | More Info
| ... | For more informationabout *Robot Framework* see http://robotframework.org
《機器人框架用戶指南》中標題為“ 免費測試套件元數據 ”的部分對此進行了記錄。
您還可以在測試用例或關鍵字中的任何位置調用Set Suite Metadata關鍵字。
您可以在測試套件,測試用例和關鍵字文檔中添加鏈接。 這是用戶指南中的示例:
*** Test cases ***
| Example
| | [Documentation]
| | ... | See [http://www.robotframework.org]|robot framework website]
該信息記錄在《機器人框架用戶指南》中標題為“ 自定義鏈接和圖像 ”的部分中。
您要添加頂級元數據。 該元數據將是一個HTML鏈接。
為主套件創建一個西裝設置(在父測試文件夾中創建一個名為__init __。robot的文件)
在其中:
*** Settings *** Documentation The main init phase for all robot framework tests. Suite Setup Setup *** Keywords *** Setup Set Suite Metadata Link to my cool external site http://www.external.com top=True
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.