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 wheel test (#16001)

Yury Semikhatsky93b255ce9079
diff --git a/tests/page/wheel.spec.ts b/tests/page/wheel.spec.ts
index 206d219563..ad41c0bd66 100644
--- a/tests/page/wheel.spec.ts
+++ b/tests/page/wheel.spec.ts
@@ -163,7 +163,7 @@ it('should work when the event is canceled', async ({ page }) => {
metaKey: false,
});
// Give the page a chance to scroll.
- await page.waitForTimeout(100);
+ await page.waitForFunction(`!!window['lastEvent']`);
// Ensure that it did not.
expect(await page.evaluate('window.scrollY')).toBe(0);
});