From 2c7a709c1454d4bdfbefb05bdcb2fadf080473f4 Mon Sep 17 00:00:00 2001 From: Haricharan Jaka <87761091+haricharan-jaka@users.noreply.github.com> Date: Wed, 22 Jun 2022 20:27:54 +0530 Subject: [PATCH] WIFI-9798 (#634) * Updated cod eblock of wifi_connect in android lib Signed-off-by: haricharan-jaka * Added extra sleep to pixel 4 in captive portal for clicking the page Signed-off-by: haricharan-jaka --- libs/perfecto_libs/android_lib.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libs/perfecto_libs/android_lib.py b/libs/perfecto_libs/android_lib.py index 268f1db7c..bab4ee05c 100644 --- a/libs/perfecto_libs/android_lib.py +++ b/libs/perfecto_libs/android_lib.py @@ -2010,8 +2010,10 @@ def wifi_connect(request, WifiName, WifiPass, setup_perfectoMobile, connData): # This is To get all available ssids # ------------------------------------------------------ try: - for check_for_all_ssids in range(2): + for k in range(9): available_ssids = get_all_available_ssids(driver, deviceModelName) + print("active_ssid_list: ", available_ssids) + allure.attach(name="Available SSIDs in device: ", body=str(available_ssids)) try: if WifiName not in available_ssids: scrollDown(setup_perfectoMobile) @@ -2019,14 +2021,13 @@ def wifi_connect(request, WifiName, WifiPass, setup_perfectoMobile, connData): else: ssid_found = True print(WifiName + " : Found in Device") - #allure.attach(name= body=str(WifiName + " : Found in Device")) + # allure.attach(name= body=str(WifiName+" : Found in Device")) break except: - print("1538") - pass + print("couldn't find wifi in available ssid") if not ssid_found: - print("could not found" + WifiName + " in device") - #allure.attach(name= body=str("could not found" + WifiName + " in device")) + print("could not found " + WifiName + " in device") + # allure.attach(name= body=str("could not found" + WifiName + " in device")) closeApp(connData["appPackage-android"], setup_perfectoMobile) return ssid_with_internet except: @@ -5073,7 +5074,7 @@ def captive_portal_and(request, WifiName, WifiPass, setup_perfectoMobile, connDa except Exception as e: print("Exception on Selecting Wifi Network. Please check wifi Name or signal") try: - time.sleep(2) + time.sleep(20) report.step_start("Click Accept Terms Button") print("Click Accept Terms Button") join_btn_element = driver.find_element_by_xpath("//*[@text='Accept Terms of Service']")