diff --git a/src/webkit/wkConnection.ts b/src/webkit/wkConnection.ts index c89a639742..329c2a5b05 100644 --- a/src/webkit/wkConnection.ts +++ b/src/webkit/wkConnection.ts @@ -21,7 +21,6 @@ import { ConnectionTransport } from '../transport'; import { Protocol } from './protocol'; const debugProtocol = platform.debug('pw:protocol'); -const debugWrappedMessage = platform.debug('pw:wrapped'); // WKBrowserServer uses this special id to issue Browser.close command which we // should ignore. @@ -126,7 +125,7 @@ export class WKSession extends platform.EventEmitter { return Promise.reject(new Error(`Protocol error (${method}): ${this.errorText}`)); const id = this.connection.nextMessageId(); const messageObj = { id, method, params }; - debugWrappedMessage('SEND ► ' + JSON.stringify(messageObj, null, 2)); + platform.debug('pw:wrapped:' + this.sessionId)('SEND ► ' + JSON.stringify(messageObj, null, 2)); const result = new Promise((resolve, reject) => { this._callbacks.set(id, {resolve, reject, error: new Error(), method}); }); @@ -146,7 +145,7 @@ export class WKSession extends platform.EventEmitter { } dispatchMessage(object: any) { - debugWrappedMessage('◀ RECV ' + JSON.stringify(object, null, 2)); + platform.debug('pw:wrapped:' + this.sessionId)('◀ RECV ' + JSON.stringify(object, null, 2)); if (object.id && this._callbacks.has(object.id)) { const callback = this._callbacks.get(object.id)!; this._callbacks.delete(object.id); diff --git a/test/navigation.spec.js b/test/navigation.spec.js index 1712078360..302b314b7e 100644 --- a/test/navigation.spec.js +++ b/test/navigation.spec.js @@ -172,6 +172,8 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI await page.goto('http://localhost:44123/non-existing-url').catch(e => error = e); if (CHROMIUM) expect(error.message).toContain('net::ERR_CONNECTION_REFUSED'); + else if (WEBKIT && process.platform === 'win32') + expect(error.message).toContain(`Couldn\'t connect to server`); else if (WEBKIT) expect(error.message).toContain('Could not connect'); else @@ -898,6 +900,8 @@ module.exports.describe = function({testRunner, expect, playwright, FFOX, CHROMI } else if (WEBKIT) { if (process.platform === 'darwin') expect(errorMessage).toContain('The certificate for this server is invalid'); + else if (process.platform === 'win32') + expect(errorMessage).toContain('SSL peer certificate or SSH remote key was not OK'); else expect(errorMessage).toContain('Unacceptable TLS certificate'); } else { diff --git a/test/network.spec.js b/test/network.spec.js index f63fc1e7f8..6bcfce3c36 100644 --- a/test/network.spec.js +++ b/test/network.spec.js @@ -250,6 +250,8 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT}) } else if (WEBKIT) { if (process.platform === 'darwin') expect(failedRequests[0].failure().errorText).toBe('The network connection was lost.'); + else if (process.platform === 'win32') + expect(failedRequests[0].failure().errorText).toBe('Unsupported protocol'); else expect(failedRequests[0].failure().errorText).toBe('Message Corrupt'); } else {