use of org.activityinfo.test.pageobject.web.entry.GxtDataEntryDriver 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