1#!/usr/bin/env python3.4 2# 3# Copyright 2017 - The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import itertools 18import time 19 20from acts_contrib.test_utils.net import ui_utils as uutils 21import acts_contrib.test_utils.wifi.wifi_test_utils as wutils 22from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest 23 24import WifiManagerTest 25from acts import asserts 26from acts import signals 27from acts.test_decorators import test_tracker_info 28from acts_contrib.test_utils.tel.tel_test_utils import get_operator_name 29from acts.utils import force_airplane_mode 30 31WifiEnums = wutils.WifiEnums 32 33DEFAULT_TIMEOUT = 15 34OSU_TEST_TIMEOUT = 300 35 36# Constants for providers. 37GLOBAL_RE = 0 38OSU_BOINGO = 0 39BOINGO = 1 40ATT = 2 41 42# Constants used for various device operations. 43RESET = 1 44TOGGLE = 2 45 46UNKNOWN_FQDN = "@#@@!00fffffx" 47 48# Constants for Boingo UI automator 49EDIT_TEXT_CLASS_NAME = "android.widget.EditText" 50PASSWORD_TEXT = "Password" 51PASSPOINT_BUTTON = "Get Passpoint" 52BOINGO_UI_TEXT = "Online Sign Up" 53 54 55class WifiPasspointTest(WifiBaseTest): 56 """Tests for APIs in Android's WifiManager class. 57 58 Test Bed Requirement: 59 * One Android device 60 * Several Wi-Fi networks visible to the device, including an open Wi-Fi 61 network. 62 """ 63 64 def setup_class(self): 65 super().setup_class() 66 self.dut = self.android_devices[0] 67 wutils.wifi_test_device_init(self.dut) 68 req_params = [ 69 "passpoint_networks", 70 "boingo_username", 71 "boingo_password", 72 ] 73 self.unpack_userparams(req_param_names=req_params, ) 74 asserts.assert_true( 75 len(self.passpoint_networks) > 0, 76 "Need at least one Passpoint network.") 77 wutils.wifi_toggle_state(self.dut, True) 78 self.unknown_fqdn = UNKNOWN_FQDN 79 80 def setup_test(self): 81 super().setup_test() 82 self.dut.droid.wakeLockAcquireBright() 83 self.dut.droid.wakeUpNow() 84 self.dut.unlock_screen() 85 self.dut.adb.shell("input keyevent KEYCODE_HOME") 86 87 def teardown_test(self): 88 super().teardown_test() 89 self.dut.droid.wakeLockRelease() 90 self.dut.droid.goToSleepNow() 91 passpoint_configs = self.dut.droid.getPasspointConfigs() 92 for config in passpoint_configs: 93 wutils.delete_passpoint(self.dut, config) 94 wutils.reset_wifi(self.dut) 95 96 """Helper Functions""" 97 98 def install_passpoint_profile(self, passpoint_config): 99 """Install the Passpoint network Profile. 100 101 Args: 102 passpoint_config: A JSON dict of the Passpoint configuration. 103 104 """ 105 asserts.assert_true( 106 WifiEnums.SSID_KEY in passpoint_config, 107 "Key '%s' must be present in network definition." % 108 WifiEnums.SSID_KEY) 109 # Install the Passpoint profile. 110 self.dut.droid.addUpdatePasspointConfig(passpoint_config) 111 112 def check_passpoint_connection(self, passpoint_network): 113 """Verify the device is automatically able to connect to the Passpoint 114 network. 115 116 Args: 117 passpoint_network: SSID of the Passpoint network. 118 119 """ 120 ad = self.dut 121 ad.ed.clear_all_events() 122 try: 123 wutils.start_wifi_connection_scan_and_return_status(ad) 124 wutils.wait_for_connect(ad) 125 except: 126 pass 127 # Re-verify we are connected to the correct network. 128 network_info = self.dut.droid.wifiGetConnectionInfo() 129 self.log.info("Network Info: %s" % network_info) 130 if not network_info or not network_info[WifiEnums.SSID_KEY] or \ 131 network_info[WifiEnums.SSID_KEY] not in passpoint_network: 132 raise signals.TestFailure( 133 "Device did not connect to passpoint network.") 134 135 def get_configured_passpoint_and_delete(self): 136 """Get configured Passpoint network and delete using its FQDN.""" 137 passpoint_config = self.dut.droid.getPasspointConfigs() 138 if not len(passpoint_config): 139 raise signals.TestFailure("Failed to fetch the list of configured" 140 "passpoint networks.") 141 if not wutils.delete_passpoint(self.dut, passpoint_config[0]): 142 raise signals.TestFailure( 143 "Failed to delete Passpoint configuration" 144 " with FQDN = %s" % passpoint_config[0]) 145 146 def ui_automator_boingo(self): 147 """Run UI automator for boingo passpoint.""" 148 # Verify the boingo login page shows 149 asserts.assert_true(uutils.has_element(self.dut, text=BOINGO_UI_TEXT), 150 "Failed to launch boingohotspot login page") 151 152 # Go to the bottom of the page 153 for _ in range(3): 154 self.dut.adb.shell("input swipe 300 900 300 300") 155 156 # Enter username & password 157 screen_dump = uutils.get_screen_dump_xml(self.dut) 158 nodes = screen_dump.getElementsByTagName("node") 159 index = 0 160 for node in nodes: 161 if uutils.match_node(node, class_name="android.widget.EditText"): 162 x, y = eval(node.attributes["bounds"].value.split("][")[0][1:]) 163 self.dut.adb.shell("input tap %s %s" % (x, y)) 164 if index == 0: 165 self.dut.adb.shell("input text %s" % self.boingo_username) 166 index += 1 167 else: 168 self.dut.adb.shell("input text %s" % self.boingo_password) 169 break 170 self.dut.adb.shell("input keyevent 111") 171 self.dut.adb.shell("input keyevent 111") # collapse keyboard 172 self.dut.adb.shell( 173 "input swipe 300 900 300 750") # swipe up to show text 174 175 # Login 176 uutils.wait_and_click(self.dut, text=PASSPOINT_BUTTON) 177 time.sleep(DEFAULT_TIMEOUT) 178 179 def start_subscription_provisioning(self, state): 180 """Start subscription provisioning with a default provider.""" 181 182 self.unpack_userparams(('osu_configs', )) 183 asserts.assert_true( 184 len(self.osu_configs) > 0, "Need at least one osu config.") 185 osu_config = self.osu_configs[OSU_BOINGO] 186 # Clear all previous events. 187 self.dut.ed.clear_all_events() 188 self.dut.droid.startSubscriptionProvisioning(osu_config) 189 start_time = time.time() 190 while time.time() < start_time + OSU_TEST_TIMEOUT: 191 dut_event = self.dut.ed.pop_event("onProvisioningCallback", 192 DEFAULT_TIMEOUT * 18) 193 if dut_event['data']['tag'] == 'success': 194 self.log.info("Passpoint Provisioning Success") 195 # Reset WiFi after provisioning success. 196 if state == RESET: 197 wutils.reset_wifi(self.dut) 198 time.sleep(DEFAULT_TIMEOUT) 199 # Toggle WiFi after provisioning success. 200 elif state == TOGGLE: 201 wutils.toggle_wifi_off_and_on(self.dut) 202 time.sleep(DEFAULT_TIMEOUT) 203 break 204 if dut_event['data']['tag'] == 'failure': 205 raise signals.TestFailure( 206 "Passpoint Provisioning is failed with %s" % 207 dut_event['data']['reason']) 208 break 209 if dut_event['data']['tag'] == 'status': 210 self.log.info("Passpoint Provisioning status %s" % 211 dut_event['data']['status']) 212 if int(dut_event['data']['status']) == 7: 213 time.sleep(DEFAULT_TIMEOUT) 214 self.ui_automator_boingo() 215 # Clear all previous events. 216 self.dut.ed.clear_all_events() 217 218 # Verify device connects to the Passpoint network. 219 time.sleep(DEFAULT_TIMEOUT) 220 current_passpoint = self.dut.droid.wifiGetConnectionInfo() 221 if current_passpoint[ 222 WifiEnums.SSID_KEY] not in osu_config["expected_ssids"]: 223 raise signals.TestFailure("Device did not connect to the %s" 224 " passpoint network" % 225 osu_config["expected_ssids"]) 226 # Delete the Passpoint profile. 227 self.get_configured_passpoint_and_delete() 228 wutils.wait_for_disconnect(self.dut, timeout=15) 229 230 def start_subscription_provisioning_OSU_websie(self): 231 """Start subscription provisioning with a default websider.""" 232 233 self.unpack_userparams(('osu_configs', )) 234 asserts.assert_true( 235 len(self.osu_configs) > 0, "Need at least one osu config.") 236 osu_config = self.osu_configs[OSU_BOINGO] 237 # Clear all previous events. 238 self.dut.ed.clear_all_events() 239 self.dut.droid.startSubscriptionProvisioning(osu_config) 240 start_time = time.time() 241 while time.time() < start_time + OSU_TEST_TIMEOUT: 242 dut_event = self.dut.ed.pop_event("onProvisioningCallback", 243 DEFAULT_TIMEOUT * 18) 244 if dut_event['data']['tag'] == 'success': 245 self.log.info("Passpoint Provisioning Success") 246 # Reset WiFi after provisioning success. 247 if dut_event['data']['tag'] == 'failure': 248 raise signals.TestFailure( 249 "Passpoint Provisioning is failed with %s" % 250 dut_event['data']['reason']) 251 break 252 if dut_event['data']['tag'] == 'status': 253 self.log.info("Passpoint Provisioning status %s" % 254 dut_event['data']['status']) 255 if int(dut_event['data']['status']) == 7: 256 time.sleep(DEFAULT_TIMEOUT) 257 asserts.assert_true( 258 uutils.has_element(self.dut, text=BOINGO_UI_TEXT), 259 "Failed to launch boingohotspot login page") 260 break 261 # Clear all previous events. 262 self.dut.ed.clear_all_events() 263 264 """Tests""" 265 266 @test_tracker_info(uuid="b0bc0153-77bb-4594-8f19-cea2c6bd2f43") 267 def test_add_passpoint_network(self): 268 """Add a Passpoint network and verify device connects to it. 269 270 Steps: 271 1. Install a Passpoint Profile. 272 2. Verify the device connects to the required Passpoint SSID. 273 3. Get the Passpoint configuration added above. 274 4. Delete Passpoint configuration using its FQDN. 275 5. Verify that we are disconnected from the Passpoint network. 276 277 """ 278 passpoint_config = self.passpoint_networks[BOINGO] 279 self.install_passpoint_profile(passpoint_config) 280 ssid = passpoint_config[WifiEnums.SSID_KEY] 281 self.check_passpoint_connection(ssid) 282 self.get_configured_passpoint_and_delete() 283 wutils.wait_for_disconnect(self.dut) 284 285 @test_tracker_info(uuid="eb29d6e2-a755-4c9c-9e4e-63ea2277a64a") 286 def test_update_passpoint_network(self): 287 """Update a previous Passpoint network and verify device still connects 288 to it. 289 290 1. Install a Passpoint Profile. 291 2. Verify the device connects to the required Passpoint SSID. 292 3. Update the Passpoint Profile. 293 4. Verify device is still connected to the Passpoint SSID. 294 5. Get the Passpoint configuration added above. 295 6. Delete Passpoint configuration using its FQDN. 296 297 """ 298 passpoint_config = self.passpoint_networks[BOINGO] 299 self.install_passpoint_profile(passpoint_config) 300 ssid = passpoint_config[WifiEnums.SSID_KEY] 301 self.check_passpoint_connection(ssid) 302 303 # Update passpoint configuration using the original profile because we 304 # do not have real profile with updated credentials to use. 305 self.install_passpoint_profile(passpoint_config) 306 307 # Wait for a Disconnect event from the supplicant. 308 wutils.wait_for_disconnect(self.dut) 309 310 # Now check if we are again connected with the updated profile. 311 self.check_passpoint_connection(ssid) 312 313 self.get_configured_passpoint_and_delete() 314 wutils.wait_for_disconnect(self.dut) 315 316 @test_tracker_info(uuid="b6e8068d-faa1-49f2-b421-c60defaed5f0") 317 def test_add_delete_list_of_passpoint_network(self): 318 """Add multiple passpoint networks, list them and delete one by one. 319 320 1. Install Passpoint Profile A. 321 2. Install Passpoint Profile B. 322 3. Get all the Passpoint configurations added above and verify. 323 6. Ensure all Passpoint configurations can be deleted. 324 325 """ 326 for passpoint_config in self.passpoint_networks[:2]: 327 self.install_passpoint_profile(passpoint_config) 328 time.sleep(DEFAULT_TIMEOUT) 329 configs = self.dut.droid.getPasspointConfigs() 330 # It is length -1 because ATT profile will be handled separately 331 if not len(configs) or len(configs) != len( 332 self.passpoint_networks[:2]): 333 raise signals.TestFailure("Failed to fetch some or all of the" 334 " configured passpoint networks.") 335 for config in configs: 336 if not wutils.delete_passpoint(self.dut, config): 337 raise signals.TestFailure("Failed to delete Passpoint" 338 " configuration with FQDN = %s" % 339 config) 340 341 @test_tracker_info(uuid="a53251be-7aaf-41fc-a5f3-63984269d224") 342 def test_delete_unknown_fqdn(self): 343 """Negative test to delete Passpoint profile using an unknown FQDN. 344 345 1. Pass an unknown FQDN for removal. 346 2. Verify that it was not successful. 347 348 """ 349 if wutils.delete_passpoint(self.dut, self.unknown_fqdn): 350 raise signals.TestFailure("Failed because an unknown FQDN" 351 " was successfully deleted.") 352 353 @test_tracker_info(uuid="ac71344f-e5d9-4e70-b15d-8ce24a4b3744") 354 def test_global_reach_passpoint(self): 355 """Test connection to global reach passpoint. 356 357 Steps: 358 1. Install global reach passpoint profile. 359 2. Verify connection to the global reach wifi network. 360 3. Delete passpoint and verify device disconnects. 361 """ 362 passpoint_config = self.passpoint_networks[GLOBAL_RE] 363 self.install_passpoint_profile(passpoint_config) 364 ssid = passpoint_config[WifiEnums.SSID_KEY] 365 self.check_passpoint_connection(ssid) 366 self.get_configured_passpoint_and_delete() 367 wutils.wait_for_disconnect(self.dut) 368 369 @test_tracker_info(uuid="bf03c03a-e649-4e2b-a557-1f791bd98951") 370 def test_passpoint_failover(self): 371 """Add a pair of passpoint networks and test failover when one of the" 372 profiles is removed. 373 374 1. Install a Passpoint Profile A and B. 375 2. Verify device connects to a Passpoint network and get SSID. 376 3. Delete the current Passpoint profile using its FQDN. 377 4. Verify device fails over and connects to the other Passpoint SSID. 378 5. Delete Passpoint configuration using its FQDN. 379 380 """ 381 # Install both Passpoint profiles on the device. 382 passpoint_ssid = list() 383 for passpoint_config in self.passpoint_networks[:2]: 384 passpoint_ssid.extend(passpoint_config[WifiEnums.SSID_KEY]) 385 self.install_passpoint_profile(passpoint_config) 386 time.sleep(DEFAULT_TIMEOUT) 387 388 # Get the current network and the failover network. 389 wutils.wait_for_connect(self.dut) 390 current_passpoint = self.dut.droid.wifiGetConnectionInfo() 391 current_ssid = current_passpoint[WifiEnums.SSID_KEY] 392 if current_ssid not in passpoint_ssid: 393 raise signals.TestFailure("Device did not connect to any of the " 394 "configured Passpoint networks." 395 "current: {}, expected: {}".format( 396 current_ssid, passpoint_ssid)) 397 398 expected_ssid = self.passpoint_networks[0][WifiEnums.SSID_KEY] 399 if current_ssid in expected_ssid: 400 expected_ssid = self.passpoint_networks[1][WifiEnums.SSID_KEY] 401 402 # Remove the current Passpoint profile. 403 for network in self.passpoint_networks[:2]: 404 if current_ssid in network[WifiEnums.SSID_KEY]: 405 if not wutils.delete_passpoint(self.dut, network["fqdn"]): 406 raise signals.TestFailure("Failed to delete Passpoint" 407 " configuration with FQDN = %s" % 408 network["fqdn"]) 409 # Verify device fails over and connects to the other passpoint network. 410 time.sleep(DEFAULT_TIMEOUT) 411 412 current_passpoint = self.dut.droid.wifiGetConnectionInfo() 413 if current_passpoint[WifiEnums.SSID_KEY] not in expected_ssid: 414 raise signals.TestFailure("Device did not failover to the %s" 415 " passpoint network" % expected_ssid) 416 417 # Delete the remaining Passpoint profile. 418 self.get_configured_passpoint_and_delete() 419 wutils.wait_for_disconnect(self.dut) 420 421 @test_tracker_info(uuid="37ae0223-0cb7-43f3-8ba8-474fad6e4b71") 422 def test_install_att_passpoint_profile(self): 423 """Add an AT&T Passpoint profile. 424 425 It is used for only installing the profile for other tests. 426 """ 427 isFound = False 428 for passpoint_config in self.passpoint_networks: 429 if 'att' in passpoint_config['fqdn']: 430 isFound = True 431 self.install_passpoint_profile(passpoint_config) 432 break 433 if not isFound: 434 raise signals.TestFailure("cannot find ATT profile.") 435 436 @test_tracker_info(uuid="e3e826d2-7c39-4c37-ab3f-81992d5aa0e8") 437 def test_att_passpoint_network(self): 438 """Add a AT&T Passpoint network and verify device connects to it. 439 440 Steps: 441 1. Install a AT&T Passpoint Profile. 442 2. Verify the device connects to the required Passpoint SSID. 443 3. Get the Passpoint configuration added above. 444 4. Delete Passpoint configuration using its FQDN. 445 5. Verify that we are disconnected from the Passpoint network. 446 447 """ 448 carriers = ["att"] 449 operator = get_operator_name(self.log, self.dut) 450 if operator not in carriers: 451 self.log.warn("Device %s does not have a ATT sim" % self.dut.model) 452 453 passpoint_config = self.passpoint_networks[ATT] 454 self.install_passpoint_profile(passpoint_config) 455 ssid = passpoint_config[WifiEnums.SSID_KEY] 456 self.check_passpoint_connection(ssid) 457 self.get_configured_passpoint_and_delete() 458 wutils.wait_for_disconnect(self.dut) 459 460 @test_tracker_info(uuid="c85c81b2-7133-4635-8328-9498169ae802") 461 def test_start_subscription_provisioning(self): 462 self.start_subscription_provisioning(0) 463 464 @test_tracker_info(uuid="fd09a643-0d4b-45a9-881a-a771f9707ab1") 465 def test_start_subscription_provisioning_and_reset_wifi(self): 466 self.start_subscription_provisioning(RESET) 467 468 @test_tracker_info(uuid="f43ea759-673f-4567-aa11-da3bc2cabf08") 469 def test_start_subscription_provisioning_and_toggle_wifi(self): 470 self.start_subscription_provisioning(TOGGLE) 471 472 @test_tracker_info(uuid="ad6d5eb8-a3c5-4ce0-9e10-d0f201cd0f40") 473 def test_user_override_auto_join_on_passpoint_network(self): 474 """Add a Passpoint network, simulate user change the auto join to false, ensure the device 475 doesn't auto connect to this passponit network 476 477 Steps: 478 1. Install a Passpoint Profile. 479 2. Verify the device connects to the required Passpoint SSID. 480 3. Disable auto join Passpoint configuration using its FQDN. 481 4. disable and enable Wifi toggle, ensure we don't connect back 482 """ 483 passpoint_config = self.passpoint_networks[BOINGO] 484 self.install_passpoint_profile(passpoint_config) 485 ssid = passpoint_config[WifiEnums.SSID_KEY] 486 self.check_passpoint_connection(ssid) 487 self.dut.log.info("Disable auto join on passpoint") 488 self.dut.droid.wifiEnableAutojoinPasspoint(passpoint_config['fqdn'], 489 False) 490 wutils.wifi_toggle_state(self.dut, False) 491 wutils.wifi_toggle_state(self.dut, True) 492 asserts.assert_false( 493 wutils.wait_for_connect(self.dut, ssid, assert_on_fail=False), 494 "Device should not connect.") 495 496 @test_tracker_info(uuid="03624cd2-96e2-4fda-abfc-517c6daa7cf5") 497 def test_passpoint_release_2_OSU_page_swipe_away(self): 498 """Before adding a Passpoint network, using recent task to swip the task 499 Steps: 500 1. Go to Wi-Fi page 501 2. Tap Boingo and tap to sign up 502 3. After Online Sign Up (OSU) page show up, open recent task screen 503 4. Swipe away OSU page 504 Verification: 505 Disconnect from Boingo network 506 """ 507 self.start_subscription_provisioning_OSU_websie() 508 #launch recent task and kill the osu task 509 self.dut.adb.shell("input keyevent KEYCODE_APP_SWITCHER") 510 self.dut.adb.shell("input keyevent 20") 511 self.dut.adb.shell("input keyevent DEL") 512 self.dut.adb.shell("input keyevent KEYCODE_HOME") 513 514 # Clear all previous events. 515 self.dut.ed.clear_all_events() 516 current_passpoint = self.dut.droid.wifiGetConnectionInfo() 517 asserts.assert_false( 518 current_passpoint[WifiEnums.SSID_KEY] in 519 osu_config["expected_ssids"], "Device should not connect") 520 521 # Verify device does not connects to the Passpoint network. 522 asserts.assert_true( 523 self.dut.droid.wifiGetConnectionStandard() != 524 wifi_constants.WIFI_CONNECTED, "DUT did not connect to passpoint.") 525 526 @test_tracker_info(uuid="4655ee21-15d3-4742-9638-f07752127ce7") 527 def test_passpoint_release_2_connectivity_connection_failure(self): 528 """Before adding a Passpoint network, before sig in to use back key to leave the task 529 Steps: 530 1. Go to Wi-Fi page 531 2. Tap Boingo and tap to sign up 532 3. Tap back button when device pop up Online Sign Up (OSU) 533 534 Verification: 535 Disconnect from Boingo network 536 """ 537 self.start_subscription_provisioning_OSU_websie() 538 #launch back key 539 self.dut.adb.shell("input keyevent KEYCODE_BACK") 540 # Clear all previous events. 541 self.dut.ed.clear_all_events() 542 # Verify device does not connects to the Passpoint network. 543 asserts.assert_true( 544 self.dut.droid.wifiGetConnectionStandard() != 545 wifi_constants.WIFI_CONNECTED, "DUT did not connect to passpoint.") 546 547 @test_tracker_info(uuid="3372c605-2934-4739-8413-d9a103e87eef") 548 def test_passpoint_release_2_subscription_detail_of_current_connected_network( 549 self): 550 """Add a Passpoint network and check the connection detail 551 Steps: 552 1. Connecting a passpoint wifi 553 2. Go to Settings> Network & Internet> Wi-Fi 554 3. Tap current connected Wi-Fi and check the detail 555 Verification: 556 1.There is a forget button shown on the UI. 557 2.The dut shows Frequency, Security and Advanced (Metered, Privacy, Network detail, etc. 558 """ 559 self.unpack_userparams(('osu_configs', )) 560 asserts.assert_true( 561 len(self.osu_configs) > 0, "Need at least one osu config.") 562 osu_config = self.osu_configs[OSU_BOINGO] 563 # Clear all previous events. 564 self.dut.ed.clear_all_events() 565 self.dut.droid.startSubscriptionProvisioning(osu_config) 566 start_time = time.time() 567 while time.time() < start_time + OSU_TEST_TIMEOUT: 568 dut_event = self.dut.ed.pop_event("onProvisioningCallback", 569 DEFAULT_TIMEOUT * 18) 570 if dut_event['data']['tag'] == 'success': 571 self.log.info("Passpoint Provisioning Success") 572 break 573 if dut_event['data']['tag'] == 'failure': 574 raise signals.TestFailure( 575 "Passpoint Provisioning is failed with %s" % 576 dut_event['data']['reason']) 577 break 578 if dut_event['data']['tag'] == 'status': 579 self.log.info("Passpoint Provisioning status %s" % 580 dut_event['data']['status']) 581 if int(dut_event['data']['status']) == 7: 582 time.sleep(DEFAULT_TIMEOUT) 583 self.ui_automator_boingo() 584 585 # Clear all previous events. 586 self.dut.ed.clear_all_events() 587 588 # Verify device connects to the Passpoint network. 589 time.sleep(DEFAULT_TIMEOUT) 590 current_passpoint = self.dut.droid.wifiGetConnectionInfo() 591 if current_passpoint[ 592 WifiEnums.SSID_KEY] not in osu_config["expected_ssids"]: 593 raise signals.TestFailure("Device did not connect to the %s" 594 " passpoint network" % 595 osu_config["expected_ssids"]) 596 self.dut.adb.shell("am start-activity -a\ 597 android.settings.NETWORK_PROVIDER_SETTINGS") 598 599 # Open the Network details pasge and check UI 600 uutils.wait_and_click(self.dut,resource_id=\ 601 "com.android.settings:id/settings_button_no_background") 602 time.sleep(DEFAULT_TIMEOUT) 603 604 # Verify Network Details 605 asserts.assert_true( 606 uutils.has_element(self.dut, content_desc="Network details"), 607 "Failed to launch Network details") 608 asserts.assert_true( 609 uutils.has_element(self.dut, text_contains="Connected / Metered"), 610 "failed to find the Connected text") 611 asserts.assert_true( 612 uutils.has_element(self.dut, text_contains="Passpoint"), 613 "failed to find the Passpoint secuty type") 614 asserts.assert_true( 615 uutils.has_element(self.dut, text_contains="Forget"), 616 "failed to find the Forget button") 617 asserts.assert_true( 618 uutils.has_element(self.dut, text_contains="5 GHz"), 619 "failed to find the Frequency text") 620 621 # Delete the Passpoint profile. 622 self.get_configured_passpoint_and_delete() 623 wutils.wait_for_disconnect(self.dut, timeout=15) 624