Skip to content

test(playground): add browser tests for playgrounds and framework tabs - #4902

Open
thetaPC wants to merge 1 commit into
playground-file-tabsfrom
playground-tests
Open

thetaPC wants to merge 1 commit into
playground-file-tabsfrom
playground-tests

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #4901.

Playgrounds had no tests, and most of what can break in them only shows up in a browser: the framework choice shared with the docs tabs, file tabs, and the files StackBlitz receives. These run with Playwright against the site the Checks job already builds, so CI doesn't build the site twice.

  • The framework choice is shared between docs tabs and playgrounds and kept across reloads, and a stored Angular (Standalone) pick shows as Angular.
  • A framework or mode a playground has no code for is disabled and skipped by the keyboard.
  • File tabs show one file at a time, select the first file after a framework switch, and follow the Docusaurus keyboard behavior.
  • StackBlitz receives every file of a multi-file example, including hidden tabs, matching the source exactly. The request is intercepted, so nothing is sent to StackBlitz.
  • The iOS/MD mode switches the demo, carries over to other playgrounds on the page, and is kept across reloads.

The config follows the newer team repos, such as the starters and the photo gallery tutorials, with two differences: tests end in .e2e.ts, as in ionic-framework, because Vitest runs every .spec.ts, and they run in desktop Chrome, since most docs readers are on desktop. A failed CI run uploads the HTML report.

How to test

  1. Check the Checks job's "Run E2E Tests" step. It lists each test, and a failed run attaches the HTML report as the playwright-report artifact.

  2. To run them locally, build the site first:

    npm run build:preview
    npx playwright install chromium
    npm run test:e2e

    The HTML report opens on a failure, or with npx playwright show-report.

Found while writing these, left for the hooks cleanup:

  • The StackBlitz, copy and reset buttons have no accessible name.
  • The iOS and MD buttons don't expose which one is selected.
  • Code snippet ids repeat across playgrounds on the same page.

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Nov 25, 2026 4:17pm UTC

Request Review

@thetaPC
thetaPC added this pull request to stack #4900 November 25, 2026 16:30
@thetaPC
thetaPC marked this pull request as ready for review November 25, 2026 23:12
@thetaPC
thetaPC requested a review from a team as a code owner November 25, 2026 23:12
@thetaPC
thetaPC requested a review from ShaneK November 25, 2026 23:12

This branch was successfully deployed

1 active deployment
Preview — 52dc0a2a Deployed Nov 25, 2026 by vercel[bot]
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