【问题标题】:Allure JS protractor-cucumber-framework cucumberOpts - More than one formatterAllure JS protractor-cucumber-framework cucumberOpts - 不止一个格式化程序
【发布时间】:2020-05-14 23:13:05
【问题描述】:

最近,我在我的项目 allure-cucumberjs 记者中实现了。它运行良好,但我也有在测试执行期间格式化日志的包(cucumber-pretty)。现在,虽然我将 Allure 记者提供给 cucumberOpts.format 和 cucumber-pretty,但第二个不想工作。

我正在使用什么:

"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",
  },

config.ts

 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 以某种方式覆盖并禁用其他格式化程序?还是应该并行工作?

【问题讨论】:

    标签: protractor cucumber formatter allure cucumberjs


    【解决方案1】:

    format 部分中,您可以包含多个记者,但只有其中一个可以输出到标准输出。这是黄瓜 API 的限制。 您需要将 Allure 记者指向一个虚拟文件:reporter/reporter.ts:dummy.txt

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-30
      • 1970-01-01
      • 1970-01-01
      • 2012-11-29
      • 2018-11-14
      • 2015-09-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多