Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStart

English

Español

English

Español

Appearance

Sidebar Navigation

Introduction

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Getting started

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Test steps

Attachments

Test statuses

Sorting and filtering

Defect categories

Visual analytics

Test stability analysis

History and retries

Timeline

Export to CSV

Export metrics

Guides

JUnit 5 parametrization

JUnit 5 & Selenide: screenshots and attachments

JUnit 5 & Selenium: screenshots and attachments

Setting up JUnit 5 with GitHub Actions

Pytest parameterization

Pytest & Selenium: screenshots and attachments

Pytest & Playwright: screenshots and attachments

Pytest & Playwright: videos

Playwright parameterization

How it works

Overview

Test result file

Container file

Categories file

Environment file

Executor file

History files

Integrations

Azure DevOps

Bamboo

GitHub Actions

Jenkins

JetBrains IDEs

TeamCity

Visual Studio Code

Frameworks

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Codeception

Getting started

Configuration

Reference

CodeceptJS

Getting started

Configuration

Reference

Cucumber.js

Getting started

Configuration

Reference

Cucumber-JVM

Getting started

Configuration

Reference

Cucumber.rb

Getting started

Configuration

Reference

Cypress

Getting started

Configuration

Reference

Jasmine

Getting started

Configuration

Reference

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit 5

Getting started

Configuration

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

REST Assured

Getting started

Configuration

Robot Framework

Getting started

Configuration

Reference

RSpec

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

Allure REST Assured configuration ​

This page describes the methods that affect the behavior of the Allure REST Assured integration. All methods are chainable.

The examples here assume that you use JUnit 5 for your tests.

Customize templates ​

  • setRequestTemplate(final String templatePath)
  • setResponseTemplate(final String templatePath)

Specify paths to custom templates that Allure REST Assured will use for formatting the HTTP requests and responses.

The templates must be written in the Apache Freemarker language. When processing a request or a response, an object with its full details is passed to the corresponding template as data. You can find the default templates in the Allure Java repository.

The paths are interpreted as relative to the tpl directory in your project's resources. For example, the code below uses the templates located at tpl/my-http-request.ftl and tpl/my-http-response.ftl.

java
import io.qameta.allure.restassured.AllureRestAssured;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;

class TestMyWebsite {

    static AllureRestAssured allureFilter = new AllureRestAssured()
            .setRequestTemplate("my-http-request.ftl")
            .setResponseTemplate("my-http-response.ftl");

    @Test
    void testSomeRequest() {
        given()
                .filter(allureFilter)
                .get("https://jsonplaceholder.typicode.com/todos/1")
                .then()
                .body("userId", equalTo(1));
    }
}

Customize attachment names ​

  • setRequestAttachmentName(final String requestAttachmentName)
  • setResponseAttachmentName(final String responseAttachmentName)

Specify the names under which Allure REST Assured will create the attachments for the test report.

By default, each request will be called “Request”, while each response will get a name based on its HTTP code, e.g., “HTTP/1.1 200 OK”.

java
import io.qameta.allure.restassured.AllureRestAssured;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.*;
import static org.hamcrest.Matchers.*;

class TestMyWebsite {

    static AllureRestAssured allureFilter = new AllureRestAssured()
            .setRequestAttachmentName("Here is what we asked")
            .setResponseAttachmentName("Here is what we got");

    @Test
    void testSomeRequest() {
        given()
                .filter(allureFilter)
                .get("https://jsonplaceholder.typicode.com/todos/1")
                .then()
                .body("userId", equalTo(1));
    }
}
Pager
Previous pageGetting started
Next pageGetting started
Powered by

Join our newsletter

Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2025 Qameta Software Inc. All rights reserved.