use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.
the class UiBot method getVisibleObjectById.
/**
* Gets an object which is guaranteed to be present in the current UI.
*
* @param text Object's text as displayed by the UI.
*/
public UiObject getVisibleObjectById(String id) {
UiObject uiObject = mDevice.findObject(new UiSelector().resourceId(id));
assertTrue("could not find object with id '" + id + "'", uiObject.exists());
return uiObject;
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by AOSPA.
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");
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class BugreportReceiverTest method testProgress_cancel.
public void testProgress_cancel() throws Exception {
resetProperties();
sendBugreportStarted(1000);
waitForScreenshotButtonEnabled(true);
final NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits(2);
nf.setMaximumFractionDigits(2);
assertProgressNotification(NAME, 00.00f);
openProgressNotification(ID);
UiObject cancelButton = mUiBot.getVisibleObject(mContext.getString(com.android.internal.R.string.cancel).toUpperCase());
mUiBot.click(cancelButton, "cancel_button");
waitForService(false);
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method clickJustOnce.
private void clickJustOnce() {
boolean gotIt = mDevice.wait(Until.hasObject(By.res("android", "button_once")), mTimeout);
assertTrue("'Just Once' button not visible yet", gotIt);
UiObject justOnce = mDevice.findObject(new UiSelector().resourceId("android:id/button_once"));
assertTrue("'Just Once' button not found", justOnce.exists());
click(justOnce, "Just Once");
}
use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method getVisibleObjectById.
/**
* Gets an object which is guaranteed to be present in the current UI.
*
* @param text Object's text as displayed by the UI.
*/
public UiObject getVisibleObjectById(String id) {
UiObject uiObject = mDevice.findObject(new UiSelector().resourceId(id));
assertTrue("could not find object with id '" + id + "'", uiObject.exists());
return uiObject;
}
Aggregations