Web
Runs the app in Chromium through Playwright. It is the fastest platform to start and the only one with full Playwright traces, so it is where tests are usually written first. Package: @toets/driver-web.
ts
import { defineConfig, platforms } from '@toets/test';
export default defineConfig({
app: { web: { url: 'http://localhost:8080' } },
projects: [platforms.web()],
});The app must already be served at url; start it with Playwright's webServer option or in your CI job.
| Aspect | Web |
|---|---|
| Test ID | data-testid |
| Focus | document.activeElement, or the SDK's focus when connected |
| Keys | KeyboardEvents; the key mapping is configurable for TV web keycodes |
| Launch | navigates to url with the launch payload as a __toets query parameter |
| Artifacts | Playwright trace (--trace on), video, console logs |
Options (test ID attribute, key map, viewport, launch transport): web driver options.
Traps
- Desktop Chromium is not a TV browser. It is modern Chromium, not the engine of a given TV OS. Old-engine coverage (Tizen, webOS) is a later phase.
- Apps that listen to
keyCode. Many TV web apps read legacy key codes (for example 461 for back on webOS). Configure the driver's key map to match what your app expects. - Virtual focus. Apps whose JS focus engine highlights elements without moving DOM focus report focus through the SDK with
reportFocus(); without it, focus assertions see nothing. - Do not lean on the trace viewer for parity. Other platforms have step screenshots and text snapshots instead; make failures understandable from those.