Skip to content

Commit a053818

Browse files
authored
test: unflake Firefox tests (#2431)
1 parent 7bd2c7f commit a053818

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/async/test_click.py

+8
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ async def test_wait_for_stable_position(page: Page, server: Server) -> None:
547547
document.body.style.margin = '0';
548548
}""",
549549
)
550+
# rafraf for Firefox to kick in the animation.
551+
await page.evaluate(
552+
"() => new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f)))"
553+
)
550554

551555
await page.click("button")
552556
assert await page.evaluate("window.result") == "Clicked"
@@ -564,6 +568,10 @@ async def test_timeout_waiting_for_stable_position(page: Page, server: Server) -
564568
button.style.marginLeft = '200px'
565569
}"""
566570
)
571+
# rafraf for Firefox to kick in the animation.
572+
await page.evaluate(
573+
"() => new Promise(f => requestAnimationFrame(() => requestAnimationFrame(f)))"
574+
)
567575

568576
with pytest.raises(Error) as exc_info:
569577
await button.click(timeout=3000)

0 commit comments

Comments
 (0)