use of org.activityinfo.test.pageobject.web.ApplicationPage in project activityinfo by bedatadriven.
the class SyncSmokeTest method initialSync.
@Test
public void initialSync() {
ApplicationPage applicationPage = context.login();
applicationPage.openSettingsMenu().enableOfflineMode();
applicationPage.assertOfflineModeLoads(15, TimeUnit.MINUTES);
}
use of org.activityinfo.test.pageobject.web.ApplicationPage in project activityinfo by bedatadriven.
the class TargetsUiTest method statefulTree.
@Test
public void statefulTree() throws Exception {
background();
ApplicationPage app = driver.getApplicationPage();
TargetsPage targets = app.navigateToDesignTab().selectDatabase(driver.alias(DATABASE)).targets();
targets.select("Target1");
// expand tree only one time for Target1, then it should be stateful and keep it expanded
targets.expandTree("nb. kits");
targets.valueGrid().findCell("1000");
targets.select("Target2");
targets.valueGrid().findCell("2000");
// back to Target1 without expand, tree must be already expanded
targets.select("Target1");
targets.valueGrid().findCell("1000");
}
use of org.activityinfo.test.pageobject.web.ApplicationPage in project activityinfo by bedatadriven.
the class UserSortingUiTest method test.
@Test
public void test() throws Exception {
String database = "My db";
driver.login();
driver.setup().createDatabase(property("name", database));
String[] partners = new String[] { "ARC", "NRC", "RI" };
for (String partner : partners) {
driver.setup().addPartner(partner, database);
}
for (int i = 0; i < 300; ++i) {
String name = ('A' + (i % 26)) + " Jones";
String user = String.format("user%d@example.com", i);
driver.setup().grantPermission(property("name", name), property("partner", partners[i % partners.length]), property("database", database), property("user", user), property("permissions", "View"));
}
ApplicationPage app = driver.getApplicationPage();
GxtGrid userGrid = app.navigateToDesignTab().selectDatabase(driver.alias(database)).users().grid();
userGrid.waitUntilAtLeastOneRowIsLoaded();
// Verify that partners are sorted over the three several pages
// and not just within the current page
userGrid.sortBy("partner");
assertThat(userGrid.columnValues("partner"), everyItem(equalTo(driver.alias("ARC"))));
}
use of org.activityinfo.test.pageobject.web.ApplicationPage in project activityinfo by bedatadriven.
the class FormDesignUiTest method addingFields.
@Test
public void addingFields() throws Exception {
driver.login();
driver.setup().createDatabase(name(DATABASE));
driver.setup().createForm(name("Form"), property("database", DATABASE), property("classicView", false));
ApplicationPage applicationPage = driver.getApplicationPage();
FormDesignerPage designer = applicationPage.navigateToFormDesigner(aliasTable.getAlias(DATABASE), aliasTable.getAlias("Form"));
List<String> types = designer.fields().getFieldTypes();
if (types.isEmpty()) {
throw new AssertionError("Could not find any field types");
}
for (String type : types) {
designer.fields().dropNewField(type);
designer.save();
}
designer.fields().dropNewField(I18N.CONSTANTS.fieldTypeCalculated());
}
use of org.activityinfo.test.pageobject.web.ApplicationPage in project activityinfo by bedatadriven.
the class LocationDialogUiTest method frenchCoordinates.
@Test
public void frenchCoordinates() throws Exception {
LocaleProxy.initialize();
ThreadLocalLocaleProvider.pushLocale(Locale.forLanguageTag("fr"));
accounts.setLocale("fr");
System.out.println(I18N.CONSTANTS.newSite());
driver.login();
driver.setup().createDatabase(name(CLUSTER_DATABASE));
driver.setup().createLocationType(name(VILLAGE), property("database", CLUSTER_DATABASE), property("workflowId", "open"));
driver.setup().createForm(name(DISTRIBUTION_FORM), property("database", CLUSTER_DATABASE), property("locationType", VILLAGE));
ApplicationPage applicationPage = driver.getApplicationPage();
applicationPage.openLocaleMenu().selectLocale("Fran\u00e7ais");
DataEntryTab dataEntryTab = applicationPage.navigateToDataEntryTab();
GxtDataEntryDriver dataEntry = (GxtDataEntryDriver) dataEntryTab.navigateToForm(this.driver.getAliasTable().getAlias(DISTRIBUTION_FORM)).newSubmission();
LocationDialog locationDialog = dataEntry.getLocationDialog();
locationDialog.locationInput().sendKeys("Mwenu Ditu");
try {
locationDialog.addNew();
locationDialog.dragMarker(5, 5);
} catch (TimeoutException e) {
// sometimes test fails because it can't find marker, however tried it manually and it always appears
// retry one time
locationDialog.addNew();
locationDialog.dragMarker(5, 5);
}
GxtFormPanel.GxtField latitude = locationDialog.getFormPanel().findFieldByLabel(I18N.CONSTANTS.latitude());
latitude.assertValid();
}
Aggregations