当前位置:网站首页>pytest接口自动化测试框架 | 集成Allure测试报告
pytest接口自动化测试框架 | 集成Allure测试报告
2022-08-01 07:12:00 【COCOgsta】
视频来源:B站《冒死上传!pytest接口自动化测试框架(基础理论到项目实战及二次开发)教学视频【软件测试】》
一边学习一边整理老师的课程内容及试验笔记,并与大家分享,侵权即删,谢谢支持!
附上汇总贴:pytest接口自动化测试框架 | 汇总_COCOgsta的博客-CSDN博客
- 安装jdk1.8才可以运行Allure
- 解压Allure压缩包
- 配置Allure到环境变量,到path里面
allure测试报告是基于pytest运行后,生成的json文件,来实现的结果展示,以一个工程的形态展示本次的所有测试结果
要集成pytest实现allure的展示,需要安装:
pip install allure-pytest
test_allure.py
import pytest
def test_case01():
assert 1==1
def test_case02():
assert 1 == 1
def test_case03():
assert 1 == 3
def test_case04():
assert 1 == 4
def test_case05():
assert 1 == 5
def test_case06():
assert 1 == 6
main.py
import pytest
import os
if __name__ == '__main__':
pytest.main(['-s', 'test_allure.py', '--alluredir', './result'])
os.system('allure generate ./result/ -o ./report_allure/ --clean')
边栏推荐
- 「面经分享」西北大学 | 字节 生活服务 | 一面二面三面 HR 面
- 金山打字通 官网 下载
- 【FiddlerScript】利用FiddlerScript抓包保利威下载
- Using FiddlerScript caught poly FiddlerScript 】 【 download
- 仿牛客网项目总结
- Offer刷题——1
- Explosive 30,000 words, the hardest core丨Mysql knowledge system, complete collection of commands [recommended collection]
- 从购买服务器到网站搭建成功保姆级教程~超详细
- 特殊的日子,值得纪念
- 旋度(7)连接失败localhost8080;连接拒绝了
猜你喜欢
实战演练 Navicat 中英文模式切换
Practical training Navicat Chinese and English mode switching
【HDLBits 刷题】Circuits(1)Combinational Logic
研发过程中的文档管理与工具
Dbeaver connect the MySQL database and error Connection refusedconnect processing
first unique character in characters
app 自动化 通过工具查看app 元素 (三)
Windows taskbar icon abnormal solution
Win任务栏图标异常解决
MVVM项目开发(商品管理系统一)
随机推荐
Xiaobai's 0 Basic Tutorial SQL: An Overview of Relational Databases 02
Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast
special day to remember
史上超强最常用SQL语句大全
支付宝如何生成及配置公钥证书
mysql中添加字段的相关问题
数据机构----线性表之单向链表
【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
I have three degrees, and I have five faces. I was "confessed" by the interviewer, and I got an offer of 33*15.
The Bean's life cycle
根据指定区域内容生成图片并进行分享总结
我的创作纪念日
More than 2022 cattle guest school game 4 yue
点餐系统数据库设计--SQL Server
Srping bean in the life cycle
How JS works
Sound Signal Processing Fundamental Frequency Detection and Time-Frequency Analysis
NIO编程
R语言使用gt包和gtExtras包优雅地、漂亮地显示表格数据:gtExtras包的pad_fn函数与gt::fmt函数一起用于填充包含数值的特定列、对数据列的数值进行十进制对齐(从小数点对齐)
从购买服务器到网站搭建成功保姆级教程~超详细