diff --git a/tests/config/proxy.ts b/tests/config/proxy.ts index 782dfc7814..1853196e6e 100644 --- a/tests/config/proxy.ts +++ b/tests/config/proxy.ts @@ -21,6 +21,10 @@ import net from 'net'; import type { SocksSocketClosedPayload, SocksSocketDataPayload, SocksSocketRequestedPayload } from '../../packages/playwright-core/src/common/socksProxy'; import { SocksProxy } from '../../packages/playwright-core/lib/common/socksProxy'; +const kConnectHostsToIgnore = new Set([ + 'www.bing.com:443', +]); + export class TestProxy { readonly PORT: number; readonly URL: string; @@ -63,6 +67,8 @@ export class TestProxy { this._prependHandler('connect', (req: IncomingMessage) => { if (!options?.allowConnectRequests) return; + if (kConnectHostsToIgnore.has(req.url)) + return; this.connectHosts.push(req.url); req.url = `127.0.0.1:${port}`; }); diff --git a/tests/library/channels.spec.ts b/tests/library/channels.spec.ts index 03becec063..5d9d0c78b3 100644 --- a/tests/library/channels.spec.ts +++ b/tests/library/channels.spec.ts @@ -239,7 +239,7 @@ it('should not generate dispatchers for subresources w/o listeners', async ({ pa }); }); -it('should work with the domain module', async ({ browserType, server, browserName }) => { +it('should work with the domain module', async ({ browserType, server, browserName, channel }) => { const local = domain.create(); local.run(() => { }); let err; @@ -262,7 +262,7 @@ it('should work with the domain module', async ({ browserType, server, browserNa if (browserName === 'firefox') expect(message).toBe('CLOSE_ABNORMAL'); else - expect(message).toContain(': 400'); + expect(message).toContain(channel.includes('msedge') ? '' : ': 400'); await browser.close(); diff --git a/tests/library/web-socket.spec.ts b/tests/library/web-socket.spec.ts index 179c332307..c3d48ad267 100644 --- a/tests/library/web-socket.spec.ts +++ b/tests/library/web-socket.spec.ts @@ -137,7 +137,7 @@ it('should emit binary frame events', async ({ page, server }) => { expect(sent[1][i]).toBe(i); }); -it('should emit error', async ({ page, server, browserName }) => { +it('should emit error', async ({ page, server, browserName, channel }) => { let callback; const result = new Promise(f => callback = f); page.on('websocket', ws => ws.on('socketerror', callback)); @@ -148,7 +148,7 @@ it('should emit error', async ({ page, server, browserName }) => { if (browserName === 'firefox') expect(message).toBe('CLOSE_ABNORMAL'); else - expect(message).toContain(': 400'); + expect(message).toContain(channel.includes('msedge') ? '' : ': 400'); }); it('should not have stray error events', async ({ page, server }) => {