Skip to content

Add browser smoke tests for demo fixtures#42

Merged
blackopsrepl merged 2 commits intomainfrom
issue/38-browser-demo-verification
Mar 23, 2026
Merged

Add browser smoke tests for demo fixtures#42
blackopsrepl merged 2 commits intomainfrom
issue/38-browser-demo-verification

Conversation

@blackopsrepl
Copy link
Copy Markdown
Contributor

Summary

Add browser-level smoke coverage for the shipped demo fixtures and wire it into local and CI workflows.

What Changed

  • added a Playwright-backed smoke script that opens demos/full-surface.html and demos/rail.html
  • fail the check on browser page errors, request failures, or console errors
  • verify the main shipped UI surfaces mount in the demo fixtures
  • added make browser-setup and make test-browser, and included browser verification in the standard local validation targets
  • installed browser dependencies in CI and ran the smoke check there
  • fixed the full-surface Gantt fixture to mount lazily when its tab is visible
  • added a demo server that aliases /sf/* to static/sf/* so bundled font URLs resolve in local demo serving
  • documented the browser verification workflow

Validation

  • node --test tests/*.test.js
  • node tests/demo-browser-check.js
  • python3 -m py_compile scripts/demo_server.py

Fixes #38

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 391283cd67

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Makefile Outdated

browser-setup:
@printf "$(PROGRESS) Installing browser test dependencies...\n"
@npm ci && npx playwright install chromium && \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install Playwright system packages in browser-setup

On fresh Debian/Ubuntu developer machines, npx playwright install chromium only downloads the browser binary; it does not install the shared libraries Chromium needs. Playwright’s own install docs use install --with-deps for that step (https://playwright.dev/docs/intro#updating-playwright), and this same PR already needs --with-deps in .github/workflows/ci.yml:31-34 to make CI pass. As written, make browser-setup still leaves make test-browser failing with missing system dependencies on common Linux setups even though it is documented as the one-time setup command.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. browser-setup now uses npx playwright install --with-deps chromium so the one-time local setup matches the CI dependency path and installs the shared libraries Chromium needs on Debian/Ubuntu-class Linux machines.

Comment on lines +12 to +15
path_only = path.split("?", 1)[0].split("#", 1)[0]
if path_only.startswith("/sf/"):
path_only = "/static" + path_only
return str(ROOT / path_only.lstrip("/"))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent path traversal outside the repo root

translate_path() now concatenates the raw request path onto ROOT without normalizing or rejecting .. segments, so make demo-serve will serve arbitrary local files outside the repo. I verified that requesting /../../etc/hosts from this server returns 200, which is a regression from the previous python -m http.server behavior. This matters whenever the demo port is exposed via a forwarded port or shared dev environment.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8c544a3. translate_path() now URL-decodes, normalizes the path via PurePosixPath, drops .. segments, resolves the candidate path, and rejects anything that escapes ROOT. I verified /../../../../etc/hosts now returns 404, while /sf/fonts/space-grotesk.woff2 still returns 200.

@blackopsrepl blackopsrepl merged commit 28f6c56 into main Mar 23, 2026
1 check passed
@blackopsrepl blackopsrepl deleted the issue/38-browser-demo-verification branch March 23, 2026 20:53
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.

Add browser-level verification for demo fixtures

1 participant