import { defineConfig, devices } from '@playwright/test'; /** * Playwright configuration for BSC Score browser automation * Configured to work with local dev server on port 3000 */ export default defineConfig({ // Test directory - where your recorded scripts live testDir: './tests/recordings', // Match all .ts files in the recordings directory (not just .test.ts or .spec.ts) testMatch: '**/*.ts', // Maximum time one test can run for timeout: 30 * 1000, // Test execution settings fullyParallel: false, // Run tests sequentially to avoid conflicts forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: 1, // Run one at a time for recordings // Reporter configuration reporter: 'html', // Shared settings for all tests use: { // Base URL for tests baseURL: 'http://localhost:3000', // Browser context options trace: 'on-first-retry', screenshot: 'only-on-failure', // Viewport size viewport: { width: 1280, height: 720 }, }, // Configure projects for different browsers projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, // Uncomment to add more browsers // { // name: 'firefox', // use: { ...devices['Desktop Firefox'] }, // }, // { // name: 'webkit', // use: { ...devices['Desktop Safari'] }, // }, ], // Web server configuration - starts dev server automatically if needed // webServer: { // command: 'npm run dev', // url: 'http://localhost:3000', // reuseExistingServer: !process.env.CI, // timeout: 120 * 1000, // }, });