learning_ai_invt_trdg/scripts/tests/reports
Saravana Achu Mac a57229346c test(ui): enhance E2E test runner with AI-friendly detailed reports
- Updated scripts/tests/run-e2e.sh to generate comprehensive reports
- Added JSON reports for AI parsing with actionable recommendations
- Added markdown reports for human readability
- Created summary JSON with for_ai_agents section for automated action
- Added timestamped reports with symlinks to latest
- Added health check status to reports
- Created scripts/tests/reports/README.md with usage documentation
- Reports include: test results, failure analysis, next actions, file paths
2026-05-09 13:32:55 -07:00
..
README.md test(ui): enhance E2E test runner with AI-friendly detailed reports 2026-05-09 13:32:55 -07:00

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.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

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

{
  "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:

./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

# 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

# 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:

# 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:

- 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.