Skip to content

test: e2e Playwright test of the core loop (#79) - #91

Merged
xcjs merged 1 commit into
mainfrom
test/e2e-core-loop
Oct 3, 2026
Merged

xcjs merged 1 commit into
mainfrom
test/e2e-core-loop

Conversation

@m-vawter

@m-vawter m-vawter commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Adds a Playwright end-to-end test of the core loop through the existing window.__dominic hooks (installFixture, reload, updateApp, injectBrokenApp, then Ask Agent to Fix), plus a shorter test of the runtime-crash path. The test answers /api/chat inside the browser with an AI SDK v4 data-stream reply that carries an update_app call, so it needs no provider key, locally or in CI. tests/e2e/README.md explains how to run it.

A separate new e2e job in CI installs Chromium and runs npm run test:e2e against a production build. The change also touches package.json and .github/workflows/ci.yml, so it needs Zack's review for those files.

Verification

  • npm run test:e2e: 2/2 passed locally (about 11 s), repeatedly; it also goes red when the loop is broken on purpose.
  • npm run typecheck: clean. npm run lint:md: 0 errors. A fresh npm ci with the new lockfile works.
  • Not yet run on Node 24: CI pins 24.21.0 via .nvmrc, and local runs used Node 22. The first CI run of the e2e job is the real check.
  • The job runs on every PR, but it only blocks merges once "E2E (Playwright)" is added as a required check in branch protection. That's the platform lane's call.

Closes #79.

🤖 Generated with Claude Code

Drive the core loop through the window.__dominic hooks: installFixture,
reload, updateApp, injectBrokenApp, then Ask Agent to Fix, plus a second
test for the runtime-crash path. /api/chat is answered in the browser
with an AI SDK v4 data-stream reply (encoded with the SDK's own
formatDataStreamPart) carrying an update_app call, so no provider key is
needed. Requests off the app's origin are blocked, and the test server
starts with blank provider keys.

Playwright builds the app and serves the Nitro output on 127.0.0.1:3179.
`npm run test:e2e` type-checks tests/e2e first. A new, separate CI job
installs Chromium, runs the suite, and uploads the report on failure.
lint:md now skips the gitignored e2e artifact folders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@xcjs xcjs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed: Playwright e2e of the core loop with a stubbed /api/chat (no provider key), CI e2e job with report artifact upload, lint:md excludes for test artifacts, tsc'd spec harness. Heads-up for merge order: this and #94 (my lint-precommit PR) both touch package.json/package-lock.json; whichever merges second may need a trivial lock rebase. Approving.

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.

0.1 Playwright end-to-end test of the core loop

2 participants