|
1 | 1 | import { defineConfig, devices } from '@playwright/test' |
2 | 2 |
|
3 | | -/** |
4 | | - * Read environment variables from file. |
5 | | - * https://github.com/motdotla/dotenv |
6 | | - */ |
7 | | -// import dotenv from 'dotenv'; |
8 | | -// dotenv.config({ path: path.resolve(__dirname, '.env') }); |
9 | | - |
10 | | -/** |
11 | | - * See https://playwright.dev/docs/test-configuration. |
12 | | - */ |
13 | 3 | export default defineConfig({ |
14 | 4 | testDir: './browser_tests', |
15 | | - /* Run tests in files in parallel */ |
16 | 5 | fullyParallel: true, |
17 | | - /* Fail the build on CI if you accidentally left test.only in the source code. */ |
18 | 6 | forbidOnly: !!process.env.CI, |
19 | | - /* Retry on CI only - increased for better flaky test handling */ |
20 | | - retries: process.env.CI ? 3 : 0, |
21 | | - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
22 | 7 | reporter: 'html', |
23 | | - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 8 | + // /* // Toggle for [LOCAL] testing. |
| 9 | + retries: process.env.CI ? 3 : 0, |
24 | 10 | use: { |
25 | | - /* Base URL to use in actions like `await page.goto('/')`. */ |
26 | | - // baseURL: 'http://127.0.0.1:3000', |
27 | | - |
28 | | - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
29 | 11 | trace: 'on-first-retry' |
30 | 12 | }, |
31 | | - /* Path to global setup file. Exported function runs once before all the tests */ |
| 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 | + //*/ |
| 25 | + |
32 | 26 | globalSetup: './browser_tests/globalSetup.ts', |
33 | | - /* Path to global teardown file. Exported function runs once after all the tests */ |
34 | 27 | globalTeardown: './browser_tests/globalTeardown.ts', |
35 | 28 |
|
36 | | - /* Configure projects for major browsers */ |
37 | 29 | projects: [ |
38 | 30 | { |
39 | 31 | name: 'chromium', |
|
0 commit comments