1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-04 12:22:41 +01:00

Googleplaybooks: Adding support for night reading dialogues.

Certain devices present a night time reading popup alert when opening the books workload.
This can throw off the workload so I've added a function to check for this and dismiss if neccessary.
This commit is contained in:
scott
2018-06-12 16:39:10 +01:00
committed by setrofim
parent 2cb1f47e11
commit 503005ba5f
2 changed files with 10 additions and 0 deletions

View File

@@ -617,6 +617,8 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
// becomes visible on the screen. Therefore add pause instead. // becomes visible on the screen. Therefore add pause instead.
sleep(3); sleep(3);
dismissNightLight();
if (!activityReader.waitForExists(viewTimeout)) { if (!activityReader.waitForExists(viewTimeout)) {
throw new UiObjectNotFoundException("Could not find \"activity reader view\"."); throw new UiObjectNotFoundException("Could not find \"activity reader view\".");
} }
@@ -692,4 +694,12 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
} }
return page; return page;
} }
private void dismissNightLight() throws Exception {
UiObject night =
mDevice.findObject(new UiSelector().text("Night Light makes reading easy"));
if (night.exists()) {
clickUiObject(BY_TEXT, "DISMISS");
}
}
} }