Search in sources :

Example 1 with FluentElement

use of org.activityinfo.test.pageobject.api.FluentElement 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 FluentElement

use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.

the class LocationDialog method dragMarker.

public void dragMarker(int pixelsToLeft, int pixelsToRight) {
    FluentElement marker = dialog.getWindowElement().find().div(withClass("leaflet-marker-pane")).div(withClass("leaflet-marker-icon")).waitForFirst();
    marker.dragAndDropBy(pixelsToLeft, pixelsToRight);
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 3 with FluentElement

use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.

the class ReportEditorBar method rename.

public void rename(String reportName) {
    container.find().span(containingText(I18N.CONSTANTS.changeTitle())).first().click();
    FluentElement input = container.find().div(withClass("x-editor")).input(withClass("x-form-text")).waitForFirst();
    input.sendKeys(reportName);
    input.sendKeys(Keys.ENTER);
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 4 with FluentElement

use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.

the class BsFormPanel method findFieldsByLabel.

/**
 * Useful for repeating subforms where we may have many fields with the same label.
 *
 * @param labelText label text
 * @return all fields by label
 */
public List<BsField> findFieldsByLabel(String labelText) {
    List<BsField> result = Lists.newArrayList();
    XPathBuilder div = form.find().label(withText(labelText)).ancestor().div(withClass("form-group"));
    if (div.firstIfPresent().isPresent()) {
        for (FluentElement element : div.waitForList().list()) {
            result.add(new BsField(element));
        }
        return result;
    }
    XPathBuilder label = form.find().label(withText(labelText)).ancestor().span(withClass("radio"));
    if (label.firstIfPresent().isPresent()) {
        for (FluentElement element : label.waitForList().list()) {
            result.add(new BsField(element));
        }
    }
    return result;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) XPathBuilder(org.activityinfo.test.pageobject.api.XPathBuilder)

Example 5 with FluentElement

use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.

the class BsTable method rows.

public List<Row> rows() {
    // as() doesn't work because of inner class? convert manually
    List<FluentElement> elements = container.find().tagName("tr", false, withClass(type.getTrEvenClass()), withClass(type.getTrOddClass())).asList().list();
    List<Row> rows = Lists.newArrayList();
    for (FluentElement element : elements) {
        rows.add(new Row(element));
    }
    return rows;
// return Lists.newArrayList(container.find().tagName("tr", false, withClass(type.getTrEvenClass()), withClass(type.getTrOddClass()))
// .asList().as(Row.class));
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) DataTableRow(gherkin.formatter.model.DataTableRow)

Aggregations

FluentElement (org.activityinfo.test.pageobject.api.FluentElement)29 FluentElements (org.activityinfo.test.pageobject.api.FluentElements)4 WebDriver (org.openqa.selenium.WebDriver)4 ArrayList (java.util.ArrayList)3 DataTableRow (gherkin.formatter.model.DataTableRow)2 GxtModal (org.activityinfo.test.pageobject.gxt.GxtModal)2 GxtTree (org.activityinfo.test.pageobject.gxt.GxtTree)2 DesignPage (org.activityinfo.test.pageobject.web.design.DesignPage)2 DesignTab (org.activityinfo.test.pageobject.web.design.DesignTab)2 Test (org.junit.Test)2 Stopwatch (com.google.common.base.Stopwatch)1 List (java.util.List)1 BsDataEntryDriver (org.activityinfo.test.driver.BsDataEntryDriver)1 DataEntryDriver (org.activityinfo.test.driver.DataEntryDriver)1 XPathBuilder (org.activityinfo.test.pageobject.api.XPathBuilder)1 ReportsTab (org.activityinfo.test.pageobject.web.reports.ReportsTab)1 Select (org.openqa.selenium.support.ui.Select)1