use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method addUserToDatabase.
public void addUserToDatabase(String userEmail, String databaseName, String partner, List<FieldValue> permissions) {
UserAccount account = accounts.ensureAccountExists(userEmail);
ensureLoggedIn();
UsersPage usersPage = applicationPage.navigateToDesignTab().selectDatabase(getAliasTable().getAlias(databaseName)).users();
GxtModal modal = usersPage.addUser();
modal.form().fillTextField("Name", account.getEmail());
modal.form().fillTextField("Email", account.getEmail());
modal.form().select("Partner", getAliasTable().getAlias(partner));
modal.accept();
Sleep.sleepSeconds(1);
usersPage.setPermission(account.getEmail(), permissions);
}
use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertLockedSiteDialog.
private void assertLockedSiteDialog(DataEntryTab dataEntryTab) {
GxtModal gxtModal = GxtModal.waitForModal(dataEntryTab.getContainer());
String dialogTitle = gxtModal.getTitle().trim();
assertEquals("Entry is not locked. Dialog title: " + dialogTitle + ", expected: " + I18N.CONSTANTS.lockedSiteTitle(), dialogTitle, I18N.CONSTANTS.lockedSiteTitle());
gxtModal.clickButton("OK");
}
use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method createTarget.
@Override
public void createTarget(TestObject target) throws Exception {
TargetsPage targetPage = navigateToTargetSetupFor(target.getAlias("database"));
GxtModal dialog = targetPage.addButton();
dialog.form().fillTextField("Name", target.getAlias());
dialog.form().fillDateField("from", new LocalDate(2014, 1, 1));
dialog.form().fillDateField("to", new LocalDate(2014, 12, 31));
if (target.has("partner")) {
dialog.form().select("Partner", target.getAlias("partner"));
}
if (target.has("project")) {
dialog.form().select("Project", target.getAlias("project"));
}
dialog.accept();
}
use of org.activityinfo.test.pageobject.gxt.GxtModal in project activityinfo by bedatadriven.
the class UiApplicationDriver method createForm.
@Override
protected void createForm(TestObject form) throws Exception {
ensureLoggedIn();
String database = aliasTable.getAlias(form.getString("database"));
String name = aliasTable.createAlias(form.getString("name"));
DesignPage design = applicationPage.navigateToDesignTab().selectDatabase(database).design();
GxtModal modal = design.newBetaForm();
Form modalForm = modal.form();
modalForm.fillTextField(I18N.CONSTANTS.name(), name);
modalForm.select(I18N.CONSTANTS.published(), I18N.CONSTANTS.notPublished());
modal.accept(I18N.CONSTANTS.save());
}
use of org.activityinfo.test.pageobject.gxt.GxtModal 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