Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: adjust windows WebSocket test expectation (#35553)

Max Schmitta8314361b089
diff --git a/tests/library/proxy.spec.ts b/tests/library/proxy.spec.ts
index b7df2b66f7..6cd1cb401d 100644
--- a/tests/library/proxy.spec.ts
+++ b/tests/library/proxy.spec.ts
@@ -323,7 +323,7 @@ it('should use SOCKS proxy for websocket requests', async ({ browserType, server
await closeProxyServer();
});
-it('should use http proxy for websocket requests', async ({ browserName, browserType, server, proxyServer }) => {
+it('should use http proxy for websocket requests', async ({ browserName, browserType, server, proxyServer, isWindows }) => {
proxyServer.forwardTo(server.PORT, { allowConnectRequests: true });
const browser = await browserType.launch({
proxy: { server: `localhost:${proxyServer.PORT}` }
@@ -350,7 +350,7 @@ it('should use http proxy for websocket requests', async ({ browserName, browser
// WebKit does not use CONNECT for websockets, but other browsers do.
if (browserName === 'webkit')
- expect(proxyServer.wsUrls).toContain('ws://fake-localhost-127-0-0-1.nip.io:1337/ws');
+ expect(proxyServer.wsUrls).toContain(isWindows ? '/ws' : 'ws://fake-localhost-127-0-0-1.nip.io:1337/ws');
else
expect(proxyServer.connectHosts).toContain('fake-localhost-127-0-0-1.nip.io:1337');