Search in sources :

Example 41 with UiObject

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

the class DirectoryListBot method openDocument.

public void openDocument(String label) throws UiObjectNotFoundException {
    int toolType = Configurator.getInstance().getToolType();
    Configurator.getInstance().setToolType(MotionEvent.TOOL_TYPE_FINGER);
    UiObject doc = findDocument(label);
    doc.click();
    Configurator.getInstance().setToolType(toolType);
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 42 with UiObject

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

the class UiBot method openSearchView.

public void openSearchView() throws UiObjectNotFoundException {
    UiObject searchView = findSearchView();
    searchView.click();
    assertTrue(searchView.exists());
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 43 with UiObject

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

the class UiBot method openOverflowMenu.

public UiObject openOverflowMenu() throws UiObjectNotFoundException {
    UiObject obj = findMenuMoreOptions();
    obj.click();
    mDevice.waitForIdle(mTimeout);
    return obj;
}
Also used : UiObject(android.support.test.uiautomator.UiObject)

Example 44 with UiObject

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

the class FilesActivityUiTest method testDownload_RetryUnsuccessful.

@Suppress
public void testDownload_RetryUnsuccessful() throws Exception {
    DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
    // This downloads fails! But it'll still show up.
    dm.enqueue(new Request(Uri.parse("http://www.google.com/hamfancy")));
    bots.roots.openRoot("Downloads");
    UiObject doc = bots.directory.findDocument("Unsuccessful");
    doc.waitForExists(TIMEOUT);
    int toolType = Configurator.getInstance().getToolType();
    Configurator.getInstance().setToolType(MotionEvent.TOOL_TYPE_FINGER);
    doc.click();
    Configurator.getInstance().setToolType(toolType);
    assertTrue(bots.main.findDownloadRetryDialog().exists());
    // to clear the dialog.
    device.pressBack();
}
Also used : UiObject(android.support.test.uiautomator.UiObject) Request(android.app.DownloadManager.Request) DownloadManager(android.app.DownloadManager) Suppress(android.test.suitebuilder.annotation.Suppress)

Example 45 with UiObject

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

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)

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