/ playwright.config.ts
playwright.config.ts
 1  import { defineConfig, devices } from '@playwright/test';
 2  
 3  /**
 4   * Playwright E2E test configuration for ACDC Governor.
 5   * @see https://playwright.dev/docs/test-configuration
 6   */
 7  export default defineConfig({
 8    testDir: './e2e',
 9    fullyParallel: true,
10    forbidOnly: !!process.env.CI,
11    retries: process.env.CI ? 2 : 0,
12    workers: process.env.CI ? 1 : undefined,
13    reporter: [
14      ['html', { outputFolder: 'playwright-report' }],
15      ['json', { outputFile: 'playwright-report/results.json' }],
16    ],
17    use: {
18      baseURL: 'http://localhost:5173',
19      trace: 'on-first-retry',
20      screenshot: 'only-on-failure',
21    },
22  
23    projects: [
24      {
25        name: 'chromium',
26        use: { ...devices['Desktop Chrome'] },
27      },
28      {
29        name: 'firefox',
30        use: { ...devices['Desktop Firefox'] },
31      },
32      {
33        name: 'webkit',
34        use: { ...devices['Desktop Safari'] },
35      },
36      {
37        name: 'a11y',
38        use: { ...devices['Desktop Chrome'] },
39        testMatch: '**/*.a11y.spec.ts',
40      },
41    ],
42  
43    webServer: {
44      command: 'npm run dev',
45      url: 'http://localhost:5173',
46      reuseExistingServer: !process.env.CI,
47      timeout: 120000,
48    },
49  });