browser (experimental)
- Type:
- Default:
Browser Mode configuration. When enabled, tests run in a real browser instead of the Node.js environment.
Options
enabled
- Type:
boolean - Default:
false
Enable Browser Mode.
Enabling Browser Mode requires installing the @rstest/browser package and Playwright browsers.
provider
- Type:
'playwright' - Default:
'playwright'
Browser driver provider. Currently only Playwright is supported.
Mixing multiple providers in the same test run is currently not supported.
browser
- Type:
'chromium' | 'firefox' | 'webkit' - Default:
'chromium'
The browser type to use for testing.
chromium- Google Chrome, Microsoft Edgefirefox- Mozilla Firefoxwebkit- Safari
You need to install the corresponding browser before use:
headless
- Type:
boolean - Default:
truein CI environments,falsefor local development
Whether to run the browser in headless mode (without UI).
During local development, setting headless: false shows the browser window for easier debugging.
If you want headed mode for local debugging and headless in CI, control it with environment variables:
port
- Type:
number - Default:
undefined(automatically selects an available port)
The port number for the Browser Mode Dev Server.
If you set port and the port is already in use, the behavior is controlled by strictPort: when strictPort: true, Rstest throws an error and exits; when strictPort: false, it falls back to another available port. If port is not specified, an available port is always selected automatically.
strictPort
- Type:
boolean - Default:
false
When port is specified, whether the port must be available:
true: throw an error and exit if the port is in usefalse: fall back to another available port if the port is in use
Current limitation: browser launch options must match in one run
In one rstest process, all Browser Mode projects must share the same browser launch options:
providerbrowserheadlessportstrictPort
This means mixing multiple providers, or running Chromium/Firefox/WebKit together in the same run, is not supported yet.
For cross-browser coverage, run tests in separate executions (for example, in a CI matrix):
Multi-project config isolation
When using projects in Browser Mode, each project still compiles and executes with its own build config (for example plugins, include, and framework-specific setup).
Browser launch options still need to stay aligned across browser projects: provider, browser, headless, port, and strictPort.
Mixing with node tests
You can configure both browser tests and Node.js tests together:
Related links
- Browser Mode Guide - Introduction and usage guide for Browser Mode
- Getting Started - Configure Browser Mode tests
- User interactions - Write semantic tests with
page+expect.element