use _allPages()

This commit is contained in:
Simon Knott 2025-02-07 15:48:15 +01:00
parent 34991a032f
commit 974e12366e
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -70,15 +70,7 @@ export class MockingProxy extends ChannelOwner<channels.MockingProxyChannel> {
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() {