This directory contains comprehensive end-to-end tests for the TeamUP-AI website.
Tests the home page functionality:
- Page loading and content
- Navigation links
- Featured sections
Tests the discover page:
- Search functionality
- Profile recommendations (interest-based and top profiles)
- Profile cards display
- Follow/unfollow interactions
Tests profile pages:
- Profile display
- Stats (followers, following, mutuals)
- Follow/unfollow buttons
- Skills and interests sections
Tests the chat functionality:
- Chat interface
- Profile search
- Message input
- Chat list
Tests authentication pages:
- Login page
- Signup page
- Form validation
- Navigation between auth pages
Tests site-wide navigation:
- Header navigation
- Link functionality
- Navigation persistence
Tests the discover API endpoints:
- Interest-based recommendations
- Top profiles
- Profile search
Tests profile API endpoints:
- Profile retrieval
- Follow/unfollow operations
End-to-end user journey tests:
- Complete user flows
- Cross-page navigation
- Search flows
npm test
# or
npx playwright testnpx playwright test tests/home.spec.tsnpx playwright test --uinpx playwright test --headednpx playwright test --project=chromium
npx playwright test --project=firefox
npx playwright test --project=webkitnpx playwright test --debugnpx playwright show-reportTests are configured in playwright.config.ts:
- Base URL:
http://localhost:3000(or setBASE_URLenv variable) - Timeout: 30 seconds per test
- Retries: 2 in CI, 0 locally
- Browsers: Chromium, Firefox, WebKit
Some tests use placeholder data. For full functionality:
- Ensure your Supabase database has test data
- Update test user IDs in API tests if needed
- Some tests are designed to work with or without data
Tests are configured to:
- Run in parallel (except in CI)
- Retry failed tests in CI
- Generate HTML reports
- Take screenshots on failure
- Record traces on retry
- Create a new
.spec.tsfile in thetestsdirectory - Use Playwright's test API:
import { test, expect } from '@playwright/test'; test('my test', async ({ page }) => { await page.goto('/'); await expect(page.getByText('Hello')).toBeVisible(); });
- Run tests to verify they work
- Add to appropriate test file or create new one