Mobile emulation
ferridriver ships Playwright's device descriptor catalog as devices in
the scripting and Node APIs. Spread a descriptor into browser.newContext,
or configure viewport, user agent, device scale factor, mobile flag,
touch flag, locale, timezone, and geolocation directly. These settings
emulate a browser; they do not start a native mobile device or automate
native application views.
Per-test
Project-wide
Touch interactions
When hasTouch is true, use the touch API (or tap) instead of
click:
Geolocation
Timezone and locale
The page's Intl and Date.now() reflect both.
Color scheme and contrast
Or per page after creation:
TypeScript
The native scripting environment exposes devices as a global. In the Node
binding, import it from ferridriver. To choose the values explicitly: