Files
Profa 494cb11c1f feat: Add comprehensive E2E test suite for agentics.org
Added complete Playwright-based E2E testing infrastructure with 36 tests
covering functional, responsive, accessibility, and performance testing.

**Test Infrastructure:**
- Playwright config with 7 browser/device configurations
- Page Object Model for maintainable test code
- npm scripts for various test execution modes

**Test Suites (36 tests total):**
- homepage.spec.ts: 14 functional tests (navigation, hero, stats, CTAs)
- responsive.spec.ts: 5 responsive design tests (mobile, tablet, desktop)
- accessibility.spec.ts: 10 WCAG 2.1 AA compliance tests
- performance.spec.ts: 7 performance and Web Vitals tests

**Documentation:**
- E2E-TEST-PLAN.md: Comprehensive 15-section test strategy (700+ lines)
- README.md: Complete usage guide (300+ lines)
- QUICKSTART.md: 5-minute setup guide
- DELIVERABLES.md: Detailed deliverables summary

**Key Features:**
- Based on real content crawled from live site
- TypeScript for type safety
- axe-core integration for accessibility testing
- Screenshot and video capture on failure
- CI/CD ready with GitHub Actions example
- Cross-browser: Chrome, Firefox, Safari, Edge, Mobile
- Responsive: Mobile (iPhone 12), Tablet (iPad), Desktop

**Test Coverage:**
✅ All 7 navigation items
✅ Hero section with community stats (100K+ members)
✅ 4 explore cards (About, Impact, Community, Projects)
✅ 7 Paths of Impact
✅ "What is Agentic AI" section
✅ Community stats (130K+ Reddit, 52K+ LinkedIn, 3K+ Discord)
✅ SEO metadata and Open Graph tags
✅ HTTPS enforcement
✅ Footer and copyright

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:18:45 +00:00

3.5 KiB
Raw Permalink Blame History

Quick Start Guide - Agentics.org E2E Tests

Get up and running with the E2E test suite in 5 minutes!

Prerequisites

  • Node.js 18+ installed
  • npm or yarn

Installation (First Time Only)

# Navigate to the test directory
cd agentics

# Install dependencies
npm install

# Install Playwright browsers
npx playwright install

Run Your First Test

# Run all tests (headless)
npm test

# Run with visible browser (recommended for first time)
npm run test:headed

View Test Results

After running tests:

# Open HTML report
npm run test:report

Common Commands

# Run in interactive UI mode (best for development)
npm run test:ui

# Run only Chrome tests
npm run test:chromium

# Run only Firefox tests
npm run test:firefox

# Run mobile tests
npm run test:mobile

# Debug a specific test
npx playwright test tests/homepage.spec.ts --debug

Understanding the Output

Successful Test Run

✓ tests/homepage.spec.ts:26:3 › TC-001: Homepage should load
✓ tests/homepage.spec.ts:52:3 › TC-002: SEO and Metadata
...
14 passed (12.5s)

Failed Test

✗ tests/homepage.spec.ts:26:3 › TC-001: Homepage should load
  Error: expect(received).toBe(expected)
  Screenshot: test-results/.../screenshot.png

File Structure Quick Reference

agentics/
├── tests/           # Your test files
│   ├── homepage.spec.ts        # Main functional tests
│   ├── responsive.spec.ts      # Mobile/tablet tests
│   ├── accessibility.spec.ts   # WCAG compliance
│   └── performance.spec.ts     # Speed and Web Vitals
├── pages/           # Page Object Models
│   └── HomePage.ts             # Homepage interactions
└── playwright.config.ts        # Test configuration

What Gets Tested?

✅ Functional (14 tests)

  • Navigation, hero section, community stats, CTAs

✅ Responsive (5 tests)

  • Mobile, tablet, desktop layouts

✅ Accessibility (10 tests)

  • WCAG 2.1 AA compliance, keyboard nav

✅ Performance (7 tests)

  • Page speed, Core Web Vitals

Total: 36 automated tests

Writing Your First Test

import { test, expect } from '@playwright/test';
import { HomePage } from '../pages/HomePage';

test('my first test', async ({ page }) => {
  const homePage = new HomePage(page);
  await homePage.goto();

  // Verify something
  await expect(homePage.logo).toBeVisible();
});

Debugging Tips

  1. Use headed mode: npm run test:headed
  2. Use UI mode: npm run test:ui (interactive)
  3. Debug single test: npx playwright test tests/homepage.spec.ts --debug
  4. View trace: Look in test-results/ folder after failed test
  5. Check screenshot: Failed tests save screenshots automatically

Next Steps

  1. ✅ Read README.md for full documentation
  2. ✅ Check E2E-TEST-PLAN.md for test strategy
  3. ✅ Review DELIVERABLES.md for what's included
  4. ✅ Explore test files in tests/ folder
  5. ✅ Modify tests as website changes

Need Help?

CI/CD Integration

Add to .github/workflows/e2e.yml:

name: E2E Tests
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      - run: cd agentics && npm ci
      - run: cd agentics && npx playwright install --with-deps
      - run: cd agentics && npm test

That's it! You're ready to run E2E tests for Agentics.org 🚀