use of org.activityinfo.test.pageobject.bootstrap.BsModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method cloneDatabase.
@Override
public void cloneDatabase(TestObject testObject) {
ensureLoggedIn();
BsModal dialog = applicationPage.navigateToDesignTab().newDatabase();
Sleep.sleepSeconds(10);
dialog.form().findFieldByLabel("Use an existing database as a template").getElement().click();
dialog.click("Next »", "Create a new database");
dialog.form().findFieldByLabel("Choose a database to copy").select(testObject.getAlias("sourceDatabase"));
dialog.click("Next »", "Create a new database");
dialog.form().findFieldByLabel("Name").fill(testObject.getAlias("targetDatabase"));
dialog.form().findFieldByLabel("Country").select("Rdc");
dialog.form().findFieldByLabel("Options").select("Copy partners");
dialog.form().findFieldByLabel("Options").select("Copy user permissions");
dialog.click("Create");
}
use of org.activityinfo.test.pageobject.bootstrap.BsModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertFieldsOnNewForm.
public void assertFieldsOnNewForm(String formName, List<String> fieldLabels) {
ensureLoggedIn();
DataEntryTab dataEntryTab = applicationPage.navigateToDataEntryTab().navigateToForm(aliasTable.getAlias(formName));
dataEntryTab.buttonClick(I18N.CONSTANTS.newSite());
BsModal bsModal = FormModal.find(dataEntryTab.getContainer());
for (String fieldLabel : fieldLabels) {
assertNotNull("Failed to find field with label: " + fieldLabel, bsModal.form().findFieldByLabel(fieldLabel));
}
}
use of org.activityinfo.test.pageobject.bootstrap.BsModal in project activityinfo by bedatadriven.
the class DesignerField method delete.
public DesignerField delete() {
BsModal bsModal = clickDelete();
bsModal.click(I18N.CONSTANTS.delete());
return this;
}
use of org.activityinfo.test.pageobject.bootstrap.BsModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method getFormField.
public Form.FormItem getFormField(String formName, String databaseName, String fieldName, Optional<String> selectedValue) {
TablePage tablePage = openFormTable(aliasTable.getAlias(databaseName), aliasTable.getAlias(formName));
final BsModal modal;
if (selectedValue.isPresent()) {
tablePage.table().waitForCellByText(selectedValue.get()).getContainer().clickWhenReady();
modal = tablePage.table().editSubmission();
} else {
modal = tablePage.table().newSubmission();
}
// there is wait in edit submission to make sure progress disappear but it looks like it does not work always well
Sleep.sleepSeconds(2);
BsFormPanel.BsField fieldByLabel = modal.form().findFieldByLabel(fieldName);
modal.cancel();
return fieldByLabel;
}
use of org.activityinfo.test.pageobject.bootstrap.BsModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertFieldValuesOnNewForm.
public void assertFieldValuesOnNewForm(String formName, List<FieldValue> values) {
ensureLoggedIn();
DataEntryTab dataEntryTab = applicationPage.navigateToDataEntryTab().navigateToForm(aliasTable.getAlias(formName));
dataEntryTab.buttonClick(I18N.CONSTANTS.newSite());
BsModal bsModal = FormModal.find(dataEntryTab.getContainer());
for (FieldValue field : values) {
BsFormPanel.BsField fieldItem = (BsFormPanel.BsField) bsModal.form().findFieldByLabel(field.getField());
switch(field.getControlType()) {
case "radio":
assertTrue(fieldItem.isRadioSelected(field.getValue()));
break;
default:
throw new UnsupportedOperationException("Unknown control type: " + field.getControlType());
}
}
}
Aggregations