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

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

Test steps

Attachments

Test statuses

Sorting and filtering

Environments

Defect categories

Visual analytics

Test stability analysis

History and retries

Quality Gate

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

Test result file

Container file

Categories file

Environment file

Executor file

History files

Integrations

Azure DevOps

Bamboo

GitHub Action

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

Environments Allure 3 ​

Allure Report 3 offers a new way to organize test results by environments, allowing you to group together tests by operating systems, browsers, deployments - or any other ways of categorization, and compare results from different environments easily.

This feature is based on test result labels: you can map certain labels (or combinations of labels) to a specific environment name, and Allure Report 3 will split all test results on the report home page into separate hierarchies, which you can switch between via the Environments dropdown menu.

Allure Report 3 Environments

Additionally, on the Environments tab of every test result you will be able to see available results of the same test from other environments.

Allure Report 3 Environments tab

Prerequisites ​

  • This feature requires you to use a dynamic configuration file (.mjs, .cjs, .js) for Allure Report 3.
  • You should set the labels storing environment information in your tests code. Please refer to the documentation of the framework adapter you're using to find out how.

Basic configuration ​

Environments are governed by the environments configuration parameter.

You should specify environment names as the keys of the environments object and provide a matcher function for each.

The examples below show how to assign environments based on a single label or multiple labels. Allure will look for labels named os and, in the two-label example, browser, and assign environments accordingly:

js
{
  environments: {
    windows: {
      matcher: ({ labels }) =>
        labels.find(({ name, value }) => name === "os" && value === "Windows"),
    },
    macos: {
      matcher: ({ labels }) =>
        labels.find(({ name, value }) => name === "os" && value === "macOS"),
    },
    linux: {
      matcher: ({ labels }) =>
        labels.find(({ name, value }) => name === "os" && value === "Linux"),
    }
  }
}
js
{
  environments: {
    "windows-chrome": {
        matcher: ({ labels }) =>
        labels.some(l => l.name === "os" && l.value === "Windows") &&
        labels.some(l => l.name === "browser" && l.value === "Chrome"),
    },
    "windows-firefox": {
        matcher: ({ labels }) =>
        labels.some(l => l.name === "os" && l.value === "Windows") &&
        labels.some(l => l.name === "browser" && l.value === "Firefox"),
    },
    "ubuntu-chrome": {
        matcher: ({ labels }) =>
        labels.some(l => l.name === "os" && l.value === "Ubuntu") &&
        labels.some(l => l.name === "browser" && l.value === "Chrome"),
    },
    "ubuntu-firefox": {
        matcher: ({ labels }) =>
        labels.some(l => l.name === "os" && l.value === "Ubuntu") &&
        labels.some(l => l.name === "browser" && l.value === "Firefox"),
    }
  }
}

The above configurations result in environment menus like these:

Allure Report 3 Environments menu

How matcher functions work ​

  • Allure reads test result files and loads all labels from each test result.
  • The matcher function receives { labels: TestLabel[] } from the Allure Report process. Each label is { name: string, value: string }.
  • If the test result belongs to the environment, the matcher function returns true.
  • First match wins - tests results cannot be assigned to multiple environments, so the order of environments in the config file matters.
  • If Allure can't match a test result to any environment, it assigns it to the default environment, so no test results get lost.

Environment variables ​

You can add any metadata that applies to the whole report via the global variables configuration parameter. Allure displays it at the top of the report homepage in the Variables section.

In addition to global variables, you can set environment-specific variables, which can override existing global variables, or be displayed in addition to them, when you select a specific environment:

js
// Global vs Environment-Specific Variables
{
  variables: {
    "App Version": "2.5.1",            // Shown everywhere
    "Build Number": "#1234",         // Shown everywhere
    "Database": "prod-db-primary"      // Shown, unless overridden
  },
  environments: {
    staging: {
        matcher: ({ labels }) =>
        labels.some(({ name, value }) => name === "env" && value === "staging"),
        variables: {
            "Server": "staging.example.com", // Shown for staging
            "Database": "staging-db",        // Overrides global variable for staging
        }
    },
    production: {
        matcher: ({ labels }) =>
        labels.some(({ name, value }) => name === "env" && value === "production"),
        variables: {
            "Server": "api.example.com",     // Shown for production
        }
    }
  }
}

Allure Report 3 Environment variables

CLI override and CI/CD workflows ​

Allure CLI allows you to override environment assignment for the entire test launch by using the allure run wrapper command:

bash
allure run --environment="<environment_name>" -- <test_command>

For example:

bash
allure run --environment="staging" -- pnpm test

Its main use is running tests in multiple environments in CI/CD workflows and creating combined reports.

Below is a snippet from the Allure Report 3 Demo workflow on GitHub, illustrating this idea:

yaml
jobs:
  test:
    name: Build
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}

    steps:
      # ...
      # Test environment set up steps
      # ...

      - name: Test Project
        run: pnpm allure run --config=./allurerc.mjs --environment="${{ matrix.os }}" --stage="allure-results-${{ matrix.os }}" -- pnpm test

      - name: Upload test results
        if: always()
        uses: actions/upload-artifact@v5
        with:
          name: allure-results-${{ matrix.os }}
          path: ./allure-results-${{ matrix.os }}.zip
          compression-level: 0

  report:
    runs-on: ubuntu-latest
    needs: test
    steps:
      # ...
      # Report generator set up steps
      # ...

      - name: Download allure results from Ubuntu
        uses: actions/download-artifact@v6
        with:
          name: allure-results-ubuntu-latest
          path: ./

      - name: Download allure results from macOS
        uses: actions/download-artifact@v6
        with:
          name: allure-results-macos-latest
          path: ./

      - name: Build report
        run: pnpm allure generate --stage="allure-results-*.zip" --output=./allure-report

        # ...
        # Report deployment steps
        # ...

TIP

While the --environment option overrides the label mapping rules in the config file, it will still pick up any variables specified for the environment matching the one you pass. This means you can define environment variables in the config even when using --environment to assign environments.

js
{
  environments: {
    staging: {
        // matcher redundant when using --environment flag
        variables: {
            "Server": "staging.example.com",
            "Database": "staging-db"
        }
    },
    production: {
        variables: {
            "Server": "api.example.com",
            "Database": "prod-db-primary"
        }
    }
  }
}

The old environments feature ​

Allure 3 still supports adding environment metadata to a report using the legacy Allure 2 method: if an environment.properties file is discovered in the results directory, Allure displays the data from it at the top of the report page in the Metadata section.

Allure Report 2-style environments metadata

This can either complement or conflict with your environments configuration, so make sure to get rid of this file, or to harmonize it with your new environments set up - whichever suits you best.

Pager
Previous pageSorting and filtering
Next pageDefect categories
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.