Integrate Allure Reports

In this lesson, you'll learn how to integrate Allure reporting to our project and produce visually appealing test reports.

What is Allure?

Allure Framework is a flexible and lightweight test reporting tool that shows a very concise representation of test execution in a very intuitive web report.

Installing Allure via command line


brew install allure


sudo apt-add-repository ppa:qameta/allure
sudo apt-get update 
sudo apt-get install allure


To install scoop, follow the link.

scoop install allure

Manual installation

Alternatively, we can download the latest Allure command-line binary from link, extract, and add to classpath.

Mac / Linux

export PATH=$PATH:</path/allure/bin>


set PATH=%PATH%;<\path\allure\bin>;

Adding dependency

Gradle (in build.xml)

buildscript {
    repositories {
    dependencies {
        classpath "io.qameta.allure:allure-gradle:2.8.1"

plugins {
    id 'io.qameta.allure'

def allure_version = '2.13.1'

allure {
    version = allure_version
    autoconfigure = true
    aspectjweaver = true
    clean = true
    allureJavaVersion = allure_version
    resultsDir = file('test-output/allure-results')
    reportDir = file('test-output/allure-reports')
   downloadLink = "${allure_version}/allure-commandline-${allure_version}.zip"

Opening Allure report

./gradlew allureServe

Maven (in pom.xml)




Opening Allure report

mvn allure:serve

Understanding Allure

Allure has few annotations for marking the life cycle of test execution.

  • @Step
  • @Attachment


Any action that constitutes a testing scenario is marked with @Step.

@Step("opening base url")
public void openUrl(String url) {

Here, by default, the name of the step will be taken if the name parameter is not mentioned in @Step. We can also have placeholders too in the name parameter. For more information, please follow the link.

This can also be done programmatically, using the below code.

import static io.qameta.allure.util.AspectUtils.getName;
import static io.qameta.allure.util.AspectUtils.getParameters;
import static io.qameta.allure.util.ResultsUtils.getStatus;
import static io.qameta.allure.util.ResultsUtils.getStatusDetails;
import io.qameta.allure.AllureLifecycle;
import io.qameta.allure.Step;
import io.qameta.allure.model.Parameter;
import io.qameta.allure.model.Status;
import io.qameta.allure.model.StepResult;
import io.qameta.allure.Allure;

public void openBaseUrl() {
    StepResult result = new StepResult().setName("open base url");
    Allure.getLifecycle().startStep(UUID.randomUUID().toString(), result);
    try {
        getLifecycle().updateStep(s -> s.setStatus(getStatus(e).orElse(Status.PASSED));
    } catch(Exception e) {
        getLifecycle().updateStep(s -> s.setStatus(getStatus(e).orElse(Status.BROKEN));
        throw e;


The below method annotated with @Attachment should return either a String or byte[]. For attaching a file to the report, do as follows:

@Attachment(value = "adding log", type = "text/plain")
public String addAttachment() {
    return "hello";

Alternatively, for doing the same programmatically without using @Attachment annotation, do as follows:

public void openBaseUrl() {
    Allure.getLifecycle().addAttachment("adding log", "text/plain", ".txt", "hello");

Multiple overloaded methods are also available. Please follow the link for more information.

Additionally, please follow the link for more comprehensive information about Allure.

Sample report

Following is a sample report generated by Allure framework:

Get hands-on with 1200+ tech skills courses.