在 Ruby 中配置 Allure to Cucumber [英] Configuration in Allure to Cucumber in Ruby
问题描述
我需要配置以下参数:
environment, trend, history, executors, retries,
等等.我需要这些参数让黄瓜与红宝石一起使用.我搜索了很多地方,但没有找到太多.如果您能提供这些参数,我将不胜感激.
etc. I need these params for cucumber to work with ruby. I searched in a lot of places and I did not find much. I would appreciate if you can provide these params.
推荐答案
历史
Allure 在报告生成期间将历史信息存储到 allure-report/history
文件夹.因此,在生成报告之前,您需要将之前启动的此类文件夹复制到您的 allure-results
中.
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.
历史功能由 Allure CI 插件开箱即用地处理
要添加有关您的测试执行器的信息,请在您的 allure-results
中创建一个文件 executor.json
:
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 插件会为你添加执行者信息
您还可以在报告中添加自定义问题类别.创建文件 categories.json
并将其放入结果文件夹中:
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"
]
}
]
默认情况下会处理重试.对于每个测试 Allure 都会生成 historyId
(通常是 md5(fullName + parameterValues)).如果报告包含具有相同 historyId
的少数结果,则 Allure 仅显示最新的,其他标记为重试,可从测试结果页面的 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.
例如,如果您运行测试 3 次(前 2 次损坏,最新通过,Allure 将显示此类测试通过)
For example, if you run your test 3 times (first 2 are broken, latest is passed, Allure will display such test as passed)
这篇关于在 Ruby 中配置 Allure to Cucumber的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!