Skip to content

Commit a053818

Browse files
authored
test: unflake Firefox tests (microsoft#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

Lines changed: 8 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy