Pytest 生成Report
1. 生成JunitXML 格式的测试报告
JunitXML报告是一种很常用的测试报告,比如可以和Jenkins进行集成,在Jenkins的GUI上显示Pytest的运行结果,非常便利。
运行完case后可以到report路径下去查看相应的xml文件,也可以在PyCharm打开该xml文件查看。
运行
pytest --junitxml=path
#绝对路径:
pytest -v test_one_func.py --junitxml=C:\Users\PycharmProjects\pytest_example\report\test_one_func.xml
#相对路径
pytest -v test_one_func.py --junitxml=report\test_one_func.xml
2. 生成result log格式的测试报告
txt也是最简单的一种测试报告,实例如下。运行完case后可以到report路径下去查看相应的txt文件,也可以在PyCharm打开该txt文件查看。
pytest -v test_one_func.py --resultlog=report\log.txt
3. 生成Html格式的测试报告
html格式的测试报告在浏览器观看效果很好,还可以把这些测试报告放在Web服务器上。 首先,需要安装pytest-html插件。
pip install pytest-html
pytest -v test_one_func.py --html=report\test_one_func.html
Pytest 生成Report的更多相关文章
- Python单元测试框架之pytest -- 生成测试报告
继续pytest单元测试框架的学习,pytest可以生成多种类型的测试报告.这一节就来学习pytest如何生成测试报告. 创建test_calss.py 测试用例文件,这里以测试该文件为例. #cod ...
- JMeter 十三:生成 report dashboard
参考:http://jmeter.apache.org/usermanual/generating-dashboard.html JMeter 3.x开始,可以生成HTML格式的report . 注意 ...
- 在 .Net 项目中生成Report小记
背景 项目为WinForm + WCF 的应用,按照给定格式生成Report,显示在WinForm窗体上并可以导出为PDF和Excel文件. 分析 之前用过DevExpress For WinForm ...
- pytest生成测试报告
生成JunitXML格式的测试报告 --junitxml=report\h.xml 生成result log 格式的测试报告 --resultlog=report\h.log 生成htm ...
- Allure+pytest 生成测试报告
简介: python 主流自动化测试报告插件有三个:HTMLTestRunner.BeautifulReport 和 Allure.HTMLTestRunner是一个比较古老的报告模板,界面也不是很好 ...
- pytest生成allure报告
在pytest框架中可以用很多插件来生成测试报告,本文总结下怎么生成allure报告 allure allure是一款开源的,专门用来展示测试结果的一个工具,allure可以与很多的测试框架做集成,比 ...
- Selenium生成Report的利器- ExtentReports
生成的报告最后的样子是: 里面加了截图, 将每一步骤的截图,(所以方法里多加了一个截屏方法). 加入到报告中,这样更清晰明了.首先 pom文件中需引用:<!-- 报告输出 --><d ...
- pytest生成测试报告-4种方法
1.生成resultlog文件 2.生成JunitXML文件 3.生成html测试报告 > pip install pytest-html # 通过pip安装pytest-html 4. ...
- 生成report由Eamil定時寄出
Blat 是一个命令行发邮件的小工具,仅支持简单的SMTP协议,需要SMTP服务器的支持. 官网:http://www.blat.net/ 下载地址:https://sourceforge.ne ...
随机推荐
- 越狱机器SSH安装与使用
SSH安装html, body {overflow-x: initial !important;}.CodeMirror { height: auto; } .CodeMirror-scroll { ...
- How Not to Crash #2: Mutation Exceptions 可变异常(不要枚举可变的集合)
How Not to Crash #2: Mutation Exceptions 可变异常html, body {overflow-x: initial !important;}html { font ...
- WPF中自定义路由事件
public class MyButtonSimple: Button { // Create a custom routed event by first registering a RoutedE ...
- Aspose.Cells Smart markers 基于模板导出Excel
Aspose.Cells可以预先定义Excel模板,然后填充数据(官方文档:http://www.aspose.com/docs/display/cellsjava/Smart+Markers). 设 ...
- Android——Fragment实例精讲——底部导航栏+ViewPager滑动切换页面
说明: 实现效果: 1- 用ViewPager实现Fragmen之间的切换 2- 底部用RadioGroup实现,更方便的实现图片和字体颜色的改变,更方便的通过RadioButton的点击事件来控制页 ...
- WinForm 控件键盘消息处理剖析(转)
一直想整理键盘事件的调用顺序,刚好看见园子里的这篇文章,写的不错,就转载了:http://www.cnblogs.com/tedzhao/archive/2010/09/07/1820557.html ...
- Spring cloud系列十四 分布式链路监控Spring Cloud Sleuth
1. 概述 Spring Cloud Sleuth实现对Spring cloud 分布式链路监控 本文介绍了和Sleuth相关的内容,主要内容如下: Spring Cloud Sleuth中的重要术语 ...
- const_cast的应用
对于const变量,我们不能修改它的值,这是这个限定符最直接的表现.但是我们就是想违背它的限定希望修改其内容怎么办呢?于是我们可以使用const_cast转换符是用来移除变量的const限定符.con ...
- Rscripts的使用,以及如何为R脚本传参数
一.在windows下使用Rscript: 1.进入cmd.exe下,将当前工作目录转到Rscript.exe所在目录下面,然后调用Rscript **.R文件即可.但是所调用的.R文件必须是在R的 ...
- 安卓程序代写 网上程序代写[原]BluetoothDevice详解
一. BluetoothDevice简介 1. 继承关系 public static Class BluetoothDevice extends Object implement Parcelable ...