use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
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 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"));
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.
the class UiBot method findDialogOkButton.
public UiObject findDialogOkButton() {
UiObject object = findObject("android:id/content", "android:id/button1");
object.waitForExists(mTimeout);
return object;
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.
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 android_frameworks_base by AOSPA.
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)));
}
Aggregations