Skip to content
Snippets Groups Projects
Commit 7cf6591b authored by anttil's avatar anttil
Browse files

SWE-2 / SP-314 : Wait for paging toolbar to get enabled

SVN: 26930
parent dd4b3df3
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,13 @@
package ch.systemsx.cisd.openbis.uitest.widget;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.FluentWait;
import com.google.common.base.Predicate;
import ch.systemsx.cisd.openbis.uitest.infra.webdriver.WidgetContext;
/**
......@@ -38,10 +45,23 @@ public class PagingToolBar implements Widget, Refreshable
public void settings()
{
Button b = context.find(".//button[text()='Settings']", Button.class);
if (!b.isPressed())
{
b.click();
}
new FluentWait<WebElement>(context)
{
}.withTimeout(30, TimeUnit.SECONDS).pollingEvery(100, TimeUnit.MILLISECONDS).until(
new Predicate<WebElement>()
{
@Override
public boolean apply(WebElement element)
{
System.out.println("waiting for paging toolbar to get enabled");
return !context.getAttribute("class").contains("x-item-disabled");
}
});
b.click();
}
@Override
......
......@@ -45,6 +45,10 @@ public class SettingsDialog implements Widget
if (l.size() > 0)
{
l.get(0).click();
} else
{
throw new IllegalStateException("Could not find column " + name
+ " from settings dialog!");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment