From 209b5dea44d79d9a31aab847c93f27b0a205af2a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 15 Nov 2024 11:30:09 -0800 Subject: [PATCH] test: unflake TestPageClock --- .../src/test/java/com/microsoft/playwright/TestPageClock.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageClock.java b/playwright/src/test/java/com/microsoft/playwright/TestPageClock.java index 9486f675..bbdbb2d2 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestPageClock.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestPageClock.java @@ -290,8 +290,9 @@ void shouldRunTimeBeforePopup(Page page, Server server) { Page popup = page.waitForPopup(() -> { page.evaluate("url => window.open(url)", server.PREFIX + "/popup.html"); }); + popup.waitForURL(server.PREFIX + "/popup.html"); Double popupTime = (Double) popup.evaluate("time"); - assertTrue(popupTime >= 2000); + assertTrue(popupTime >= 2000, "popupTime = " + popupTime); } @Test @@ -310,6 +311,7 @@ void shouldNotRunTimeBeforePopupOnPause(Page page, Server server) { Page popup = page.waitForPopup(() -> { page.evaluate("url => window.open(url)", server.PREFIX + "/popup.html"); }); + popup.waitForURL(server.PREFIX + "/popup.html"); Object popupTime = popup.evaluate("time"); assertEquals(1000, popupTime); }