# E2E Test Reports This directory contains detailed E2E test reports generated by the test runner script. ## Report Files Each test run generates the following files: ### Timestamped Reports - `test-report-{timestamp}.json` - Full JSON report with test results, metadata, and actionable items - `test-report-{timestamp}.md` - Markdown report for human readability - `summary-{timestamp}.json` - AI-friendly summary with quick actions - `results-{timestamp}.json` - Raw Playwright JSON output - `test-output-{timestamp}.log` - Complete test output log ### Latest Reports (Symlinks) - `latest.json` - Symlink to most recent JSON report - `latest.md` - Symlink to most recent markdown report - `latest-summary.json` - Symlink to most recent AI summary ## For AI Agents The JSON reports are designed to be easily parsed by coding agents for automated action: ### Quick Summary ```bash cat scripts/tests/reports/latest-summary.json ``` Key fields for AI agents: - `for_ai_agents.quick_summary` - One-line status summary - `for_ai_agents.if_failed_check` - Path to detailed log for failure analysis - `for_ai_agents.html_report` - Path to HTML report for visual inspection - `for_ai_agents.next_action` - Recommended next action ### Example JSON Structure ```json { "timestamp": "20260509_133000", "test_status": "passed", "tests_total": 50, "tests_passed": 48, "tests_failed": 2, "duration_seconds": 120, "health_check": { "status": "healthy", "app_running": true, "app_url": "http://localhost:3050" }, "for_ai_agents": { "quick_summary": "failed - 48/50 tests passed in 120s", "if_failed_check": "scripts/tests/reports/test-output-20260509_133000.log", "html_report": "web/playwright-report/index.html", "next_action": "Review failures in log and fix broken selectors or API issues" } } ``` ## Running Tests Execute the test runner script: ```bash ./scripts/tests/run-e2e.sh ``` This will: 1. Install dependencies if needed 2. Install Playwright browsers if needed 3. Run all E2E tests 4. Generate reports in this directory 5. Check application health 6. Create symlinks to latest reports ## Report Locations - **Reports Directory:** `scripts/tests/reports/` - **HTML Report:** `web/playwright-report/index.html` - **Playwright Results:** `web/test-results/` ## Using Reports for Debugging ### For Humans ```bash # View latest markdown report cat scripts/tests/reports/latest.md # Open HTML report open web/playwright-report/index.html # View test output log cat scripts/tests/reports/latest-summary.json | jq .for_ai_agents.if_failed_check | xargs cat ``` ### For AI Agents ```bash # Get quick status cat scripts/tests/reports/latest-summary.json | jq .for_ai_agents.quick_summary # Get next action cat scripts/tests/reports/latest-summary.json | jq .for_ai_agents.next_action # Get failure log path cat scripts/tests/reports/latest-summary.json | jq -r .for_ai_agents.if_failed_check ``` ## Report Retention Reports are timestamped and retained indefinitely. To clean up old reports: ```bash # Remove reports older than 30 days find scripts/tests/reports -name "*.json" -mtime +30 -delete find scripts/tests/reports -name "*.md" -mtime +30 -delete find scripts/tests/reports -name "*.log" -mtime +30 -delete ``` ## Integration with CI The test runner can be integrated into CI pipelines: ```yaml - name: Run E2E Tests run: ./scripts/tests/run-e2e.sh - name: Upload Reports uses: actions/upload-artifact@v3 with: name: e2e-test-reports path: scripts/tests/reports/ ``` AI agents can then parse the `latest-summary.json` to determine next actions automatically.