From 974e12366e06e2cd784395f20cc2baf502b4adb7 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 7 Feb 2025 15:48:15 +0100 Subject: [PATCH] use _allPages() --- packages/playwright-core/src/client/mockingProxy.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/playwright-core/src/client/mockingProxy.ts b/packages/playwright-core/src/client/mockingProxy.ts index 7886243ea1..2b2fbbd100 100644 --- a/packages/playwright-core/src/client/mockingProxy.ts +++ b/packages/playwright-core/src/client/mockingProxy.ts @@ -70,15 +70,7 @@ export class MockingProxy extends ChannelOwner { findPage(correlation: string): Page | undefined { const guid = `page@${correlation}`; - // TODO: move this as list onto Playwright directly - for (const browserType of [this._playwright.chromium, this._playwright.firefox, this._playwright.webkit]) { - for (const context of browserType._contexts) { - for (const page of context._pages) { - if (page._guid === guid) - return page; - } - } - } + return this._playwright._allPages().find(page => page._guid === guid); } baseURL() {