use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
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)));
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class DirectoryListBot method assertMessageTextView.
public void assertMessageTextView(String message) throws UiObjectNotFoundException {
UiObject messageTextView = findMessageTextView();
assertTrue(messageTextView.exists());
String msg = String.valueOf(message);
assertEquals(String.format(msg, "TEST_ROOT_0"), messageTextView.getText());
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class UiBot method findDialogCancelButton.
public UiObject findDialogCancelButton() {
UiObject object = findObject("android:id/content", "android:id/button2");
object.waitForExists(mTimeout);
return object;
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
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());
}
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class BugreportReceiverTest method takeScreenshot.
/**
* Takes a screenshot using the system notification.
*/
private void takeScreenshot() throws Exception {
UiObject screenshotButton = getScreenshotButton();
mUiBot.click(screenshotButton, "screenshot_button");
}
Aggregations