CI: Playwright UI tests against a real server, workers and MariaDB #49

Merged
jared merged 2 commits from ci-ui-tests into main 2026-11-22 13:46:35 -05:00
Owner

Part of #45 (phase 5): frontend tests in the pipeline alongside the backend.

What it adds

A new UI (playwright) job runs in the official Playwright image with a MariaDB service container. scripts/ci/ui-stack.sh starts the real server and three real workers, with worker auth enforced as in production. The tests in tests/ui/ then drive the UI in Chromium: 30 tests across desktop and a Pixel 7 viewport.

Area Checks
Every test Fails on any page error, console error or failed Pulse request (shared fixture)
Pages All 6 pages load with the right title and heading; the dashboard and workers page show 3 online workers
Quick Command The command runs on a worker, and its output and status show in Executions; a failing command shows as failed with its stderr; multi-worker mode reaches all 3
Workflows A workflow is created in the UI, run on all workers and completes; invalid JSON is rejected
Live updates Executions gets a new row over the browser WebSocket when a command starts elsewhere (the page doesn't poll, so this guards #38)
Auth No SSO identity: 401 page and API. Wrong group: 403
Mobile No horizontal scroll on any page at phone width

Other changes

  • External requests are blocked in the tests, so SSO headers never leave the runner and Google Fonts can't make the tests flaky.
  • Deploy now also waits for the UI job.
  • The rate limits can be raised with PULSE_API_RATE_MAX and PULSE_EXEC_RATE_MAX, which the test stack needs (a full run returned 429s). Production keeps the defaults of 300 per 15 minutes and 20 per minute.
  • On failure, the playwright-report artifact holds the HTML report, traces and screenshots, and the job prints the server and worker logs.
  • README: the CI/CD table now includes the new job, plus a "UI tests" section on running them locally.

Verification

  • Locally: 30/30 passed on three consecutive runs. jest 67/67; lint has 0 errors.
  • I also checked that the fixture catches failures: a thrown page error and a 404 both made a test fail.

No visual changes, and Gandalf isn't affected.

🤖 Generated with Claude Code

Part of #45 (phase 5): frontend tests in the pipeline alongside the backend. ## What it adds A new `UI (playwright)` job runs in the official Playwright image with a MariaDB service container. `scripts/ci/ui-stack.sh` starts the real server and three real workers, with worker auth enforced as in production. The tests in `tests/ui/` then drive the UI in Chromium: 30 tests across desktop and a Pixel 7 viewport. | Area | Checks | |---|---| | Every test | Fails on any page error, console error or failed Pulse request (shared fixture) | | Pages | All 6 pages load with the right title and heading; the dashboard and workers page show 3 online workers | | Quick Command | The command runs on a worker, and its output and status show in Executions; a failing command shows as failed with its stderr; multi-worker mode reaches all 3 | | Workflows | A workflow is created in the UI, run on all workers and completes; invalid JSON is rejected | | Live updates | Executions gets a new row over the browser WebSocket when a command starts elsewhere (the page doesn't poll, so this guards #38) | | Auth | No SSO identity: 401 page and API. Wrong group: 403 | | Mobile | No horizontal scroll on any page at phone width | ## Other changes - External requests are blocked in the tests, so SSO headers never leave the runner and Google Fonts can't make the tests flaky. - Deploy now also waits for the UI job. - The rate limits can be raised with `PULSE_API_RATE_MAX` and `PULSE_EXEC_RATE_MAX`, which the test stack needs (a full run returned 429s). Production keeps the defaults of 300 per 15 minutes and 20 per minute. - On failure, the `playwright-report` artifact holds the HTML report, traces and screenshots, and the job prints the server and worker logs. - README: the CI/CD table now includes the new job, plus a "UI tests" section on running them locally. ## Verification - Locally: 30/30 passed on three consecutive runs. jest 67/67; lint has 0 errors. - I also checked that the fixture catches failures: a thrown page error and a 404 both made a test fail. No visual changes, and Gandalf isn't affected. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-22 13:37:55 -05:00
CI: Playwright UI tests against a real server, workers and MariaDB
CI / Test (jest) (push) Failing after 57s
CI / Lint (eslint) (push) Successful in 59s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 28s
CI / Test (jest) (pull_request) Successful in 17s
CI / Security (npm audit) (pull_request) Successful in 12s
CI / UI (playwright) (push) Failing after 2m25s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Failing after 1m21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
5bca0cd87b
New required-to-be job `UI (playwright)` (#45 phase 5): the official
Playwright image with a MariaDB service container. scripts/ci/ui-stack.sh
starts the real server and three workers (WORKER_AUTH_ENFORCE=1), then
tests/ui/ runs 30 tests on desktop and a phone viewport:

- every page loads with no page errors, console errors or failed requests
  (enforced by a shared fixture for every test)
- quick commands run on a worker and their output and status show in
  Executions; multi-worker mode; failing commands show as failed
- workflows are created and run from the UI and complete on all workers
- Executions updates live over the authenticated browser WebSocket
- no SSO identity: 401 page and API; wrong group: 403
- every page fits a phone screen

External requests are blocked in tests so SSO headers never leave the
machine. Deploy now also waits for the UI job. The API and execution rate
limits can be raised with PULSE_API_RATE_MAX / PULSE_EXEC_RATE_MAX for
test stacks; production defaults are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared added 1 commit 2026-11-22 13:42:45 -05:00
CI: run MariaDB inside the UI job; take Node from job images, not setup-node
CI / Test (jest) (push) Successful in 23s
CI / Lint (eslint) (push) Successful in 27s
CI / Security (npm audit) (push) Successful in 14s
CI / Lint (eslint) (pull_request) Successful in 24s
CI / Test (jest) (pull_request) Successful in 14s
CI / Security (npm audit) (pull_request) Successful in 8s
CI / UI (playwright) (push) Successful in 1m38s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m33s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
8b93c88f0f
The runner uses Docker's default bridge network, so the mariadb service
hostname never resolved. It also shares one tool cache volume between
concurrent jobs: parallel setup-node runs overwrote each other's Node
(the earlier <nil> failure and today's missing npm package.json).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared merged commit 1d5b8cdd53 into main 2026-11-22 13:46:35 -05:00
jared deleted branch ci-ui-tests 2026-11-22 13:46:38 -05:00
Sign in to join this conversation.