codeceptjs / codeceptjs/CodeceptJS

Firefox profile can't be loaded in codeceptjs webdriver

Đang mở
#2,476 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
757
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.