這是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