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
37 stars 28 forks source link

browserVersion: insiders fails #124

Open kgartland-rstudio opened 5 months ago

kgartland-rstudio commented 5 months ago

Version: wdio-vscode-service": "^6.1.0

When running with browserVersion: "insiders" I hit the following error:

2024-06-21T15:19:35.831Z INFO @wdio/local-runner: shutting down SevereServiceError in "onPrepare" SevereServiceError: A service failed in the 'onPrepare' hook SevereServiceError: Couldn't set up VSCode: Invalid version main at VSCodeServiceLauncher._downloadVSCode (file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/wdio-vscode-service/src/launcher.ts:192:19) at async VSCodeServiceLauncher._setupVSCodeDesktop (file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/wdio-vscode-service/src/launcher.ts:175:47) at async VSCodeServiceLauncher.onPrepare (file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/wdio-vscode-service/src/launcher.ts:95:17) at async file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/@wdio/cli/build/utils.js:42:17 at async Promise.all (index 0) at async Launcher.run (file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/@wdio/cli/build/launcher.js:93:13) Stopping runner... at file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/@wdio/cli/build/utils.js:58:35 at async Launcher.run (file:///Users/kgartland/work/publishing-client/test/vscode-ui/node_modules/@wdio/cli/build/launcher.js:93:13)

Running with browserVersion: "stable" works as expected.

sij1nk commented 4 months ago

browserVersion: "insiders" similarly does not work if browserName: "chrome"

Using the following wdio.conf.ts (only the capabilities object is really relevant here):

import type { Options } from "@wdio/types";
export const config: Options.Testrunner = {
  runner: "local",
  autoCompileOpts: {
    autoCompile: true,
    tsNodeOpts: {
      project: "./tsconfig.json",
      transpileOnly: true,
    },
  },
  specs: ["./test/specs/**/*.ts"],
  exclude: [],
  maxInstances: 10,
  capabilities: [
    {
      browserName: "chrome",
      browserVersion: "insiders",
      "wdio:vscodeOptions": {
        userSettings: {
          "editor.fontSize": 14,
        },
      },
    },
  ],
  logLevel: "info",
  bail: 0,
  waitforTimeout: 10000,
  connectionRetryTimeout: 120000,
  connectionRetryCount: 3,
  services: ["vscode"],

  framework: "mocha",

  reporters: ["spec"],

  mochaOpts: {
    ui: "bdd",
    timeout: 60000,
  },
};

Produces the following error:


> wdio
> wdio run ./wdio.conf.ts

Execution of 1 workers started at 2024-08-01T09:21:17.153Z

2024-08-01T09:21:17.361Z INFO @wdio/cli:launcher: Run onPrepare hook
2024-08-01T09:21:17.804Z INFO @wdio/local-runner: Shutting down spawned worker
2024-08-01T09:21:18.055Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2024-08-01T09:21:18.055Z INFO @wdio/local-runner: shutting down
SevereServiceError in "onPrepare"
SevereServiceError: 
A service failed in the 'onPrepare' hook
SevereServiceError: Couldn't start server for VSCode Web: Couldn't set up VSCode Web: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at VSCodeServiceLauncher._setupVSCodeWeb (file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/wdio-vscode-service/src/launcher.ts:133:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async VSCodeServiceLauncher.onPrepare (file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/wdio-vscode-service/src/launcher.ts:102:13)
    at async file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/@wdio/cli/build/utils.js:42:17
    at async Promise.all (index 0)
    at async Launcher.run (file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/@wdio/cli/build/launcher.js:93:13)

Stopping runner...
    at file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/@wdio/cli/build/utils.js:58:35
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Launcher.run (file:///home/rg/repos/@webdriverio/vscode-web-latest/node_modules/@wdio/cli/build/launcher.js:93:13)

I traced this back to https://github.com/webdriverio-community/wdio-vscode-service/blob/main/src/launcher.ts#L267 : the string insiders is inserted into VSCODE_WEB_STANDALONE, but the resulting URL leads nowhere. It works if we insert the string insider

https://update.code.visualstudio.com/api/update/web-standalone/insiders/latest https://update.code.visualstudio.com/api/update/web-standalone/insider/latest

Not sure if there's anything else, I did not debug this extensively