import { defineConfig, devices } from '@playwright/test'; /** * Playwright E2E Test Configuration * @see https://playwright.dev/docs/test-configuration */ 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', { open: 'never' }], ['list'], ], use: { baseURL: process.env.BASE_URL || 'http://localhost:3150', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', }, projects: [ // Setup project for authentication { name: 'setup', testMatch: /.*\.setup\.ts/, }, { name: 'chromium', use: { ...devices['Desktop Chrome'], }, dependencies: ['setup'], }, { name: 'firefox', use: { ...devices['Desktop Firefox'], }, dependencies: ['setup'], }, // Mobile viewport tests { name: 'mobile-chrome', use: { ...devices['Pixel 5'], }, dependencies: ['setup'], }, ], // Web server configuration for local development webServer: { command: 'npm run dev', url: 'http://localhost:3150', reuseExistingServer: !process.env.CI, timeout: 120 * 1000, }, });