use of android.support.test.uiautomator.UiSelector in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureSettingsTest method getDozeSwitch.
private UiObject getDozeSwitch() throws Exception {
UiScrollable settings = navigateToAmbientDisplay();
UiObject dozeSwitch = null;
UiSelector relativeLayoutSelector = new UiSelector().className(RelativeLayout.class.getName());
String titleDoze = mTargetContext.getResources().getString(R.string.doze_title);
for (int i = 0; i <= settings.getChildCount(relativeLayoutSelector); i++) {
UiObject relativeLayout = settings.getChild(relativeLayoutSelector.instance(i));
if (relativeLayout.getChildCount() != 2) {
continue;
}
UiObject obj1 = relativeLayout.getChild(new UiSelector().index(0));
if (obj1.getText() == titleDoze) {
return relativeLayout.getFromParent(new UiSelector().className(Switch.class.getName()));
}
}
return null;
}
use of android.support.test.uiautomator.UiSelector in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureSettingsTest method navigateToAmbientDisplay.
private UiScrollable navigateToAmbientDisplay() throws Exception {
UiScrollable settings = new UiScrollable(new UiSelector().packageName(mTargetPackage).scrollable(true));
String titleDisplay = mTargetContext.getResources().getString(R.string.display_settings_title);
settings.scrollTextIntoView(titleDisplay);
mDevice.findObject(new UiSelector().text(titleDisplay)).click();
settings.scrollTextIntoView(mTargetContext.getResources().getString(R.string.doze_title));
return settings;
}
use of android.support.test.uiautomator.UiSelector in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureSettingsTest method testGestureSettingsExists.
@Test
public void testGestureSettingsExists() throws Exception {
launchMoves();
UiObject titleObj = mDevice.findObject(new UiSelector().text(mTargetContext.getResources().getString(R.string.gesture_preference_title)));
assertNotNull(titleObj);
assertTrue(titleObj.exists());
}
use of android.support.test.uiautomator.UiSelector in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GestureSettingsTest method navigateToMovesSetting.
private void navigateToMovesSetting(String title) throws Exception {
launchMoves();
UiScrollable moves = new UiScrollable(new UiSelector().packageName(mTargetPackage).scrollable(true));
moves.scrollTextIntoView(title);
}
use of android.support.test.uiautomator.UiSelector in project android_frameworks_base by ResurrectionRemix.
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;
}
Aggregations