Search in sources :

Example 1 with FormDesignerPage

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

the class DesignUiTest method globalDatabase.

@Test
public void globalDatabase() throws Exception {
    driver.login();
    driver.setup().createDatabase(property("name", DATABASE), property("country", "Global"));
    driver.createForm(name(FORM), property("database", DATABASE), property("classicView", false));
    FormDesignerPage formDesignerPage = driver.openFormDesigner(DATABASE, FORM);
    formDesignerPage.save();
}
Also used : FormDesignerPage(org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage) Test(org.junit.Test)

Example 2 with FormDesignerPage

use of org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage 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 FormDesignerPage

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

the class FormDesignUiTest method addingFields.

@Test
public void addingFields() throws Exception {
    driver.login();
    driver.setup().createDatabase(name(DATABASE));
    driver.setup().createForm(name("Form"), property("database", DATABASE), property("classicView", false));
    ApplicationPage applicationPage = driver.getApplicationPage();
    FormDesignerPage designer = applicationPage.navigateToFormDesigner(aliasTable.getAlias(DATABASE), aliasTable.getAlias("Form"));
    List<String> types = designer.fields().getFieldTypes();
    if (types.isEmpty()) {
        throw new AssertionError("Could not find any field types");
    }
    for (String type : types) {
        designer.fields().dropNewField(type);
        designer.save();
    }
    designer.fields().dropNewField(I18N.CONSTANTS.fieldTypeCalculated());
}
Also used : ApplicationPage(org.activityinfo.test.pageobject.web.ApplicationPage) FormDesignerPage(org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage) Test(org.junit.Test)

Aggregations

FormDesignerPage (org.activityinfo.test.pageobject.web.design.designer.FormDesignerPage)3 Test (org.junit.Test)2 ApplicationPage (org.activityinfo.test.pageobject.web.ApplicationPage)1 DesignPage (org.activityinfo.test.pageobject.web.design.DesignPage)1 DesignTab (org.activityinfo.test.pageobject.web.design.DesignTab)1 WebDriver (org.openqa.selenium.WebDriver)1