Search in sources :

Example 21 with FluentElement

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

the class ChooseFormDialog method nodes.

private SetMultimap<String, FluentElement> nodes() {
    // parsing manually, for some reason /div containsText(nodeName) does not work
    SetMultimap<String, FluentElement> nodes = HashMultimap.create();
    FluentElement formElement = modal.form().getForm();
    for (FluentElement node : formElement.find().span(XPathBuilder.withClass("icon")).ancestor().div().asList().list()) {
        String text = node.text();
        if (!Strings.isNullOrEmpty(text)) {
            nodes.put(text, node);
        }
    }
    return nodes;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 22 with FluentElement

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

the class DesignerField method labelWithMandatoryMarker.

private String labelWithMandatoryMarker() {
    Optional<FluentElement> labelElement = element.find().div().div(withClass("h5")).firstIfPresent();
    if (labelElement.isPresent()) {
        FluentElement header = labelElement.get();
        String label = labelElement.get().text();
        Optional<FluentElement> code = header.find().span(withClass("small")).firstIfPresent();
        if (code.isPresent()) {
            label = label.substring(code.get().text().length() + 1);
        }
        return label;
    }
    return "";
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 23 with FluentElement

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

the class BsTable method columns.

public List<Cell> columns() {
    List<Cell> columns = Lists.newArrayList();
    FluentElement columnsContainer = container.find().thead().tr().asList().get(1);
    for (FluentElement element : columnsContainer.find().th().asList()) {
        columns.add(new Cell(element));
    }
    return columns;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 24 with FluentElement

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

the class SubformContainer method getPanels.

public List<SubformPanel> getPanels() {
    List<SubformPanel> panels = Lists.newArrayList();
    List<FluentElement> elements = headerDiv.findElements(By.xpath("following-sibling::*")).list();
    for (FluentElement element : elements) {
        if (element.getTagName().equalsIgnoreCase("div") && element.attribute("class").contains("subformPanel")) {
            panels.add(new SubformPanel(element));
        } else {
            break;
        }
    }
    return panels;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 25 with FluentElement

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

the class ApplicationPage method navigateToReportsTab.

public ReportsTab navigateToReportsTab() {
    FluentElement container = container();
    container.find().div(withText("Reports")).clickWhenReady();
    // we may got "Save" dialog before leaving the current page
    closeSaveDialogSilently(true);
    return new ReportsTab(container);
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement) ReportsTab(org.activityinfo.test.pageobject.web.reports.ReportsTab)

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