use of org.activityinfo.test.pageobject.gxt.GxtTree in project activityinfo by bedatadriven.
the class TargetsPage method expandTree.
public void expandTree(String indicatorName) {
GxtTree tree = GxtTree.treeGrid(container);
try {
// expand roots -> must be removed once we find out real problem for KeyDown on TreeGrid (throws cannot focus element on key down)
for (GxtTree.GxtNode root : Lists.newArrayList(tree.findRootNodes())) {
root.ensureExpanded();
}
tree.waitUntil(new Predicate<GxtTree>() {
@Override
public boolean apply(GxtTree tree) {
Optional<GxtTree.GxtNode> root = tree.firstRootNode();
boolean loaded = root.isPresent() && root.get().joint().firstIfPresent().isPresent();
return !loaded;
}
});
tree.search(indicatorName).get().ensureExpanded();
} catch (WebDriverException e) {
// revisit it later
// unknown error: cannot focus element on key down
}
Preconditions.checkState(tree.firstRootNode().get().joint().firstIfPresent().isPresent());
}
Aggregations