Pytest生成allure报告

allure官网

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

1. 安装allure-pytest插件

2.下载allure,下载之后解压,解压之后还要配置环境变量(环境变量path下加bin路径)

3.验证allure是否安装成功:

dos中验证: allure --version

pytest中验证:allure --version(如果失败重启pytest)

4.生成allure报告:

  • 生成临时allure json报告

  pytest.ini中加参数 

adopts:  --alluredir = ./temps -- clearn-alluredir
  • 生成正式的allure报告

在临时报告生成基础上

run.py下添加 

os.system("allure generate ./temps -o ./reports --clean ")

 

 

 

posted @ 2023-05-16 08:59  蜗牛果果  阅读(33)  评论(0编辑  收藏  举报