public static void testSetUpProgressText(WebDriver driver) throws InterruptedException { WebDriverWait wait = new WebDriverWait(driver, WAIT_TIME); String str = wait.until( ExpectedConditions .presenceOfElementLocated(SETUP_PROGRESS_TEXT)) .getText(); Assert.assertEquals(str, "Setup Progress:"); }
@Test public void shouldThrowAnExceptionIfTheTimerRunsOut() { TickingClock clock = new TickingClock(200); WebDriverWait wait = new WebDriverWait(mockDriver, clock, clock, 1, 200); try { wait.until(new FalseExpectation()); fail(); } catch (TimeoutException e) { // this is expected } }