2021-09-17 17:13:47 -07:00
# class: TestOptions
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
* langs: js
Playwright Test provides many options to configure test environment, [Browser], [BrowserContext] and more.
2022-03-25 19:30:45 +01:00
These options are usually provided in the [configuration file ](../test-configuration.md ) through [`property: TestConfig.use` ] and [`property: TestProject.use` ].
2021-09-17 17:13:47 -07:00
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-03-16 19:01:15 +01:00
import { defineConfig } from '@playwright/test ';
2023-01-12 13:12:02 -08:00
export default defineConfig({
2021-09-17 17:13:47 -07:00
use: {
headless: false,
viewport: { width: 1280, height: 720 },
ignoreHTTPSErrors: true,
video: 'on-first-retry',
},
2023-01-12 13:12:02 -08:00
});
2021-09-17 17:13:47 -07:00
```
Alternatively, with [`method: Test.use` ] you can override some options for a file.
2023-05-10 23:30:51 +02:00
```js title="example.spec.ts"
2021-09-17 17:13:47 -07:00
import { test, expect } from '@playwright/test ';
// Run tests in this file with portrait-like viewport.
test.use({ viewport: { width: 600, height: 900 } });
test('my portrait test', async ({ page }) => {
// ...
});
```
## property: TestOptions.acceptDownloads = %%-context-option-acceptdownloads-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
acceptDownloads: false,
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.baseURL = %%-context-option-baseURL-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
```js
import { defineConfig, devices } from '@playwright/test ';
export default defineConfig({
use: {
/* Base URL to use in actions like `await page.goto('/')` . */
baseURL: 'http://localhost:3000',
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.browserName
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [BrowserName]< "chromium"|"firefox"|"webkit">>
Name of the browser that runs tests. Defaults to `'chromium'` . Most of the time you should set `browserName` in your [TestConfig]:
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-01-12 13:12:02 -08:00
import { defineConfig, devices } from '@playwright/test ';
2021-09-17 17:13:47 -07:00
2023-01-12 13:12:02 -08:00
export default defineConfig({
2021-09-17 17:13:47 -07:00
use: {
browserName: 'firefox',
},
2023-01-12 13:12:02 -08:00
});
2021-09-17 17:13:47 -07:00
```
## property: TestOptions.actionTimeout
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [int]>
Default timeout for each Playwright action in milliseconds, defaults to 0 (no timeout).
This is a default timeout for all Playwright actions, same as configured via [`method: Page.setDefaultTimeout` ].
2023-04-18 19:04:13 +02:00
**Usage**
```js
import { defineConfig, devices } from '@playwright/test ';
export default defineConfig({
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
},
});
```
2022-03-25 19:30:45 +01:00
Learn more about [various timeouts ](../test-timeouts.md ).
2021-11-19 17:06:46 -08:00
2021-09-17 17:13:47 -07:00
## property: TestOptions.bypassCSP = %%-context-option-bypasscsp-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
bypassCSP: true,
}
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.channel = %%-browser-option-channel-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
projects: [
{
name: 'Microsoft Edge',
2023-06-27 14:39:44 +02:00
use: {
2023-06-27 11:53:53 +02:00
...devices['Desktop Edge'],
2023-06-27 14:39:44 +02:00
channel: 'msedge'
2023-04-18 19:04:13 +02:00
},
},
]
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.colorScheme = %%-context-option-colorscheme-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
colorScheme: 'dark',
},
});
```
2022-02-08 20:45:42 -08:00
## property: TestOptions.connectOptions
2022-07-05 16:24:50 -08:00
* since: v1.10
2022-02-08 20:45:42 -08:00
- type: < [void]|[Object]>
- `wsEndpoint` < [string]> A browser websocket endpoint to connect to.
2022-04-06 19:02:10 -07:00
- `headers` ?< [void]|[Object]< [string], [string]>> Additional HTTP headers to be sent with web socket connect request. Optional.
- `timeout` ?< [int]> Timeout in milliseconds for the connection to be established. Optional, defaults to no timeout.
2022-02-08 20:45:42 -08:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
connectOptions: {
wsEndpoint: 'ws://localhost:5678',
},
},
});
```
2022-02-08 20:45:42 -08:00
When connect options are specified, default [`property: Fixtures.browser` ], [`property: Fixtures.context` ] and [`property: Fixtures.page` ] use the remote browser instead of launching a browser locally, and any launch options like [`property: TestOptions.headless` ] or [`property: TestOptions.channel` ] are ignored.
2021-09-17 17:13:47 -07:00
## property: TestOptions.contextOptions
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [Object]>
Options used to create the context, as passed to [`method: Browser.newContext` ]. Specific options like [`property: TestOptions.viewport` ] take priority over this.
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
contextOptions: {
reducedMotion: 'reduce',
},
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.deviceScaleFactor = %%-context-option-devicescalefactor-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
viewport: { width: 2560, height: 1440 },
deviceScaleFactor: 2,
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.extraHTTPHeaders = %%-context-option-extrahttpheaders-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
extraHTTPHeaders: {
'X-My-Header': 'value',
},
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.geolocation = %%-context-option-geolocation-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
geolocation: { longitude: 12.492507, latitude: 41.889938 },
},
});
```
Learn more about [geolocation ](../emulation.md#color-scheme-and-media ).
2021-09-17 17:13:47 -07:00
## property: TestOptions.hasTouch = %%-context-option-hastouch-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
hasTouch: true
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.headless = %%-browser-option-headless-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
headless: false
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.httpCredentials = %%-context-option-httpcredentials-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
httpCredentials: {
username: 'user',
password: 'pass',
},
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.ignoreHTTPSErrors = %%-context-option-ignorehttpserrors-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
ignoreHTTPSErrors: true,
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.isMobile = %%-context-option-ismobile-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
isMobile: false,
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.javaScriptEnabled = %%-context-option-javascriptenabled-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
javaScriptEnabled: false,
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.launchOptions
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [Object]>
Options used to launch the browser, as passed to [`method: BrowserType.launch` ]. Specific options [`property: TestOptions.headless` ] and [`property: TestOptions.channel` ] take priority over this.
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
projects: [
{
name: 'chromium',
2023-06-27 11:53:53 +02:00
use: {
2023-06-21 13:03:26 +01:00
...devices['Desktop Chrome'],
launchOptions: {
args: ['--start-maximized']
}
}
2023-04-18 19:04:13 +02:00
}
]
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.locale = %%-context-option-locale-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
locale: 'it-IT',
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.navigationTimeout
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [int]>
Timeout for each navigation action in milliseconds. Defaults to 0 (no timeout).
This is a default navigation timeout, same as configured via [`method: Page.setDefaultNavigationTimeout` ].
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
navigationTimeout: 3000,
},
});
```
2022-03-25 19:30:45 +01:00
Learn more about [various timeouts ](../test-timeouts.md ).
2021-11-19 17:06:46 -08:00
2021-09-17 17:13:47 -07:00
## property: TestOptions.offline = %%-context-option-offline-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
offline: true
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.permissions = %%-context-option-permissions-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
permissions: ['notifications'],
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.proxy = %%-browser-option-proxy-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
proxy: {
server: 'http://myproxy.com:3128',
bypass: 'localhost',
},
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.screenshot
2022-07-05 16:24:50 -08:00
* since: v1.10
2022-12-13 12:31:52 -08:00
- type: < [Object]|[ScreenshotMode]< "off"|"on"|"only-on-failure">>
2022-12-07 16:45:33 +00:00
- `mode` < [ScreenshotMode]< "off"|"on"|"only-on-failure">> Automatic screenshot mode.
- `fullPage` ?< [boolean]> When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to `false` .
- `omitBackground` ?< [boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false` .
2021-09-17 17:13:47 -07:00
Whether to automatically capture a screenshot after each test. Defaults to `'off'` .
* `'off'` : Do not capture screenshots.
* `'on'` : Capture screenshot after each test.
* `'only-on-failure'` : Capture screenshot after each test failure.
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
screenshot: 'only-on-failure',
},
});
```
2023-07-26 16:15:07 -07:00
Learn more about [automatic screenshots ](../test-use-options.md#recording-options ).
2021-09-17 17:13:47 -07:00
## property: TestOptions.storageState = %%-js-python-context-option-storage-state-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
storageState: 'storage-state.json',
},
});
```
2023-08-10 16:32:45 -07:00
**Details**
When storage state is set up in the config, it is possible to reset storage state for a file:
```js title="not-signed-in.spec.ts"
import { test } from '@playwright/test ';
// Reset storage state for this file to avoid being authenticated
test.use({ storageState: { cookies: [], origins: [] } });
test('not signed in test', async ({ page }) => {
// ...
});
```
2022-09-27 20:06:07 -08:00
## property: TestOptions.testIdAttribute
* since: v1.27
Custom attribute to be used in [`method: Page.getByTestId` ]. `data-testid` is used by default.
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
testIdAttribute: 'pw-test-id',
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.timezoneId = %%-context-option-timezoneid-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
timezoneId: 'Europe/Rome',
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.trace
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-11-08 15:39:58 -08:00
- type: < [Object]|[TraceMode]< "off"|"on"|"retain-on-failure"|"on-first-retry">>
2023-03-31 22:04:24 +02:00
- `mode` < [TraceMode]< "off"|"on"|"retain-on-failure"|"on-first-retry"|"on-all-retries">> Trace recording mode.
2023-05-18 11:27:45 -07:00
- `attachments` ?< [boolean]> Whether to include test attachments. Defaults to true. Optional.
2022-04-06 19:02:10 -07:00
- `screenshots` ?< [boolean]> Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview. Defaults to true. Optional.
- `snapshots` ?< [boolean]> Whether to capture DOM snapshot on every action. Defaults to true. Optional.
- `sources` ?< [boolean]> Whether to include source files for trace actions. Defaults to true. Optional.
2021-11-08 15:39:58 -08:00
Whether to record trace for each test. Defaults to `'off'` .
* `'off'` : Do not record trace.
* `'on'` : Record trace for each test.
* `'retain-on-failure'` : Record trace for each test, but remove all traces from successful test runs.
* `'on-first-retry'` : Record trace only when retrying a test for the first time.
2023-03-31 22:04:24 +02:00
* `'on-all-retries'` : Record traces only when retrying for all retries.
2021-09-17 17:13:47 -07:00
2021-12-10 11:15:01 -08:00
For more control, pass an object that specifies `mode` and trace features to enable.
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
trace: 'on-first-retry'
},
});
```
2023-07-26 16:15:07 -07:00
Learn more about [recording trace ](../test-use-options.md#recording-options ).
2021-09-17 17:13:47 -07:00
## property: TestOptions.userAgent = %%-context-option-useragent-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
userAgent: 'some custom ua',
},
});
```
2021-09-17 17:13:47 -07:00
## property: TestOptions.video
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
- type: < [Object]|[VideoMode]< "off"|"on"|"retain-on-failure"|"on-first-retry">>
- `mode` < [VideoMode]< "off"|"on"|"retain-on-failure"|"on-first-retry">> Video recording mode.
2022-04-06 19:02:10 -07:00
- `size` ?< [Object]> Size of the recorded video. Optional.
2021-09-17 17:13:47 -07:00
- `width` < [int]>
- `height` < [int]>
Whether to record video for each test. Defaults to `'off'` .
* `'off'` : Do not record video.
* `'on'` : Record video for each test.
* `'retain-on-failure'` : Record video for each test, but remove all videos from successful test runs.
* `'on-first-retry'` : Record video only when retrying a test for the first time.
2021-12-10 11:15:01 -08:00
To control video size, pass an object with `mode` and `size` properties. If video size is not specified, it will be equal to [`property: TestOptions.viewport` ] scaled down to fit into 800x800. If `viewport` is not configured explicitly the video size defaults to 800x450. Actual picture of each page will be scaled down if necessary to fit the specified size.
2021-12-09 07:38:58 -08:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
video: 'on-first-retry',
},
});
```
2023-07-26 16:15:07 -07:00
Learn more about [recording video ](../test-use-options.md#recording-options ).
2021-09-17 17:13:47 -07:00
## property: TestOptions.viewport = %%-context-option-viewport-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2021-09-17 17:13:47 -07:00
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
viewport: { width: 100, height: 100 },
},
});
```
2022-06-08 18:27:51 -04:00
## property: TestOptions.serviceWorkers = %%-context-option-service-worker-policy-%%
2022-07-05 16:24:50 -08:00
* since: v1.10
2023-04-18 19:04:13 +02:00
**Usage**
2023-05-10 18:38:12 +02:00
```js title="playwright.config.ts"
2023-04-18 19:04:13 +02:00
import { defineConfig } from '@playwright/test ';
export default defineConfig({
use: {
serviceWorkers: 'allow'
},
});
```