Skip to content
Allure report logoAllure Report
Main Navigation ModulesDocumentationStarter Project

English

Español

English

Español

Appearance

Sidebar Navigation

Allure 3

Install & Upgrade

Install Allure

Upgrade Allure

Configure

Create Reports

How to generate a report

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Reading Allure charts

Migrate from Allure 2

Allure 2

Install & Upgrade

Install for Windows

Install for macOS

Install for Linux

Install for Node.js

Upgrade Allure

Create Reports

How to generate a report

How to view a report

Improving readability of your test reports

Improving navigation in your test report

Features

Agent Mode

Test steps

Attachments

Test statuses

Assertion diffs

Sorting and filtering

Environments

Multistage Builds

Categories

Visual analytics

Test stability analysis

History and retries

Quality Gate

Global Errors and Attachments

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

Publishing Reports to GitHub Pages

Allure Report 3: XCResults Reader

How it works

Overview

Glossary

Test result file

Container file

Categories file

Environment file

Executor file

History files

Test Identifiers

Integrations

Azure DevOps

Bamboo

GitHub Action

Gradle

Jenkins

JetBrains IDEs

Maven

TeamCity

Visual Studio Code

Frameworks

AVA

Getting started

Configuration

Reference

Axios

Getting started

Configuration

Reference

Behat

Getting started

Configuration

Reference

Behave

Getting started

Configuration

Reference

Bun

Getting started

Configuration

Reference

Chai

Getting started

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

Fetch

Getting started

Configuration

Reference

Go

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

Node.js Test Runner

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

Rust Cargo Test

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

Getting started with Allure AVA ​

Allure AVA npm latest version

Generate beautiful HTML reports using Allure Report and your AVA tests.

Setting up ​

1. Prepare your project ​

  1. Make sure Node.js is installed.

    Allure AVA requires AVA 8 or later. AVA 8 requires Node.js ^22.20, ^24.12, or >=26.

  2. Open a terminal and go to the project directory. For example:

    bash
    cd /home/user/myproject
  3. Make sure Allure Report is installed. If it's not, follow the installation instructions. Note that Allure Report requires Java.

  4. Install the Allure AVA integration:

    bash
    npm install --save-dev allure-ava ava
    bash
    yarn add --dev allure-ava ava
    bash
    pnpm add -D allure-ava ava
  5. Call installAllure() from your AVA configuration file.

    For an ESM config (ava.config.mjs):

    js
    // ava.config.mjs
    import { installAllure } from "allure-ava";
    
    await installAllure({
      resultsDir: "allure-results",
    });
    
    export default {};

    If your project does not use "type": "module" in its package.json, keep the configuration in CommonJS — name the file ava.config.js and export an async factory:

    js
    // ava.config.js
    module.exports = async () => {
      const { installAllure } = await import("allure-ava");
    
      await installAllure({
        resultsDir: "allure-results",
      });
    
      return {};
    };

    Note that AVA only reads ava.config.js and ava.config.mjs; a file named ava.config.cjs is silently ignored.

    Your test files themselves do not need any changes. Optionally, specify resultsDir and other options. See Allure AVA configuration for more details.

    TIP

    If the tests run but the results directory is not created and the console prints no test runtime is found, AVA did not load your configuration file — check its name and location.

2. Run tests ​

Run your AVA tests the same way you would run them usually:

bash
npx ava

This will save the necessary data into allure-results or another directory, according to the configuration. If the directory already exists, new files will be added to the existing ones so that a future report will be based on them all.

Tests declared with test.skip() or test.todo(), as well as tests excluded by test.skipIf() and test.runIf() conditions, appear in the report with the Skipped status.

Tests declared with test.failing() follow AVA's own semantics: when such a test fails as expected, it counts as successful and appears in the report with the Passed status; if it unexpectedly passes, it is reported as Broken with AVA's "Test was expected to fail, but succeeded" error.

If an AVA worker process crashes, times out, or exits unexpectedly, the tests affected by it appear in the report with the Broken status.

