use of android.support.test.uiautomator.UiObject in project android_frameworks_base by DirtyUnicorns.
the class UiBot method clickOnNotification.
/**
* Opens the system notification and clicks a given notification.
*
* @param text Notificaton's text as displayed by the UI.
*/
public void clickOnNotification(String text) {
UiObject notification = getNotification(text);
click(notification, "bug report notification");
}
use of android.support.test.uiautomator.UiObject in project cw-omnibus by commonsguy.
the class ListTests method openActivity.
private void openActivity() throws UiObjectNotFoundException {
device.pressHome();
UiObject allAppsButton = device.findObject(new UiSelector().description("Apps"));
allAppsButton.clickAndWaitForNewWindow();
UiObject appsTab = device.findObject(new UiSelector().text("Apps"));
appsTab.click();
UiScrollable appViews = new UiScrollable(new UiSelector().scrollable(true));
appViews.setAsHorizontalList();
UiObject ourApp = appViews.getChildByText(new UiSelector().className("android.widget.TextView"), "Action Bar Fragment Demo");
ourApp.clickAndWaitForNewWindow();
UiObject appValidation = device.findObject(new UiSelector().packageName("com.commonsware.android.abf"));
Assert.assertTrue("Could not open test app", appValidation.exists());
}
use of android.support.test.uiautomator.UiObject in project android by owncloud.
the class InitialTest method clickByDescription.
/**
* Helper to click on objects that match the content-description text
*
* @param text
* @throws UiObjectNotFoundException
*/
private void clickByDescription(String text) throws UiObjectNotFoundException {
UiObject obj = new UiObject(new UiSelector().description(text));
obj.clickAndWaitForNewWindow();
}
use of android.support.test.uiautomator.UiObject in project android by owncloud.
the class InitialTest method clickByText.
/**
* Helper to click on object that match the text value
*
* @param text
* @throws UiObjectNotFoundException
*/
private void clickByText(String text) throws UiObjectNotFoundException {
UiObject obj = new UiObject(new UiSelector().text(text));
obj.clickAndWaitForNewWindow();
}
use of android.support.test.uiautomator.UiObject in project platform_frameworks_base by android.
the class FilesActivityUiTest method testDownload_RetryUnsuccessful.
@Suppress
public void testDownload_RetryUnsuccessful() throws Exception {
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
// This downloads fails! But it'll still show up.
dm.enqueue(new Request(Uri.parse("http://www.google.com/hamfancy")));
bots.roots.openRoot("Downloads");
UiObject doc = bots.directory.findDocument("Unsuccessful");
doc.waitForExists(TIMEOUT);
int toolType = Configurator.getInstance().getToolType();
Configurator.getInstance().setToolType(MotionEvent.TOOL_TYPE_FINGER);
doc.click();
Configurator.getInstance().setToolType(toolType);
assertTrue(bots.main.findDownloadRetryDialog().exists());
// to clear the dialog.
device.pressBack();
}
Aggregations