python接口自動(dòng)化-allure2-添加用例鏈接

# -*- coding: utf-8 -*-
# @Time    : 2023/6/29 10:49
# @Author  : yanfa
# @user   : yanfa 
# @File    : test_allure_03_for_add_link.py
# @remark: 添加鏈接
""""""
import allure

"""應(yīng)用場(chǎng)景:
將報(bào)告與bug管理/測(cè)試用例管理系統(tǒng)集成,支持三種@allure.link、@allure.issue、@allure.testcase
"""

# 格式1:添加普通鏈接 @allure.link(url,name) url-鏈接 name-鏈接名稱
@allure.link("https://xxx.com")
def test_with_link():
    pass

@allure.link("https://xxx.com","這是普通鏈接")
def test_with_link_name():
    pass

# 格式2:添加用例管理系統(tǒng)鏈接 @allure.testcase(url,name) 會(huì)有一個(gè)圓柱圖標(biāo)
@allure.testcase("https://xxx.com","這是用例管理系統(tǒng)")
def test_with_link_testcase():
    pass

# 格式3:添加bug管理系統(tǒng)鏈接 @allure.issue(url,name) 會(huì)有一個(gè)bug圖標(biāo)
# 特殊:通過(guò)--allure-link-pattern指定一個(gè)模版鏈接,將url傳成bugid
# --allure-link-pattern=issue:https://xxx.com/t/topic/{}
# 目標(biāo)鏈接:https://xxx.com/t/topic/24593
# 執(zhí)行命令:pytest test_allure_03_for_add_link.py --alluredir=./report --clean-alluredir --allure-link-pattern=issue:https://xxx.com/t/topic/{}
@allure.issue("24593","這是bug管理系統(tǒng)")
def test_with_link_issue():
    pass

?著作權(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)容