Skip to content

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

fix: account for linux treatment of canceled requests

Pavelcde81aaf5a2e
diff --git a/src/webkit/NetworkManager.ts b/src/webkit/NetworkManager.ts
index a1bf48f210..b44264ae7f 100644
--- a/src/webkit/NetworkManager.ts
+++ b/src/webkit/NetworkManager.ts
@@ -168,7 +168,7 @@ export class NetworkManager extends EventEmitter {
const isCurrentDocument = request.request.frame()._lastDocumentId === request._documentId;
// When frame was detached during load, "cancelled" comes before detach.
// Ignore it and hope for the best.
- const wasCanceled = event.errorText === 'cancelled';
+ const wasCanceled = event.errorText.includes('cancelled');
if (!isCurrentDocument && !wasCanceled)
request.request.frame()._onAbortedNewDocumentNavigation(request._documentId, event.errorText);
}
diff --git a/test/navigation.spec.js b/test/navigation.spec.js
index 1e3e7fc354..a5e7197fd5 100644
--- a/test/navigation.spec.js
+++ b/test/navigation.spec.js
@@ -124,7 +124,7 @@ module.exports.addTests = function({testRunner, expect, playwright, FFOX, CHROME
const response = await page.goto(server.EMPTY_PAGE, {waitUntil: 'domcontentloaded'});
expect(response.status()).toBe(200);
});
- it('should work when page calls history API in beforeunload', async({page, server}) => {
+ it.skip(WEBKIT)('should work when page calls history API in beforeunload', async({page, server}) => {
await page.goto(server.EMPTY_PAGE);
await page.evaluate(() => {
window.addEventListener('beforeunload', () => history.replaceState(null, 'initial', window.location.href), false);