一、层级装饰器
名称 | 含义 | 层级 | 用途 |
---|---|---|---|
epic |
史诗 | 顶层 | 将类再往上归一层 |
feature |
功能 | 第二层 | 标记类 |
story |
故事 | 第三层 | 标记方法 |
二、标识层级
- 可继承,方法继承类
- 可重写,方法自身标签优先,没有再用类标签
@allure.epic('三户管理')
@allure.feature('用户模块')
class TestUser:
@allure.story('注册')
def test_sign_up(self):
.....
三、报告展现
image.png
四、按层级控制用例
image.png
pytest --allure-features=feature1,feature2 ./test_case/
pytest --allure-stories=story1,story2 ./test_case/