codeceptjs / codeceptjs/CodeceptJS

Can't connect to WebDriver error when running tests on through CLI

Đang mở
#2,859 0 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?
Try to run tests using CLI.

**NOTE**: It worth to mention that with my current configuration, I am able to run tests when debugging with my IDE (Visual Studio Code). But same config and test files fails when running `npx codeceptjs run` on CLI.

#### What do you get instead?
Error message on CLI.

> Provide console output if related. Use `--verbose` mode for more details.
CodeceptJS v3.0.5
Using test root "/mnt/c/projects/codeceptjs-demo"
Helpers: WebDriver
Plugins: screenshotOnFail, retryFailedStep, tryTo, wdio

test1 --
Error in "uncompressDownloadedFile:readStream.pipe".
See more details below:
ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
Error in "uncompressDownloadedFile:readStream.pipe".
See more details below:
ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
[1] Error | Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
✖ "before all" hook: codeceptjs.beforeSuite for "test 1 @t1" in 1495ms
[1] Error | Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
Error: ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'
S test 2 @t2

-- FAILURES:

1) test1
"before all" hook: codeceptjs.beforeSuite for "test 1 @t1":
ETXTBSY: text file is busy, open '/mnt/c/projects/codeceptjs-demo/node_modules/selenium-standalone/.selenium/chromedriver/latest-x64-chromedriver'

FAIL | 0 passed, 1 failed, 1 skipped // 1s
› Stopped SeleniumStandaloneLauncher

```bash
# paste output here

I'm running command `npx codeceptjs run --verbose` under project root path level.

```

> Provide test source code if related

```js
// paste test
```

### Details

* CodeceptJS version:
* NodeJS Version:
* Operating System:
* puppeteer || webdriverio || protractor || testcafe version (if related)
* Configuration file:

```js
# paste config here

const { setHeadlessWhen } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
WebDriver: {
url: 'localhost',
browser: 'chrome',
restart: false,
windowSize: '1920x1680',
desiredCapabilities: {
chromeOptions: {
args: [
"--headless",
"--disable-gpu",
"--no-sandbox"
]
}
}
}
},
include: {
I: './steps_file.js'
},
bootstrap: null,
mocha: {},
name: 'codeceptjs-demo',
plugins: {
pauseOnFail: {},
retryFailedStep: {
enabled: true
},
tryTo: {
enabled: true
},
screenshotOnFail: {
enabled: true
},
wdio: {
enabled: true,
services: ['selenium-standalone']
}
}
}
```

Thank you

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.