Skip to content

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

fix(port-forwarding): on WebKit Win (#6745)

Max Schmitt1778e117f77b
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index ebb60081f0..919ec8604b 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -178,6 +178,14 @@ export function canAccessFile(file: string) {
}
}
+const localIpAddresses = [
+ 'localhost',
+ '127.0.0.1',
+ '::ffff:127.0.0.1',
+ '::1',
+ '0000:0000:0000:0000:0000:0000:0000:0001', // WebKit (Windows)
+];
+
export function isLocalIpAddress(ipAdress: string): boolean {
- return ['localhost', '127.0.0.1', '::ffff:127.0.0.1', '::1'].includes(ipAdress);
+ return localIpAddresses.includes(ipAdress);
}
diff --git a/tests/portForwardingServer.spec.ts b/tests/portForwardingServer.spec.ts
index 5bfee8f295..eac3413d23 100644
--- a/tests/portForwardingServer.spec.ts
+++ b/tests/portForwardingServer.spec.ts
@@ -20,6 +20,7 @@ import { contextTest as it, expect } from './config/browserTest';
import type { LaunchOptions, ConnectOptions } from '../index';
it.skip(({ mode }) => mode !== 'default');
+it.fixme(({platform, browserName}) => platform === 'darwin' && browserName === 'webkit');
let targetTestServer: http.Server;
let port!: number;