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); });