WIFI-9798 (#634)

* Updated cod eblock of wifi_connect in android lib

Signed-off-by: haricharan-jaka <haricharan.jaka@candelatech.com>

* Added extra sleep to pixel 4 in captive portal for clicking the page

Signed-off-by: haricharan-jaka <haricharan.jaka@candelatech.com>
This commit is contained in:
Haricharan Jaka
2022-06-22 20:27:54 +05:30
committed by GitHub
parent be7141d1a8
commit 2c7a709c14

View File

@@ -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']")