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

相关推荐
pe7er3 天前
macOS 应用无法打开(权限问题)解决方案
macos·mac
harmful_sheep5 天前
mac生效的终端查看
macos
iOS门童6 天前
macOS 应用"已损坏"无法打开?一文搞懂 Gatekeeper 与解决方案
macos
NPE~6 天前
[工具分享]Maccy —— 优雅的 macOS 剪贴板历史管理工具
macos·教程·工具·实用工具
差不多程序员6 天前
Mac安装OpenClaw-cn保姆级教程
macos
dzl843946 天前
mac 安装python
开发语言·python·macos
Bruce_Liuxiaowei6 天前
在 macOS 上通过 Docker 本地安装 OpenClaw 完整教程
macos·docker·容器·openclaw
阿捏利6 天前
详解Mach-O(十五)Mach-O __DATA_CONST
macos·ios·c/c++·mach-o
ShikiSuen6 天前
macOS 的 CpLk 中英切换卡顿的元凶在 InputMethodKit 本身
macos
xiayutian_c6 天前
如虎添翼-MacOS
macos