Configuration in Allure to Cucumber in Ruby

喜夏-厌秋 提交于 2019-12-01 09:16:20

History

Allure stores history information to allure-report/history folder during report generation. So you need to copy such folder from previous launch into your allure-results before you generate the report.

History features are handled out of the box by Allure CI plugins

Executor info

To add an information about your test executor create a file executor.json in your allure-results:

{
  "name": "Jenkins",
  "type": "jenkins",
  "url": "http://example.org",
  "buildOrder": 13,
  "buildName": "allure-report_deploy#13", 
  "buildUrl": "http://example.org/build#13",
  "reportUrl": "http://example.org/build#13/AllureReport",
  "reportName": "Demo allure report"
}

In the report such information will be displayed like this:

Allure CI plugins will add executor information for you

Categories

You can also add custom problem categories in the report. Create file categories.json and place it into your results folder:

[
  {
    "name": "Ignored tests",
    "messageRegex": ".*ignored.*",
    "matchedStatuses": [
      "skipped"
    ]
  },
  {
    "name": "Infrastructure problems",
    "messageRegex": ".*RuntimeException.*",
    "matchedStatuses": [
      "broken"
    ]
  },
  {
    "name": "Outdated tests",
    "messageRegex": ".*FileNotFound.*",
    "matchedStatuses": [
      "broken"
    ]
  },
  {
    "name": "Regression",
    "messageRegex": ".*\\sException:.*",
    "matchedStatuses": [
      "broken"
    ]
  }
]

Retries

Retries are handled by default. For each test Allure generates historyId (usually it is md5(fullName + parameterValues)). If report contains few results with the same historyId Allure only displays latest, other are marked as retries and available from Retries section on test result page.

For example, if you run your test 3 times (first 2 are broken, latest is passed, Allure will display such test as passed)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!