美文网首页
python接口自动化-allure2-添加用例链接

python接口自动化-allure2-添加用例链接

作者: 疯子李 | 来源:发表于2024-01-10 00:33 被阅读0次
# -*- coding: utf-8 -*-
# @Time    : 2023/6/29 10:49
# @Author  : yanfa
# @user   : yanfa 
# @File    : test_allure_03_for_add_link.py
# @remark: 添加链接
""""""
import allure

"""应用场景:
将报告与bug管理/测试用例管理系统集成,支持三种@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:添加用例管理系统链接 @allure.testcase(url,name) 会有一个圆柱图标
@allure.testcase("https://xxx.com","这是用例管理系统")
def test_with_link_testcase():
    pass

# 格式3:添加bug管理系统链接 @allure.issue(url,name) 会有一个bug图标
# 特殊:通过--allure-link-pattern指定一个模版链接,将url传成bugid
# --allure-link-pattern=issue:https://xxx.com/t/topic/{}
# 目标链接:https://xxx.com/t/topic/24593
# 执行命令: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管理系统")
def test_with_link_issue():
    pass

相关文章

网友评论

      本文标题:python接口自动化-allure2-添加用例链接

      本文链接:https://www.haomeiwen.com/subject/lqpvgdtx.html