1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01: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:
Marc Bonnici 2018-10-24 09:17:48 +01:00 committed by setrofim
parent 7632ee8288
commit dead312ff7
12 changed files with 18 additions and 24 deletions

View File

@ -41,6 +41,11 @@ public class UiAutomation extends BaseUiAutomation {
public static String TAG = "UXPERF"; public static String TAG = "UXPERF";
@Test
public void setup() throws Exception {
dismissAndroidVersionPopup();
}
@Test @Test
public void runWorkload() throws Exception { public void runWorkload() throws Exception {
runBenchmark(); runBenchmark();

View File

@ -42,6 +42,11 @@ public class UiAutomation extends BaseUiAutomation {
public static String TestButton6 = "com.antutu.ABenchMark:id/start_test_text"; public static String TestButton6 = "com.antutu.ABenchMark:id/start_test_text";
private static int initialTimeoutSeconds = 20; private static int initialTimeoutSeconds = 20;
@Test
public void setup() throws Exception {
dismissAndroidVersionPopup();
}
@Test @Test
public void runWorkload() throws Exception{ public void runWorkload() throws Exception{
hitTest(); hitTest();

View File

@ -36,6 +36,11 @@ public class UiAutomation extends BaseUiAutomation {
public Bundle parameters; public Bundle parameters;
public String packageID; public String packageID;
@Test
public void setup() throws Exception {
dismissAndroidVersionPopup();
}
@Test @Test
public void runWorkload() throws Exception { public void runWorkload() throws Exception {
startTest(); startTest();

View File

@ -62,6 +62,7 @@ public class UiAutomation extends BaseUiAutomation {
@Override @Override
public void setup() throws Exception { public void setup() throws Exception {
initialize_instrumentation(); initialize_instrumentation();
dismissAndroidVersionPopup();
if (!isCorporate) if (!isCorporate)
dismissEula(); dismissEula();

View File

@ -46,7 +46,7 @@ public class UiAutomation extends BaseUiAutomation {
@Test @Test
public void setup() throws Exception{ public void setup() throws Exception{
dismissPopup(); dismissAndroidVersionPopup();
setScreenOrientation(ScreenOrientation.NATURAL); setScreenOrientation(ScreenOrientation.NATURAL);
loadBenchmarks(); loadBenchmarks();
installBenchmark(); installBenchmark();
@ -62,18 +62,6 @@ public class UiAutomation extends BaseUiAutomation {
unsetScreenOrientation(); 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 //Swipe to benchmarks and back to initialise the app correctly
private void loadBenchmarks() throws Exception { private void loadBenchmarks() throws Exception {
UiObject title = UiObject title =

View File

@ -62,7 +62,7 @@ public class UiAutomation extends BaseUiAutomation {
@Test @Test
public void setup() throws Exception { public void setup() throws Exception {
dismissPopUp(); dismissAndroidVersionPopup();
dismissEULA(); dismissEULA();
if (version.equals("2.0.3")) { if (version.equals("2.0.3")) {
dissmissWelcomebanner(); dissmissWelcomebanner();
@ -307,14 +307,4 @@ public class UiAutomation extends BaseUiAutomation {
noButton.click(); 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();
}
}
} }