use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.
the class GxtGrid method columnValues.
public List<String> columnValues(String columnId) {
FluentElements cells = container.find().div(withClass("x-grid3-cell-inner"), withClass("x-grid3-col-" + columnId)).asList();
List<String> values = new ArrayList<>();
for (FluentElement cell : cells) {
values.add(cell.text().trim());
}
return values;
}
use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.
the class RelevanceDialog method set.
public RelevanceDialog set(DataTable dataTable, AliasTable alias) {
for (int i = 0; i < dataTable.getGherkinRows().size(); i++) {
DataTableRow row = dataTable.getGherkinRows().get(i);
List<String> cells = row.getCells();
Preconditions.checkState(cells.size() == 4);
String fieldLabel = alias.getAlias(cells.get(0));
String operation = cells.get(1);
String value = cells.get(2);
String controlType = cells.get(3);
if ("radio".equals(controlType)) {
value = alias.getAlias(value);
}
FluentElement lastRow = lastRow();
List<FluentElement> select = lastRow.find().select().waitForList().list();
Select fieldSelector = new Select(select.get(1).element());
fieldSelector.selectByVisibleText(fieldLabel);
Select operationSelector = new Select(select.get(2).element());
operationSelector.selectByVisibleText(operation);
switch(controlType) {
case "radio":
FluentElement radioLabel = lastRow().find().label(XPathBuilder.withText(value)).first();
radioLabel.clickWhenReady();
break;
}
}
return save();
}
use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.
the class DataEntryTab method buttonClick.
public DataEntryTab buttonClick(String buttonLabel) {
final FluentElement button = container.find().button(withText(buttonLabel)).first();
button.waitUntil(new // wait until button become enabled (there may be small period before it becomes enabled)
Predicate<WebDriver>() {
@Override
public boolean apply(@Nullable WebDriver input) {
return button.attribute("aria-disabled").equals("false");
}
});
button.click();
return this;
}
use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.
the class GxtFormDataEntryDriver method moveToNextSection.
private void moveToNextSection() {
FluentElement sectionElement = sections.next();
sectionElement.click();
String sectionName = sectionElement.findElement(By.className("formSecHeader")).text();
System.out.println(sectionName);
switch(sectionName) {
case "Indicators":
currentForm = new GxtIndicatorForm(modal.getWindowElement());
break;
case "Comments":
currentForm = new GxtCommentsForm(modal.getWindowElement());
break;
default:
currentForm = findVisibleForm();
break;
}
}
use of org.activityinfo.test.pageobject.api.FluentElement in project activityinfo by bedatadriven.
the class ImportDialog method selectTargetName.
private void selectTargetName(String targetName) {
FluentElement panel = modal.getWindowElement().find().div(withClass("panel-body")).first();
Optional<FluentElement> radio = panel.find().label(withText(targetName)).ancestor().span(withClass("radio")).firstIfPresent();
if (radio.isPresent()) {
radio.get().clickWhenReady();
return;
}
throw new AssertionError("Failed to find target column: " + targetName);
}
Aggregations