Skip to content

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

fix(test): unflake screencast backpressure test on slow macOS runner (#41951)

microsoft-playwright-automation[bot]4b0cc996cc7b
diff --git a/tests/library/screencast.spec.ts b/tests/library/screencast.spec.ts
index 31c4a86213..d66e3712d4 100644
--- a/tests/library/screencast.spec.ts
+++ b/tests/library/screencast.spec.ts
@@ -83,7 +83,7 @@ test('applies backpressure while async onFrame callback is pending', async ({ br
requestAnimationFrame(animate);
});
await firstFrameReceived;
- await expect.poll(() => Date.now() - lastFrameTimestamp).toBeGreaterThan(1000);
+ await expect.poll(() => Date.now() - lastFrameTimestamp, { timeout: 30000 }).toBeGreaterThan(1000);
const framesWhileBlocked = frameCount;
await ensureSomeFrames(page);
@@ -96,7 +96,7 @@ test('applies backpressure while async onFrame callback is pending', async ({ br
});
await ensureSomeFrames(page);
return frameCount;
- }).toBeGreaterThan(framesWhileBlocked);
+ }, { timeout: 30000 }).toBeGreaterThan(framesWhileBlocked);
await page.screencast.stop();
await context.close();