Add Playwright E2E tests for Visual Designer#19689
Open
shenglol wants to merge 1 commit into
Open
Conversation
- Add Playwright (Chromium) infrastructure with 4 spec files covering app shell, graph rendering, controls/status bar, and node interactions. - Instrument core components with stable data-testid attributes. - Split tsconfig into composite app/e2e projects so playwright.config.ts picks up @types/node; switch build to tsc -b && vite build. - Wire e2e/e2e:install scripts into the test-vscode-bicep-ui CI job (Linux only) and upload the Playwright HTML report as an artifact. - Ignore .tsbuildinfo, e2e/.report, and e2e/.results in git/eslint.
Contributor
|
Test this change out locally with the following install scripts (Action run 26075134651) VSCode
Azure CLI
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds end-to-end test coverage for the Bicep Visual Designer React app using Playwright (Chromium), and wires it into CI.
Changes
Playwright infrastructure
playwright.config.ts: Chromium-only project, auto-boots the Vite dev server at127.0.0.1:5173, CI-aware (retries=2,workers=1,forbidOnly=true), HTML report toe2e/.report, artifacts toe2e/.results.e2e/fixtures.ts: shared helpers —SAMPLE_GRAPHS,openVisualDesigner,loadSampleGraph,waitForAnyNode,nodeCount,getGraphTransform.app-loads.spec.ts— shell loads, no unexpected console errors, default graph auto-received.graph-rendering.spec.ts— flat/module/complex/empty sample graphs, graph swap.controls.spec.ts— status bar states, control enable/disable, zoom/fit-view transforms, export overlay open/close.node-interactions.spec.ts— focus on click, blur on empty click,revealFileRangeon dblclick, focus survival across graph swaps.Test instrumentation
Added stable
data-testid(and related data attributes) to:App.tsx(app-root)lib/graph/components/Canvas.tsx(graph-canvas)lib/graph/components/BaseNode.tsx/AtomicNode.tsx/CompoundNode.tsx(graph-node+data-node-id+data-node-kind)features/controls/ControlBar.tsx(control-bar,control-zoom-in,control-zoom-out,control-fit-view,control-reset-layout,control-export)features/status/StatusBar.tsx(status-bar+data-status+data-error-count,status-indicator,status-error-link,status-empty-message)features/devtools/DevToolbar.tsx(dev-toolbar,dev-graph-*,dev-mutation-*)features/export/ExportOverlay.tsx(export-overlay)TypeScript project references
tsconfig.jsonis now solution-style and referencestsconfig.app.json(src) andtsconfig.e2e.json(playwright.config.ts+e2e/**,types: ["node"]).buildscript:tsc -b && vite build.baseUrlfrom the app tsconfig (TS 4.1+ resolvespathsrelative to the tsconfig).Scripts
e2e,e2e:ui,e2e:report,e2e:installinapps/visual-designer/package.json.e2e:*namespace (instead oftest:e2e:*) keeps Playwright out of the unit-testturbo testpipeline used elsewhere in the monorepo.CI (
.github/workflows/build.yml)In the
test-vscode-bicep-uijob, afterRun tests, gated on Linux:npm run e2e:install(installs Chromium + deps)npm run e2e(CI=true)e2e/.reportasvisual-designer-playwright-reportartifact (if: always(), 7-day retention).Hygiene
.gitignore: ignore*.tsbuildinfo,**/e2e/.report/,**/e2e/.results/, plus Playwright defaults.eslint.config.mjs: ignore**/e2e/.results/and**/e2e/.report/.Validation
tsc -b→ exit 0npm run lint→ cleannpm run e2elocally → 21 passed in ~34s.Microsoft Reviewers: Open in CodeFlow