Configure options below — the preview updates in real time.
Core test runner configuration including directories, timeouts, and parallelism.
Directory that contains all test files.
Glob patterns or regular expressions matching files that should be run as tests.
Glob patterns or regular expressions matching files that should be ignored.
Timeout in milliseconds for a single test execution.
Maximum time in milliseconds the whole test suite can run. 0 means no timeout.
The maximum number of retries given to failed tests.
Maximum number of concurrent worker processes. Can be a number or percentage string like 50%.
The number of times to repeat each test.
The maximum number of test failures before the runner aborts the run. 0 means no limit.
Name of the test suite.
Path to a custom tsconfig.json file for Playwright to use when transforming TypeScript test files.
Configure test reporters, output directories, and snapshot behavior.
The reporter(s) to use for test output.
Directory for test artifacts such as screenshots, videos, traces, etc.
Whether to preserve test output artifacts (traces, videos) in the output directory.
Deprecated. The base directory for visual regression snapshot files. Use snapshotPathTemplate instead.
A template controlling where to save snapshots.
When to automatically update missing or failing visual snapshots.
Maximum number of slow tests to report in the console output.
Threshold in milliseconds for a test to be considered slow.
Method used to update source files when updating snapshots.
Filter tests by title patterns and control execution behavior.
Filter to only run tests with a title matching this pattern (e.g. @smoke).
Filter out tests with a title matching this pattern.
Filter to only run tests with matching tags (e.g. @fast, @smoke).
Configure global setup/teardown scripts and metadata.
Path to the global setup file. Exported function runs once before all tests.
Path to the global teardown file. Exported function runs once after all tests.
Any custom metadata to be included in the test report.
Global test options configuring the browser, context, and page behavior.
Name of the browser that will run the tests.
Browser channel to use (e.g. chrome, chrome-beta, msedge).
Base URL prepended to relative paths in page.goto().
Width of the browser viewport in pixels.
Height of the browser viewport in pixels.
Device scale factor / pixel ratio.
Configure automatic capture of screenshots, video recordings, and traces.
Whether to automatically capture a screenshot at the end of each test.
Whether to record a video for each test execution.
Whether to record a Playwright trace for post-mortem debugging.
Configure network behavior, timeouts, and HTTP settings.
Default timeout for Playwright actions (click, fill, wait) in milliseconds.
Timeout in milliseconds for navigation actions (like page.goto).
Toggles the ability to register Service Workers.
Extra HTTP headers to send with every network request.
Custom User-Agent string.
Network proxy server URL.
Comma-separated list of domains to bypass proxy.
Configure locale, timezone, geolocation, color scheme, and permissions emulation.
User locale setting (e.g. en-US, de-DE).
Emulated timezone ID (e.g. Europe/Paris).
Emulated media feature prefers-color-scheme.
Emulated geolocation latitude.
Emulated geolocation longitude.
Grants specified permissions automatically (e.g. geolocation, notifications).
Path to a file containing cookies and localStorage state (bypasses login).
Custom attribute to be used with the page.getByTestId() locator.
Configure the assertion library timeouts and visual comparison settings.
Default timeout for async expect matchers in milliseconds.
Maximum acceptable differing pixels for screenshot comparisons.
Maximum acceptable differing pixel ratio (0 to 1).
Acceptable perceived color difference threshold (0 to 1).
How to handle animations during screenshot comparison.
Whether to hide the text caret during screenshot comparison.
Scale of the screenshot comparison (CSS pixels vs device pixels).
Maximum acceptable differing pixels for snapshot comparisons.
Maximum acceptable differing pixel ratio (0 to 1) for snapshot comparisons.
Acceptable perceived color difference threshold (0 to 1) for snapshot comparisons.
Timeout in milliseconds for the expect.toPass() assertion to keep retrying.
Launch a local development server before running tests.
Custom name used as a prefix in log messages for this web server.
Shell command to start the server (e.g. npm run start).
HTTP URL to poll for the server to be ready.
Port to poll instead of URL.
Maximum time to wait for the web server to be ready in milliseconds.
Current working directory to spawn the command in.
Environment variables to supply to the server command.
How to handle the server's standard output.
How to handle the server's standard error.
Configure multiple browser projects. Common setups include Chromium, Firefox, and WebKit.
Configure test sharding for parallel execution across multiple machines.
Total number of shards to split the test suite across.
The current shard index (1-based).
1import { defineConfig } from "@playwright/test";23export default defineConfig({4 projects: [5 {6 name: "chromium",7 use: {8 browserName: "chromium",9 },10 },11 ],12});