protractor - Allure JS protractor-cucumber-framework cucumberOpts - 不止一个格式化程序
问题描述
最近,我在我的项目 allure-cucumberjs 记者中实现了。它运行良好,但我也有在测试执行期间格式化日志的包(cucumber-pretty)。现在,虽然我将 Allure 记者与 cucumber-pretty 一起提供给 cucumberOpts.format,但第二个不想工作。
我正在使用什么:
"dependencies": {
"allure-cucumberjs": "^2.0.0-beta.6",
"cucumber": "^6.0.5",
"cucumber-pretty": "^6.0.0",
"protractor": "^5.4.2",
"protractor-cucumber-framework": "^6.2.0",
"ts-node": "^8.5.4",
"typescript": "^3.7.3",
},
配置文件
cucumberOpts: {
compiler: 'ts:ts-node/register',
format: [
'json:results/results.json',
'node_modules/cucumber-pretty',
'reporter/reporter.ts',
'rerun:@rerun.txt',
],
require: ['../e2e/steps/*.ts', '../e2e/support/*.ts', '../support/*.ts'],
strict: true,
tags: '',
}
如果我从上面的配置文件中删除“reporter/reporter.ts”,那么漂亮的插件效果很好。
这是一个错误,Allure 以某种方式覆盖并禁用其他格式化程序?或者它应该并行工作?
解决方案
在format
部分中,您可以包含多个报告器,但其中只有一个可以输出到标准输出。这是黄瓜 API 的限制。您需要将 Allure 记者指向一个虚拟文件:reporter/reporter.ts:dummy.txt
.
推荐阅读
- php - PHP API,使用 JSON 返回文本
- html - Firefox 和 chrome 搜索栏的不同再现
- php - 登录用户的 Woocommerce 购物车会话不会过期
- php - 如何在嵌套的 json 中制作 id 数组
- html - 最小高度或最小宽度或响应将不起作用
- typescript - PrimeNG Angular 8 p-dropdown selectedItem模板未呈现
- android - Pie 及以上版本中的谷歌地图
- c++ - 如何在 C++ 中将字符串转换为整数?
- amazon-web-services - 如何限制对 AWS 负载均衡器的访问,以便只有另一个特定的 AWS 负载均衡器可以进行入站访问?
- c# - 如何使用按钮单击更改布尔属性?