codeceptjs / codeceptjs/CodeceptJS
Firefox profile can't be loaded in codeceptjs webdriver
- Dominant language
- JavaScript
- Stars
- 4.2k
- Forks
- 757
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 16
Description
#### What are you trying to achieve?
I'm trying to install extension in Firefox using profile created with firefox-profile-service in wdio plugin according to the [documentation](https://webdriver.io/docs/firefox-profile-service.html)
#### What do you get instead?
I've got an error from Webdriver
```bash
Error: Failed to create session.
Expected to read a START_MAP but instead have: START_COLLECTION. Last 128 characters read: EwZDBiZjgtZjViNS1jOGI0LWE4YjItMmI5ODc5ZTA4YzVkfS54cGlQSwUGAAAAAAMAAwDRAAAAsYUdAAAA"}}],"firstMatch":[{}]},"desiredCapabilities":
Driver info: driver.version: unknown
at startWebDriverSession (node_modules/webdriver/build/utils.js:45:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
```
I can load profile with only Webdriverio used and it works fine, profile with specified configurations and installed extension was launched properly, but the it doesn't work when I'm launching tests with Codeceptjs. Also I tried to launch test without desiredCapabilities property in codeceptjs config, in this case Firefox launches, but profile isn't applied
### Details
* CodeceptJS version: 2.6.6
* NodeJS Version: 10.16.0
* Operating System: macOS 10.14.4
* webdriverio
* Configuration file:
```js
// codecept.conf.js
exports.config = {
tests: './tests/*_test.js',
output: 'test-results',
helpers: {
WebDriver: {
url: 'https://myapp.com',
browser: 'firefox',
host: '127.0.0.1',
port: 4444,
logLevel: 'silent',
restart: true,
keepBrowserState: false,
keepCookies: false,
windowSize: '1280x800',
desiredCapabilities: [{
browserName: 'firefox',
}],
},
},
plugins: {
wdio: {
enabled: true,
services: [
'selenium-standalone',
'firefox-profile'
],
firefoxProfile: {
extensions: ['./myExtension.xpi'],
'xpinstall.signatures.required': false,
legacy: false,
},
},
},
};
```
* Working config for wdio
```js
// wdio.conf.js
exports.config = {
runner: 'local',
specs: [
'./test/specs/**/*.js'
],
exclude: [],
maxInstances: 1,
capabilities: [{
maxInstances: 1,
browserName: 'firefox',
}],
logLevel: 'silent',
bail: 0,
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ['selenium-standalone', 'firefox-profile'],
firefoxProfile: {
extensions: [
'./myExtension.xpi',
],
'xpinstall.signatures.required': false,
},
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
};
```
Contributor guide
Assessment
This issue has not been assessed yet.