mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 12:58:36 +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";
|
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();
|
||||||
|
Binary file not shown.
@ -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();
|
||||||
|
Binary file not shown.
@ -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();
|
||||||
|
Binary file not shown.
@ -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();
|
||||||
|
Binary file not shown.
@ -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 =
|
||||||
|
Binary file not shown.
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user