mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 09:02:12 +00: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:
		
										
											Binary file not shown.
										
									
								
							@@ -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();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user