Search in sources :

Example 1 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 2 with UiObject

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

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

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

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

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

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

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

the class DirectoryListBot method assertDocumentsCount.

public void assertDocumentsCount(int count) throws UiObjectNotFoundException {
    UiObject docsList = findDocumentsList();
    assertEquals(count, docsList.getChildCount());
}
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