bx-playwright: Setup, CLI and Configuration
BoxLang is the AI-native software productivity platform for building, modernizing and running applications, with developers and AI agents working together.
Install
Requires BoxLang 1.17+ and Java 21+. Two distributions, same module name (playwright) and API:
| Module |
Size |
Node.js |
bx-playwright |
~4 MB |
Downloaded by bxplaywright install for the current OS |
bx-playwright-full |
~206 MB |
Bundled for every platform (offline) |
install-bx-module bx-playwright
bxplaywright install # driver + Node.js + Chromium
bxplaywright install firefox webkit # more browsers ("all" for every browser)
bxplaywright install chromium --with-deps # Linux CI: also OS packages
bxplaywright doctor # check everything, prints fixes
Everything lives in ~/.boxlang/playwright (setting home or BX_PLAYWRIGHT_HOME).
CLI
bxplaywright <verb> (same as boxlang module:bxplaywright <verb>). --json gives machine readable output. Exit code 0 = success.
| Verb |
Does |
install [browsers...] [--with-deps] [--only-shell] [--force] [--skip-node] |
Driver, Node.js, browsers (default chromium) |
install-node [--force], install-deps, uninstall [--all] |
Parts of the install |
doctor, version, devices, profiles [name], clean |
Inspect and maintain |
codegen [url] [--output=file.bxs] |
Record actions as BoxLang code (--target=java etc. for other languages) |
open [url], screenshot <url> <file>, pdf <url> <file>, show-trace [zip], mcp, run <args> |
Playwright CLI tools |
help [verb] [--json], completions [bash|zsh|fish|powershell] |
Help and tab completions (bash is installed with the module) |
Settings (boxlang.json)
{
"modules": {
"bxplaywright": {
"settings": {
"baseURL": "http://localhost:8080",
"headless": true,
"timeouts": { "action": 30000, "navigation": 30000, "assertion": 5000 },
"profiles": { "staging": { "extends": "desktop", "baseURL": "https://staging.example.com" } }
}
}
}
}
| Setting |
Default |
Purpose |
home, browsersPath |
~/.boxlang/playwright, {home}/browsers |
Storage |
nodePath, nodeVersion, nodeDownloadURL |
auto |
Node.js resolution and mirror |
defaultProfile |
default |
Profile used by playwright() |
browser, channel, headless, slowMo |
chromium, ``, true, 0 |
Browser launch |
baseURL, viewport, device, locale, timezone, colorScheme, ignoreHTTPSErrors |
|
Context |
timeouts |
action/navigation 30000, assertion 5000 |
Milliseconds |
testIdAttribute |
data-testid |
@name selectors |
artifacts |
all off |
{ directory, screenshot, trace, video } policies |
snapshots |
{ threshold : 0.2 } |
Visual regression |
render |
{ format : "A4", printBackground : true, waitUntil : "networkidle" } |
Rendering defaults |
launchOptions, contextOptions |
{} |
Any raw Playwright option |
profiles |
{} |
Custom profiles |
Profiles
playwright( "mobile" ) // iPhone 15, webkit
playwright( [ "android", "dark" ] ) // merged left to right
playwright( "tablet", { locale : "es-ES" } ) // plus overrides
playwright( { headless : false } ) // options only
Built-in: default, chromium, firefox, webkit, chrome, chrome-beta, edge, hd, laptop, macbook, desktop, 4k, mobile/iphone, iphone-se, mobile-landscape, android/pixel, galaxy, tablet/ipad, android-tablet, dark, light, reduced-motion, high-contrast, headed, debug, record, ci, offline, print, screenshot.
Custom profiles take any setting plus extends (a name or a list). A custom profile with a built-in name replaces it.
Resolution Order (last wins)
- Module settings
- Profiles (requested, or
defaultProfile)
- Environment:
BX_PLAYWRIGHT_BROWSER, BX_PLAYWRIGHT_HEADLESS, BX_PLAYWRIGHT_BASEURL, BX_PLAYWRIGHT_UPDATE_SNAPSHOTS (BX_PLAYWRIGHT_PROFILE picks the default profile)
- Options passed to
playwright(), newContext() or newPage()
CI
install-bx-module bx-playwright
bxplaywright install chromium --with-deps
BX_PLAYWRIGHT_PROFILE=ci boxlang run-tests.bxs
Cache ~/.boxlang/playwright between runs.
1---2name: bx-playwright-setup3description: "Use this skill when installing or configuring bx-playwright (BoxLang browser automation with Playwright): the bx-playwright vs bx-playwright-full distributions, the bxplaywright CLI (install, doctor, devices, profiles, codegen, show-trace, mcp), module settings in boxlang.json, built-in and custom profiles, BX_PLAYWRIGHT_* environment variables, and CI setup."4metadata:5 source: https://skillmd.com/skills/ortus-boxlang/bx-playwright-setup6---78# bx-playwright: Setup, CLI and Configuration910> BoxLang is the AI-native software productivity platform for building, modernizing and running applications, with developers and AI agents working together.1112## Install1314Requires BoxLang 1.17+ and Java 21+. Two distributions, same module name (`playwright`) and API:1516| Module | Size | Node.js |17|---|---|---|18| `bx-playwright` | ~4 MB | Downloaded by `bxplaywright install` for the current OS |19| `bx-playwright-full` | ~206 MB | Bundled for every platform (offline) |2021```bash22install-bx-module bx-playwright23bxplaywright install # driver + Node.js + Chromium24bxplaywright install firefox webkit # more browsers ("all" for every browser)25bxplaywright install chromium --with-deps # Linux CI: also OS packages26bxplaywright doctor # check everything, prints fixes27```2829Everything lives in `~/.boxlang/playwright` (setting `home` or `BX_PLAYWRIGHT_HOME`).3031## CLI3233`bxplaywright <verb>` (same as `boxlang module:bxplaywright <verb>`). `--json` gives machine readable output. Exit code 0 = success.3435| Verb | Does |36|---|---|37| `install [browsers...] [--with-deps] [--only-shell] [--force] [--skip-node]` | Driver, Node.js, browsers (default chromium) |38| `install-node [--force]`, `install-deps`, `uninstall [--all]` | Parts of the install |39| `doctor`, `version`, `devices`, `profiles [name]`, `clean` | Inspect and maintain |40| `codegen [url] [--output=file.bxs]` | Record actions as BoxLang code (`--target=java` etc. for other languages) |41| `open [url]`, `screenshot <url> <file>`, `pdf <url> <file>`, `show-trace [zip]`, `mcp`, `run <args>` | Playwright CLI tools |42| `help [verb] [--json]`, `completions [bash\|zsh\|fish\|powershell]` | Help and tab completions (bash is installed with the module) |4344## Settings (`boxlang.json`)4546```json47{48 "modules": {49 "bxplaywright": {50 "settings": {51 "baseURL": "http://localhost:8080",52 "headless": true,53 "timeouts": { "action": 30000, "navigation": 30000, "assertion": 5000 },54 "profiles": { "staging": { "extends": "desktop", "baseURL": "https://staging.example.com" } }55 }56 }57 }58}59```6061| Setting | Default | Purpose |62|---|---|---|63| `home`, `browsersPath` | `~/.boxlang/playwright`, `{home}/browsers` | Storage |64| `nodePath`, `nodeVersion`, `nodeDownloadURL` | auto | Node.js resolution and mirror |65| `defaultProfile` | `default` | Profile used by `playwright()` |66| `browser`, `channel`, `headless`, `slowMo` | `chromium`, ``, `true`, `0` | Browser launch |67| `baseURL`, `viewport`, `device`, `locale`, `timezone`, `colorScheme`, `ignoreHTTPSErrors` | | Context |68| `timeouts` | action/navigation 30000, assertion 5000 | Milliseconds |69| `testIdAttribute` | `data-testid` | `@name` selectors |70| `artifacts` | all `off` | `{ directory, screenshot, trace, video }` policies |71| `snapshots` | `{ threshold : 0.2 }` | Visual regression |72| `render` | `{ format : "A4", printBackground : true, waitUntil : "networkidle" }` | Rendering defaults |73| `launchOptions`, `contextOptions` | `{}` | Any raw Playwright option |74| `profiles` | `{}` | Custom profiles |7576## Profiles7778```js79playwright( "mobile" ) // iPhone 15, webkit80playwright( [ "android", "dark" ] ) // merged left to right81playwright( "tablet", { locale : "es-ES" } ) // plus overrides82playwright( { headless : false } ) // options only83```8485Built-in: `default`, `chromium`, `firefox`, `webkit`, `chrome`, `chrome-beta`, `edge`, `hd`, `laptop`, `macbook`, `desktop`, `4k`, `mobile`/`iphone`, `iphone-se`, `mobile-landscape`, `android`/`pixel`, `galaxy`, `tablet`/`ipad`, `android-tablet`, `dark`, `light`, `reduced-motion`, `high-contrast`, `headed`, `debug`, `record`, `ci`, `offline`, `print`, `screenshot`.8687Custom profiles take any setting plus `extends` (a name or a list). A custom profile with a built-in name replaces it.8889## Resolution Order (last wins)90911. Module settings922. Profiles (requested, or `defaultProfile`)933. Environment: `BX_PLAYWRIGHT_BROWSER`, `BX_PLAYWRIGHT_HEADLESS`, `BX_PLAYWRIGHT_BASEURL`, `BX_PLAYWRIGHT_UPDATE_SNAPSHOTS` (`BX_PLAYWRIGHT_PROFILE` picks the default profile)944. Options passed to `playwright()`, `newContext()` or `newPage()`9596## CI9798```bash99install-bx-module bx-playwright100bxplaywright install chromium --with-deps101BX_PLAYWRIGHT_PROFILE=ci boxlang run-tests.bxs102```103104Cache `~/.boxlang/playwright` between runs.