在Allure中配置Ruby中的Cucumber
我需要配置以下参数:
environment, trend, history, executors, retries,
我需要这些黄瓜的参数与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会显示这样的测试通过)