Skip to content

Vikindor/allure-report-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Allure Report - HTTP Templates

Minimal, dependency-free FreeMarker templates (request.ftl, response.ftl) for clean, consistent HTTP attachments in Allure Report.
Designed to blend seamlessly into the Allure UI, with structured blocks and safe HTML escaping.

✨ Features

  • Zero external resources — no Bootstrap, jQuery, highlight.js, or CDNs.
  • Clean, consistent cards (Request / Headers / Body / Cookies / Curl; Status code for Response).
  • Safe rendering (?html) to prevent layout breaks from raw payloads.
  • Unified spacing, rounded corners, and light/dark-friendly colors.
  • Monospace font stack for code, configurable via CSS variables.
  • Both templates share the same CSS variables, ensuring a consistent look and feel.
  • Optional iframe autoresize (delete the <script> block to disable it).

🖼 Screenshot

Style comparison screenshot

📦 Files

🚀 Installation

  1. Add dependency (required for the AllureRestAssured listener, not for the templates):
dependencies {
    testImplementation("io.qameta.allure:allure-rest-assured:x.xx.x")
}
  1. Copy the two .ftl files into tpl package in your project resources (the path must match exactly):
src/
  test/
    resources/
      tpl/
        request.ftl
        response.ftl
  1. Create a listener class in your helpers package:
import io.qameta.allure.restassured.AllureRestAssured;

public class ApiAllureListener {
    private ApiAllureListener(){}

    private static final AllureRestAssured FILTER = new AllureRestAssured()
            .setRequestTemplate("request.ftl")
            .setResponseTemplate("response.ftl");

    public static AllureRestAssured filter() {
        return FILTER;
    }
}
  1. Add filter() to @BeforeAll, for example:
public class TestBase {
    @BeforeAll
    static void setupApi() {
	    <your configs>
        RestAssured.filters(ApiAllureListener.filter());
    }
}

About

Custom FreeMarker templates for improved Request/Response rendering in Allure Report

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Contributors