diff --git a/e2e/maputnik-driver.ts b/e2e/maputnik-driver.ts index 0e5f5dc1..4359c53b 100644 --- a/e2e/maputnik-driver.ts +++ b/e2e/maputnik-driver.ts @@ -235,13 +235,8 @@ export class MaputnikDriver { // Fixtures are read directly from disk in Playwright, no registration needed. }, - intercept: async (url: string, alias: string, _method = "GET") => { + intercept: async (pattern: RegExp, alias: string, _method = "GET") => { this.recordedRequests.set(alias, []); - // Convert the Cypress-style glob (which may contain "?" in a query string) - // into a regex so query parameters match reliably. - const pattern = new RegExp( - "^" + url.replace(/[.+^${}()|[\]\\?]/g, "\\$&").replace(/\*/g, ".*") + "$" - ); await this.page.route(pattern, (route) => { this.recordedRequests.get(alias)!.push(route.request()); route.continue(); diff --git a/e2e/modals.spec.ts b/e2e/modals.spec.ts index f03ef678..300f06c1 100644 --- a/e2e/modals.spec.ts +++ b/e2e/modals.spec.ts @@ -284,7 +284,7 @@ test.describe("modals", () => { await then(get.inputValue("modal:settings.maputnik:renderer")).shouldEqual("ol"); await given.intercept( - "https://api\\.maptiler\\.com/tiles/v3-openmaptiles/tiles\\.json\\?key=*", + /https:\/\/api\.maptiler\.com\/tiles\/v3-openmaptiles\/tiles\.json\?key=.*/, "tileRequest", "GET" );