Playwright CLI and test runner with headless Chromium for sandbox agents
10K+
Playwright CLI and test runner with headless Chromium for sandbox agents
| Name | Required | Default | Description |
|---|---|---|---|
nodeVersion | Optional | 24 | DHI Node.js major to install only when Node is absent Options: 22, 24, 26 |
version | Required | — | Playwright release carried by the DHI package |
[email protected]| Type | Required | Description | |
|---|---|---|---|
com.docker.sandbox/network-policy@1 | Required | — | |
com.docker.sandbox/lifecycle@1 | Required | — | |
com.docker.sandbox/agent-context@1 | Optional | — | |
com.docker.sandbox/agent-context@2 | Optional | — | |
deb/apt, deb/bash, deb/coreutils, deb/grepsbx run <agent> --kit sbx/playwright:latestRun the following command to install sbx on your machine.
brew install docker/tap/sbxwinget install Docker.sbxThis v3 mixin Kit adds the Playwright CLI, @playwright/test, and headless Chromium to a
compatible Debian 13 workload. It composes with agent workloads such as
Claude Code and Shell.
This Kit is built on Docker Hardened Images.
Add --kit sbx/playwright when creating your sandbox. The Kit keeps the workload's command, user, home directory, and
package database.
sbx run sbx/claude --kit sbx/playwright
Run playwright --version, then npx playwright test in your project. For browser scripts, use
const { chromium } = require('playwright'). NODE_PATH makes the global packages available even without a local
package.json. Projects with local dependencies use their own packages.
The driver and matching test runner arrive in the Kit. Sandbox creation installs Chromium, its headless shell, and native libraries through apt. The browser follows the distribution's Chromium security updates rather than a bundled Chrome-for-Testing build. The workload needs apt, Bash, and access to its configured package repositories.
The Kit preserves Node.js when the workload or another Kit already supplies it. That interpreter must meet Playwright's Node.js 20 or newer requirement. The Kit installs npm and npx independently when missing.
| Argument | Default | Values | Meaning |
|---|---|---|---|
nodeVersion | 24 | 22, 24, 26 | DHI Node.js major to install when Node.js is absent. An existing interpreter is preserved. |
For example, add --kit-arg nodeVersion=22 when creating the sandbox.
sbx run sbx/claude --kit sbx/playwright --kit-arg nodeVersion=22
Chromium runs headlessly. Screenshots, PDFs, traces, and videos work without a display server. Headed mode, codegen,
and the UI runner need a display server that you supply. Firefox and WebKit are not provisioned.
Keep PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright. This shared directory is writable by the agent. If your project pins
a different Playwright release, run npx playwright install chromium to download its matching browser. Downloading
Firefox or WebKit alone does not install their additional native libraries.
Browser CDN hosts are allowed at runtime. Package repositories are allowed during installation. Sites under test need their own network policy grants. Installing project npm dependencies also needs the registry hosts your project uses.
See the Sandbox Kit v3 specification, Playwright documentation, and Docker Hardened Images documentation.