Devices, locale, geolocation and permissions
Run the same Daily List test as a phone, in German, in another time zone and at a made-up place, with the Playwright options that set each one.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: trying on the same coat in different sizes and weather. A coat shop does not guess. A customer tries the coat small and large. Then the shop checks it in rain, in wind and in the sun. One coat, many conditions. You learn where it pinches.
Daily List is a to-do list app. Lily may use it on a phone, in Germany, in a different , or with the location switch off. Tom, the tester, cannot buy a phone for every case. He asks the test browser to dress itself in each condition.
The picture has limits. A coat on a hanger is not a coat on a person. A browser dressed as a phone is still a computer pretending. It cannot show how a real phone feels in a hand.
What it is: Playwright is a free library from Microsoft that drives a real browser from code. The browsers are Chromium, Firefox and WebKit. This topic is one slice of that library: the settings that make a test browser pretend to be somewhere else. Tom spreads a ready-made bundle for a phone, ...devices['iPhone 13']. That bundle is a . It holds a screen size, touch support and the browser's self-description. For language and time he sets locale: 'de-DE' and timezoneId: 'Europe/Berlin'. For a made-up place he sets and a permission grant, permissions: ['geolocation']. The nearest neighbour is a real phone on a desk. Playwright does not replace that phone.
Why it matters: Many bugs live in the differences. A button that is fine on a laptop may be hidden on a phone. A date such as 01/12 means January in one country and December in another. Without these settings, Tom would meet those bugs only after Lily, in Germany, reported them. With them, he reproduces each case on one laptop before the release.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 5 in this section
- playwright
- a free Microsoft tool that drives a browser for tests
- chromium
- the open-source browser engine behind Google Chrome
- webkit
- The browser engine behind Safari. Playwright can drive it.
- descriptor
- the shop name printed on a card statement
- geolocation
- where a device is on Earth, as two numbers
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Running the same test as a phone, in another language and zone, at a made-up place, with the permission on or off.
- Pick the device
- Set language and zone
- Set place and permission
- Compare the results
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The same coat | The same test |
| Different sizes | Device descriptors |
| Rain, wind and sun | Locale, time zone and colour scheme |
| A pocket you may or may not open | A permission grant |
WHERE THIS PICTURE STOPS
- A coat on a hanger is not a coat on a person. A pretend phone is not a real phone.
- A shop has a few sizes. The list of devices is long and changes.
- Weather happens to the coat. A test sets each condition on purpose.
HOOK
One coat, many conditions.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If users differ by phone, place or switch, usually set that condition in the test. Do not wait for a real phone.
| In the trick | What it stands for |
|---|---|
| phone | device descriptors with a screen size |
| place | locale and time zone |
| switch | a permission grant |
A pretend phone is not a real phone, so some bugs only show on real devices.
TELL A FRIEND
Trying one coat in different sizes and weather.
OFTEN MIXED UP WITH Emulators, real devices and device clouds. The general lesson compares emulators, real devices and clouds. This lesson shows the Playwright options.
Sources & standards — 5 sources
- Market practice
Emulation (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Configuration (use) (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Isolation (Playwright documentation) ↗ — Microsoft (Playwright) · Each test gets its own browser context, a clean-slate environment that is fast to create and fully isolated (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
BrowserContext (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: clearPermissions, grantPermissions and storageState options. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: clearPermissions, grantPermissions and storageState options. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
PRACTISE AND KEEP
Sources for this topic — 5 sources
- Market practice
Emulation (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Configuration (use) (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Projects (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
- Market practice
Isolation (Playwright documentation) ↗ — Microsoft (Playwright) · Each test gets its own browser context, a clean-slate environment that is fast to create and fully isolated (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
BrowserContext (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: clearPermissions, grantPermissions and storageState options. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: clearPermissions, grantPermissions and storageState options. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.