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 摘要。