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

Update framework to wait for object before dismissing chrome popup

* Added wait for exist for google terms accept.

* Reduced wait time for device sync negative button to reduce workload run
  time.
This commit is contained in:
Rob Freeman 2020-03-30 10:14:37 +01:00 committed by Marc Bonnici
parent 3be00b296d
commit c9ddee761a
2 changed files with 5 additions and 4 deletions

View File

@ -586,20 +586,21 @@ public class BaseUiAutomation {
acceptButton.click();
}
}
// If Chrome is a fresh install then these popups may be presented
// dismiss them if visible.
public void dismissChromePopup() throws Exception {
UiObject accept =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept")
.className("android.widget.Button"));
if (accept.exists()){
if (accept.waitForExists(3000)){
accept.click();
UiObject negative =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button")
.className("android.widget.Button"));
negative.waitForExists(100000);
negative.click();
if (negative.waitForExists(10000)) {
negative.click();
}
}
UiObject lite =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/button_secondary")

Binary file not shown.