1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

Speedometer: Extending teardown function

Some devices throw errors if too many browser tabs are open. Have
added a method to close down the tabs in the teardown function.
This commit is contained in:
scott 2018-09-11 12:22:22 +01:00 committed by Marc Bonnici
parent 6d654157b2
commit ccaca3d6d8
2 changed files with 15 additions and 0 deletions

View File

@ -57,6 +57,7 @@ public class UiAutomation extends BaseUiAutomation {
@Test
public void teardown() throws Exception{
clearTabs();
unsetScreenOrientation();
}
@ -94,5 +95,19 @@ public class UiAutomation extends BaseUiAutomation {
Log.d(TAG, "Speedometer Score " + textScore);
Log.d(TAG, "Speedometer Score " + scores.getContentDescription());
}
public void clearTabs() throws Exception {
UiObject tabselector =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/tab_switcher_button")
.className("android.widget.ImageButton"));
tabselector.click();
UiObject menu =
mDevice.findObject(new UiSelector().resourceId("com.android.chrome:id/menu_button")
.className("android.widget.ImageButton"));
menu.click();
UiObject closetabs =
mDevice.findObject(new UiSelector().textContains("Close all tabs"));
closetabs.click();
}
}