feat(markdown): add Playwright visual + functional e2e for the demo shell by stephenliang · Pull Request #73477 · code-dot-org/code-dot-org · GitHub
Skip to content

feat(markdown): add Playwright visual + functional e2e for the demo shell#73477

Open
stephenliang wants to merge 2 commits into
stephen/codegen-visual-infrafrom
stephen/markdown-visual-e2e
Open

feat(markdown): add Playwright visual + functional e2e for the demo shell#73477
stephenliang wants to merge 2 commits into
stephen/codegen-visual-infrafrom
stephen/markdown-visual-e2e

Conversation

@stephenliang

Copy link
Copy Markdown
Member

Summary

Adds Playwright e2e tests for the markdown demo shell, consuming @code-dot-org/playwright-support from #73476.

  • 5 functional tests — picker renders, default scenario, scenario switch, dark-mode theme flip, sanitization strips scripts.
  • 24 visual tests — 12 scenarios × light/dark, each captured via Applitools Eyes in CI.
  • markdown-ci.yml — new GHA workflow (mirrors oceans-ci pattern).
  • CI paths-filterplaywright-support/** added to markdown filter.

Stacked on #73476 — merge that first.

Test plan

  • turbo run build typecheck green for markdown
  • CI (frontend-ci → markdown job) green
  • Applitools Eyes baselines accepted for the 24 visual checkpoints

Deploy notes

No deployment changes.

🤖 Generated with Claude Code

stephenliang and others added 2 commits June 25, 2026 08:55
…hell

Re-introduce visual coverage to the markdown package (its vitest-browser
harness was removed earlier in the branch) via the shared
@code-dot-org/playwright-support — the abstraction's first non-lab consumer.

- e2e/fixtures/visual.ts — createVisualTest({appName: 'Code.org Markdown'})
- e2e/poms/DemoPage.ts — POM for the demo shell (scenario picker, dark-mode
  toggle, preview)
- e2e/demo.spec.ts — functional checks (picker renders, default scenario,
  scenario switch, dark-mode theme flip, sanitization strips scripts)
- e2e/visual.spec.ts — an @visual checkpoint per scenario in light and dark
  (24 total); baselines live in Applitools, none committed
- playwright.config.ts — chromium functional project + visualProjects()
- package.json — test:ui / test:ui:ci / test:visual:prove + playwright and
  @code-dot-org/playwright-support deps
- vitest.config.ts — exclude e2e/** so Vitest ignores the Playwright specs
- .gitignore — playwright-report, test-results, e2e/tmp

CI: add .github/workflows/markdown-ci.yml (mirrors oceans-ci: build + e2e
with VISUAL_PROVIDER=applitools) and wire it into frontend-ci.yml — a
paths-filter output and filter, a conditional job passing
playwright-image-tag, and the teardown.needs entry.

Verified: typecheck, lint, 43 unit tests, and build pass; Playwright
resolves the package for both functional (5) and @visual (24) specs;
locators authored against the demo DOM (data-testid + DSCO Toggle role
confirmed from source). The live browser run is deferred — the shared
sandbox OOM-kills the render under concurrent load (BROWSER DISCONNECTED,
no JS error; about:blank and oceans rendered fine) — it runs in
markdown-ci's isolated container, and the mechanism was captured live
against oceans.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CI paths-filter: add playwright-support/** to markdown filter.
- markdown-ci.yml: add Install LFS step to match oceans-ci.
- DemoPage: check()/setChecked() use {force: true} for DSCO
  opacity:0 input overlays.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant