You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/browser/playwright.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,49 @@ These options are directly passed down to `playwright[browser].connect` command.
75
75
Since this command connects to an existing Playwright server, any `launch` options will be ignored.
76
76
:::
77
77
78
+
### Running Browsers in Docker
79
+
80
+
If your platform doesn't support Playwright browsers natively (e.g. WebKit on Arch Linux), you can run a [Playwright server in Docker](https://playwright.dev/docs/docker#remote-connection) and connect to it via `connectOptions`.
Using `network_mode: host` lets the containerized browser reach Vitest's dev server on localhost without needing to expose it on `0.0.0.0`. Make sure the Playwright version in the Docker image matches the version installed locally.
119
+
:::
120
+
78
121
## contextOptions
79
122
80
123
Vitest creates a new context for every test file by calling [`browser.newContext()`](https://playwright.dev/docs/api/class-browsercontext). You can configure this behaviour by specifying [custom arguments](https://playwright.dev/docs/api/class-browser#browser-new-context).
0 commit comments