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