|
1 | 1 | import { defineConfig, devices } from '@playwright/test' |
| 2 | +import type { PlaywrightTestConfig } from '@playwright/test' |
| 3 | + |
| 4 | +const maybeLocalOptions: PlaywrightTestConfig = process.env.PLAYWRIGHT_LOCAL |
| 5 | + ? { |
| 6 | + // VERY HELPFUL: Skip screenshot tests locally |
| 7 | + // grep: process.env.CI ? undefined : /^(?!.*screenshot).*$/, |
| 8 | + timeout: 30_000, // Longer timeout for breakpoints |
| 9 | + retries: 0, // No retries while debugging. Increase if writing new tests. that may be flaky. |
| 10 | + workers: 1, // Single worker for easier debugging. Increase to match CPU cores if you want to run a lot of tests in parallel. |
| 11 | + |
| 12 | + use: { |
| 13 | + trace: 'on', // Always capture traces (CI uses 'on-first-retry') |
| 14 | + video: 'on' // Always record video (CI uses 'retain-on-failure') |
| 15 | + } |
| 16 | + } |
| 17 | + : { |
| 18 | + retries: process.env.CI ? 3 : 0, |
| 19 | + use: { |
| 20 | + trace: 'on-first-retry' |
| 21 | + } |
| 22 | + } |
2 | 23 |
|
3 | 24 | export default defineConfig({ |
4 | 25 | testDir: './browser_tests', |
5 | 26 | fullyParallel: true, |
6 | 27 | forbidOnly: !!process.env.CI, |
7 | 28 | reporter: 'html', |
8 | | - // /* // Toggle for [LOCAL] testing. |
9 | | - retries: process.env.CI ? 3 : 0, |
10 | | - use: { |
11 | | - trace: 'on-first-retry' |
12 | | - }, |
13 | | - /*/ // [LOCAL] |
14 | | - // VERY HELPFUL: Skip screenshot tests locally |
15 | | - // grep: process.env.CI ? undefined : /^(?!.*screenshot).*$/, |
16 | | - timeout: 30_000, // Longer timeout for breakpoints |
17 | | - retries: 0, // No retries while debugging. Increase if writing new tests. that may be flaky. |
18 | | - workers: 4, // Single worker for easier debugging. Increase to match CPU cores if you want to run a lot of tests in parallel. |
19 | | -
|
20 | | - use: { |
21 | | - trace: 'on', // Always capture traces (CI uses 'on-first-retry') |
22 | | - video: 'on' // Always record video (CI uses 'retain-on-failure') |
23 | | - }, |
24 | | - //*/ |
| 29 | + ...maybeLocalOptions, |
25 | 30 |
|
26 | 31 | globalSetup: './browser_tests/globalSetup.ts', |
27 | 32 | globalTeardown: './browser_tests/globalTeardown.ts', |
|
0 commit comments