这是Set firefox profile with protractor主题的后续行动。使用承诺配置多个功能
按照setFirefoxProfile
HOWTO,可以设置Firefox配置文件与使用firefox-profile
和q
库随时进行编码的Firefox配置特殊"helper" js code。
这为我工作,直到我试图使用多个浏览器和配置multiCapabilities
:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
multiCapabilities: [
{
browserName: 'chrome',
specs: [
'footer.disabledCookies.spec.js'
],
chromeOptions: {
prefs: {
'profile.default_content_settings.cookies': 2
}
}
},
...
// other capabilities here
...
helper.getFirefoxProfile()
},
...
}
在此设置下,我得到一个错误(全回溯here):
规范模式不匹配任何文件。
据我所知,这意味着使用Firefox配置文件的设置缺少specs
键。换句话说,它找不到任何测试运行。我试过include specs
into the capabilities
dictionary inside the helper itself,但是错误依然存在。
如何修复错误,并设置火狐配置文件,如果使用multiCapabilities
?
作为一种变通方法,我已经创建了仅火狐单独量角器配置文件来配置(使用capabilities
),并设置grunt
运行两次量角器 - 一个用于这种“火狐与配置文件”配置,而另一个一个用于所有其他浏览器。
我打开了一个问题https://github.com/angular/protractor/issues/1594。我认为这是你想要的。请对此问题发表评论并使用它来跟踪更新。 – hankduan 2014-12-04 19:31:42
@hankduan非常感谢您对功能请求进行了详细说明。请回答(您在github问题中提供的一些技术细节),我会接受它。如果要实现该功能,我们会根据适当的说明更新答案。 – alecxe 2014-12-11 15:10:49