Background
Recent work adds a "Preview Workflow Diagram" command (Mermaid first, Cytoscape planned) that opens a vscode.WebviewPanel and renders SVG via a bundled JS module. The current E2E harness (@vscode/test-electron + Mocha) cannot reach into webview iframes, so we can validate that the panel opens and that the LSP wire delivers a valid graph LR … payload, but not that the SVG actually rendered correctly inside the webview.
Proposal
Add a second, opt-in E2E target npm run test:wdio using wdio-vscode-service (WebdriverIO + VS Code via WebDriver). This drives the real Electron/Chromium instance and can query the webview's DOM, which:
- Proves
mermaid.render() actually injected <svg> into the panel (node count, edge count, viewBox).
- Becomes load-bearing for the planned click-to-jump v2 work (webview → extension
selectStep round-trip), which needs DOM event simulation against rendered nodes.
- Doesn't disturb the existing Mocha suite — runs as a separate harness.
Suggested shape
- New devDeps:
@wdio/cli, wdio-vscode-service, @wdio/mocha-framework, webdriverio (>=8.14 for VS Code 1.86+).
wdio.conf.ts at repo root: browserName: "vscode", pinned browserVersion, wdio:vscodeOptions.extensionPath: ".", workspace pointed at test-data/.
client/tests/wdio/specs/diagramPreview.spec.ts: open fixture → executeWorkbench invokes galaxy-workflows.previewMermaidDiagram → switch into the webview frame → assert svg [id^="diagram-"] exists, node <g class="node"> count matches the fixture's step count.
- Page object pattern in
client/tests/wdio/pageobjects/ for reusable VS Code element locators.
- CI: add a job (Linux uses
xvfb-run); macOS/Windows headed.
Gotchas (per Apr 2026 wdio-vscode-service docs)
- Chromedriver is auto-resolved per VS Code version; needs CI network access.
- ~8–12s bootstrap per spec — keep specs grouped, not one-per-feature.
- Webview iframe access is via WebDriver context switching, not CDP; sandbox/CSP restrictions don't apply.
What this enables next
- Migrating the postMessage round-trip pattern (proposed for live-update tests in the next diagram preview commit) to direct DOM assertions, removing test-only message types.
- Click-to-jump v2 tests that simulate
<g class="node"> clicks and assert editor selection.
- Future Cytoscape renderer tests share the same harness.
Out of scope for this issue
- Replacing the existing Mocha E2E suite — wdio is additive.
- The actual click-to-jump implementation.
Refs: wdio-vscode-service. Layer-1 LSP-wire tests for the diagram preview have landed locally in client/tests/e2e/suite/diagramPreview.e2e.ts on a feature branch; this issue tracks the follow-up DOM-level coverage.
Background
Recent work adds a "Preview Workflow Diagram" command (Mermaid first, Cytoscape planned) that opens a
vscode.WebviewPaneland renders SVG via a bundled JS module. The current E2E harness (@vscode/test-electron+ Mocha) cannot reach into webview iframes, so we can validate that the panel opens and that the LSP wire delivers a validgraph LR …payload, but not that the SVG actually rendered correctly inside the webview.Proposal
Add a second, opt-in E2E target
npm run test:wdiousingwdio-vscode-service(WebdriverIO + VS Code via WebDriver). This drives the real Electron/Chromium instance and can query the webview's DOM, which:mermaid.render()actually injected<svg>into the panel (node count, edge count, viewBox).selectStepround-trip), which needs DOM event simulation against rendered nodes.Suggested shape
@wdio/cli,wdio-vscode-service,@wdio/mocha-framework,webdriverio(>=8.14 for VS Code 1.86+).wdio.conf.tsat repo root:browserName: "vscode", pinnedbrowserVersion,wdio:vscodeOptions.extensionPath: ".", workspace pointed attest-data/.client/tests/wdio/specs/diagramPreview.spec.ts: open fixture →executeWorkbenchinvokesgalaxy-workflows.previewMermaidDiagram→ switch into the webview frame → assertsvg [id^="diagram-"]exists, node<g class="node">count matches the fixture's step count.client/tests/wdio/pageobjects/for reusable VS Code element locators.xvfb-run); macOS/Windows headed.Gotchas (per Apr 2026 wdio-vscode-service docs)
What this enables next
<g class="node">clicks and assert editor selection.Out of scope for this issue
Refs: wdio-vscode-service. Layer-1 LSP-wire tests for the diagram preview have landed locally in
client/tests/e2e/suite/diagramPreview.e2e.tson a feature branch; this issue tracks the follow-up DOM-level coverage.