codeceptjs / codeceptjs/CodeceptJS

Firefox profile can't be loaded in codeceptjs webdriver

未關閉
#2,476 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
4.2k
分支
757
平均合併
2 天 9 小時
30 天內合併 PR
16

描述

#### 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
},
};
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。