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

@ -593,14 +593,15 @@ public class BaseUiAutomation {
UiObject accept = UiObject accept =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept") mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/terms_accept")
.className("android.widget.Button")); .className("android.widget.Button"));
if (accept.exists()){ if (accept.waitForExists(3000)){
accept.click(); accept.click();
UiObject negative = UiObject negative =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button") mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/negative_button")
.className("android.widget.Button")); .className("android.widget.Button"));
negative.waitForExists(100000); if (negative.waitForExists(10000)) {
negative.click(); negative.click();
} }
}
UiObject lite = UiObject lite =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/button_secondary") mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/button_secondary")
.className("android.widget.Button")); .className("android.widget.Button"));

Binary file not shown.