You can still pass regular AVA CLI arguments:

bash
npx ava test/**/*.test.js --match "signing in"

3. Generate a report ​

Finally, convert the test results into an HTML report. This can be done by one of two commands:

  • allure generate processes the test results and saves an HTML report into the allure-report directory. To view the report, use the allure open command.

  • allure serve creates the same report as allure generate, then automatically opens the main page of the report in a web browser.

Writing tests ​

The Allure AVA integration extends the standard reporting features of AVA by providing additional capabilities for crafting more informative and structured tests. This section highlights key enhancements that can be utilized:

  • Metadata Annotation: Enhance test reports with descriptions, links, and other metadata.
  • Test Organization: Structure your tests into clear hierarchies for better readability and organization, see organize tests.
  • Step Division: Break down tests into smaller test steps for easier understanding and maintenance.
  • Parametrized Tests: Clearly describe the parameters for parametrized tests to specify different scenarios.
  • Set labels globally: Use environment variables to set metadata and other labels.
  • Attachments: Capture files and other content during test execution.
  • Test Selection: Use a test plan file to select which tests to run, allowing for flexible test execution.
  • Environment Details: Include comprehensive environment information to accompany the test report.

In most cases, Allure AVA provides two different ways to use a feature: the Runtime API and the Metadata API.

  • Runtime API: use Allure's functions to add certain data to the test result during its execution. This approach allows for constructing the data dynamically.

    Note that it is recommended to call Allure's functions as close to the beginning of the test as possible. This way, the data will be added even if the test fails early.

  • Metadata API: add a metadata tag (beginning with @allure.) into the test name. Allure AVA will extract it and update the test result's data accordingly. When using this approach, the data is guaranteed to be added regardless of how the test itself runs.

Add metadata ​

Allure allows you to enrich your reports with a variety of metadata. This additional information provides context and details for each test, enhancing the report's usefulness. Refer to the metadata reference section for an exhaustive list of what can be added.

js
import * as allure from "allure-js-commons";
import test from "ava";

test("Test Authentication", async (t) => {
  await allure.displayName("Test Authentication");
  await allure.owner("John Doe");
  await allure.tags("Web interface", "Authentication");
  await allure.severity("critical");
  // ...
  t.pass();
});
js
import test from "ava";

test(
  "Test Authentication" +
    " @allure.label.owner:JohnDoe" +
    " @allure.label.tag:WebInterface" +
    " @allure.label.tag:Authentication" +
    " @allure.label.severity:critical",
  (t) => {
    // ...
    t.pass();
  },
);

Organize tests ​

As described in Improving navigation in your test report, Allure supports multiple ways to organize tests into hierarchical structures.

To specify a test's location in the behavior-based hierarchy:

js
import * as allure from "allure-js-commons";
import test from "ava";

test("Test Authentication", async (t) => {
  await allure.epic("Web interface");
  await allure.feature("Essential features");
  await allure.story("Authentication");
  // ...
  t.pass();
});
js
import test from "ava";

test(
  "Test Authentication" +
    " @allure.label.epic:WebInterface" +
    " @allure.label.feature:EssentialFeatures" +
    " @allure.label.story:Authentication",
  (t) => {
    // ...
    t.pass();
  },
);

To specify a test's location in the suite-based hierarchy:

js
import * as allure from "allure-js-commons";
import test from "ava";

test("Test Authentication", async (t) => {
  await allure.parentSuite("Tests for web interface");
  await allure.suite("Tests for essential features");
  await allure.subSuite("Tests for authentication");
  // ...
  t.pass();
});
js
import test from "ava";

test(
  "Test Authentication" +
    " @allure.label.parentSuite:TestsForWebInterface" +
    " @allure.label.suite:TestsForEssentialFeatures" +
    " @allure.label.subSuite:TestsForAuthentication",
  (t) => {
    // ...
    t.pass();
  },
);

Divide a test into steps ​

