前言
- 前面提到,可以使用@allure.title 和 @allure.description 给测试用例添加标题和描述
- 在用例里面也可以动态更新标题和详情
- 使用allure.dynamic.description 和 allure.dynamic.title 实现
源码
class Dynamic(object):
@staticmethod
def title(test_title):
plugin_manager.hook.add_title(test_title=test_title)
@staticmethod
def description(test_description):
plugin_manager.hook.add_description(test_description=test_description)
@staticmethod
def description_html(test_description_html):
plugin_manager.hook.add_description_html(test_description_html=test_description_html)
@staticmethod
def label(label_type, *labels):
plugin_manager.hook.add_label(label_type=label_type, labels=labels)
@staticmethod
def severity(severity_level):
Dynamic.label(LabelType.SEVERITY, severity_level)
@staticmethod
def feature(*features):
Dynamic.label(LabelType.FEATURE, *features)
@staticmethod
def story(*stories