1. pytest測試代碼
2. jenkins配置
建構-執行shell指令
3. allure配置
需要安裝Allure插件

<b>附錄:allure定制化相關注解</b>
1.feature——測試用例特性(主要功能子產品)
使用方法:@allure.feature()
2.story——feature功能子產品下的分支功能
使用方法:@allure.story()
3.severity——測試用例的重要級别
Allure中對嚴重級别的定義:
blocker級别:中斷缺陷(用戶端程式無響應,無法執行下一步操作)
critical級别:臨界缺陷( 功能點缺失)
normal級别:普通缺陷(數值計算錯誤)
minor級别:次要缺陷(界面錯誤與UI需求不符)
trivial級别:輕微缺陷(必輸項無提示,或者提示不規範)
使用方法:@allure.severity(allure.severity_level.CRITICAL) 或者 @allure.severity('critical')
4.step——測試用例的步驟
使用方法:[email protected]() 隻能以裝飾器的形式放在類或者方法上面 2.with allure.step(): 可以放在測試用例方法裡面,但測試步驟的代碼需要被該語句包含
5.attach——用于向測試報告中輸入一些附加的資訊,通常是一些測試資料資訊
使用方法:allure.attach(body, name, attachment_type, extension)
<code>body</code> - 要寫入檔案的原始内容。
<code>name</code> - 包含檔案名的字元串
<code>attachment_type </code>- 其中一個<code>allure.attachment_type</code>值
<code>extension</code> - 提供的将用作建立檔案的擴充名
6.link/issue/testcase——連結
使用方法:
@allure.link()
@allure.issue()
@allure.testcase()
7.description——用例描述
@allure.description() 提供描述字元串的裝飾器
@allure.description_html() 提供一些HTML在測試用例的描述部分