109 / 139 · 13 Browser Automation with Playwright · Visual Testing and Edge Cases← prev⊞ allnext →☰ Read as one page
12.6Geolocation and Permissions
test('shows nearby stores for London location', async ({ context }) => {
await context.grantPermissions(['geolocation']);
await context.setGeolocation({ latitude: 51.5074, longitude: -0.1278 });
const page = await context.newPage();
await page.goto('/stores');
await expect(page.getByText('London')).toBeVisible();
});