Allure 安装及使用

https://blog.csdn.net/chenfei_5201213/article/details/80982929

Allure 安装及使用

 
linux下安装方法
  1. Allure requires Java 8 or higher
  2. npm install -g allure-commandline --save-dev
    (如果npm不能使用需要单独安装)
 
增加软连接
 
windows下安装 Allure工具
环境
1、安装JDK1.8+
2、安装Allure
  • 下载Allure的zip安装包,戳这里
  • 解压到allure-commandline目录
  • 进入bin目录,运行allure.bat
  • 添加allure到环境变量PATH(\安装路径\allure-commandline\bin)
添加环境变量的方法:
计算机--属性--高级系统设置--环境变量--系统变量--path--编辑
 
然后新开cmd
 
 
 
demo
 
case test_demo1.py
 
运行case
运行完成后会在指定目录下生产xml报告
 
使用allure生产html可视化报告
 
 
 
run .py

pytest.main(['-m','testfails','--reruns','2','--reruns-delay','5',
"--html=HtmlTestReport/report.html",
"--alluredir=HtmlTestReport/allure"])

增加报告文件夹

 

 

 运行run.py,报错 

AttributeError: module 'allure' has no attribute 'severity_level'

解决方法:https://www.cnblogs.com/guotang/p/12726900.html

1、pip uninstall pytest-allure-adaptor

2、pip install allure-pytest

3、搞定 

重新运行,生成数据

如何查看报告数据:

使用allure server allure报告目录

如:

 

 

 

 

 

 

 

 

 

 

 

 

 
posted @ 2020-09-27 12:03  liujuan2728  阅读(464)  评论(0编辑  收藏  举报