Skip to content

Commit

Permalink
XWIKI-17052: Allow to inject Javascript / CSS in Notification Displayer
Browse files Browse the repository at this point in the history
  * Small change in Notification Page object to wait the async macro to
    be finished when loading notifications in order to avoid flickers
  • Loading branch information
surli committed Mar 20, 2020
1 parent 923a54b commit 3d144f8
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.xwiki.test.ui.po.BootstrapSwitch;
Expand Down Expand Up @@ -167,7 +168,16 @@ public void showNotificationTray()

private void waitUntilNotificationsAreLoaded()
{
getDriver().waitUntilCondition(webDriver -> !notificationsArea.getAttribute(CLASS).contains("loading"));
getDriver().waitUntilCondition(webDriver -> {
if (!notificationsArea.getAttribute(CLASS).contains("loading")) {
try {
getDriver().findElementWithoutWaiting(notificationsArea, By.className("xwiki-async"));
} catch (NoSuchElementException e) {
return true;
}
}
return false;
});
}

private List<WebElement> getNotifications()
Expand Down

0 comments on commit 3d144f8

Please sign in to comment.