6:allure

1:下载zip包

https://github.com/allure-framework/allure2/releases

2:解压allure,并把bin目录配置环境变量,allure --version验证

 

 3:安装allure-pytest

python3 -m pip install allure-pytest

4:执行用例指定生成allure目录

pytest test_01.py --alluredir=./result/1

5:查看报告-自动启动浏览器

allure serve ./result/1

6:allure特性--feature修饰测试类,story修饰方法用例

import allure

@allure.feature('登录模块')  @allure.story('执行成功')@allure.story('执行失败')

 

 

    1:allure运行登录模块

    pytest test_01.py --allure-features '登录模块'

     2:allure运行执行成功的用例

     pytest test_01.py --allure-stories '执行成功'

 

7:把主流程和重要模块都跑一遍

1:通过pytest.mark标签

2:通过allure.feature allure.story

 

posted @ 2022-02-14 20:40  观呼吸  阅读(56)  评论(0)    收藏  举报