Allure生成测试报告
Allure 使用
安装 adapter
如果要在 pytest
中使用 Allure
,需要使用一个 Adaptor
安装 pytest-allure-adaptor
pip3 install pytest-allure-adaptor
生成报告
还是基于我们上一篇讲解 pytest 所写的代码
现在我们需要做的只是一行命令!在执行原先的命令之后加一句配置即可
pytest -s -q --alluredir report
或者
pytest -s -q --alluredir [path_to_report_dir]
这时候你就会发现用例执行完成之后会在当前目录下生成了一个report文件
打开xml会发现一堆乱七八糟的东西.坑爹呢.说好的报告美观呢?(掀桌
这个文件夹的东西很重要,最终生成好看的报告就是靠他们.但再生成之前需要先装一个生成工具
生成好看的报告
生成工具有很多种,相关文档可以参考下面
它支持 gradle Plugin
,Jenkins Plugin
等等.这里我们简单的使用 Command 的方式生成报告.
安装 Command Tool
allure-commandline下载链接
https://github.com/allure-framework/allure1/releases/download/allure-core-1.5.2/allure-commandline.zip
下载解压缩即可使用
生成 Report
allure generate directory-with-results/ -o directory-with-report
这里我们的命令是
allure generate report/ -o report/html
最终报告会生成在 report/html
目录下
打开 index.html
,之前写的 case 报告就会呈现在你面前
注:直接用chrome浏览器打开报告,报告会是空白页面,解决办法,在pycharm中右击index.html选择打开方式Open in Browser就可以了
Allure生成测试报告的更多相关文章
- Pytest测试框架(五):pytest + allure生成测试报告
Allure 是一款轻量级.支持多语言的开源自动化测试报告生成框架,由Java语言开发,可以集成到 Jenkins. pytest 测试框架支持Allure 报告生成. pytest也可以生成juni ...
- python + pytest + allure生成测试报告
pytest结合allure生成测试报告 环境搭建 要安装java环境,版本要是jdk1.8的,配置好java环境变量,不然输入allure命令会报错,JAVA_HOME环境,自行配置 安装allur ...
- pytest(11)-Allure生成测试报告(一)
Allure是一个开源的测试报告生成框架,提供了测试报告定制化功能,相较于我们之前使用过pytest-html插件生成的html格式的测试报告,通过Allure生成的报告更加规范.清晰.美观. pyt ...
- Pytest+allure生成测试报告
1.Allure.zip包的下载地址: https://github.com/allure-framework/allure2 在跳转页面选择一个allure.zip包的版本下载 若以上方法无法下载z ...
- python自动化之使用allure生成测试报告
Allure测试报告框架帮助你轻松实现"高大上"报告展示.本文通过示例演示如何从0到1集成Allure测试框架.重点展示了如何将Allure集成到已有的自动化测试工程中.以及如何实 ...
- pytest+jenkins+allure 生成测试报告发送邮件
前言第一部分:Pycharm for Gitee1. pycharm安装gitee插件2. gitee关联本地Git快速设置- 如果你知道该怎么操作,直接使用下面的地址简易的命令行入门教程:3. Gi ...
- Pytest使用pytest-html和allure生成测试报告
Pytest-html 1.安装命令pip3 install pytest-html,如下图: 执⾏后,会在当前⽬录下⽣成 ⼀个report.html的⽂件,打开后会展示详细的测试报告,执行该命令py ...
- pytest + allure 生成测试报告
pytest测试样例规则:测试文件以test_开头(以_test结尾也可以)测试类以Test开头,并且不能带有 init 方法测试函数以test_开头断言使用基本的assert即可 ubuntu 安装 ...
- Allure自动化测试报告之修改allure测试报告名称
1.从github获取allure代码 https://github.com/allure-framework/allure2 2.安装gradle,用于打包jar brew install grad ...
随机推荐
- ios 处理内存警告
iPhone下每个app可用的内存是被限制的,如果一个app使用的内存超过20M,则系统会向该app发送Memory Warning消息.收到此消息后,app必须正确处理,否则可能出错或者出现内存泄露 ...
- Linux下使用curl进行http请求(转)
curl在Linux下默认已经安装,Windows需要自行安装. 下载地址:https://curl.haxx.se/download.html Windows离线版本:链接:http://pan.b ...
- 转:Python yield 使用浅析 from IBM Developer
评注:没有看懂. 转: https://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/ Python yield 使用浅析 初 ...
- 推断dxf文件的版本号
打开DXF參考手冊,在DXF參考手冊中,点击"索引"-->输入"HEADER",在ACADVER字段有acd的版本号信息: 以下是用C语言,写的推断dxf ...
- zoj 3573 Under Attack(线段树 标记法 最大覆盖数)
Under Attack Time Limit: 10 Seconds Memory Limit: 65536 KB Doctor serves at a military air f ...
- 怎样查询锁表的SQL
通过以下的语句查询出锁表的SQL: select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username ...
- Centos6-编译安装Redis
[root@tbwy02 ~]# cd /tools/[root@tbwy02 tools]# yum install -y wget gcc make tcl[root@tbwy02 tools]# ...
- iOS之Prefix.pch
本文转载至 http://blog.csdn.net/lvxiangan/article/details/21325093 Prefix.pch的作用和用法 Hello World_Prefix. ...
- Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go? | Hacker News https://news.ycombinator.com/i ...
- Maven group, artifact or version defined in the pom file do not match the file ...
在把library上传到bintray空间的时候报以下错误 Could not upload to 'https://api.bintray.com/content/ping/maven/comm-a ...