use of android.support.test.uiautomator.BySelector in project android_packages_apps_Settings by omnirom.
the class MoreWirelessSettingsTest2 method testAddNetworkMenu_Proxy.
@Suppress
@MediumTest
public void testAddNetworkMenu_Proxy() throws Exception {
loadAddNetworkMenu();
// Toggle advanced options.
mDevice.wait(Until.findObject(By.res(SETTINGS_PACKAGE, ADD_NETWORK_MENU_ADV_TOGGLE_RES_ID).clazz(CHECKBOX_CLASS)), TIMEOUT).click();
// Verify Proxy defaults to None.
BySelector proxySettingsBySelector = By.res(SETTINGS_PACKAGE, ADD_NETWORK_MENU_PROXY_SETTINGS_RES_ID).clazz(SPINNER_CLASS);
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, proxySettingsBySelector);
assertEquals("None", mDevice.wait(Until.findObject(proxySettingsBySelector), TIMEOUT).getChildren().get(0).getText());
// Verify that Proxy Manual fields appear.
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, proxySettingsBySelector);
mDevice.wait(Until.findObject(proxySettingsBySelector), TIMEOUT).click();
mDevice.wait(Until.findObject(By.text("Manual")), TIMEOUT).click();
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "proxy_warning_limited_support"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "proxy_hostname"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "proxy_exclusionlist"));
// Verify that Proxy Auto-Config options appear.
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, proxySettingsBySelector);
mDevice.wait(Until.findObject(proxySettingsBySelector), TIMEOUT).click();
mDevice.wait(Until.findObject(By.text("Proxy Auto-Config")), TIMEOUT).click();
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "proxy_pac"));
}
use of android.support.test.uiautomator.BySelector in project android_packages_apps_Settings by omnirom.
the class MoreWirelessSettingsTest2 method testAddNetworkMenu_IpSettings.
@Suppress
@MediumTest
public void testAddNetworkMenu_IpSettings() throws Exception {
loadAddNetworkMenu();
// Toggle advanced options.
mDevice.wait(Until.findObject(By.res(SETTINGS_PACKAGE, ADD_NETWORK_MENU_ADV_TOGGLE_RES_ID).clazz(CHECKBOX_CLASS)), TIMEOUT).click();
// Verify IP settings defaults to DHCP.
BySelector ipSettingsBySelector = By.res(SETTINGS_PACKAGE, ADD_NETWORK_MENU_IP_SETTINGS_RES_ID).clazz(SPINNER_CLASS);
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, ipSettingsBySelector);
assertEquals("DHCP", mDevice.wait(Until.findObject(ipSettingsBySelector), TIMEOUT).getChildren().get(0).getText());
// Verify that Static IP settings options appear.
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, ipSettingsBySelector).click();
mDevice.wait(Until.findObject(By.text("Static")), TIMEOUT).click();
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "ipaddress"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "gateway"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "network_prefix_length"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "dns1"));
findOrScrollToObject(ADD_NETWORK_MENU_SCROLLABLE_BY_SELECTOR, By.res(SETTINGS_PACKAGE, "dns2"));
}
Aggregations