use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationSettingsTests method testNotificationsSettingsListForPhone.
@MediumTest
public void testNotificationsSettingsListForPhone() {
UiObject2 configureNotifications = mDevice.wait(Until.findObject(By.text("Notifications")), TIMEOUT);
configureNotifications.click();
mDevice.wait(Until.findObject(By.text("Blink light")), TIMEOUT);
UiObject2 appNotifications = mDevice.wait(Until.findObject(By.text("On for all apps")), TIMEOUT);
appNotifications.click();
UiObject2 view = mDevice.wait(Until.findObject(By.text("All apps")), TIMEOUT);
assertNotNull("Could not find Settings > Apps screen", view);
final BySelector preferenceListSelector = By.clazz(ListView.class).res("android:id/list");
UiObject2 apps = mDevice.wait(Until.findObject(preferenceListSelector), TIMEOUT);
UiObject2 phone = scrollTo(mDevice, apps, By.text("Phone"), Direction.DOWN);
assertNotNull("Could not find Phone notification settings", phone);
phone.click();
UiObject2 incomingCalls = mDevice.wait(Until.findObject(By.text("Incoming calls")), TIMEOUT);
assertNotNull("Could not find incoming calls channel", incomingCalls);
incomingCalls.click();
// here's the meat of this test: make sure that you cannot change
// most settings for this channel
UiObject2 importance = mDevice.wait(Until.findObject(By.text("Importance")), TIMEOUT);
assertNotNull("Could not find importance toggle", importance);
assertFalse(importance.isEnabled());
assertFalse(mDevice.wait(Until.findObject(By.text("Sound")), TIMEOUT).isEnabled());
;
assertFalse(mDevice.wait(Until.findObject(By.text("Vibrate")), TIMEOUT).isEnabled());
assertFalse(mDevice.wait(Until.findObject(By.text("Override Do Not Disturb")), TIMEOUT).isEnabled());
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationSettingsTests method testNotificationsSettingsListForCalculator.
@MediumTest
public void testNotificationsSettingsListForCalculator() {
UiObject2 configureNotifications = mDevice.wait(Until.findObject(By.text("Notifications")), TIMEOUT);
configureNotifications.click();
mDevice.wait(Until.findObject(By.text("Blink light")), TIMEOUT);
UiObject2 appNotifications = mDevice.wait(Until.findObject(By.text("On for all apps")), TIMEOUT);
appNotifications.click();
UiObject2 view = mDevice.wait(Until.findObject(By.text("All apps")), TIMEOUT);
assertNotNull("Could not find Settings > Apps screen", view);
UiObject2 app = mDevice.wait(Until.findObject(By.text("Calculator")), TIMEOUT);
assertNotNull("Could not find Calculator notification settings", app);
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class NotificationSettingsTests method launchAppsSettings.
private void launchAppsSettings() throws Exception {
Intent appsSettingsIntent = new Intent(Settings.ACTION_SETTINGS);
mActivityHelper.launchIntent(appsSettingsIntent);
mSettingsHelper.flingSettingsToStart();
UiObject2 view = mDevice.wait(Until.findObject(By.text("Apps & notifications")), TIMEOUT);
view.click();
UiObject2 title = mDevice.wait(Until.findObject(By.text("Apps & notifications")), TIMEOUT);
assertNotNull("Could not find Settings > Apps & notifications screen", title);
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SyncSettingsTest method syncPageShouldHaveAddAccountButton.
@Test
public void syncPageShouldHaveAddAccountButton() throws Exception {
// Launch Settings
SettingsHelper.launchSettingsPage(InstrumentationRegistry.getContext(), Settings.ACTION_SYNC_SETTINGS);
UiObject2 addAccount = mDevice.wait(Until.findObject(By.text("Add account")), TIMEOUT);
assertTrue(addAccount != null);
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZonePickerSettingsTest method zonePickerDisabled.
@Test
public void zonePickerDisabled() throws Exception {
mHelper.setIntSetting(SettingsType.GLOBAL, Settings.Global.AUTO_TIME_ZONE, 1);
SettingsHelper.launchSettingsPage(InstrumentationRegistry.getContext(), Settings.ACTION_DATE_SETTINGS);
UiObject2 selectTimeZone = wait(SELECTOR_SELECT_TIME_ZONE);
assertFalse(selectTimeZone.isEnabled());
}
Aggregations