Search in sources :

Example 6 with GxtModal

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

the class DatabasesPage method rename.

public DatabasesPage rename(String oldName, String newName, String newDescription) {
    grid().clickCell(oldName);
    buttonClick(I18N.CONSTANTS.renameDatabase());
    GxtModal modal = new GxtModal(container);
    Form form = modal.form();
    form.findFieldByLabel(I18N.CONSTANTS.name()).fill(newName);
    form.findFieldByLabel(I18N.CONSTANTS.description()).fill(newDescription);
    modal.accept();
    return this;
}
Also used : Form(org.activityinfo.test.pageobject.web.components.Form) GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal)

Example 7 with GxtModal

use of org.activityinfo.test.pageobject.gxt.GxtModal 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)

Example 8 with GxtModal

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

the class LockUiTest method lockIsNotRemovedOnNoButtonClick.

// AI-1091
@Test
public void lockIsNotRemovedOnNoButtonClick() throws Exception {
    background();
    String lockName = "lockName";
    driver.addLockOnDb(lockName, DATABASE, "2015-01-01", "2015-01-01", true);
    LocksPage locksPage = locksPage();
    locksPage.grid().clickCell(lockName);
    GxtModal confirmDialog = locksPage.clickDelete();
    confirmDialog.clickButton(I18N.CONSTANTS.no());
    // assert lock is still in table
    locksPage.grid().findCell(lockName);
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) LocksPage(org.activityinfo.test.pageobject.web.design.LocksPage) Test(org.junit.Test)

Example 9 with GxtModal

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

the class LockUiTest method deleteLock.

// AI-1225
@Test
public void deleteLock() throws Exception {
    background();
    String lockName = "lockName";
    driver.addLockOnDb(lockName, DATABASE, "2015-01-01", "2015-01-01", true);
    LocksPage locksPage = locksPage();
    locksPage.grid().clickCell(lockName);
    GxtModal confirmDialog = locksPage.clickDelete();
    confirmDialog.clickButton(I18N.CONSTANTS.yes());
    Sleep.sleepSeconds(1);
    // assert lock is removed
    assertFalse(locksPage.grid().findCellOptional(lockName).isPresent());
    // assert delete button is disabled
    assertFalse(locksPage.getToolbarMenu().button(I18N.CONSTANTS.delete()).isEnabled());
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal) LocksPage(org.activityinfo.test.pageobject.web.design.LocksPage) Test(org.junit.Test)

Example 10 with GxtModal

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

the class ReportEditorBar method share.

public ShareReportsDialog share() {
    container.find().button(containingText(I18N.CONSTANTS.share())).first().click();
    GxtModal modal = GxtModal.waitForModal(container);
    return new ShareReportsDialog(modal);
}
Also used : GxtModal(org.activityinfo.test.pageobject.gxt.GxtModal)

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