# restart as root
adb_steps.root_connect_device(serial=serial)()

# turn display on, if turned off
ui_steps.wake_up_device(serial=serial)()

# ensure the device is unlocked
ui_steps.unlock_device(serial=serial, pin=wifi_defaults.wifi['pin'])()

# go to home screen
ui_steps.press_home(serial=serial)()

# get the DUT ip.
#  In case that ip is 192.168.43.1 we need to turn off the hotspot
dut_ip = wifi_utils.get_connection_parameter(parameter="ip_address",
                                             serial=serial)

# turn of the hotspot before start the test
if dut_ip == wifi_defaults.wifi["hotSpot_ip"]:
    # turn off the HotSpot in case that hotspot is on
    wifi_generic_steps.set_hotSpot(serial=serial, hotSpot_state="OFF")()

# make sure there are no saved networks
wifi_generic_steps.clear_saved_networks(serial=serial)()

# make sure there are no p2p connections
wifi_generic_steps.p2p_disconect_all(serial=serial)()

# turn on the airplane mode
wifi_generic_steps.set_airplane_mode(serial=serial, state="ON")()
Esempio n. 2
0
    ddwrt_ap_pass = args["passphrase"]

##### test start #####
adb_steps.connect_device(serial=serial, port=adb_server_port)()

# turn display on, if turned off
ui_steps.wake_up_device(serial=serial)()

# ensure the device is unlocked
ui_steps.unlock_device(serial=serial, pin=wifi_defaults.wifi['pin'])()

# go to home screen
ui_steps.press_home(serial=serial)()

# if not already connected, setup AP and connect DUT to it
wifi_conn_state = wifi_utils.get_connection_parameter("state", serial=serial)

if wifi_conn_state != "CONNECTED/CONNECTED":

    # configure ap
    ap_steps.setup(mode,
                   security,
                   encryption=encryption,
                   wifi_password=ddwrt_ap_pass,
                   new_ssid=ddwrt_ap_name,
                   serial=serial)()

    # make sure there are no saved networks
    wifi_generic_steps.clear_saved_networks(serial=serial)()

    # add the Wi-Fi network
Esempio n. 3
0
    password=ddwrt_ap_pass,
    identity=radius_identity,
    EAP_method=EAP_method,
    phase_2_auth=phase_2_auth,
    user_certificate=user_certificate,
    serial=serial)()

# wait until the device connects to a wifi network
wifi_generic_steps.wait_until_connected(serial=serial)()

# open browser
browser_steps.open_chrome_first_time(serial=serial,
                                     intent=True,
                                     url_to_open='127.0.0.1')()
# create the URLs and expected results to test
ap_ip = wifi_utils.get_connection_parameter(serial=serial, parameter="Gateway")

urls = [
    "http://{0}".format(ap_ip), "http://{0}/About.htm".format(ap_ip),
    "http://{0}".format(ap_ip)
]
titles = ["Info", "About DD-WRT", "Info"]
texts = [
    "System Information", "There are several different distributions",
    "System Information"
]

# navigate the pages
for idx in range(0, len(urls)):
    browser_steps.open_specific_page(url=urls[idx],
                                     url_title=titles[idx],