mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-21 01:17:43 +03:00
fix(webkit): make go back/forard return null on error (#171)
This commit is contained in:
parent
5ab0faab93
commit
02e29219fd
@ -266,12 +266,14 @@ export class Page extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _go<T extends keyof Protocol.CommandParameters>(command: T): Promise<network.Response | null> {
|
async _go<T extends keyof Protocol.CommandParameters>(command: T): Promise<network.Response | null> {
|
||||||
const [response, error] = await Promise.all([
|
const [response] = await Promise.all([
|
||||||
this.waitForNavigation(),
|
this.waitForNavigation(),
|
||||||
this._session.send(command).then(() => null).catch(e => e),
|
this._session.send(command).then(() => null),
|
||||||
]);
|
]).catch(error => {
|
||||||
if (error)
|
if (error instanceof Error && error.message.includes(`Protocol error (${command}): Failed to go`))
|
||||||
return null;
|
return [null];
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Page.goBack', function() {
|
describe('Page.goBack', function() {
|
||||||
it.skip(WEBKIT)('should work', async({page, server}) => {
|
it('should work', async({page, server}) => {
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
await page.goto(server.PREFIX + '/grid.html');
|
await page.goto(server.PREFIX + '/grid.html');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user