Skip to content

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

test: request.sizes() sometimes hangs in CR (#9349)

Ross Wollmana892fe6db069
diff --git a/tests/page/page-network-sizes.spec.ts b/tests/page/page-network-sizes.spec.ts
index f9485eddff..5f0f5da20e 100644
--- a/tests/page/page-network-sizes.spec.ts
+++ b/tests/page/page-network-sizes.spec.ts
@@ -195,3 +195,29 @@ it('should have correct responseBodySize for 404 with content', async ({ page, s
const { responseBodySize } = await req.sizes();
expect(responseBodySize).toBeGreaterThanOrEqual(0);
});
+
+
+it('should return sizes without hanging', async ({ page, server, browserName }) => {
+ it.fixme(browserName === 'chromium');
+
+ server.setRoute('/has-abandoned-fetch', (req, resp) => {
+ resp.end(`
+ <!DOCTYPE html>
+ <html>
+ <head><title>t</title></head>
+ <body>
+ <script>
+ fetch("./404");
+ </script>
+ </body>
+ </html>
+ `);
+ });
+
+ const [req] = await Promise.all([
+ page.waitForRequest(/404$/),
+ page.goto(server.PREFIX + '/has-abandoned-fetch')
+ ]);
+
+ await req.sizes();
+});