From 02f025b8ade84f0327c2b3056da958b0f0be19b3 Mon Sep 17 00:00:00 2001 From: gelbh Date: Mon, 13 Jul 2026 13:19:22 +0100 Subject: [PATCH 1/2] fix(e2e): grant geolocation to multiplayer browser contexts --- e2e/fixtures/map.ts | 3 +++ e2e/fixtures/session.ts | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/e2e/fixtures/map.ts b/e2e/fixtures/map.ts index 7a5fec07..3bdfef17 100644 --- a/e2e/fixtures/map.ts +++ b/e2e/fixtures/map.ts @@ -1,6 +1,9 @@ import { type Page, expect } from "@playwright/test"; import { clickViaEvaluate } from "./dom"; +/** Matches Playwright `use.geolocation` in playwright.config.ts */ +export const E2E_GEOLOCATION = { latitude: 53.35, longitude: -6.26 }; + export const LOCAL_GAME_AREA = { type: "Polygon" as const, coordinates: [ diff --git a/e2e/fixtures/session.ts b/e2e/fixtures/session.ts index d73dc4eb..4cc816c6 100644 --- a/e2e/fixtures/session.ts +++ b/e2e/fixtures/session.ts @@ -1,5 +1,5 @@ import { type Browser, type Page, expect } from "@playwright/test"; -import { LOCAL_GAME_AREA } from "./map"; +import { E2E_GEOLOCATION, LOCAL_GAME_AREA } from "./map"; import { dismissMapOnboarding, prepareE2EPage } from "./page-init"; import type { BlockExternalAssetsOptions } from "./network"; @@ -172,8 +172,12 @@ export async function createMultiplayerContexts( browser: Browser, network: BlockExternalAssetsOptions = {}, ) { - const hostContext = await browser.newContext(); - const guestContext = await browser.newContext(); + const contextOptions = { + geolocation: E2E_GEOLOCATION, + permissions: ["geolocation"] as const, + }; + const hostContext = await browser.newContext(contextOptions); + const guestContext = await browser.newContext(contextOptions); const hostPage = await hostContext.newPage(); const guestPage = await guestContext.newPage(); From 9452ff37c841613ad6591e3f886fa1a6a61e7be6 Mon Sep 17 00:00:00 2001 From: gelbh Date: Mon, 13 Jul 2026 13:39:15 +0100 Subject: [PATCH 2/2] fix(e2e): drop readonly permissions tuple for Playwright typing --- e2e/fixtures/session.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/fixtures/session.ts b/e2e/fixtures/session.ts index 4cc816c6..5827df72 100644 --- a/e2e/fixtures/session.ts +++ b/e2e/fixtures/session.ts @@ -174,7 +174,7 @@ export async function createMultiplayerContexts( ) { const contextOptions = { geolocation: E2E_GEOLOCATION, - permissions: ["geolocation"] as const, + permissions: ["geolocation"], }; const hostContext = await browser.newContext(contextOptions); const guestContext = await browser.newContext(contextOptions);