Search in sources :

Example 1 with GxtGrid

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"))));
}
Also used : ApplicationPage(org.activityinfo.test.pageobject.web.ApplicationPage) GxtGrid(org.activityinfo.test.pageobject.gxt.GxtGrid) Test(org.junit.Test)

Example 2 with GxtGrid

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();
    }
}
Also used : GxtGrid(org.activityinfo.test.pageobject.gxt.GxtGrid) IndicatorLink(org.activityinfo.test.driver.model.IndicatorLink)

Example 3 with GxtGrid

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);
    }
}
Also used : GxtGrid(org.activityinfo.test.pageobject.gxt.GxtGrid) IndicatorLink(org.activityinfo.test.driver.model.IndicatorLink)

Example 4 with GxtGrid

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);
}
Also used : GxtGrid(org.activityinfo.test.pageobject.gxt.GxtGrid)

Example 5 with GxtGrid

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();
}
Also used : GxtGrid(org.activityinfo.test.pageobject.gxt.GxtGrid)

Aggregations

GxtGrid (org.activityinfo.test.pageobject.gxt.GxtGrid)7 IndicatorLink (org.activityinfo.test.driver.model.IndicatorLink)2 BsFormPanel (org.activityinfo.test.pageobject.bootstrap.BsFormPanel)1 BsModal (org.activityinfo.test.pageobject.bootstrap.BsModal)1 ApplicationPage (org.activityinfo.test.pageobject.web.ApplicationPage)1 Test (org.junit.Test)1