Skip to content

test(docsite): add page-load smoke test that crawls every route#3740

Draft
cixzhang wants to merge 1 commit into
mainfrom
navi/test/docsite-smoke
Draft

test(docsite): add page-load smoke test that crawls every route#3740
cixzhang wants to merge 1 commit into
mainfrom
navi/test/docsite-smoke

Conversation

@cixzhang

@cixzhang cixzhang commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds a page-load smoke test for the docsite that catches the broad class of "a page white-screens / throws at runtime" regressions that the existing data-extraction unit tests and build-time type/lint checks can't see.

pnpm -F @astryxdesign/docsite test:smoke:

  1. Boots the production server (next start).
  2. Enumerates every route from the site's own /sitemap.xml — the same generated registries (componentRegistry, docsRegistry, templateRegistry, blogRegistry) that drive the pages and the sitemap test — so new components, docs, templates, and blog posts are covered with no edits to the test.
  3. Visits each URL in headless Chromium and fails the route if it:
    • returns a non-OK document status,
    • throws an uncaught exception (pageerror), or
    • logs a browser console.error.

It also probes two routes the sitemap intentionally omits but that must still render: /playground/preview and a deliberate 404 (to confirm the not-found page itself renders without throwing).

Why

The docsite has ~260 routes, almost all client-rendered with StyleX + heavy client deps (Monaco, theme reels). A component-detail or doc page that throws only at render time passes tsc, eslint, and the vitest data tests today — nothing exercises the actual rendered page. This closes that gap end to end.

Files

  • apps/docsite/scripts/smoke-test.mjs — the crawler (standalone Node + Playwright, mirroring the existing .github/scripts/accessibility-audit.js pattern).
  • apps/docsite/package.jsontest:smoke script.
  • apps/docsite/README.md — Testing docs.

Verification

Ran the full server side locally against a production build: all 267 sitemap routes return clean (226×200, 41×307 intended redirects, zero 4xx/5xx). The headless-browser crawl half runs in CI where Chromium is available (the sandbox I authored this in blocks Playwright's browser CDN).

CI wiring (needs workflow scope — please add)

I couldn't push the workflow change (this token lacks workflow scope). Please add this job to .github/workflows/ci.yml, right after the existing docsite-test job:

  # Docsite page-load smoke test — builds the docsite, boots `next start`, and
  # crawls every route from /sitemap.xml in a headless browser, failing on any
  # uncaught page error, console.error, or non-OK document status. Catches the
  # "page white-screens / throws at runtime" class of regressions that the
  # data-extraction unit tests can't see.
  docsite-smoke:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v7

      - uses: pnpm/action-setup@v6
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: 'pnpm'

      - run: pnpm install --frozen-lockfile

      # The docsite build imports each theme's built entry (@astryxdesign/theme-*/built),
      # so every package must be built first — not just core.
      - name: Build packages
        run: pnpm build

      - name: Build docsite
        run: pnpm -F @astryxdesign/docsite build

      - name: Install Playwright Chromium
        run: pnpm exec playwright install --with-deps chromium

      - name: Run page-load smoke test
        run: pnpm -F @astryxdesign/docsite test:smoke

Playwright is already a root devDependency (used by the pr-a11y job), so no new dependency is added.

Boot the production server and visit every route from /sitemap.xml in a
headless browser, failing on any uncaught page error, console.error, or
non-OK document status. Routes are enumerated from the same generated
registries that drive the pages, so new components, docs, templates, and
blog posts are covered with no edits.

Adds a pnpm test:smoke script backed by Playwright. The CI job that runs
it is included in the PR description (workflow changes need a separate
push scope).
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 9, 2026
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 9, 2026 2:58pm

Request Review

@cixzhang cixzhang added area:docs Documentation site (apps/docsite) and doc content type:test Tests only labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation site (apps/docsite) and doc content CLA Signed This label is managed by the Meta Open Source bot. type:test Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants