我需要配置以下参数:
environment, trend, history, executors, retries,
等我需要 cucumber 的这些参数才能与 ruby 一起工作。我搜索了很多地方,但没有找到太多。如果您能提供这些参数,我将不胜感激。
最佳答案
历史
Allure 在报告生成期间将历史信息存储到 allure-report/history
文件夹。因此,在生成报告之前,您需要将之前启动的此类文件夹复制到 allure-results
中。
Allure CI 插件开箱即用地处理历史特征
执行者信息
要添加有关您的测试执行器的信息,请在您的 allure-results
中创建一个文件 executor.json
:
{
"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"
}
在报告中,此类信息将显示如下:
Allure CI 插件将为您添加执行者信息
类别
您还可以在报告中添加自定义问题类别。创建文件 categories.json
并将其放入您的结果文件夹中:
[
{
"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"
]
}
]
重试
默认处理重试。对于每个测试,Allure 都会生成 historyId
(通常是 md5(fullName + parameterValues))。如果报告包含具有相同 historyId
的少量结果,Allure 仅显示最新的,其他标记为重试并可从测试结果页面的 Retries
部分获得。
例如,如果您运行测试 3 次(前 2 次失败,最新通过,Allure 将显示此类测试已通过)
关于ruby - Allure to Cucumber in Ruby 中的配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46220385/