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

オープン
#2,859 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, nodejs
領域
cli, testing-qa

調査の方向性

まず、提供された設定を使用し、プロジェクトルートから npx codeceptjs run --verbose を実行して失敗を再現します。報告された chromedriver のパスと before all フック周辺の WebDriver および selenium-standalone のセットアップを調査します。CLI によるテスト実行が報告された ETXTBSY エラーで失敗しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

# paste output here

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

Provide test source code if related

// paste test
Details
  • CodeceptJS version:
  • NodeJS Version:
  • Operating System:
  • puppeteer || webdriverio || protractor || testcafe version (if related)
  • Configuration file:
# 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

主要言語
JavaScript
スター
4.2k
フォーク
756
平均マージ
2日 9時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。