| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 1 | import { defineConfig, devices } from "@sand4rt/experimental-ct-web"; |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 2 | |
| 3 | /** |
| 4 | * See https://playwright.dev/docs/test-configuration. |
| 5 | */ |
| 6 | export default defineConfig({ |
| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 7 | testDir: "./src", |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 8 | /* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */ |
| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 9 | snapshotDir: "./__snapshots__", |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 10 | /* Maximum time one test can run for. */ |
| 11 | timeout: 10 * 1000, |
| 12 | /* Run tests in files in parallel */ |
| 13 | fullyParallel: true, |
| 14 | /* Fail the build on CI if you accidentally left test.only in the source code. */ |
| 15 | forbidOnly: !!process.env.CI, |
| 16 | /* Retry on CI only */ |
| 17 | retries: process.env.CI ? 2 : 0, |
| 18 | /* Opt out of parallel tests on CI. */ |
| 19 | workers: process.env.CI ? 1 : undefined, |
| 20 | /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 21 | reporter: [["html", { open: process.env.CI ? "never" : "on-failure" }]], |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 22 | /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 23 | use: { |
| 24 | /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 25 | trace: "on-first-retry", |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 26 | |
| 27 | /* Port to use for Playwright component endpoint. */ |
| 28 | ctPort: 3100, |
| 29 | }, |
| 30 | |
| 31 | /* Configure projects for major browsers */ |
| 32 | projects: [ |
| 33 | { |
| Sean McCullough | a0f68fa | 2025-04-22 09:57:54 -0700 | [diff] [blame] | 34 | name: "chromium", |
| 35 | use: { ...devices["Desktop Chrome"] }, |
| Sean McCullough | b29f891 | 2025-04-20 15:39:11 -0700 | [diff] [blame] | 36 | }, |
| 37 | // { |
| 38 | // name: 'firefox', |
| 39 | // use: { ...devices['Desktop Firefox'] }, |
| 40 | // }, |
| 41 | // { |
| 42 | // name: 'webkit', |
| 43 | // use: { ...devices['Desktop Safari'] }, |
| 44 | // }, |
| 45 | ], |
| 46 | }); |