page.setNonBlocking(true);
page.setNonBlockingOpacity(opacity);
page.waitUntilThereIsNoNotify();
page.showNotification();
final NotifyMessage message = page.getNotify().getItem(0);
actions.moveToElement(message.advanced().getSummaryElement()).perform();
Graphene.waitAjax().withMessage("The notify should has opacity " + opacity + ".")
.pollingEvery(50, TimeUnit.MILLISECONDS).until(new Predicate<WebDriver>() {
@Override
public boolean apply(WebDriver input) {
double actualOpacity = Double.valueOf(message.advanced().getRootElement().getCssValue("opacity"));
boolean succcess = Math.abs(Double.valueOf(opacity) - actualOpacity) <= 0.2;
if (!succcess) {
Utils.triggerJQ("mouseover", message.advanced().getSummaryElement());
}
return succcess;
}
});
}