Отчет Allure не отображает категории [codeceptjs] - PullRequest
0 голосов
/ 03 декабря 2018

Я пытаюсь классифицировать по ошибочному результату теста в разных категориях, используя файл category.json.Я использую следующий файл JSON:

[
    {
      "name": "Ignored tests", 
      "matchedStatuses": ["skipped"]
    },
    {
      "name": "Infrastructure problems",
      "matchedStatuses": ["broken", "failed"],
      "messageRegex": ".*An unknown server-side error occurred.*"
    },
    {
      "name": "Outdated tests",
      "matchedStatuses": ["broken"],
      "traceRegex": ".*FileNotFoundException.*"
    },
    {
      "name": "Test defects",
      "matchedStatuses":[
          "broken",
          "Element is not currently visible and may not be manipulated"
        ],
      "traceRegex":[
          ".*Cannot read property.*",
          ".*is not in DOM or there is no element.*",
          ".*is not a function.*"
        ]
    },
    {
      "name": "Element Not visible",
      "traceRegex":[
          ".*still not visible after.*",
          ".*Element is not currently visible and may not be manipulated.*",
          ".*was not found by text|CSS|XPath.*"
        ]
    },
    {
      "name":"Promise Rejected",
      "traceRegex": [".*Promise was rejected with the following reason.*"]
    }
  ]

и в отчете об очаровании и получаю только дефекты продукта.

Вот как это выглядит

Я использую allure: 2.8.1 codeceptjs: 1.4.6 appium: 1.8.2

1 Ответ

0 голосов
/ 14 февраля 2019

У вас неправильный categories.json формат файла (traceRegex ожидается в виде строки).Если вы хотите иметь несколько совпадений для каждой категории, просто используйте одно и то же имя:

[{
  "name": "Element Not visible",
  "traceRegex": ".*still not visible after.*"
}, {
  "name": "Element Not visible",
  "traceRegex": ".*Element is not currently visible and may not be manipulated.*"
}]
...