Skip to content

Own categories in config file

Alexandr D edited this page Oct 5, 2018 · 5 revisions

Using allureConfig.json you can add your own categories to the report.

To create custom categories add to config a categories block:

"categories": [
    {
      "name": "Problems with locators", 
      "messageRegex": ".*NoSuchElementException.*"
    },
    {
      "name": "Problems with DOM",
      "traceRegex": ".*StaleElementReferenceException.*"
    },
    {
      "name": "Problems with timeout",
      "messageRegex": ".*Timed out.*",
      "traceRegex": ".*WebDriverException.*"
    },
    {
      "name": "Defected tests",
      "matchedStatuses": ["failed"]
    }
  ]

Where:

  • categories.name- (mandatory) category name

  • categories.matchedStatuses - (optional) list of suitable test statuses. Default ["failed", "broken", "passed", "skipped", "unknown"]

  • categories.messageRegex - (optional) regex pattern to check test error message. Default ".*"

  • categores.traceRegex - (optional) regex pattern to check stack trace. Default ".*"

A more complete example of categories can be found here.

Example of Categories widget with custom categories:

alt text