【发布时间】:2015-01-31 13:39:12
【问题描述】:
这是Set firefox profile with protractor 主题的后续内容。
根据setFirefoxProfile howto,可以使用特殊的"helper" js code 设置一个firefox 配置文件,该配置文件使用firefox-profile 和q 库来即时制作编码的firefox 配置文件。
这对我有用,直到我尝试使用多个浏览器并配置 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,如何修复错误并设置firefox配置文件?
作为一种解决方法,我创建了一个单独的量角器配置文件,仅配置了 firefox(使用 capabilities)并将 grunt 设置为运行量角器两次 - 一个用于此“带有配置文件的 firefox”配置和另一个适用于所有其他浏览器。
【问题讨论】:
-
我打开了一个问题github.com/angular/protractor/issues/1594。我认为这是你想要的。请对此问题发表评论并使用它来跟踪更新。
-
@hankduan 非常感谢您详细说明此功能请求。请回答(您在 github 问题中提供的一些技术细节),我会接受。如果该功能将被实施,我们将使用适当的说明更新答案。
标签: javascript angularjs firefox selenium protractor