use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
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();
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method openSearchView.
public void openSearchView() throws UiObjectNotFoundException {
UiObject searchView = findSearchView();
searchView.click();
assertTrue(searchView.exists());
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
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;
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method assertInActionMode.
public void assertInActionMode(boolean inActionMode) {
UiObject actionModeBar = findActionModeBar();
assertEquals(inActionMode, actionModeBar.exists());
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method findDialogCancelButton.
public UiObject findDialogCancelButton() {
UiObject object = findObject("android:id/content", "android:id/button2");
object.waitForExists(mTimeout);
return object;
}
Aggregations