Jotley / website / playwright.config.ts
| 1 | import { defineConfig, devices } from '@playwright/test'; |
| 2 | |
| 3 | export default defineConfig({ |
| 4 | testDir: './e2e', |
| 5 | fullyParallel: true, |
| 6 | forbidOnly: !!process.env.CI, |
| 7 | retries: process.env.CI ? 2 : 0, |
| 8 | workers: process.env.CI ? 1 : undefined, |
| 9 | reporter: 'html', |
| 10 | |
| 11 | use: { |
| 12 | // Base URL for tests - use local dev server or production |
| 13 | baseURL: process.env.TEST_BASE_URL || 'http://localhost:3006', |
| 14 | trace: 'on-first-retry', |
| 15 | screenshot: 'only-on-failure', |
| 16 | }, |
| 17 | |
| 18 | projects: [ |
| 19 | { |
| 20 | name: 'chromium', |
| 21 | use: { ...devices['Desktop Chrome'] }, |
| 22 | }, |
| 23 | // Uncomment to test on more browsers |
| 24 | // { |
| 25 | // name: 'firefox', |
| 26 | // use: { ...devices['Desktop Firefox'] }, |
| 27 | // }, |
| 28 | // { |
| 29 | // name: 'webkit', |
| 30 | // use: { ...devices['Desktop Safari'] }, |
| 31 | // }, |
| 32 | // { |
| 33 | // name: 'Mobile Chrome', |
| 34 | // use: { ...devices['Pixel 5'] }, |
| 35 | // }, |
| 36 | ], |
| 37 | |
| 38 | // Run local dev server before tests if not testing production |
| 39 | webServer: process.env.TEST_BASE_URL ? undefined : { |
| 40 | command: 'npm run dev', |
| 41 | url: 'http://localhost:3006', |
| 42 | reuseExistingServer: !process.env.CI, |
| 43 | timeout: 120 * 1000, |
| 44 | }, |
| 45 | }); |