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 最不严重

相关推荐
那年窗外下的雪.17 分钟前
AIDC 学习日志|第 25 天|设备输出反推、MAC Flapping 与 EAD 撤销
前端·网络·git·学习·macos
星辰即远方38 分钟前
RunLoop初步了解
macos·objective-c·cocoa
代码的小搬运工1 小时前
Runloop
macos·objective-c·cocoa
秋雨梧桐叶落莳1 小时前
【iOS】GCD内容整理
macos·ios·cocoa
demo007x16 小时前
让大模型活在你的鼠标旁:我用 Tauri 2 + Rust 打造了一款“反直觉”的 AI 全局划词效率神器
macos·程序员·llm
那年窗外下的雪.1 天前
AIDC 学习日志|第 24 天|设备输出反推与 MAC Flapping 定位
网络协议·学习·tcp/ip·http·macos·tcpdump
RobinDevNotes1 天前
Palmier Pro:AI时代的Mac视频编辑器
人工智能·ceph·macos·ai·音视频·视频编辑·mcp
johnsong2 天前
AI前沿日报 2026-09-08
人工智能·macos
33三 三like2 天前
基于 MAC-RUNGUIDE 的完整启动流程
macos
tedcloud1233 天前
Wand-Enhancer:如何搭建一套远程开发与测试环境
前端·人工智能·macos·开源·流程图