使用黄瓜报告器和量角器-黄瓜框架

问题描述 投票:0回答:1

据我所知,protractor-cucumber-framework通过cucumberOpts对象传递给黄瓜,这使用户可以指定黄瓜选项,例如stricttags。我正在尝试在此框架中使用TeamCity记者。根据报告者的说明(例如TeamCity Reporter,要使用此报告者,请在运行黄瓜时使用--format选项指定报告者。因此,我的解释是,我应在format中指定cucumberOpts属性]对象以相同的方式,即cucumber -f TeamCityFormatter::Formatter变为:

cucumberOpts: {
  'format': 'TeamCityFormatter::Formatter'
}

但是当我这样做时,出现错误:

Unhandled rejection Error: ENOENT: no such file or directory, open 'C:\Dev\fork\Billing.Test.Automation.V2\:Formatter':

我以为也许我只需要指定模块的名称,所以我尝试了:

cucumberOpts: {
  'format': 'TeamCityFormatter'
}

哪个给我这个错误:

Unhandled rejection Error: Cannot find module 'C:\Dev\fork\Billing.Test.Automation.V2\TeamCityFormatter'

因此看起来它正在寻找一个模块,所以我尝试将其指向node_modules文件夹中的模块:

cucumberOpts: {
  'format': 'node_modules/teamcity-formatter'
}

我收到此错误:

Unhandled rejection TypeError: this.registerHandler is not a function

是否有通过protractor-cucumber-framework使用黄瓜报告器的特殊方法?

protractor cucumber teamcity
1个回答
0
投票

不是答案,而是如何将软件包作为插件导入的示例

onPrepare:fucntion(){
  ...
},
// Here the magic happens
plugins: [{
    package: 'protractor-multiple-cucumber-html-reporter-plugin',
    options: {
        automaticallyGenerateReport: true,
        removeExistingJsonReportFile: true,
        displayDuration: true
    }
}],
© www.soinside.com 2019 - 2024. All rights reserved.