Locale, Timezone & Geolocation in Playwright
From the Playwright cheat sheet · Emulation & Devices · verified Jul 2026
Locale, Timezone & Geolocation
Emulate user locale, timezone, geolocation, permissions, and color scheme
typescript
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
locale: 'de-DE',
timezoneId: 'Europe/Berlin',
colorScheme: 'dark',
geolocation: { latitude: 52.52, longitude: 13.405 },
permissions: ['geolocation'],
},
});💡 test.use() overrides config-level settings for all tests in the current file
⚡ emulateMedia() lets you switch color scheme mid-test without reloading
📌 permissions must be granted explicitly — geolocation, notifications, clipboard, etc.
🟢 Locale affects Intl APIs, date formatting, and number display in the browser context
localetimezonegeolocationdark-mode