diff --git a/e2e/fixtures/map.ts b/e2e/fixtures/map.ts index 7a5fec0..3bdfef1 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 d73dc4e..5827df7 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"], + }; + const hostContext = await browser.newContext(contextOptions); + const guestContext = await browser.newContext(contextOptions); const hostPage = await hostContext.newPage(); const guestPage = await guestContext.newPage();