1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-03 20:02:39 +01:00

Gmail: A workload to perform standard productivity tasks within Gmail. The workload carries out various tasks, such as creating new emails, attaching images and sending them.

Moved broadcast to super. Mandatory and Default are XOR

Added a longer wait for sync to finish. Increases reliability on certain phones

Changed recipient to not mandatory and a default set

Wait for sync when launching gmail from the sharing feature

Fix: cornercase where image viewer already points to working directory. Refactored code due to duplication

Added new function to BaseUiAutomation class to find a folder in the gallery
This commit is contained in:
Michael McGeagh
2016-09-26 16:37:59 +01:00
parent 4e161127e1
commit cb53fe9ec8
9 changed files with 470 additions and 0 deletions

View File

@@ -574,4 +574,45 @@ public class BaseUiAutomation extends UiAutomatorTestCase {
}
return object;
}
// Helper to select a folder in the gallery
public void selectGalleryFolder(String directory) throws Exception {
UiObject workdir =
new UiObject(new UiSelector().text(directory)
.className("android.widget.TextView"));
UiScrollable scrollView =
new UiScrollable(new UiSelector().scrollable(true));
// If the folder is not present wait for a short time for
// the media server to refresh its index.
boolean discovered = workdir.waitForExists(TimeUnit.SECONDS.toMillis(10));
if (!discovered && scrollView.exists()) {
// First check if the directory is visible on the first
// screen and if not scroll to the bottom of the screen to look for it.
discovered = scrollView.scrollIntoView(workdir);
// If still not discovered scroll back to the top of the screen and
// wait for a longer amount of time for the media server to refresh
// its index.
if (!discovered) {
// scrollView.scrollToBeggining() doesn't work for this
// particular scrollable view so use device method instead
for (int i = 0; i < 10; i++) {
uiDeviceSwipeUp(20);
}
discovered = workdir.waitForExists(TimeUnit.SECONDS.toMillis(60));
// Scroll to the bottom of the screen one last time
if (!discovered) {
discovered = scrollView.scrollIntoView(workdir);
}
}
}
if (discovered) {
workdir.clickAndWaitForNewWindow();
} else {
throw new UiObjectNotFoundException("Could not find folder : " + directory);
}
}
}