use of org.activityinfo.test.pageobject.web.entry.DataEntryTab in project activityinfo by bedatadriven.
the class DataEntrySteps method field_contains_image.
@Then("^\"([^\"]*)\" field contains image.$")
public void field_contains_image(String imageFieldName) throws Throwable {
DataEntryTab dataEntryTab = (DataEntryTab) driver.getCurrentPage();
dataEntryTab.selectSubmission(0);
BsModal modal = dataEntryTab.editBetaSubmission();
// give it a time fetch image serving url and put it to img.src
Sleep.sleepSeconds(35);
assertTrue(modal.form().findFieldByLabel(driver.getAliasTable().getAlias(imageFieldName)).isBlobImageLoaded());
modal.cancel();
}
use of org.activityinfo.test.pageobject.web.entry.DataEntryTab in project activityinfo by bedatadriven.
the class DataEntrySteps method firstDownloadableLinkOfFirstSubmission.
private String firstDownloadableLinkOfFirstSubmission(String attachmentFieldName) {
DataEntryTab dataEntryTab = (DataEntryTab) driver.getCurrentPage();
dataEntryTab.selectSubmission(0);
BsModal modal = dataEntryTab.editBetaSubmission();
String blobLink = modal.form().findFieldByLabel(driver.getAliasTable().getAlias(attachmentFieldName)).getFirstBlobLink();
// all links must start from https
assertTrue(blobLink.startsWith("https"));
modal.cancel();
return blobLink;
}
use of org.activityinfo.test.pageobject.web.entry.DataEntryTab 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