Search in sources :

Example 6 with UiObject

use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.

the class DirectoryListBot method findDocument.

public UiObject findDocument(String label) throws UiObjectNotFoundException {
    final UiSelector docList = new UiSelector().resourceId("com.android.documentsui:id/container_directory").childSelector(new UiSelector().resourceId(DIR_LIST_ID));
    // Wait for the first list item to appear
    new UiObject(docList.childSelector(new UiSelector())).waitForExists(mTimeout);
    // new UiScrollable(docList).scrollIntoView(new UiSelector().text(label));
    return mDevice.findObject(docList.childSelector(new UiSelector().text(label)));
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector)

Example 7 with UiObject

use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.

the class DirectoryListBot method assertMessageTextView.

public void assertMessageTextView(String message) throws UiObjectNotFoundException {
    UiObject messageTextView = findMessageTextView();
    assertTrue(messageTextView.exists());
    String msg = String.valueOf(message);
    assertEquals(String.format(msg, "TEST_ROOT_0"), messageTextView.getText());
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 8 with UiObject

use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.

the class UiBot method findDialogCancelButton.

public UiObject findDialogCancelButton() {
    UiObject object = findObject("android:id/content", "android:id/button2");
    object.waitForExists(mTimeout);
    return object;
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 9 with UiObject

use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.

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 10 with UiObject

use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.

the class BugreportReceiverTest method takeScreenshot.

/**
     * Takes a screenshot using the system notification.
     */
private void takeScreenshot() throws Exception {
    UiObject screenshotButton = getScreenshotButton();
    mUiBot.click(screenshotButton, "screenshot_button");
}
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