use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.
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 AOSPA.
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 android_frameworks_base by AOSPA.
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 AOSPA.
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 android_frameworks_base by AOSPA.
the class BugreportReceiverTest method waitForScreenshotButtonEnabled.
private UiObject waitForScreenshotButtonEnabled(boolean expectedEnabled) throws Exception {
UiObject screenshotButton = getScreenshotButton();
int maxAttempts = SAFE_SCREENSHOT_DELAY;
int i = 0;
do {
boolean enabled = screenshotButton.isEnabled();
if (enabled == expectedEnabled) {
return screenshotButton;
}
i++;
Log.v(TAG, "Sleeping for 1 second while waiting for screenshot.enable to be " + expectedEnabled + " (attempt " + i + ")");
Thread.sleep(DateUtils.SECOND_IN_MILLIS);
} while (i <= maxAttempts);
fail("screenshot.enable didn't change to " + expectedEnabled + " in " + maxAttempts + "s");
return screenshotButton;
}
Aggregations