Skip to content

Commit

Permalink
Make UI test working in all roundcube versions
Browse files Browse the repository at this point in the history
  • Loading branch information
hypery2k committed Jan 8, 2015
1 parent f1c5095 commit d039128
Showing 1 changed file with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class RoundCubePage extends PortalPage {
@FindBy(id = "rcmloginuser")
private WebElement rcLogin;

@FindBy(xpath = "(//*[contains(@class,'messagelist')]//tbody//td[contains(@class,'subject')]/a)[1]")
@FindBy(xpath = "(//tbody//td[contains(@class,'subject')]/a)[1]")
private WebElement firstEmail;

@FindBy(id = ROUNDCUBE_LOADER)
Expand All @@ -67,32 +67,29 @@ public RoundCubePage(final WebDriver pWebDriver) {
*/
private void wait_for_rc_load() throws TestError {
this.load_iFrame(ROUNDCUBE_FRAME);
waitFor(500).milliseconds();
try {
if (element(newAjaxLoader).isCurrentlyVisible()) {
waitFor(50).milliseconds();
// wait for loader icon to disappear
element(newAjaxLoader).waitUntilNotVisible();
if (isRcLoginDisplayed()) {
throw new TestError("Roundcube Login should not be visible!");
}
LOG.info("AJAX loader disappeared. Loading complete...");
}
} catch (final NoSuchElementException e) {
} catch (final NoSuchElementException e1) {
LOG.info("New AJAX Roundcube loader not found");
}
try {
if (element(ajaxLoader).isCurrentlyVisible()) {
waitFor(50).milliseconds();
// wait for loader icon to disappear
element(ajaxLoader).waitUntilNotVisible();
if (isRcLoginDisplayed()) {
throw new TestError("Roundcube Login should not be visible!");
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...");
}
LOG.info("AJAX loader disappeared. Loading complete...");
} catch (final NoSuchElementException e2) {
LOG.info("AJAX Roundcube loader not found");
}
} catch (final NoSuchElementException e) {
LOG.info("AJAX Roundcube loader not found");
}
}

Expand Down

0 comments on commit d039128

Please sign in to comment.