pytest allure 生成html测试报告
前提:需要 java 1.8 以上、python3环境
一、下载pytest
pip install pytest
二、下载Allure Pytest Adaptor插件
pip install pytest-allure-adaptor
三、下载allure压缩包
地址:https://github.com/allure-framework/allure2/releases,配置环境变量:path 里添加 安装目录/allure-commandline-2.12.1/bin
四、报错解决
错误:module ‘allure’ has no attribute ‘severity_level’
删除后重新安装,执行以下命令:
pip uninstall pytest-allure-adaptor
pip install allure-pytest
五、运行
测试文件目录下执行 pytest,测试文件必须以 test 开头,支持全部测试用例运行,也可以指定测试用例运行,进入文件测试用例目录下执行
1、指定运行:pytest 测试文件 --alluredir report
pytest test_demo01.py --alluredir report
会在当前文件夹生成 allure-report 文件夹,包含HTML测试报告 index.html
2、全部运行:pytest --alluredir report
pytest --alluredir report
会在当前文件夹生成 allure-report 文件夹,包含HTML测试报告 index.html,含所有测试用例结果数据
pytest allure 生成html测试报告的更多相关文章
- Python&Selenium&pytest借助allure生成自动化测试报告
一.摘要 本篇博文将介绍Python和Selenium进行自动化测试时,如何借助allure生成自动化测试报告 二.环境配置 首先python环境中安装pytest和pytest_allure_ada ...
- Pytest测试框架(五):pytest + allure生成测试报告
Allure 是一款轻量级.支持多语言的开源自动化测试报告生成框架,由Java语言开发,可以集成到 Jenkins. pytest 测试框架支持Allure 报告生成. pytest也可以生成juni ...
- python + pytest + allure生成测试报告
pytest结合allure生成测试报告 环境搭建 要安装java环境,版本要是jdk1.8的,配置好java环境变量,不然输入allure命令会报错,JAVA_HOME环境,自行配置 安装allur ...
- 【Mac+Wind7】pytest + allure生成定制报告
一.升级Powershell(windows7及以上版本默认自带.其实普通的CMD命令行工具够用了) 我是Win7默认带的pw1.0,太古老了升级一下,地址如下,选择与自己windows版本匹配的连接 ...
- Pytest+allure生成测试报告
1.Allure.zip包的下载地址: https://github.com/allure-framework/allure2 在跳转页面选择一个allure.zip包的版本下载 若以上方法无法下载z ...
- pytest+allure生成接口自动化测试报告
准备环境 1.安装pytest pip install pytest -i http://pypi.douban.com/simple pytest-ordering pytest.main([ &q ...
- pytest + allure 生成测试报告
pytest测试样例规则:测试文件以test_开头(以_test结尾也可以)测试类以Test开头,并且不能带有 init 方法测试函数以test_开头断言使用基本的assert即可 ubuntu 安装 ...
- mvn + testng + allure 生成自动化测试报告
最近学了个新东西,使用java的testng测试框架做自动化测试.并且声称自动化报告. (1)创建maven工程 File-New-Other (2)创建testng类 当前import org.te ...
- pytest+allure高端测试报告
1.下载jdk,搭建jdk环境 下载JDK http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.下载allure ...
随机推荐
- C#LeetCode刷题之#190-颠倒二进制位(Reverse Bits)
问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/4050 访问. 颠倒给定的 32 位无符号整数的二进制位. 输入: ...
- NeuralCoref: python的共指消解工具教程
转载地址 https://blog.csdn.net/blmoistawinde/article/details/81782971 共指消解 首先简要地说说共指消解是什么,有什么用处.假设机器正在阅读 ...
- neo4j批量导入数据的两种解决方案
neo4j批量导入数据有两种方法,第一种是使用cypher语法中的LOAD CSV,第二种是使用neo4j自带的工具neo4j-admin import. LOAD CSV 导入的文件必须是csv文件 ...
- JVM的方法执行引擎-entry point栈帧
接着上一篇去讲,回到JavaCalls::call_helper()中: address entry_point = method->from_interpreted_entry(); entr ...
- Java之Annotation(注解)——注解处理器
如果没有用来读取注解的方法和工作,那么注解也就不会比注释更有用处了.使用注解的过程中,很重要的一部分就是创建于使用注解处理器.Java SE5扩展了反射机制的API,以帮助程序员快速的构造自定义注解处 ...
- DML语言(数据操纵语言)
#DML语言/*数据操作语言:插入:insert修改:update删除:delete */ #一.插入语句#方式一:经典的插入/*语法:insert into 表名(列名,...) values(值1 ...
- 「完整案例」基于Socket开发TCP传输客户端
1 程序界面设计 TCP客户端在上位机开发中应用很广,大多数情况下,上位机软件都是作为一个TCP客户端来与PLC或其他服务器进行通信的.TCP客户端的主要功能就是连接服务器.发送数据.接收数据.断开 ...
- Hibernate在MySQL中查询区分大小写
MySQL查询中默认是不区分大小写的,比如如下语句: SELECT * from PersonBehDevice where flag=0 AND devicecode ='ddjc' 查询结果如下: ...
- Z shell (zsh) 安装
1. 安装 zsh 和一些依赖 sudo apt update sudo apt install -y zsh python-pygments autojump 2.下载推荐配置文件 3. 在家目录解 ...
- 用Python的Pandas和Matplotlib绘制股票KDJ指标线
我最近出了一本书,<基于股票大数据分析的Python入门实战 视频教学版>,京东链接:https://item.jd.com/69241653952.html,在其中给出了MACD,KDJ ...