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

相关推荐
ihui数学建模9 小时前
【Mac版】Linux 入门命令行快捷键+联想记忆
linux·运维·macos
可曾去过倒悬山1 天前
mac操作笔记
macos
可曾去过倒悬山1 天前
Mac上优雅简单地使用Git:从入门到高效工作流
git·elasticsearch·macos
山楂树の1 天前
模型优化——在MacOS 上使用 Python 脚本批量大幅度精简 GLB 模型(通过 Blender 处理)
python·macos·3d·图形渲染·blender
光头才能变强1 天前
Mac安装Navicat教程Navicat Premium for Mac v17.1.9 Mac安装navicat【亲测】
macos
Frilled Lizard2 天前
解决mac下git pull、push需要输入密码
git·macos
是小崔啊2 天前
Mac下的Homebrew
macos
0wioiw03 天前
Apple基础(Xcode①-项目结构解析)
ide·macos·xcode
名字不要太长 像我这样就好3 天前
【iOS】weak修饰符
macos·ios·objective-c·cocoa·xcode
ghostwritten3 天前
在 Mac 上用 Vagrant 安装 K8s
macos·kubernetes·vagrant