Search in sources :

Example 36 with UiObject

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

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

use of android.support.test.uiautomator.UiObject in project cw-omnibus by commonsguy.

the class ListTests method testAdd.

@Test
public void testAdd() throws UiObjectNotFoundException {
    UiObject add = device.findObject(new UiSelector().text("Word"));
    add.setText("snicklefritz");
    device.pressEnter();
    UiScrollable words = new UiScrollable(new UiSelector().className("android.widget.ListView"));
    words.setAsVerticalList();
    Assert.assertNotNull("Could not find snicklefritz", words.getChildByText(new UiSelector().className("android.widget.TextView"), "snicklefritz"));
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector) UiScrollable(android.support.test.uiautomator.UiScrollable) Test(org.junit.Test)

Example 38 with UiObject

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

the class UiBot method findDialogOkButton.

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

Example 39 with UiObject

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

the class DirectoryListBot method assertDocumentsCountOnList.

public void assertDocumentsCountOnList(boolean exists, int count) throws UiObjectNotFoundException {
    UiObject docsList = findDocumentsList();
    assertEquals(exists, docsList.exists());
    if (docsList.exists()) {
        assertEquals(count, docsList.getChildCount());
    }
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 40 with UiObject

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

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)

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