Allure Report Categories

Profile picture for user arilio666

In the allure report, we can categorize tests in HTML reports based on their failure, pass, or broken. Two categories of allure reports are product and test defects, also known as failed and broken tests. Categories.json should be a list of mappings.

[
 {
   "name": "Ignored tests",
   "messageRegex": ".*ignored.*",
   "matchedStatuses": ["skipped"],
   "flaky": true
 },
 {
   "name": "Infrastructure problems",
   "traceRegex": ".*RuntimeException.*",
   "matchedStatuses": ["broken", "failed"]
 },
 {
   "name": "Outdated tests",
   "messageRegex": ".*FileNotFound.*",
   "matchedStatuses": ["broken"]
 },
 {
   "name": "Passed",
   "messageRegex": ".*",
   "matchedStatuses": ["passed"]
 }
]
  • This is what hecategory.json should look like.
  • Category names here should be mandatory.
  • There can be an optional list of test statuses such as failed, broken, passed, skipped, and unknown.
  • To check the test error message regex pattern is also followed ".*"
  • Also, the regex pattern can be used to contain stack traces.

Conclusion:

These are all the guidelines to create an allure report category JSON file, and it is simple when followed with its parameters.