1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 02:01:16 +00:00

fw/uiauto: Add method to baseclass to dismiss android version popup

In Android Q a popup will be displayed warning if the application has
not been designed for the latest version of android. This has currently been
dealt with on a per workload basis however this is a common popup so
add a method to dismiss the popup if present to the base class.
This commit is contained in:
Marc Bonnici 2018-10-23 11:03:31 +01:00 committed by setrofim
parent 8f6b1a7fae
commit 7632ee8288
2 changed files with 15 additions and 0 deletions

View File

@ -547,6 +547,21 @@ public class BaseUiAutomation {
}
}
// If an an app is not designed for running on the latest version of android
// (currently Q) dissmiss the warning popup if present.
public void dismissAndroidVersionPopup() throws Exception {
UiObject warningText =
mDevice.findObject(new UiSelector().textContains(
"This app was built for an older version of Android"));
UiObject acceptButton =
mDevice.findObject(new UiSelector().resourceId("android:id/button1")
.className("android.widget.Button"));
if (warningText.exists() && acceptButton.exists()) {
acceptButton.click();
}
}
// Override getParams function to decode a url encoded parameter bundle before
// passing it to workloads.
public Bundle getParams() {

Binary file not shown.