|
| 1 | +import { defineConfig, devices } from '@playwright/test'; |
| 2 | + |
| 3 | +const BASE_URL = 'http://localhost:5173/'; |
| 4 | + |
| 5 | +export default defineConfig({ |
| 6 | + testDir: './e2e', |
| 7 | + fullyParallel: true, |
| 8 | + forbidOnly: !!process.env.CI, |
| 9 | + retries: process.env.CI ? 2 : 0, |
| 10 | + workers: process.env.CI ? 1 : undefined, |
| 11 | + reporter: 'html', |
| 12 | + use: { |
| 13 | + baseURL: BASE_URL, |
| 14 | + trace: 'on-first-retry', |
| 15 | + }, |
| 16 | + |
| 17 | + /* Configure projects for major browsers */ |
| 18 | + projects: [ |
| 19 | + { |
| 20 | + name: 'chromium', |
| 21 | + use: { ...devices['Desktop Chrome'] }, |
| 22 | + }, |
| 23 | + |
| 24 | + { |
| 25 | + name: 'firefox', |
| 26 | + use: { ...devices['Desktop Firefox'] }, |
| 27 | + }, |
| 28 | + |
| 29 | + { |
| 30 | + name: 'webkit', |
| 31 | + use: { ...devices['Desktop Safari'] }, |
| 32 | + }, |
| 33 | + |
| 34 | + /* Test against mobile viewports. */ |
| 35 | + // { |
| 36 | + // name: 'Mobile Chrome', |
| 37 | + // use: { ...devices['Pixel 5'] }, |
| 38 | + // }, |
| 39 | + // { |
| 40 | + // name: 'Mobile Safari', |
| 41 | + // use: { ...devices['iPhone 12'] }, |
| 42 | + // }, |
| 43 | + |
| 44 | + /* Test against branded browsers. */ |
| 45 | + // { |
| 46 | + // name: 'Microsoft Edge', |
| 47 | + // use: { ...devices['Desktop Edge'], channel: 'msedge' }, |
| 48 | + // }, |
| 49 | + // { |
| 50 | + // name: 'Google Chrome', |
| 51 | + // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, |
| 52 | + // }, |
| 53 | + ], |
| 54 | + /* Run your local dev server before starting the tests */ |
| 55 | + webServer: { |
| 56 | + command: 'npm run dev', |
| 57 | + reuseExistingServer: !process.env.CI, |
| 58 | + }, |
| 59 | +}); |
0 commit comments