Skip to content

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

test: unflake "should delete header with undefined value" (#36197)

Dmitry Gozman3abb8bd34b47
diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts
index f7387d622d..a2a7e40862 100644
--- a/tests/page/page-request-continue.spec.ts
+++ b/tests/page/page-request-continue.spec.ts
@@ -58,8 +58,10 @@ it('should not allow to override unsafe HTTP headers', async ({ page, server, br
// Electron doesn't send the request if the host header is overridden,
// but doesn't throw an error either.
expect(error).toBeFalsy();
+ serverRequestPromise.catch(() => {});
} else if (browserName === 'chromium') {
expect(error.message).toContain('Unsafe header');
+ serverRequestPromise.catch(() => {});
} else {
expect(error).toBeFalsy();
// These lines just document current behavior in FF and WK,