use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class DirectoryListBot method selectDocument.
public UiObject selectDocument(String label) throws UiObjectNotFoundException {
UiObject doc = findDocument(label);
doc.longClick();
return doc;
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
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());
}
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
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);
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class RootsListBot method findRoot.
private UiObject findRoot(String label) throws UiObjectNotFoundException {
final UiSelector rootsList = new UiSelector().resourceId("com.android.documentsui:id/container_roots").childSelector(new UiSelector().resourceId(ROOTS_LIST_ID));
// We might need to expand drawer if not visible
if (!new UiObject(rootsList).waitForExists(mTimeout)) {
Log.d(TAG, "Failed to find roots list; trying to expand");
final UiSelector hamburger = new UiSelector().resourceId("com.android.documentsui:id/toolbar").childSelector(new UiSelector().className("android.widget.ImageButton").clickable(true));
new UiObject(hamburger).click();
}
// Wait for the first list item to appear
new UiObject(rootsList.childSelector(new UiSelector())).waitForExists(mTimeout);
// Now scroll around to find our item
new UiScrollable(rootsList).scrollIntoView(new UiSelector().text(label));
return new UiObject(rootsList.childSelector(new UiSelector().text(label)));
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class UiBot method openOverflowMenu.
public UiObject openOverflowMenu() throws UiObjectNotFoundException {
UiObject obj = findMenuMoreOptions();
obj.click();
mDevice.waitForIdle(mTimeout);
return obj;
}
Aggregations