test: add E2E test foundation with Playwright#132
Open
jakebromberg wants to merge 5 commits intomainfrom
Open
Conversation
2 tasks
Deploying wxyc-dj with
|
| Latest commit: |
b109696
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://baecb561.dj-site.pages.dev |
| Branch Preview URL: | https://feat-e2e-foundation.dj-site.pages.dev |
aaf4f79 to
0c8d47f
Compare
276a83b to
186ad11
Compare
Infrastructure: - Add Playwright configuration for E2E testing - Create reusable page objects for auth flows (login, dashboard, roster, onboarding) - Implement auth fixtures with session reuse - Add helper scripts for E2E test environment - Add GitHub Actions workflows for CI and E2E tests This is the foundation for comprehensive E2E testing. Test specs will be added in subsequent PRs. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add @playwright/test to devDependencies - Add test:e2e and test:e2e:ui scripts - Exclude e2e folder from main tsconfig to prevent type errors - Add e2e/tsconfig.json for E2E test type checking
Replace Docker Compose with GitHub Actions service containers for PostgreSQL and native Node background processes for auth/backend. Parallelize npm ci, Playwright install, dj-site build, and backend setup to overlap the frontend and backend tracks. Playwright config changes: - Add 10-minute globalTimeout to cap runaway runs - Lower per-test timeout from 30s to 15s (3x the ~5s baseline) - Lower expect.timeout from 15s to 10s (aligned with actionTimeout) - Disable retries during development (re-enable once suite is stable) Workflow changes: - Use services: postgres instead of Docker Compose - Run auth + backend as native Node background processes - Source .env in backend subshell so vars are available at import time - Parallelize npm ci for both repos - Run backend track (build, init-db, start services, seed users) concurrently with frontend track (Playwright install + dj-site build) - Cache Playwright browsers across runs - Add --max-failures=10 to stop after 10 failures - Lower job timeout from 45 to 15 minutes
The frontend process started by `npm run start &` was not tracked, so it was never killed in the Cleanup step. Write its PID to /tmp/frontend.pid and include it in cleanup alongside auth/backend. Also add frontend logs to the failure diagnostics step.
842e879 to
e4ee072
Compare
The .npmrc references ${NPM_TOKEN} for @wxyc/shared (a private package
on GitHub Packages), but CI workflows never exposed the secret as an
env var, causing 401 Unauthorized on every npm ci step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lib/features/authorization/) withAuthorizedViewcomponentE2E workflow performance (Closes #189)
services:container + native Node processesglobalTimeout(10 min), tighter per-test timeouts,--max-failures=10timeout-minutesfrom 45 to 15BETTER_AUTH_JWKS_URLmoved into shared.envso it's available to both services and the user-seeding scriptSpeed comparison
Measured from successful CI runs on the same branch (before vs after).
services:)npm ci)Key changes that drive the improvement:
services:containers start PostgreSQL before any workflow step runs, eliminating the 2m 11s Docker Compose bootTest plan