Search in sources :

Example 1 with DesignTab

use of org.activityinfo.test.pageobject.web.design.DesignTab in project activityinfo by bedatadriven.

the class DesignUiTest method saveButtonState.

// AI-878
@Test
public void saveButtonState() throws Exception {
    driver.login();
    driver.setup().createDatabase(property("name", DATABASE));
    driver.setup().createForm(name(FORM), property("database", DATABASE), property("classicView", false));
    driver.ensureLoggedIn();
    String db = driver.getAliasTable().getAlias(DATABASE);
    String form = driver.getAliasTable().getAlias(FORM);
    DesignTab tab = driver.getApplicationPage().navigateToDesignTab().selectDatabase(db);
    DesignPage designPage = tab.design();
    GxtTree.GxtNode node = designPage.getDesignTree().select(form);
    FluentElement nodeElement = node.getElement();
    nodeElement.doubleClick();
    FluentElement editor = findInputEditor(tab.getContainer());
    editor.sendKeys("123", Keys.ENTER);
    designPage.getToolbarMenu().clickButton("Save");
    assertFalse(designPage.getToolbarMenu().button("Saved").isEnabled());
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) DesignPage(org.activityinfo.test.pageobject.web.design.DesignPage) DesignTab(org.activityinfo.test.pageobject.web.design.DesignTab) GxtTree(org.activityinfo.test.pageobject.gxt.GxtTree) Test(org.junit.Test)

Example 2 with DesignTab

use of org.activityinfo.test.pageobject.web.design.DesignTab in project activityinfo by bedatadriven.

the class ApplicationPage method navigateToFormDesigner.

public FormDesignerPage navigateToFormDesigner(String database, String formName) {
    DesignTab designTab = navigateToDesignTab();
    designTab.selectDatabase(database);
    DesignPage designPage = designTab.design();
    designPage.getDesignTree().select(formName);
    designPage.getToolbarMenu().clickButton(I18N.CONSTANTS.openFormDesigner());
    page.waitUntil(new Predicate<WebDriver>() {

        @Override
        public boolean apply(WebDriver input) {
            return page.find().div(withClass(FormDesignerPage.DROP_TARGET_CLASS)).exists();
        }
    });
    return new FormDesignerPage(page);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) DesignPage(org.activityinfo.test.pageobject.web.design.DesignPage) FormDesignerPage(org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage) DesignTab(org.activityinfo.test.pageobject.web.design.DesignTab)

Example 3 with DesignTab

use of org.activityinfo.test.pageobject.web.design.DesignTab in project activityinfo by bedatadriven.

the class ApplicationPage method navigateToTable.

public TablePage navigateToTable(String database, String formName) {
    DesignTab designTab = navigateToDesignTab();
    designTab.selectDatabase(database);
    DesignPage designPage = designTab.design();
    designPage.getDesignTree().select(formName);
    designPage.getToolbarMenu().clickButton(I18N.CONSTANTS.openTable());
    return new TablePage(page);
}
Also used : DesignPage(org.activityinfo.test.pageobject.web.design.DesignPage) TablePage(org.activityinfo.test.pageobject.web.entry.TablePage) DesignTab(org.activityinfo.test.pageobject.web.design.DesignTab)

Example 4 with DesignTab

use of org.activityinfo.test.pageobject.web.design.DesignTab in project activityinfo by bedatadriven.

the class DesignUiTest method navigateAwayWithoutSavingChanges.

// AI-877
@Test
public void navigateAwayWithoutSavingChanges() throws Exception {
    driver.login();
    driver.setup().createDatabase(property("name", DATABASE));
    driver.setup().createForm(name(FORM), property("database", DATABASE), property("classicView", false));
    driver.ensureLoggedIn();
    String db = driver.getAliasTable().getAlias(DATABASE);
    String form = driver.getAliasTable().getAlias(FORM);
    DesignTab tab = driver.getApplicationPage().navigateToDesignTab().selectDatabase(db);
    DesignPage designPage = tab.design();
    GxtTree.GxtNode node = designPage.getDesignTree().select(form);
    FluentElement nodeElement = node.getElement();
    nodeElement.doubleClick();
    FluentElement editor = findInputEditor(tab.getContainer());
    editor.sendKeys("123");
    try {
        driver.getApplicationPage().navigateToDashboard();
    } catch (Exception e) {
    // ignore : our goal is to navigate away and make sure confirmation dialog appears
    }
    GxtModal confirmationModal = GxtModal.waitForModal(designPage.getContainer().root());
    assertNotNull(confirmationModal);
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) DesignPage(org.activityinfo.test.pageobject.web.design.DesignPage) GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) DesignTab(org.activityinfo.test.pageobject.web.design.DesignTab) GxtTree(org.activityinfo.test.pageobject.gxt.GxtTree) Test(org.junit.Test)

Aggregations

DesignPage (org.activityinfo.test.pageobject.web.design.DesignPage)4 DesignTab (org.activityinfo.test.pageobject.web.design.DesignTab)4 FluentElement (org.activityinfo.test.pageobject.api.FluentElement)2 GxtTree (org.activityinfo.test.pageobject.gxt.GxtTree)2 Test (org.junit.Test)2 GxtModal (org.activityinfo.test.pageobject.gxt.GxtModal)1 FormDesignerPage (org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage)1 TablePage (org.activityinfo.test.pageobject.web.entry.TablePage)1 WebDriver (org.openqa.selenium.WebDriver)1