mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-26 23:04:57 +00:00
Moved critical user flow tests to proper package structure: - Created packages/system_critical_flows/ package - Converted hardcoded e2e/critical-flows.spec.ts to declarative JSON - Located at packages/system_critical_flows/playwright/tests.json - 24 critical flows across 10 categories (all @smoke, @critical, @auth, etc.) Structure: - packages/system_critical_flows/package.json (package metadata) - packages/system_critical_flows/playwright/tests.json (24 tests, declarative JSON) - packages/system_critical_flows/playwright/metadata.json (entity metadata) - packages/system_critical_flows/README.md (package documentation) - packages/system_critical_flows/playwright/README.md (test documentation) This aligns with MetaBuilder architecture: - Tests are in packages (not root e2e/) - 100% declarative JSON format - Integrated with unified test runner - Follows playwright.schema.json specification - 95% configuration, 5% code principle The unified test runner auto-discovers and executes via: npm run test:e2e (discovers all packages/*/playwright/tests.json) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Playwright Tests: System Critical Flows
24 end-to-end tests proving critical MetaBuilder functionality works.
Test Coverage
Flow 1: Public Discovery & Login (3 tests)
- Hero page loads with marketing content
- Features section displays
- Navigation to login from CTA button
Flow 2: Authentication & Session (4 tests)
- Login page renders with form elements
- Empty form validation rejects submission
- Login with test credentials succeeds
- Session persists on page reload
Flow 3: User Dashboard (3 tests)
- Dashboard displays user profile
- Dashboard shows available packages
- Navigation menu displays with logout option
Flow 4: Admin User Management (3 tests)
- Admin can access user management page
- User list displays with pagination
- Admin can view role management page
Flow 5: Package Management (3 tests)
- Package manager page is accessible
- Available packages are listed
- Package action buttons are interactive
Flow 6: Navigation & Discovery (3 tests)
- Header navigation works on home page
- Footer displays with links
- Mobile responsive navigation (375px viewport)
Flow 7: Error Handling (2 tests)
- 404 page displays for invalid routes
- Page loads within acceptable time (<6s)
Test Files
tests.json- All 24 test definitions in declarative JSON formatmetadata.json- Entity metadataREADME.md- This file
Execution
# All tests
npm run test:e2e
# By tag
npm run test:e2e -- --grep "@smoke"
npm run test:e2e -- --grep "@critical"
npm run test:e2e -- --grep "@auth"
npm run test:e2e -- --grep "@admin"
# Specific flow
npm run test:e2e -- --grep "Flow 1"
npm run test:e2e -- --grep "Flow 2"
Implementation Notes
- All tests use declarative JSON (no hardcoded code)
- Follows
playwright.schema.jsonspecification - Auto-discovered by unified test runner
- Executed with database seeding via
global.setup.ts - Uses Playwright's built-in test configuration
Test Characteristics
| Aspect | Details |
|---|---|
| Format | JSON (declarative) |
| Tests | 24 total |
| Flows | 10 categories |
| Tags | 12 filter categories |
| Timeouts | 10s default, 6s for performance tests |
| Actions | 15+ action types supported |
| Assertions | 20+ matcher types |
| Fixtures | Test user credentials |
Architecture Pattern
This demonstrates the "JSON Interpreter Everywhere" pattern:
tests.json (Data)
↓
json-runner/playwright-json-runner.ts (Interpreter)
↓
Playwright (Executor)
↓
Results (Evidence)
- 95% configuration (JSON test definitions)
- 5% code (Playwright runner + interpreter)
- Tests as data, not code