From cbdf41d75afadcbd52d69014d9d628a30c7fa60e Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Mon, 10 Aug 2020 13:29:47 -0400 Subject: [PATCH] Wait for contact add page to load before doing screenshot diff (#756) This test is flaky and the going theory is that we take a screenshot immediately after we click the "Add" button and the CSS hover effect is somehow still playing on the button. --- .../registry/webdriver/RegistrarConsoleScreenshotTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/test/java/google/registry/webdriver/RegistrarConsoleScreenshotTest.java b/core/src/test/java/google/registry/webdriver/RegistrarConsoleScreenshotTest.java index 778ecbbc4..e85cf7f65 100644 --- a/core/src/test/java/google/registry/webdriver/RegistrarConsoleScreenshotTest.java +++ b/core/src/test/java/google/registry/webdriver/RegistrarConsoleScreenshotTest.java @@ -238,6 +238,9 @@ class RegistrarConsoleScreenshotTest extends WebDriverTestCase { Thread.sleep(1000); driver.waitForElement(By.tagName("h1")); driver.waitForElement(By.id("reg-app-btn-add")).click(); + // Attempt to fix flaky tests. The going theory is that the click button CSS animation needs to + // finish before the screenshot is captured. + Thread.sleep(250); driver.diffPage("page"); }