---
title: Categories file
description: Learn the format of the categories.json file in Allure Report for defining custom categories using message and trace regex. Enhance your test categorization.
---

# Categories file

Warning:
This page describes a data format used by Allure and its integrations for test frameworks. Depending on the test framework you use, this file may or may not be generated automatically based on the project configuration. Check [your integration's documentation](/docs/frameworks/).

The `categories.json` file in the test results directory, if present, defines [custom categories](/docs/categories/#custom-categories).

The data is stored as a JSON array of objects. Each object defines one custom category and can have the properties described below. The order of objects in the array is the order in which Allure will try to match a test result against the categories.

Example:

```json
[
  {
    "name": "Ignored tests",
    "messageRegex": ".*ignored.*",
    "matchedStatuses": ["skipped"]
  },
  {
    "name": "Infrastructure problems",
    "messageRegex": ".*RuntimeException.*",
    "matchedStatuses": ["broken"]
  }
]
```

## name (string)

The name of the category.

## messageRegex (string)

The regular expression that the test result's message should match.

## traceRegex (string)

The regular expression that the test result's trace should match.

## matchedStatuses (array)

An array of statuses that the test result should be one of. Possible values are: “failed”, “broken”, “passed”, “skipped”, “unknown”. See [Test statuses](/docs/test-statuses/).

## flaky (boolean)

Whether the test result should be marked as [flaky](/docs/test-stability/#flaky-tests).
