1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

Googleslides: Fixes images not being found on some chromebooks.

On some chromebooks the "images" tab does not appear when attempting to
insert an image, instead the desired image needs to be found via local
storage.
This commit is contained in:
Marc Bonnici 2017-06-19 17:13:10 +01:00
parent 088102a81d
commit 8b7db92ab8
2 changed files with 19 additions and 2 deletions

View File

@ -135,7 +135,22 @@ public class UiAutomation extends UxPerfUiAutomation {
if (!imagesFolder.waitForExists(WAIT_TIMEOUT_1SEC*10)) { if (!imagesFolder.waitForExists(WAIT_TIMEOUT_1SEC*10)) {
clickUiObject(BY_DESC, "Show roots"); clickUiObject(BY_DESC, "Show roots");
} }
imagesFolder.click(); if (imagesFolder.exists()) {
imagesFolder.click();
} else {
// On some chromebooks the images tabs is missing so we need select the local storage.
UiObject localDevice = mDevice.findObject(new UiSelector().textContains("Chromebook"));
// The local storage can hidden by default so we need to enable showing it.
if (!localDevice.exists()){
clickUiObject(BY_DESC, "More Options");
clickUiObject(BY_DESC, "More Options");
clickUiObject(BY_TEXT, "Show internal storage");
clickUiObject(BY_DESC, "Show roots");
}
localDevice.click();
}
UiObject folderEntry = mDevice.findObject(new UiSelector().textContains(workingDirectoryName)); UiObject folderEntry = mDevice.findObject(new UiSelector().textContains(workingDirectoryName));
UiScrollable list = new UiScrollable(new UiSelector().scrollable(true)); UiScrollable list = new UiScrollable(new UiSelector().scrollable(true));
@ -145,7 +160,9 @@ public class UiAutomation extends UxPerfUiAutomation {
folderEntry.waitForExists(WAIT_TIMEOUT_1SEC*10); folderEntry.waitForExists(WAIT_TIMEOUT_1SEC*10);
} }
folderEntry.clickAndWaitForNewWindow(); folderEntry.clickAndWaitForNewWindow();
clickUiObject(BY_ID, "com.android.documentsui:id/date", true);
UiObject picture = mDevice.findObject(new UiSelector().resourceId("com.android.documentsui:id/date").enabled(true));
picture.click();
} }
public void insertShape(String shapeName) throws Exception { public void insertShape(String shapeName) throws Exception {