use of android.support.test.uiautomator.UiSelector in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method setPassword.
/**
* Sets a PIN password, 12345, for testing.
*/
private void setPassword() throws Exception {
Intent newPasswordIntent = new Intent(getTargetContext(), ChooseLockGeneric.class).putExtra(LockPatternUtils.PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_NUMERIC).putExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, "12345").addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getInstrumentation().getContext().startActivity(newPasswordIntent);
mDevice.waitForIdle();
// Ignore any interstitial options
UiObject view = new UiObject(new UiSelector().resourceId(mSettingPackage + ":id/encrypt_dont_require_password"));
if (view.waitForExists(TIMEOUT)) {
view.click();
mDevice.waitForIdle();
}
// Set our PIN
view = new UiObject(new UiSelector().resourceId(mSettingPackage + ":id/password_entry"));
assertTrue("password_entry", view.waitForExists(TIMEOUT));
// Enter it twice to confirm
enterTestPin(view);
enterTestPin(view);
mDevice.pressBack();
assertThat(getTargetContext().getSystemService(KeyguardManager.class).isDeviceSecure()).isTrue();
}
use of android.support.test.uiautomator.UiSelector in project android_packages_apps_Settings by omnirom.
the class UserSettingsTest method launchUserSettings.
private void launchUserSettings() throws Exception {
launchSettings();
final UiScrollable settings = new UiScrollable(new UiSelector().packageName(mTargetPackage).scrollable(true));
final String titleUsersAndAccounts = USER_AND_ACCOUNTS;
settings.scrollTextIntoView(titleUsersAndAccounts);
mDevice.findObject(new UiSelector().text(titleUsersAndAccounts)).click();
mDevice.findObject(new UiSelector().text(USERS)).click();
}
use of android.support.test.uiautomator.UiSelector in project android_packages_apps_Settings by omnirom.
the class UserSettingsTest method testAddUsersWhenLockedNotExists.
@Test
public void testAddUsersWhenLockedNotExists() throws Exception {
launchUserSettings();
UiObject addUsersPreference = mDevice.findObject(new UiSelector().text(ADD_USERS_WHEN_LOCKED));
assertFalse(addUsersPreference.exists());
}
use of android.support.test.uiautomator.UiSelector in project android_packages_apps_Settings by SudaMod.
the class UserSettingsTest method testAddUsersWhenLockedNotExists.
@Test
public void testAddUsersWhenLockedNotExists() throws Exception {
launchUserSettings();
UiObject addUsersPreference = mDevice.findObject(new UiSelector().text(ADD_USERS_WHEN_LOCKED));
assertFalse(addUsersPreference.exists());
}
use of android.support.test.uiautomator.UiSelector in project android_packages_apps_Settings by SudaMod.
the class UserSettingsTest method testEmergencyInfoNotExists.
@Test
public void testEmergencyInfoNotExists() throws Exception {
launchUserSettings();
UiObject emergencyInfoPreference = mDevice.findObject(new UiSelector().text(EMERGNENCY_INFO));
assertFalse(emergencyInfoPreference.exists());
}
Aggregations