test: rebaseline with win32 in mind (#499)

This commit is contained in:
Pavel Feldman 2020-01-15 13:40:44 -08:00 committed by GitHub
parent ce1e79fe9f
commit 6f92d19cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -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<Protocol.CommandReturnValues[T]>((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);

View file

@ -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 {

View file

@ -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 {