---
title: Playwright configuration
description: Configuration properties for Allure Playwright | Change allure-results directory | Add environment info | Add error categories
---

# Allure Playwright configuration

The [Allure Playwright](/docs/playwright/) integration behavior can be affected by some configuration options set in your project's `playwright.config.ts` file.

Info:
This section describes the configuration parameters for Allure Playwright 3.0 and newer. For an older version, you may check this [readme](https://github.com/allure-framework/allure-js/blob/v2.15.1/packages/allure-playwright/README.md).

To set the options, define an object after the `"allure-playwright"` string in the `reporter` configuration section. For example:

```ts
import type { PlaywrightTestConfig } from "@playwright/test";
import { Status } from "allure-js-commons";
import * as os from "node:os";

const config: PlaywrightTestConfig = {
  reporter: [
    ["line"],
    [
      "allure-playwright",
      {
        resultsDir: "allure-results",
        detail: true,
        suiteTitle: true,
        links: {
          issue: {
            nameTemplate: "Issue #%s",
            urlTemplate: "https://issues.example.com/%s",
          },
          tms: {
            nameTemplate: "TMS #%s",
            urlTemplate: "https://tms.example.com/%s",
          },
          jira: {
            urlTemplate: (v) => `https://jira.example.com/browse/${v}`,
          },
        },
        categories: [
          {
            name: "foo",
            messageRegex: "bar",
            traceRegex: "baz",
            matchedStatuses: [Status.FAILED, Status.BROKEN],
          },
        ],
        environmentInfo: {
          os_platform: os.platform(),
          os_release: os.release(),
          os_version: os.version(),
          node_version: process.version,
        },
      },
    ],
  ],
};

export default config;
```

## resultsDir

Path to the directory where Allure Playwright will save the test results, see [How it works](/docs/how-it-works/). If the directory does not exist, it will be created. Defaults to `allure-results`.

## detail

If true (the default), Allure will automatically create [steps](/docs/playwright/#divide-a-test-into-steps) for:

- Playwright API calls, such as [`browser.newPage()`](https://playwright.dev/docs/api/class-browser#browser-new-page), [`page.goto()`](https://playwright.dev/docs/api/class-page#page-goto).
- Playwright test hooks, such as [`beforeEach()`](https://playwright.dev/docs/api/class-test#test-before-each).
- assertions made using `except`.

## suiteTitle

If true (the default), implicitly add each test into a [test suite](/docs/v2/navigation/#suite-based-hierarchy) named after its file name.

## links

A mapping of templates that can be used to construct full URLs from short identifiers.

For each type of link (see [`allure.link()`](/docs/playwright-reference/#link)), you can specify the following:

- `nameTemplate` — a template or a function for generating the link name when it is not provided.
- `urlTemplate` — a template or a function for generating the link address when it is not provided.

The templates can be strings (with `%s` where the identifier should be placed) or functions (accepting the identifier and returning the URL).

For example, with the configuration above, `await allure.issue("123")` will produce a link with the name `Issue #123` and the address `https://issues.example.com/` . Allure will display the link with the appropriate icon for the `issue` type.

## categories

Define custom categories that will be used to distinguish test results by their errors; see [Categories](/docs/categories/).

This setting is an array, each item being an object representing one custom category. The objects may have the following properties:

- `name` — a category name.
- `messageRegex` — a regular expression that the test result's message should match.
- `traceRegex` — a regular expression that the test result's trace should match.
- `matchedStatuses` — an array of statuses that the test result should be one of.
- `flaky` — whether the test result should be marked as [flaky](/docs/test-stability/#flaky-tests).

## environmentInfo

Key-value pairs that will be displayed on the report's main page, see [Environment information](/docs/v2/readability/#environment-information).
