Allure安装与使用【macOS】

安装:

brew install allure

安装插件:

pip install allure-pytest==2.8.16

生成一个html格式的报告,步骤:

  • 执行生成json,制定结果保存目录
    • pytest --alluredir=report test_demo.py

查看测试保报告方式

  • 将json转成html,使用allure generate生成html格式的测试报告
    • 进入report上级目录执行命令
    • allure generate report/ -o report/html --clean
    • report目录下会生成html文件夹,html下会有一个index.html,右键浏览器打开即可

allure generate report/ -o report/html --clean

report/ :表示xml所在目录

-o:表示output输出

--clean:覆盖路径

report/html:表示将index.html报告生成到哪个文件夹

添加测试步骤

@allure.step(title="xxx")

添加主要功能模块描述

@allure.feature("xxx")

添加严重等级

@allure.serverity(allure.severity_level.CRITICAL)

BLOCKER最严重

CRITICAL 严重

NORMAL 普通

MINOR 不严重

TRIVIAL 最不严重

相关推荐
周小董2 天前
[1379]mac安装nvm
macos
bossjuemfc2 天前
不记得文件名时,Mac 上的搜索还能怎么做?
macos
2501_915909062 天前
Windows 打开 Xcode 工程,编译调试 Xcode 项目并和 Mac 同事协作
ide·windows·vscode·macos·ios·个人开发·xcode
请为小H留灯2 天前
Mac 常用操作与维护技巧
macos·电脑·清理电脑·常用技巧
hantmac3 天前
不记得文件名时,Mac 上的搜索还能怎么做?
人工智能·macos
这是谁的博客?3 天前
AI 加速器 RTL 数字系统设计深度解析:从 MAC 阵列 Verilog 实现到时序收敛与时钟功耗的芯片落地全链路
人工智能·macos·ai·verilog·数字ic设计·ai芯片·rtl
slacker-kian3 天前
M 系列 Mac 清除顽固的 CorpLink
macos·corplink·m系列
kk_net88993 天前
FSNotes:macOS 和 iOS 上的开源笔记管理器
笔记·其他·macos·ios
zhangfeng11333 天前
com.apple.quarantine 并不是乱码,而是 macOS Gatekeeper 给下载文件自动打上的“隔离属性
macos·策略模式
甘晴void3 天前
我给 Magpie 做了个 macOS 桌宠:106 段动画,请求一多就亮灯
macos·electron·开源·deepseek·桌面宠物·magpie