**Environment Variables:**
- Fixed docker-compose.ci.yml to use correct environment variable names:
- SURREALDB_JWT_SECRET (not SURREAL_JWT_SECRET)
- GOOGLE_GENERATIVE_AI_API_KEY (not GOOGLE_API_KEY)
- Updated Gitea Actions workflow to match correct variable names
**Docker Configuration:**
- Removed SurrealDB health check (minimal scratch image lacks utilities)
- Added 10-second sleep before Next.js starts to wait for SurrealDB
- Updated magnitude service to run as root user for npm global installs
- Added xvfb-run to magnitude command for headless browser testing
- Updated Playwright Docker image from v1.49.1 to v1.56.1 in both files
- Added named volume for node_modules to persist installations
**Test Configuration:**
- Updated magnitude.config.ts to use Claude Sonnet 4.5 (20250929)
- Added headless: true to playwright.config.ts
**Testing:**
- CI test script (./scripts/test-ci-locally.sh) now works correctly
- All services start properly: SurrealDB → Next.js → Magnitude
- Playwright launches successfully in headless mode with xvfb-run
Note: Users need to ensure .env contains:
- ATPROTO_CLIENT_ID
- ATPROTO_REDIRECT_URI
- SURREALDB_JWT_SECRET
- GOOGLE_GENERATIVE_AI_API_KEY
- ANTHROPIC_API_KEY
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Created scripts/test-ci-locally.sh to test Gitea Actions workflows locally using act_runner
- Created docker-compose.ci.yml for containerized CI test environment
- Updated .gitea/workflows/magnitude.yml to use docker-compose for CI
- Added scripts/README.md documenting the CI testing approach
- Created reusable test helpers in tests/playwright/
This allows developers to run the exact same workflow that CI runs, locally,
making it much easier to debug CI failures without push cycles.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements robust testing setup with Playwright global auth, reusable test
helpers, Docker support, and CI/CD integration with Gitea Actions.
## Changes
### Playwright Setup
- Add global auth setup with storage state reuse (tests/playwright/auth.setup.ts)
- Fix auth setup to clear existing state before fresh login
- Create reusable performOAuthLogin helper (tests/playwright/helpers.ts)
- Configure dotenv loading for environment variables in playwright.config.ts
### Magnitude Configuration
- Update to use Claude Sonnet 4.5 (claude-sonnet-4-5-20250514)
- Create reusable loginFlow helper (tests/magnitude/helpers.ts)
- Fix smoke test to check login page instead of non-existent homepage
### Docker Support
- Add Dockerfile.playwright with non-root user (pwuser) for security
- Uses official Playwright Docker image (mcr.microsoft.com/playwright:v1.49.1-noble)
- Provides consistent testing environment across users and CI/CD
### CI/CD Integration
- Add Gitea Actions workflow (.gitea/workflows/magnitude.yml)
- Runs Magnitude tests on every push and PR
- Starts SurrealDB and Next.js dev server automatically
- Uploads test results as artifacts (30-day retention)
### Documentation
- Add comprehensive testing setup docs to AGENTS.md:
- Playwright Docker setup instructions
- CI/CD with Gitea Actions
- Testing framework separation (Playwright vs Magnitude)
- Required secrets for CI/CD
### Testing Best Practices
- Separate Playwright (manual + global auth) from Magnitude (automated E2E)
- Reusable helpers reduce code duplication
- Both frameworks work independently
## Testing
- ✅ Playwright auth setup test passes (5.6s)
- ✅ Magnitude smoke test passes
- ✅ OAuth flow works correctly with helper function
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>