This is a follow-up to the Set firefox profile with protractor topic.
According to the setFirefoxProfile
howto, it is possible to set a firefox profile with a special "helper" js code which uses firefox-profile
and q
libraries to make an encoded firefox profile on the fly.
This worked for me until I've tried to use multiple browsers and configuring 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()
},
...
}
With this setup I'm getting an error (full traceback here):
Spec patterns did not match any files.
As I understand, this means that the setup with firefox profile is missing specs
key. In other words, it cannot find any tests to run.
I've tried to include specs
into the capabilities
dictionary inside the helper itself, but the error persists.
How to fix the error and set firefox profile if using multiCapabilities
?
As a workaround, I've created a separate protractor configuration file with only firefox configured (using capabilities
) and set grunt
to run protractor twice - one for this "firefox with a profile" config and the other one for all other browsers.