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

Configure Allure 3

CEL expressions in configuration files

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

Self-hosted storage

Quality Gate

Resolutions

Global Errors and Attachments

Timeline

Performance Metrics

Export to CSV

Export metrics

Guides

Migrating to Allure Java 3

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

Deploying Self-Hosted Storage with Docker

Deploying Self-Hosted Storage on Cloudflare Workers

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

GitLab CI

Gradle

Jenkins

JetBrains IDEs

Maven

Slack

TeamCity

Visual Studio Code

Xray

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

Dart and Flutter

Getting started

Configuration

Reference

Diesel

Getting started

Configuration

Reference

Fetch

Getting started

Configuration

Reference

Go

Getting started

Configuration

Reference

gRPC

Getting started

Configuration

Jasmine

Getting started

Configuration

Reference

Java HTTP Client

Getting started

JBehave

Getting started

Configuration

Reference

Jest

Getting started

Configuration

Reference

JUnit 4

Getting started

Configuration

Reference

JUnit Jupiter

Getting started

Configuration

Reference

Kotlin

Getting started

Reference

Mocha

Getting started

Configuration

Reference

Newman

Getting started

Configuration

Reference

Node.js Test Runner

Getting started

Configuration

Reference

NUnit

Getting started

Configuration

Reference

OkHttp

Getting started

PHPUnit

Getting started

Configuration

Reference

Playwright

Getting started

Configuration

Reference

Playwright Java

Getting started

Configuration

Reference

pytest

Getting started

Configuration

Reference

Pytest-BDD

Getting started

Configuration

Reference

Reqnroll

Getting started

Configuration

Reference

Reqwest

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

Selenide

Getting started

Configuration

Reference

Selenium BiDi

Getting started

Configuration

Reference

SpecFlow

Getting started

Configuration

Reference

Spock

Getting started

Configuration

Reference

TestCafe

Getting started

Configuration

Reference

TestNG

Getting started

Configuration

Reference

Tinybench

Getting started

Reference

Vitest

Getting started

Configuration

Reference

WebdriverIO

Getting started

Configuration

Reference

xUnit.net

Getting started

Configuration

Reference

On this page

CEL expressions in configuration files ​

A YAML or JSON configuration file can't contain JavaScript functions. Instead, the options that take a function in a JavaScript configuration file, and some others, accept an expression written in CEL (Common Expression Language) and wrapped in ${{ ... }}. With expressions, a static configuration file can filter tests, match categories and environments, compute names, and read environment variables.

Syntax ​

yaml
name: "${{ 'Nightly ' + date.isoDate }}"
plugins:
  awesome:
    options:
      filter: "${{ test.status != 'skipped' }}"
json
{
  "name": "${{ 'Nightly ' + date.isoDate }}",
  "plugins": {
    "awesome": {
      "options": {
        "filter": "${{ test.status != 'skipped' }}"
      }
    }
  }
}
  • The whole value must be one expression. A value with text before ${{ is used as plain text, and a value with text after }} is an error.
  • Write strings inside an expression in single quotes, and quote the whole value in YAML. For a long expression, use a YAML folded block (>-), which can span several lines.
  • Frequently used operators and functions: ==, !=, <, >, &&, ||, !, condition ? a : b, + (also joins strings), contains(), startsWith(), endsWith(), matches(), list.exists(x, condition), int(), double() and string(). See the CEL language definition for all of them.
  • matches() checks a regular expression. It is case-sensitive and finds the pattern anywhere in the value, unless you anchor it with ^ and $. Double the backslashes in the pattern, for example name.matches('^internal_\\d+$'). In a double-quoted YAML string, double them once more (\\\\d), or use a >- block, which doesn't need that.
  • Check optional values with has() before you use them: environment variables that may not be set, and test result fields that may be missing, such as duration or the error message. For example, has(env.CI) && env.CI == 'true'. Reading a missing value is an error.
  • Allure checks the expressions when it reads the configuration file. If an expression is invalid or returns a value of the wrong type, Allure stops with an error that names the option, for example, Invalid expression at hideLabels[0]: expression must return a boolean.

Expressions also work in JavaScript configuration files, but there you can use functions instead.

Where you can use expressions ​

OptionVariablesThe expression returns
hideLabels itemsnameboolean: true hides the label
categories matchersdataboolean: true puts the test in the category
environments.<id>.matcherlabelsboolean: true puts the test in the environment
name, environments.<id>.name, category name, reportName of the Awesome, Classic, Dashboard and Allure2 plugins, Awesome charts[].title, Dashboard layout[].title, CSV fields[].header, TestOps launchNameenv, datestring
filter of the Awesome, Classic, Dashboard, CSV, Log and TestOps pluginstest, envboolean: true includes the test
Log qualityGateFilterresult, envboolean: true prints the quality gate result
CSV fields[].accessortest, envstring, or null for an empty cell
CSV sorta, b, envnumber: negative if a goes first, positive if b does
qualityGate enabledenvboolean
Expected values of the qualityGate rulesenvthe value the rule expects, for example a number
filter of the qualityGate rule setstest, envboolean: true checks the test
message and successMessage in qualityGate.useexpected, actualstring
allureService.accessTokenenvstring