To create steps and sub-steps, you can use the step() function, see the reference.

js
import * as allure from "allure-js-commons";
import { Status } from "allure-js-commons";
import test from "ava";

test("Test Authentication", async (t) => {
  await allure.step("Step 1", async () => {
    await allure.step("Sub-step 1", async (ctx) => {
      await ctx.parameter("foo", "1");
      // ...
    });
    await allure.step("Sub-step 2", async (ctx) => {
      await ctx.parameter("foo", "2");
      // ...
    });
  });
  await allure.logStep("Step 2", Status.SKIPPED);
  t.pass();
});

Describe parametrized tests ​

To implement the parametrized tests pattern in AVA, write the test inside a loop and use the variable parameters in both the title and the body. Each iteration is treated as a separate test run by Allure Report.

To display a parameter value in the test report, pass it to the parameter() function.

js
import * as allure from "allure-js-commons";
import test from "ava";

for (const login of ["johndoe", "[email protected]"]) {
  test(`Test Authentication as ${login}`, async (t) => {
    await allure.parameter("login", login);
    await allure.parameter("time", new Date().toUTCString(), { excluded: true });
    // ...
    t.pass();
  });
}

Set labels globally ​

Any labels, including custom ones, can be set via environment variables in your operating system. Here's an example:

bash
export ALLURE_LABEL_epic=WebInterface
npx ava
powershell
$Env:ALLURE_LABEL_epic = "WebInterface"
npx ava

Attach files ​

In Allure reports, you have the ability to attach various types of files, which can greatly enhance the comprehensibility of the report. Additionally, any messages logged with AVA's built-in t.log() are automatically added to the test result (or to the corresponding fixture, when logged in a hook) as a text attachment named "AVA logs".

For detailed instructions on how to implement attachments, refer to the attachments section in the Allure AVA reference.

js
import * as allure from "allure-js-commons";
import { ContentType } from "allure-js-commons";
import test from "ava";

test("Test Authentication", async (t) => {
  // ...

  await allure.attachment("Text file", "This is the file content.", ContentType.TEXT);

  await allure.attachmentPath("Screenshot", "/path/to/image.png", {
    contentType: ContentType.PNG,
    fileExtension: "png",
  });

  t.pass();
});

Select tests via a test plan file ​

If the ALLURE_TESTPLAN_PATH environment variable is defined and points to an existing file, AVA will only run tests listed in this file.

Tests can be matched in two ways:

  • By selector — using the path/to/file.test.js#test title format. The path is relative to the project root (the closest directory with a package.json), and the title is the test name with any @allure.* metadata tags stripped out.
  • By Allure ID — using the @allure.id:⟨VALUE⟩ metadata tag in the test name.

Here's an example of running tests according to a file named testplan.json:

bash
export ALLURE_TESTPLAN_PATH=testplan.json
npx ava
powershell
$Env:ALLURE_TESTPLAN_PATH = "testplan.json"
npx ava

Environment information ​

For the main page of the report, you can collect various information about the environment in which the tests were executed. To do so, edit the environmentInfo object in the configuration.

For example, it is a good idea to record the OS version and the Node.js version. This may help the future reader investigate bugs that are reproducible only in some environments.

js
// ava.config.mjs
import { installAllure } from "allure-ava";
import * as os from "node:os";

await installAllure({
  environmentInfo: {
    os_platform: os.platform(),
    os_release: os.release(),
    os_version: os.version(),
    node_version: process.version,
  },
});

export default {};
Pager
Previous pageFrameworks
Next pageConfiguration
Powered by

Subscribe to our newsletter

Get product news you actually need, no spam.

Subscribe
Allure TestOps
  • Overview
  • Why choose us
  • Cloud
  • Self-hosted
  • Success Stories
Company
  • Documentation
  • Blog
  • About us
  • Contact
  • Events
© 2026 Qameta Software Inc. All rights reserved.
A Markdown version of this page is available at /docs/ava.md