Skip to content

VS Code extension: real Electron E2E tests via Playwright #555

Description

@stevez

Problem

Phase 1 (#526) uses mock-based tests borrowed from playwright-vscode. While fast and CI-friendly, mocks can drift from real VS Code behavior. Real Electron E2E tests would catch integration issues (activation, commands, keybindings, webview rendering).

Approach

Use Playwright's _electron.launch() to launch a real VS Code instance with the extension installed.

Blocker: _electron.launch() broken for Electron 30+

Playwright's _electron.launch() is currently broken for modern VS Code (Electron 30+). The issue:

  • Playwright injects --remote-debugging-port=0 as a CLI arg
  • Electron 30+ rejects this flag at the CLI level before any JS executes
  • A fix was merged (#39012) then reverted (#39710) due to VS Code regressions
  • Latest report (#39922, Mar 29 2026) closed as "not planned"
  • Microsoft's own playwright-vscode tests-integration also fails on Windows with the same error

Timeline

  • #39008 — Original bug report (Jan 2026)
  • #39012 — Fix: "pass port via switches not args" (merged Jan 28)
  • #39710 — Fix reverted (broke VS Code / Electron 39)
  • #39922 — Reopened for Electron 40, closed "not planned" (Mar 29)

Workarounds

  1. Use older VS Code (pre-Electron 30, ~VS Code < 1.90) — fragile, outdated
  2. Spawn VS Code manually + connect via CDP (wdio approach) — bypass _electron.launch entirely
  3. Wait for upstream fix in Playwright

Test infrastructure prepared

Files exist at packages/vscode/e2e/ ready to use once the blocker is resolved:

  • globalSetup.ts — downloads VS Code
  • playwright.config.ts — test config
  • tests/baseTest.ts — fixture that launches VS Code with _electron.launch()
  • tests/basic.test.ts — extension activation, Test Explorer, REPL panel tests

References

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions