feat: add test entry point that discovers and executes JSON tests

Created e2e/tests.ts:
- Auto-discovers all packages/*/playwright/tests.json files
- Registers them as Playwright tests at runtime
- Uses json-runner to interpret JSON test definitions
- Loads:
  - packages/system_critical_flows/playwright/tests.json (24 tests)
  - packages/ui_home/playwright/tests.json (existing tests)
  - Any other packages with playwright/tests.json

Execution:
  npm run test:e2e

This enables the complete JSON test interpreter pattern:
- Tests live in packages (not e2e/)
- JSON definitions in playwright/tests.json
- Auto-discovered at runtime
- Executed by Playwright

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 03:48:39 +00:00
parent c43b0ebe09
commit 6dbb23a8a6

16
e2e/tests.ts Normal file
View File

@@ -0,0 +1,16 @@
/**
* Playwright Tests - Auto-discover and execute JSON test definitions
*
* This file loads all JSON test definitions from packages/*/playwright/tests.json
* and registers them as Playwright tests at runtime.
*
* Usage: npm run test:e2e
*/
import { test } from '@playwright/test'
import { loadAllPackageTests } from './json-runner/playwright-json-runner'
import { resolve } from 'path'
// Discover and register all JSON tests from packages
const packagesDir = resolve(__dirname, '../packages')
void loadAllPackageTests(packagesDir, test)