SynchronisationService extends BaseServiceHub { public boolean checkForExpectedCondition(ExpectedCondition<?> condition) { return waitForExpectedCondition(condition, 0); }  boolean waitForExpectedCondition(ExpectedCondition<?> condition, int timeout); boolean waitForExpectedCondition(ExpectedCondition<?> condition); void waitAndAssertForExpectedCondition(ExpectedCondition<?> condition, int timeout); void waitAndAssertForExpectedCondition(ExpectedCondition<?> condition); boolean checkForExpectedCondition(ExpectedCondition<?> condition); void checkAndAssertForExpectedCondition(ExpectedCondition<?> condition); void waitAndSwitchToNewBrowserWindow(int timeout); void waitAndSwitchToNewBrowserWindow(); void switchToMainWindow(); void switchToLatestPopupWindow();  }
@Test public void testCheckForExpectedCondition() throws Exception { seleniumNavigationService.navigate_to_url(TEST_PAGE_URL); assertTrue(seleniumSynchronisationService.checkForExpectedCondition(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("div[id='text']")))); seleniumElementService.findExpectedElement(By.cssSelector("button[id='delayedDisplayButton']")).click(); assertTrue(seleniumSynchronisationService.checkForExpectedCondition(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div[id='text']")))); }