mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 04:18:58 +00:00
workloads/uiauto: Update workloads to dismiss android version warning
Update workloads that use uiautomator and can display a warning about using an old version of the app to dismiss the popup if present.
This commit is contained in:
parent
7632ee8288
commit
dead312ff7
Binary file not shown.
@ -41,6 +41,11 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
public static String TAG = "UXPERF";
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception {
|
||||
dismissAndroidVersionPopup();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void runWorkload() throws Exception {
|
||||
runBenchmark();
|
||||
|
Binary file not shown.
@ -42,6 +42,11 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
public static String TestButton6 = "com.antutu.ABenchMark:id/start_test_text";
|
||||
private static int initialTimeoutSeconds = 20;
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception {
|
||||
dismissAndroidVersionPopup();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void runWorkload() throws Exception{
|
||||
hitTest();
|
||||
|
Binary file not shown.
@ -36,6 +36,11 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
public Bundle parameters;
|
||||
public String packageID;
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception {
|
||||
dismissAndroidVersionPopup();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void runWorkload() throws Exception {
|
||||
startTest();
|
||||
|
Binary file not shown.
@ -62,6 +62,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
@Override
|
||||
public void setup() throws Exception {
|
||||
initialize_instrumentation();
|
||||
dismissAndroidVersionPopup();
|
||||
|
||||
if (!isCorporate)
|
||||
dismissEula();
|
||||
|
Binary file not shown.
@ -46,7 +46,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception{
|
||||
dismissPopup();
|
||||
dismissAndroidVersionPopup();
|
||||
setScreenOrientation(ScreenOrientation.NATURAL);
|
||||
loadBenchmarks();
|
||||
installBenchmark();
|
||||
@ -62,18 +62,6 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
unsetScreenOrientation();
|
||||
}
|
||||
|
||||
// If we run the app in newer Android we'll get a popup complaining about
|
||||
// that, silently accept it and carry on.
|
||||
// This function should act as a NOP if no popup appears.
|
||||
public void dismissPopup() throws Exception {
|
||||
UiObject acceptButton =
|
||||
mDevice.findObject(new UiSelector().resourceId("android:id/button1")
|
||||
.className("android.widget.Button"));
|
||||
if (acceptButton.waitForExists(WAIT_TIMEOUT_5SEC)) {
|
||||
acceptButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
//Swipe to benchmarks and back to initialise the app correctly
|
||||
private void loadBenchmarks() throws Exception {
|
||||
UiObject title =
|
||||
|
Binary file not shown.
@ -62,7 +62,7 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
|
||||
@Test
|
||||
public void setup() throws Exception {
|
||||
dismissPopUp();
|
||||
dismissAndroidVersionPopup();
|
||||
dismissEULA();
|
||||
if (version.equals("2.0.3")) {
|
||||
dissmissWelcomebanner();
|
||||
@ -307,14 +307,4 @@ public class UiAutomation extends BaseUiAutomation {
|
||||
noButton.click();
|
||||
}
|
||||
}
|
||||
|
||||
public void dismissPopUp() throws Exception {
|
||||
UiSelector selector = new UiSelector();
|
||||
|
||||
UiObject okButton =
|
||||
mDevice.findObject(selector.className("android.widget.Button").text("OK"));
|
||||
if (okButton.exists()) {
|
||||
okButton.click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user