Skip to content

Commit 2bf92a0

Browse files
authored
devex: Add Suggested local Playwright config modifications from \�rowser_tests/README.md\ as a toggle block (#5256)
1 parent b5d3cfd commit 2bf92a0

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

playwright.config.ts

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
11
import { defineConfig, devices } from '@playwright/test'
22

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-
*/
133
export default defineConfig({
144
testDir: './browser_tests',
15-
/* Run tests in files in parallel */
165
fullyParallel: true,
17-
/* Fail the build on CI if you accidentally left test.only in the source code. */
186
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 */
227
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,
2410
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 */
2911
trace: 'on-first-retry'
3012
},
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+
3226
globalSetup: './browser_tests/globalSetup.ts',
33-
/* Path to global teardown file. Exported function runs once after all the tests */
3427
globalTeardown: './browser_tests/globalTeardown.ts',
3528

36-
/* Configure projects for major browsers */
3729
projects: [
3830
{
3931
name: 'chromium',

0 commit comments

Comments
 (0)