Search in sources :

Example 6 with GxtGrid

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

Example 7 with GxtGrid

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;
}
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