use of android.support.test.uiautomator.UiObject2 in project platform_packages_apps_Settings by BlissRoms.
the class ExternalSourcesSettingsTest method findAndVerifySwitchState.
private UiObject2 findAndVerifySwitchState(boolean checked) {
final BySelector switchSelector = By.clazz(Switch.class).res("android:id/switch_widget");
final UiObject2 switchPref = mUiDevice.wait(Until.findObject(switchSelector), START_ACTIVITY_TIMEOUT);
assertNotNull("Switch not shown", switchPref);
assertTrue("Switch in invalid state", switchPref.isChecked() == checked);
return switchPref;
}
use of android.support.test.uiautomator.UiObject2 in project android_packages_apps_Settings by omnirom.
the class WifiTetherSettingsTest method launchWifiTetherActivity.
private void launchWifiTetherActivity() {
mInstrumentation.startActivitySync(mTetherActivityIntent);
onView(withText("Portable Wi‑Fi hotspot")).perform();
UiObject2 item = mDevice.wait(Until.findObject(By.text("Portable Wi‑Fi hotspot")), TIMEOUT);
item.click();
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LifecycleEventHandlingTest method launchDashboard_shouldSeeFooter.
@Test
@Presubmit
public void launchDashboard_shouldSeeFooter() {
new SubSettingLauncher(mContext).setDestination(FeatureFlagsDashboard.class.getName()).setSourceMetricsCategory(Instrumentable.METRICS_CATEGORY_UNKNOWN).addFlags(FLAG_ACTIVITY_NEW_TASK).launch();
final String footerText = "Experimental";
// Scroll to bottom
final UiObject2 view = mDevice.wait(Until.findObject(By.res(mTargetPackage, "main_content")), TIMEOUT);
view.scroll(Direction.DOWN, 100f);
assertThat(mDevice.wait(Until.findObject(By.text(footerText)), TIMEOUT)).isNotNull();
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiTetherSettingsTest method launchWifiTetherActivity.
private void launchWifiTetherActivity() {
mInstrumentation.startActivitySync(mTetherActivityIntent);
onView(withText("Wi‑Fi hotspot")).perform();
UiObject2 item = mDevice.wait(Until.findObject(By.text("Wi‑Fi hotspot")), TIMEOUT);
item.click();
}
use of android.support.test.uiautomator.UiObject2 in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class TestUtils method clickButton.
/**
* Find {@link android.widget.Button} with {@code res} and click it
*/
public static void clickButton(UiDevice uiDevice, String res) {
final UiObject2 button = uiDevice.findObject(By.res(res));
assertWithMessage("Cannot find button with res: " + res).that(button).isNotNull();
button.click();
}
Aggregations