webdriverio: [πŸ› Bug]: Test not starting on v8

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

v8

Node.js Version

16.13.2

Mode

Standalone Mode

Which capabilities are you using?

No response

What happened?

Trying to migrate from v7 to v8. The tests start and get stuck without any error.

My dependencies

"@wdio/allure-reporter": "^8.0.0",
"@wdio/appium-service": "^8.0.0",
"@wdio/cli": "^8.0.0",
"@wdio/local-runner": "^8.0.0",
"@wdio/mocha-framework": "^8.0.0",
"@wdio/selenium-standalone-service": "^8.0.0",
"@wdio/spec-reporter": "^8.0.0",

What is your expected behavior?

Test should run just as they did with v7

How to reproduce the bug.

Setup a fresh webriver.io project with v8 and run the test scripts

Relevant log output

`2022-12-02T10:07:44.576Z DEBUG @wdio/utils:initialiseServices: initialise service "chromedriver" as NPM package
2022-12-02T10:07:44.579Z INFO @wdio/cli:launcher: Run onPrepare hook
Initializing Chrome Service With Port - 5010
2022-12-02T10:07:44.605Z INFO chromedriver: Initiate Chromedriver Launcher (v8.0.0)
2022-12-02T10:07:44.608Z INFO chromedriver: Start Chromedriver (/Users/reshail/lean-test-framework/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=5010 --url-base=/
2022-12-02T10:07:44.629Z INFO chromedriver: Starting ChromeDriver 107.0.5304.62 (1eec40d3a5764881c92085aaee66d25075c159aa-refs/branch-heads/5304@{#942}) on port 5010
2022-12-02T10:07:44.630Z INFO chromedriver: Only local connections are allowed.
2022-12-02T10:07:44.631Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
2022-12-02T10:07:44.631Z INFO chromedriver: ChromeDriver was started successfully.
2022-12-02T10:07:44.724Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 144ms
2022-12-02T10:07:44.727Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2022-12-02T10:07:44.727Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2022-12-02T10:07:44.728Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,config/wdio.conf.js`

When I force quit it

Ended WebDriver sessions gracefully after a SIGINT signal was received!
2022-12-02T10:12:15.904Z INFO @wdio/local-runner: Shutting down spawned worker
[0-0] 2022-12-02T10:12:15.904Z INFO @wdio/local-runner: Received SIGINT, giving process 5000ms to shutdown gracefully
[0-0] 2022-12-02T10:12:15.907Z INFO @wdio/local-runner: Run worker command: endSession
[0-0] 2022-12-02T10:12:15.908Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read properties of undefined (reading 'sessionId')
[0-0]     at Runner.endSession (file:///Users/reshail/lean-test-framework/node_modules/@wdio/runner/build/index.js:364:50)
[0-0]     at process.<anonymous> (file:///Users/reshail/lean-test-framework/node_modules/@wdio/local-runner/build/run.js:18:22)
[0-0]     at process.emit (node:events:402:35)
[0-0]     at process.emit (node:domain:475:12)
[0-0]     at emit (node:internal/child_process:917:12)
[0-0]     at processTicksAndRejections (node:internal/process/task_queues:84:21)
2022-12-02T10:12:15.926Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (15 by maintainers)

Most upvoted comments

Installed the latest version, same issue.

I am receiving this this error after updating to v8.

[0-6] 2023-11-27T17:06:48.105Z ERROR @wdio/local-runner: Failed launching test session: TypeError: Cannot read properties of undefined (reading 'sessionId')
[0-6]     at Runner.endSession (file:///Users/matt/wdio-project/node_modules/@wdio/runner/build/index.js:386:50)
[0-6]     at process.<anonymous> (file:///Users/matt/wdio-project/node_modules/@wdio/local-runner/build/run.js:27:22)
[0-6]     at process.emit (node:events:526:35)
[0-6]     at process.emit (node:domain:488:12)
[0-6]     at process.emit.sharedData.processEmitHook.installedValue [as emit] (/Users/matt/wdio-project/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
[0-6]     at emit (node:internal/child_process:951:14)
[0-6]     at processTicksAndRejections (node:internal/process/task_queues:83:21)

System versions

Β» node -v                                                                                                                           
v20.9.0
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Β» npm -v 
10.1.0

Using v8.24.0 of @wdio/* packages.

I am also receiving Error - SeleniumStandalone.start is not a function on v8.

2022-12-06T11:22:07.159Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2022-12-06T11:22:07.253Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2022-12-06T11:22:07.253Z INFO @wdio/cli:launcher: Run onPrepare hook
2022-12-06T11:22:07.766Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
TypeError: SeleniumStandalone.start is not a function
    at SeleniumStandaloneLauncher.onPrepare (file:///.../@wdio/selenium-standalone-service/build/launcher.js:92:42)
    at async file:///.../@wdio/cli/build/utils.js:42:17
    at async Promise.all (index 0)
    at async Launcher.run (file:///.../@wdio/cli/build/launcher.js:82:13)

npm init wdio@latest . produces the same error.

I can reproduce the issue @ReshailLean is reporting. It’s really simple to repro in my case on MacOS.

Follow the getting started guide:

npm init wdio .

  • Then I chose those options as input requested by the getting started tool:
  • local - for e2e testing of web and mobile applications
  • On my local machine
  • Cucumber
  • No!
  • Y (to auto generate test files)
  • reporter: spec
  • wait-for
  • chrome driver

This ends up with a package.json looking like this:

{
    "name": "webdriverio-tests",
    "version": "0.1.0",
    "private": true,
    "devDependencies": {
        "@wdio/cli": "^8.0.5",
        "@wdio/cucumber-framework": "^8.0.2",
        "@wdio/local-runner": "^8.0.5",
        "@wdio/spec-reporter": "^8.0.0",
        "chromedriver": "^108.0.0",
        "wdio-chromedriver-service": "^8.0.0"
    },
    "scripts": {
        "wdio": "wdio run wdio.conf.js"
    }
}

Now try running npm run wdio.

Running halts at the output mentioned above: INFO @wdio/local-runner: Start worker 0-0 with arg: run,config/wdio.conf.js

Killing the process ends up with the output @ReshailLean reports.