随笔 - 49  文章 - 0  评论 - 20  阅读 - 12万

allure commandline 命令行参数

本文地址:https://www.cnblogs.com/hchengmx/p/17892977.html

一、allure html 产生流程

Step 1. test文件运行后 产生 allure-results文件 (用来保存运行的结果)

产生allure html有两种方式

方法一:allure generate + allure open

  1. allure generate命令,将allure-results 生成 allure html,保存到指定目录
  2. 要打开的话,需要使用 allure open命令

方法二:allure server

allure server 提供与 allure generate + allure open一致的命令,区别在于生成的html文件保存在一个临时目录,通常为 C:\Users{login_user}\AppData\Local\Temp

二、语法格式

allure [options] [command] [command options]

generate

allure generate [option] ${allure_results目录} ${allure_reports目标目录}

命令参数

选项 描述
-c, --clean 是否删除 allure reports目录下的文件,默认false
--config 是否覆盖默认的 html配置,更改css格式,背景格式等
--configDirectory 与config配合使用,html配置文件路径
--profile 与config配合使用,html配置文件名
-o, --report-dir, --output 产生的html文件夹名,默认为 allure-report

主要用 -0, -c这两个参数。

open

用来打开 allure reports

选项 描述
-h, --host allure reports的host
-p, --port allure reports的端口,要是不指定,随机取一个没有在用的端口号

server

该命令相当于 allure generate + allure open,参数也与一致。

选项 描述
--config 是否覆盖默认的 html配置,更改css格式,背景格式等
--configDirectory 与config配合使用,html配置文件路径
-h, --host allure reports的host
-p, --port allure reports的端口,要是不指定,随机取一个没有在用的端口号
--profile 与config配合使用,html配置文件名

参考资料

Central Repository: io/qameta/allure/allure-commandline
allurereport.org
Allure Report Docs — How it works
allure2/allure-commandline/src/main/java/io/qameta/allure/CommandLine.java at master · allure-framework/allure2 · GitHub
Allure report graphic configuration | by Vitor Pimentel Barbosa | Quabity Ashuance | Medium
Pytest 系列(27)- allure 命令行参数 - 博客园

posted on   hchengmx  阅读(317)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· 单线程的Redis速度为什么快?
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示