Search in sources :

Example 16 with FluentElement

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

the class ImportSchemaDialog method enterCvsText.

public ImportSchemaDialog enterCvsText(String cvsText) {
    FluentElement textArea = modal.form().getForm().find().textArea(withClass("form-control")).first();
    textArea.element().clear();
    textArea.sendKeys(cvsText);
    Sleep.sleepSeconds(1);
    return this;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 17 with FluentElement

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

the class UiApplicationDriver method assertDesignerFieldHasProperty.

@Override
public void assertDesignerFieldHasProperty(String fieldLabel, DesignerFieldPropertyType fieldPropertyType, boolean enabled) {
    DesignerField designerField = formDesigner().rootDropTarget().fieldByLabel(fieldLabel);
    designerField.element().clickWhenReady();
    PropertiesPanel propertiesPanel = formDesigner().fieldProperties();
    final boolean actualValue;
    switch(fieldPropertyType) {
        case RELEVANCE:
            FluentElement propertyElement = propertiesPanel.getContainer().find().label(XPathBuilder.containingText(I18N.CONSTANTS.relevance())).first();
            actualValue = propertyElement.isDisplayed();
            break;
        case REQUIRED:
            actualValue = propertiesPanel.form().findFieldByLabel(I18N.CONSTANTS.required()).isEnabled();
            break;
        case VISIBLE:
            actualValue = propertiesPanel.form().findFieldByLabel(I18N.CONSTANTS.showInDataEntry()).isEnabled();
            break;
        default:
            throw new AssertionError("Unsupported field property type: " + fieldPropertyType);
    }
    if (actualValue != enabled) {
        throw new AssertionError("'" + fieldPropertyType + "' field property state is " + actualValue + " while it's expected to have it " + enabled + " for label: " + fieldLabel);
    }
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 18 with FluentElement

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

the class DropPanel method fields.

public List<DesignerField> fields() {
    List<FluentElement> elements = container.find().div(withClass("widget-container")).asList().list();
    List<DesignerField> fields = Lists.newArrayList();
    for (FluentElement element : elements) {
        fields.add(new DesignerField(element));
    }
    return fields;
}
Also used : FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 19 with FluentElement

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

the class FieldPalette method getFieldTypes.

public List<String> getFieldTypes() {
    FluentElements elements = panel.find().div(withClass("btn")).asList();
    List<String> types = Lists.newArrayList();
    for (FluentElement element : elements) {
        types.add(element.text());
    }
    return types;
}
Also used : FluentElements(org.activityinfo.test.pageobject.api.FluentElements) FluentElement(org.activityinfo.test.pageobject.api.FluentElement)

Example 20 with FluentElement

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

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