use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class UserSortingUiTest method test.
@Test
public void test() throws Exception {
String database = "My db";
driver.login();
driver.setup().createDatabase(property("name", database));
String[] partners = new String[] { "ARC", "NRC", "RI" };
for (String partner : partners) {
driver.setup().addPartner(partner, database);
}
for (int i = 0; i < 300; ++i) {
String name = ('A' + (i % 26)) + " Jones";
String user = String.format("user%d@example.com", i);
driver.setup().grantPermission(property("name", name), property("partner", partners[i % partners.length]), property("database", database), property("user", user), property("permissions", "View"));
}
ApplicationPage app = driver.getApplicationPage();
GxtGrid userGrid = app.navigateToDesignTab().selectDatabase(driver.alias(database)).users().grid();
userGrid.waitUntilAtLeastOneRowIsLoaded();
// Verify that partners are sorted over the three several pages
// and not just within the current page
userGrid.sortBy("partner");
assertThat(userGrid.columnValues("partner"), everyItem(equalTo(driver.alias("ARC"))));
}
use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class UiApplicationDriver method createLinkIndicators.
@Override
public void createLinkIndicators(List<IndicatorLink> linkedIndicatorRows) {
LinkIndicatorsPage linkIndicatorsPage = getLinkIndicatorPage();
linkIndicatorsPage.getSourceDb().waitUntilAtLeastOneRowIsLoaded();
linkIndicatorsPage.getTargetDb().waitUntilAtLeastOneRowIsLoaded();
for (IndicatorLink row : linkedIndicatorRows) {
linkIndicatorsPage.getSourceDb().clickCell(aliasTable.getAlias(row.getSourceDb()));
linkIndicatorsPage.getTargetDb().clickCell(aliasTable.getAlias(row.getDestDb()));
// sometimes it's too fast and we have to give time show "Loading" and only then wait for rows
Tester.sleepSeconds(1);
GxtGrid sourceIndicator = linkIndicatorsPage.getSourceIndicator().waitUntilAtLeastOneRowIsLoaded();
GxtGrid targetIndicator = linkIndicatorsPage.getTargetIndicator().waitUntilAtLeastOneRowIsLoaded();
sourceIndicator.clickCell(aliasTable.getAlias(row.getSourceIndicator()));
targetIndicator.clickCell(aliasTable.getAlias(row.getDestIndicator()));
linkIndicatorsPage.linkSelection();
}
}
use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertLinkedIndicatorsMarked.
public void assertLinkedIndicatorsMarked(List<IndicatorLink> linkedIndicatorRows, boolean marked) {
LinkIndicatorsPage linkIndicatorsPage = getLinkIndicatorPage();
linkIndicatorsPage.getSourceDb().waitUntilAtLeastOneRowIsLoaded();
linkIndicatorsPage.getTargetDb().waitUntilAtLeastOneRowIsLoaded();
for (IndicatorLink row : linkedIndicatorRows) {
Preconditions.checkState(linkIndicatorsPage.getSourceDb().findCell(aliasTable.getAlias(row.getSourceDb())).hasIcon(), marked);
Preconditions.checkState(linkIndicatorsPage.getTargetDb().findCell(aliasTable.getAlias(row.getDestDb())).hasIcon(), marked);
linkIndicatorsPage.getSourceDb().clickCell(aliasTable.getAlias(row.getSourceDb()));
linkIndicatorsPage.getTargetDb().clickCell(aliasTable.getAlias(row.getDestDb()));
GxtGrid sourceIndicator = linkIndicatorsPage.getSourceIndicator().waitUntilAtLeastOneRowIsLoaded();
GxtGrid targetIndicator = linkIndicatorsPage.getTargetIndicator().waitUntilAtLeastOneRowIsLoaded();
Preconditions.checkState(sourceIndicator.findCell(aliasTable.getAlias(row.getSourceIndicator())).hasIcon(), marked);
Preconditions.checkState(targetIndicator.findCell(aliasTable.getAlias(row.getDestIndicator())).hasIcon(), marked);
}
}
use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class TargetsPage method select.
public void select(String targetName) {
// Select the target from the upper grid
GxtGrid grid = targetGrid();
grid.waitUntilAtLeastOneRowIsLoaded();
grid.clickCell(targetName);
}
use of org.activityinfo.test.pageobject.gxt.GxtGrid in project activityinfo by bedatadriven.
the class UiApplicationDriver method oldTable.
@Override
public DataTable oldTable(String formName) {
ensureLoggedIn();
DataEntryTab dataEntryTab = applicationPage.navigateToDataEntryTab();
GxtGrid grid = dataEntryTab.navigateToForm(aliasTable.getAlias(formName)).grid();
return grid.extractData();
}
Aggregations