use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertVisible.
@Override
public void assertVisible(ObjectType objectType, boolean exists, TestObject testObject) {
ensureLoggedIn();
String name = testObject.getAlias("name");
DesignTab designTab = applicationPage.navigateToDesignTab();
designTab.selectDatabase(testObject.getAlias("database"));
if (objectType == ObjectType.LOCATION_TYPE || objectType == ObjectType.FORM) {
Optional<GxtTree.GxtNode> node = designTab.design().getDesignTree().search(name);
if (exists) {
assertTrue(objectType.name() + " with name '" + name + "' is not present.", node.isPresent());
} else {
assertTrue(objectType.name() + " with name '" + name + "' is present.", !node.isPresent());
}
} else if (objectType == ObjectType.PARTNER) {
GxtGrid grid = designTab.partners().grid();
String partnerName = testObject.getString("name");
if (!"Default".equals(partnerName)) {
partnerName = testObject.getAlias("name");
}
grid.findCell(partnerName);
} else if (objectType == ObjectType.FORM_FIELD) {
DesignPage designPage = designTab.design();
designPage.getDesignTree().search(name).get().select();
designPage.getToolbarMenu().clickButton("Open Table");
designTab.formInstanceTable().buttonClick("New");
BsModal dialog = designTab.formInstance();
BsFormPanel.BsField bsField = (BsFormPanel.BsField) dialog.form().findFieldByLabel(testObject.getString("formFieldName"));
List<String> items = testObject.getAliasList(testObject.getStringList("items"));
if (!bsField.itemLabels().containsAll(items)) {
throw new AssertionError("Not all elements formfield elements are present, expected: " + Joiner.on(",").join(items) + ", actual: " + Joiner.on(",").join(bsField.itemLabels()));
}
}
}
use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class DataEntryTab method grid.
public GxtGrid grid() {
GxtGrid grid = GxtGrid.waitForGrids(container).first().get();
grid.waitUntilAtLeastOneRowIsLoaded();
return grid;
}
Aggregations