Search in sources :

Example 1 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.

the class UiApplicationDriver method addUserToDatabase.

public void addUserToDatabase(String userEmail, String databaseName, String partner, List<FieldValue> permissions) {
    UserAccount account = accounts.ensureAccountExists(userEmail);
    ensureLoggedIn();
    UsersPage usersPage = applicationPage.navigateToDesignTab().selectDatabase(getAliasTable().getAlias(databaseName)).users();
    GxtModal modal = usersPage.addUser();
    modal.form().fillTextField("Name", account.getEmail());
    modal.form().fillTextField("Email", account.getEmail());
    modal.form().select("Partner", getAliasTable().getAlias(partner));
    modal.accept();
    Sleep.sleepSeconds(1);
    usersPage.setPermission(account.getEmail(), permissions);
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) UserAccount(org.activityinfo.test.sut.UserAccount)

Example 2 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.

the class UiApplicationDriver method assertLockedSiteDialog.

private void assertLockedSiteDialog(DataEntryTab dataEntryTab) {
    GxtModal gxtModal = GxtModal.waitForModal(dataEntryTab.getContainer());
    String dialogTitle = gxtModal.getTitle().trim();
    assertEquals("Entry is not locked. Dialog title: " + dialogTitle + ", expected: " + I18N.CONSTANTS.lockedSiteTitle(), dialogTitle, I18N.CONSTANTS.lockedSiteTitle());
    gxtModal.clickButton("OK");
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal)

Example 3 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.

the class UiApplicationDriver method createTarget.

@Override
public void createTarget(TestObject target) throws Exception {
    TargetsPage targetPage = navigateToTargetSetupFor(target.getAlias("database"));
    GxtModal dialog = targetPage.addButton();
    dialog.form().fillTextField("Name", target.getAlias());
    dialog.form().fillDateField("from", new LocalDate(2014, 1, 1));
    dialog.form().fillDateField("to", new LocalDate(2014, 12, 31));
    if (target.has("partner")) {
        dialog.form().select("Partner", target.getAlias("partner"));
    }
    if (target.has("project")) {
        dialog.form().select("Project", target.getAlias("project"));
    }
    dialog.accept();
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) LocalDate(org.joda.time.LocalDate)

Example 4 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.

the class UiApplicationDriver method createForm.

@Override
protected void createForm(TestObject form) throws Exception {
    ensureLoggedIn();
    String database = aliasTable.getAlias(form.getString("database"));
    String name = aliasTable.createAlias(form.getString("name"));
    DesignPage design = applicationPage.navigateToDesignTab().selectDatabase(database).design();
    GxtModal modal = design.newBetaForm();
    Form modalForm = modal.form();
    modalForm.fillTextField(I18N.CONSTANTS.name(), name);
    modalForm.select(I18N.CONSTANTS.published(), I18N.CONSTANTS.notPublished());
    modal.accept(I18N.CONSTANTS.save());
}
Also used : Form(org.activityinfo.test.pageobject.web.components.Form) GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal)

Example 5 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.

the class DataEntryTab method newSubmission.

public DataEntryDriver newSubmission() {
    buttonClick(I18N.CONSTANTS.newSite());
    final FluentElement windowElement = container.root();
    return container.waitFor(new Function<WebDriver, DataEntryDriver>() {

        @Override
        public DataEntryDriver apply(WebDriver input) {
            if (windowElement.find().div(withClass(GxtModal.CLASS_NAME)).exists()) {
                return new GxtDataEntryDriver(new GxtModal(windowElement));
            } else if (windowElement.find().div(withClass("formPanel")).firstIfPresent().isPresent()) {
                return new BsDataEntryDriver(windowElement);
            } else {
                return null;
            }
        }
    });
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) WebDriver(org.openqa.selenium.WebDriver) GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) DataEntryDriver(org.activityinfo.test.driver.DataEntryDriver) BsDataEntryDriver(org.activityinfo.test.driver.BsDataEntryDriver) BsDataEntryDriver(org.activityinfo.test.driver.BsDataEntryDriver)

Aggregations

GxtModal (org.activityinfo.test.pageobject.gxt.GxtModal)10 Test (org.junit.Test)3 FluentElement (org.activityinfo.test.pageobject.api.FluentElement)2 Form (org.activityinfo.test.pageobject.web.components.Form)2 LocksPage (org.activityinfo.test.pageobject.web.design.LocksPage)2 BsDataEntryDriver (org.activityinfo.test.driver.BsDataEntryDriver)1 DataEntryDriver (org.activityinfo.test.driver.DataEntryDriver)1 GxtTree (org.activityinfo.test.pageobject.gxt.GxtTree)1 DesignPage (org.activityinfo.test.pageobject.web.design.DesignPage)1 DesignTab (org.activityinfo.test.pageobject.web.design.DesignTab)1 UserAccount (org.activityinfo.test.sut.UserAccount)1 LocalDate (org.joda.time.LocalDate)1 WebDriver (org.openqa.selenium.WebDriver)1