Search in sources :

Example 96 with UiObject

use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.

the class UiBot method assertInActionMode.

public void assertInActionMode(boolean inActionMode) {
    UiObject actionModeBar = findActionModeBar();
    assertEquals(inActionMode, actionModeBar.exists());
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 97 with UiObject

use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.

the class UiBot method assertSearchTextField.

public void assertSearchTextField(boolean isFocused, String query) throws UiObjectNotFoundException {
    UiObject textField = findSearchViewTextField();
    UiObject searchIcon = findSearchViewIcon();
    assertFalse(searchIcon.exists());
    assertTrue(textField.exists());
    assertEquals(isFocused, textField.isFocused());
    if (query != null) {
        assertEquals(query, textField.getText());
    }
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 98 with UiObject

use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.

the class UiBot method findDownloadRetryDialog.

public UiObject findDownloadRetryDialog() {
    UiSelector selector = new UiSelector().text("Couldn't download");
    UiObject title = mDevice.findObject(selector);
    title.waitForExists(mTimeout);
    return title;
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector)

Example 99 with UiObject

use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.

the class DirectoryListBot method selectDocument.

public UiObject selectDocument(String label) throws UiObjectNotFoundException {
    UiObject doc = findDocument(label);
    doc.longClick();
    return doc;
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 100 with UiObject

use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.

the class BugreportReceiverTest method waitForScreenshotButtonEnabled.

private UiObject waitForScreenshotButtonEnabled(boolean expectedEnabled) throws Exception {
    UiObject screenshotButton = getScreenshotButton();
    int maxAttempts = SAFE_SCREENSHOT_DELAY;
    int i = 0;
    do {
        boolean enabled = screenshotButton.isEnabled();
        if (enabled == expectedEnabled) {
            return screenshotButton;
        }
        i++;
        Log.v(TAG, "Sleeping for 1 second while waiting for screenshot.enable to be " + expectedEnabled + " (attempt " + i + ")");
        Thread.sleep(DateUtils.SECOND_IN_MILLIS);
    } while (i <= maxAttempts);
    fail("screenshot.enable didn't change to " + expectedEnabled + " in " + maxAttempts + "s");
    return screenshotButton;
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Aggregations

UiObject (android.support.test.uiautomator.UiObject)140 UiSelector (android.support.test.uiautomator.UiSelector)44 UiScrollable (android.support.test.uiautomator.UiScrollable)13 UiObjectNotFoundException (android.support.test.uiautomator.UiObjectNotFoundException)7 DownloadManager (android.app.DownloadManager)5 Request (android.app.DownloadManager.Request)5 Bundle (android.os.Bundle)5 Suppress (android.test.suitebuilder.annotation.Suppress)5 NumberFormat (java.text.NumberFormat)5 Test (org.junit.Test)3 MediumTest (android.support.test.filters.MediumTest)2 UiDevice (android.support.test.uiautomator.UiDevice)2 RelativeLayout (android.widget.RelativeLayout)1