Search in sources :

Example 36 with BySelector

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"));
}
Also used : BySelector(android.support.test.uiautomator.BySelector) Suppress(android.test.suitebuilder.annotation.Suppress) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Example 37 with BySelector

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"));
}
Also used : BySelector(android.support.test.uiautomator.BySelector) Suppress(android.test.suitebuilder.annotation.Suppress) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

BySelector (android.support.test.uiautomator.BySelector)37 UiObject2 (android.support.test.uiautomator.UiObject2)18 MediumTest (android.test.suitebuilder.annotation.MediumTest)10 Suppress (android.test.suitebuilder.annotation.Suppress)8 ListView (android.widget.ListView)8 Test (org.junit.Test)8 Switch (android.widget.Switch)7 LargeTest (android.support.test.filters.LargeTest)6 UiSelector (android.support.test.uiautomator.UiSelector)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)1