1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

workloads/gmail: Fix attaching files

Ensure the workload uses the passed working directory for attaching
images instead of a hard coded name and allow for finding of the attach
button by description as well as name.
This commit is contained in:
Marc Bonnici 2018-03-15 18:15:22 +00:00 committed by setrofim
parent 2b7d1de9f1
commit 5e4a9311f2
2 changed files with 10 additions and 3 deletions

View File

@ -159,13 +159,20 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
ActionLogger logger = new ActionLogger(testTag, parameters);
UiObject attachIcon =
getUiObjectByResourceId(packageID + "add_attachment", "android.widget.TextView");
mDevice.findObject(new UiSelector().resourceId(packageID + "add_attachment")
.className("android.widget.TextView"));
logger.start();
attachIcon.click();
UiObject attachFile =
getUiObjectByText("Attach file", "android.widget.TextView");
mDevice.findObject(new UiSelector().textContains("Attach file")
.className("android.widget.TextView"));
if (!attachFile.exists()){
attachFile =
mDevice.findObject(new UiSelector().descriptionContains("Attach file")
.className("android.widget.TextView"));
}
attachFile.clickAndWaitForNewWindow(uiAutoTimeout);
// Show Roots menu
@ -187,7 +194,7 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
if (imagesEntry.waitForExists(uiAutoTimeout)) {
imagesEntry.click();
}
selectGalleryFolder("wa");
selectGalleryFolder(workdir_name);
UiObject imageButton =
mDevice.findObject(new UiSelector().resourceId("com.android.documentsui:id/grid")