Files
adopt-a-street/playwright.config.js
William Valentin ab2503efb8 feat: Add comprehensive E2E tests with Playwright and enhance component test IDs
Add end-to-end testing infrastructure for the application:
- Implemented Playwright E2E test suite with 31 passing tests across authentication and feature workflows
- Created mock API fixtures for testing without requiring backend/database
- Added data-testid attributes to major React components (Login, Register, TaskList, Events, SocialFeed, Profile, Navbar)
- Set up test fixtures with test images (profile-pic.jpg, test-image.jpg)
- Configured playwright.config.js for multi-browser testing (Chromium, Firefox, Safari)

Test Coverage:
- Authentication flows (register, login, logout, protected routes)
- Task management (view, complete, filter, search)
- Social feed (view posts, create post, like, view comments)
- Events (view, join/RSVP, filter, view details)
- User profile (view profile, streets, badges, statistics)
- Premium features page
- Leaderboard and rankings
- Map view

🤖 Generated with OpenCode

Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
2025-11-29 15:27:56 -08:00

34 lines
759 B
JavaScript

import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
],
webServer: {
command: 'cd frontend && npm start',
port: 3000,
reuseExistingServer: !process.env.CI,
timeout: 120 * 1000,
},
});