Allure takes the values of all other options literally. For example, the filter option of the TestPlan plugin still needs a JavaScript configuration file.

The variables contain:

  • env - the environment variables. Allure reads them once, when it reads the configuration file.
  • date - the time when Allure read the configuration file, in UTC: date.iso (for example, 2026-11-06T09:30:00.000Z), date.isoDate (2026-11-06), date.year, date.month (1 to 12), date.day and date.unixMs (milliseconds since the Unix epoch).
  • test, a, b - a test result, with fields such as name, fullName, status, duration (in milliseconds), flaky, labels (a list of objects with name and value), parameters, error.message and error.trace.
  • data - the data a category matcher checks: status, flaky, labels and, if available, message, trace, duration (in milliseconds), transition and environment.
  • labels - the labels of the test result, a list of objects with name and value.
  • name - the name of the label.
  • result - a quality gate result, with the rule, success, actual, expected and message fields.
  • expected, actual - the value that the quality gate rule expects and the value it found.

Examples ​

The examples below are parts of one configuration file.

Report name ​

The report name includes the date when the report was generated. If the REPORT_NAME environment variable is set, the name starts with its value, otherwise with "Allure Report":

yaml
name: "${{ (has(env.REPORT_NAME) ? env.REPORT_NAME : 'Allure Report') + ' ' + date.isoDate }}"

A name passed with the --name command-line option replaces the configured name and is used as is.

Hide labels ​

Hide the owner label, and all labels whose names start with internal_:

yaml
hideLabels:
  - owner
  - "${{ name.startsWith('internal_') }}"

Categories ​

The first category collects the tests whose error message contains "timeout". The second one collects the failed UI tests that ran for longer than 5 seconds:

yaml
categories:
  - name: Timeouts
    matchers: "${{ has(data.message) && data.message.contains('timeout') }}"
  - name: Slow UI failures
    matchers: >-
      ${{ data.status == 'failed' && has(data.duration) && data.duration > 5000 &&
          data.labels.exists(l, l.name == 'layer' && l.value == 'ui') }}

If the name of a category is an expression, set the category's id, so that the category stays the same when its name changes.

Environments ​

Put the tests that ran in Firefox on Linux into one environment, and the tests that ran in Chrome into another:

yaml
environments:
  firefox_linux:
    name: Firefox on Linux
    matcher: >-
      ${{ labels.exists(l, l.name == 'browser' && l.value == 'firefox') &&
          labels.exists(l, l.name == 'os' && l.value == 'linux') }}
  chrome:
    name: Chrome
    matcher: "${{ labels.exists(l, l.name == 'browser' && l.value == 'chrome') }}"

Filter tests in reports ​

The Awesome report leaves out skipped tests. The CSV file lists only failed and broken tests, sorted by duration (the longest first), with a computed duration column and the error message. The Log plugin prints only failed and broken tests:

yaml
plugins:
  awesome:
    options:
      filter: "${{ test.status != 'skipped' }}"
  csv:
    options:
      fileName: failures.csv
      filter: "${{ test.status == 'failed' || test.status == 'broken' }}"
      fields:
        - header: Name
          accessor: name
        - header: Duration
          accessor: "${{ has(test.duration) ? dyn(string(test.duration) + ' ms') : null }}"
        - header: Error
          accessor: "${{ has(test.error) && has(test.error.message) ? test.error.message : null }}"
      sort: "${{ (has(b.duration) ? b.duration : 0) - (has(a.duration) ? a.duration : 0) }}"
  log:
    options:
      filter: "${{ test.status == 'failed' || test.status == 'broken' }}"

Quality gate ​

The quality gate runs only if the CI environment variable is set, as it is in most CI services. The first rule set allows 5 failed tests, or as many as the MAX_FAILURES environment variable says. The second rule set stops the run as soon as a test with the critical severity fails. The use list changes the message of the maxFailures rule:

yaml
qualityGate:
  enabled: "${{ has(env.CI) }}"
  rules:
    - maxFailures: "${{ has(env.MAX_FAILURES) ? int(env.MAX_FAILURES) : 5 }}"
    - id: critical
      maxFailures: 0
      fastFail: true
      filter: "${{ test.labels.exists(l, l.name == 'severity' && l.value == 'critical') }}"
  use:
    - rule: maxFailures
      message: "${{ 'Failed tests: ' + string(actual) + ', allowed: ' + string(expected) }}"

If you add use, it replaces the list of rules that Allure knows, so list every rule that your rule sets use. For a built-in rule, its name is enough.

When the quality gate is disabled, allure quality-gate skips the check and exits with code 0.

Access token from an environment variable ​

Read the Allure Report Storage access token from the ALLURE_SERVICE_TOKEN environment variable. You can choose any variable name:

yaml
allureService:
  accessToken: "${{ has(env.ALLURE_SERVICE_TOKEN) ? env.ALLURE_SERVICE_TOKEN : '' }}"

If the variable isn't set, the expression returns an empty string, and Allure works without the storage service. To make the token required, write "${{ env.ALLURE_SERVICE_TOKEN }}": then every Allure command that reads the configuration file stops with an error if the variable isn't set.

Pager
Previous pageConfigure
Next pageHow to generate a report
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/v3/configure-expressions.md