Building on the topic of setting a Firefox profile with Protractor from this discussion.
Referencing the setFirefoxProfile
guide, it's noted that a customized Firefox profile can be established using specialized JavaScript code found in this "helper" script, leveraging libraries like firefox-profile
and q
for dynamic profile creation.
This method was effective until attempting to implement multiple browsers while 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()
},
...
}
However, an error is encountered in this setup (full details available here):
Spec patterns did not match any files.
The issue seems to stem from the absence of a specs
key within the Firefox profiles, resulting in no tests being identified for execution.
Attempts were made to include specs
directly into the capabilities
object inside the helper script, yet the error persists.
How can this error be resolved when configuring Firefox profiles alongside multiCapabilities
?
To navigate around this issue, a separate Protractor configuration file was created specifically for Firefox configurations (using capabilities
), with a setup involving running Protractor twice - once for the "Firefox with profile" config and another for all other browsers.