Skip to content

Commit

Permalink
test: fix loading detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Jan 9, 2015
1 parent d039128 commit a8098bf
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public RoundCubePage(final WebDriver pWebDriver) {
* @throws TestError
*/
private void wait_for_rc_load() throws TestError {
waitFor(200).milliseconds();
this.load_iFrame(ROUNDCUBE_FRAME);
try {
if (element(newAjaxLoader).isCurrentlyVisible()) {
Expand All @@ -78,18 +79,18 @@ private void wait_for_rc_load() throws TestError {
}
} catch (final NoSuchElementException e1) {
LOG.info("New AJAX Roundcube loader not found");
try {
if (element(ajaxLoader).isCurrentlyVisible()) {
// wait for loader icon to disappear
element(ajaxLoader).waitUntilNotVisible();
if (isRcLoginDisplayed()) {
throw new TestError("Roundcube Login should not be visible!");
}
LOG.info("AJAX loader disappeared. Loading complete...");
}
try {
if (element(ajaxLoader).isCurrentlyVisible()) {
// wait for loader icon to disappear
element(ajaxLoader).waitUntilNotVisible();
if (isRcLoginDisplayed()) {
throw new TestError("Roundcube Login should not be visible!");
}
} catch (final NoSuchElementException e2) {
LOG.info("AJAX Roundcube loader not found");
LOG.info("AJAX loader disappeared. Loading complete...");
}
} catch (final NoSuchElementException e2) {
LOG.info("AJAX Roundcube loader not found");
}
}

Expand Down

0 comments on commit a8098bf

Please sign in to comment.