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;
}
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);
}
}
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;
}
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;
}
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;
}
}
});
}
Aggregations