webdriverio-community / wdio-vscode-service

A service to test VSCode extensions from end to end using WebdriverIO
https://webdriverio-community.github.io/wdio-vscode-service/
MIT License
29 stars 23 forks source link

Unable to start vscode with wdio runner (unknown error: DevToolsActivePort file doesn't exist) #78

Closed elliotCamblor closed 5 months ago

elliotCamblor commented 11 months ago

Hi! I'm currently working on installed wdio to help with testing a vscode extension. When I try and run the boilerplate test file that was created through the wizard I'm getting the following error:

ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: Chrome failed to start: exited abnormally.
[0-0]   (unknown error: DevToolsActivePort file doesn't exist

What I'm finding strange is that I'm able to manually run the chromium/index.js file and provide all of the same flags that are provided as when I run the wdio run command and successfully start the emulated vscode instance. When I run wdio run wdio.conf.js , the vscode instance never starts and I get the above error.

2023-08-23T19:19:10.044Z DEBUG @wdio/utils:initialiseServices: initialise service "vscode" as NPM package
2023-08-23T19:19:10.449Z INFO chromedriver: Initiate Chromedriver Launcher (v8.1.1)
2023-08-23T19:19:10.449Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-08-23T19:19:10.459Z INFO wdio-vscode-service/launcher: Fetch releases from https://update.code.visualstudio.com/api/releases/stable
2023-08-23T19:19:11.124Z INFO wdio-vscode-service/launcher: Download Chromedriver (v108.0.5359.71)
2023-08-23T19:19:14.788Z INFO chromedriver: Start Chromedriver (path/to/extension/.wdio-vscode-service/chromedriver-108.0.5359.71) with args --port=9515 --url-base=/
2023-08-23T19:19:15.048Z INFO chromedriver: Starting ChromeDriver 108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016}) on port 9515
2023-08-23T19:19:15.049Z INFO chromedriver: Only local connections are allowed.
2023-08-23T19:19:15.049Z INFO chromedriver: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
2023-08-23T19:19:15.050Z INFO chromedriver: ChromeDriver was started successfully.
2023-08-23T19:19:15.142Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 4692ms
2023-08-23T19:19:15.144Z INFO @wdio/utils: Setting up browser driver for: vscode@stable
2023-08-23T19:19:15.144Z INFO @wdio/utils: Setting up browser binaries for: vscode@stable
2023-08-23T19:19:15.151Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2023-08-23T19:19:15.152Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2023-08-23T19:19:15.153Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,./src/test/wdio.conf.js
2023-08-23T19:19:15.178Z DEBUG @wdio/local-runner: Send command run to worker with cid "0-0"
[0-0] 2023-08-23T19:19:16.347Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2023-08-23T19:19:16.358Z DEBUG @wdio/runner: init remote session
[0-0] 2023-08-23T19:19:16.361Z DEBUG @wdio/utils:initialiseServices: initialise service "vscode" as NPM package
[0-0] 2023-08-23T19:19:16.811Z INFO wdio-vscode-service: Start VSCode proxy server on port 56358
[0-0] 2023-08-23T19:19:16.812Z INFO wdio-vscode-service: Setting up VSCode directory at /var/folders/0n/p0zc4r5j4bz1f0d5br0yv_4r0000gn/T/tmp-35684-o6rrwnUFh2FX/settings/User
[0-0] 2023-08-23T19:19:16.815Z INFO wdio-vscode-service: Start VSCode: path/to/extension/node_modules/wdio-vscode-service/dist/chromium/index.js --no-sandbox --disable-updates --skip-welcome --skip-release-notes --disable-workspace-trust --disable-extensions --extension-development-path=path/to/extension/src --extension-tests-path=path/to/extension/node_modules/wdio-vscode-service/dist/proxy/cjs/entry.js --user-data-dir=/var/folders/0n/p0zc4r5j4bz1f0d5br0yv_4r0000gn/T/tmp-35684-o6rrwnUFh2FX/settings --extensions-dir=/var/folders/0n/p0zc4r5j4bz1f0d5br0yv_4r0000gn/T/tmp-35684-o6rrwnUFh2FX/extensions --vscode-binary-path="path/to/extension/.wdio-vscode-service/vscode-darwin-1.81.1/Visual Studio Code.app/Contents/MacOS/Electron"
[0-0] 2023-08-23T19:19:16.816Z DEBUG @wdio/utils:shim: Finished to run "beforeSession" hook in 11ms
[0-0] ACTUALLY RUNING TEH TEST
[0-0] RUNNING in chrome - file:///src/test/specs/test.e2e.mjs
[0-0] 2023-08-23T19:19:16.924Z DEBUG @wdio/runner: init remote session
[0-0] 2023-08-23T19:19:16.926Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2023-08-23T19:19:16.926Z INFO @wdio/utils: Connecting to existing driver at http://localhost:9515/
[0-0] 2023-08-23T19:19:16.951Z INFO webdriver: [POST] http://localhost:9515/session
[0-0] 2023-08-23T19:19:16.952Z INFO webdriver: DATA {
[0-0]   capabilities: {
[0-0]     alwaysMatch: {
[0-0]       browserName: 'chrome',
[0-0]       browserVersion: 'stable',
[0-0]       'wdio:vscodeOptions': [Object],
[0-0]       'goog:chromeOptions': [Object]
[0-0]     },
[0-0]     firstMatch: [ {} ]
[0-0]   },
[0-0]   desiredCapabilities: {
[0-0]     browserName: 'chrome',
[0-0]     browserVersion: 'stable',
[0-0]     'wdio:vscodeOptions': {
[0-0]       extensionPath: 'path/to/extension/src',
[0-0]       userSettings: [Object],
[0-0]       binary: '"path/to/extension/.wdio-vscode-service/vscode-darwin-1.81.1/Visual Studio Code.app/Contents/MacOS/Electron"'
[0-0]     },
[0-0]     'goog:chromeOptions': {
[0-0]       binary: 'path/to/extension/node_modules/wdio-vscode-service/dist/chromium/index.js',
[0-0]       args: [Array],
[0-0]       windowTypes: [Array]
[0-0]     }
[0-0]   }
[0-0] }
[0-0] 2023-08-23T19:19:17.134Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2023-08-23T19:19:17.136Z DEBUG @wdio/utils:shim: Finished to run "after" hook in 0ms
[0-0] 2023-08-23T19:19:17.135Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: Chrome failed to start: exited abnormally.
[0-0]   (unknown error: DevToolsActivePort file doesn't exist)
[0-0]   (The process started from chrome location path/to/extension/node_modules/wdio-vscode-service/dist/chromium/index.js is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Running the following in my terminal results in the vscode instance starting properly

path/to/extension/node_modules/wdio-vscode-service/dist/chromium/index.js --no-sandbox --disable-updates --skip-welcome --skip-release-notes --disable-workspace-trust --disable-extensions --extension-development-path=path/to/extension/src --extension-tests-path=path/to/extension/node_modules/wdio-vscode-service/dist/proxy/cjs/entry.js --user-data-dir=/var/folders/0n/p0zc4r5j4bz1f0d5br0yv_4r0000gn/T/tmp-39900-dGKExBc9UQ8a/settings --extensions-dir=/var/folders/0n/p0zc4r5j4bz1f0d5br0yv_4r0000gn/T/tmp-39900-dGKExBc9UQ8a/extensions --vscode-binary-path="path/to/extension/.wdio-vscode-service/vscode-darwin-1.81.1/Visual Studio Code.app/Contents/MacOS/Electron"
christian-bromann commented 5 months ago

This should be resolved now, please let me know if it isn't!