You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

技术求助:如何自定义Allure报告的标题与Logo?

Got it, let's walk through exactly how to replace that default header text and logo in your Allure reports. These steps work for most standard setups (Maven/Gradle projects, or standalone Allure CLI usage):

1. Replace the Default "ALLURE REPORT" Title

You've got two straightforward ways to set a custom report title:

Option 1: Use the allure.properties Configuration File

  • In your project, navigate to src/test/resources (create the folder if it doesn't exist).
  • Create or edit a file named allure.properties.
  • Add this line to the file, replacing the placeholder with your desired title:
    allure.report.name=Your Custom Report Title
    
  • Regenerate your Allure report—your new title will show up in the header right away.

Option 2: Pass a Command-Line Parameter

If you generate reports directly via the Allure CLI, you can override the title on the fly with the --report-name flag:

allure generate --report-name "Your Custom Report Title" allure-results -o allure-report

Swapping out the logo requires replacing the default static resource file. Here's how to do it cleanly:

  • Use an SVG file for best results (it matches the default logo's format and stays crisp at any size). Aim for a similar aspect ratio to the default (roughly 130px wide x 30px tall).
  • Name your file logo.svg (to match the default filename, so it automatically overrides the original).

Step 2: Override the Default Logo File

For Maven/Gradle Projects (Project-Specific Override)

  • Create this directory structure in your project: src/test/resources/allure-report/static/resources/images/
  • Place your custom logo.svg into this folder. When you generate the report, your file will automatically replace the default Allure logo—no need to modify global files.

For Standalone Allure CLI (Global Override)

  • Locate your Allure CLI installation directory.
  • Navigate to config/allure-report/static/resources/images/
  • Replace the existing logo.svg with your custom one.
  • Note: This change affects all reports generated with this CLI installation—stick to the project-specific method if you want per-project customization.

Step 3: Regenerate the Report

After replacing the file, re-run your test suite and generate the Allure report again. Your custom logo should now appear in the header alongside your new title.


内容的提问来源于stack exchange,提问作者Kasun Caldera

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:18:35