mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-12-30 09:00:43 +00:00
Merge branch 'master' into WIFI-4222
This commit is contained in:
@@ -2062,6 +2062,346 @@ def reportClient(value):
|
||||
# except:
|
||||
# pass
|
||||
# return ssid_list
|
||||
#------------Enterprise Mode code----------------------------
|
||||
def get_ip_address_eap_and(request, WifiName, User, ttls_passwd, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("-------------------------------------")
|
||||
print("Verifying Wifi Connection Details....")
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
ip_address_element_text = False
|
||||
ssid_with_internet = False
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
contexts = driver.contexts
|
||||
driver.switch_to.context(contexts[0])
|
||||
|
||||
# Open Settings Application
|
||||
openApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
deviceModelName = getDeviceModelName(setup_perfectoMobile)
|
||||
print("Selected Device Model: " + deviceModelName)
|
||||
|
||||
if deviceModelName != ("Pixel 4"):
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
|
||||
|
||||
# -----------------To Open Connections page-----------------------
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Click Connections")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
connElement.click()
|
||||
|
||||
|
||||
# ---------------------Open WIFI page-------------------------------
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
print("Clicking WIFI")
|
||||
time.sleep(3)
|
||||
wifiElement = WebDriverWait(driver, 10).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,"//*[@text='Wi-Fi']")))
|
||||
wifiElement.click()
|
||||
|
||||
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_text_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
print("get_switch_text: ",get_switch_text)
|
||||
print("Find wifi switch")
|
||||
try: #To Turn on Wi-Fi Switch
|
||||
if get_switch_text == "Off":
|
||||
# driver.implicitly_wait(3)
|
||||
get_switch_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
if get_switch_text == "On":
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
except:
|
||||
pass
|
||||
print("Sleeping for: ", i)
|
||||
time.sleep(i)
|
||||
pass
|
||||
if get_switch_text == "Off":
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
else:
|
||||
print("Switch is already On")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
print("Couldn't turn on WIFI switch")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
|
||||
#---------------------This is to Forget current connected SSID-------------------------------
|
||||
try: #To deal with already connected SSID
|
||||
check_if_no_internet_popup(driver)
|
||||
network_category = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/connected_network_category']")
|
||||
try: #To forget exhisting ssid
|
||||
print("To forget ssid")
|
||||
check_if_no_internet_popup(driver)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/forget_button']//*[@resource-id='com.android.settings:id/icon']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
except:
|
||||
print("Couldn't get into additional details")
|
||||
except:
|
||||
print("No Connected SSIDS")
|
||||
#----------------------This is to Forget current connected SSID--------------------------------
|
||||
|
||||
time.sleep(2)
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
#allure.attach(name= body=str("Selecting Wifi: " + WifiName))
|
||||
ssid_found = False
|
||||
available_ssids = False
|
||||
#This is To get all available ssids
|
||||
#------------------------------------------------------
|
||||
try:
|
||||
for k in range(3):
|
||||
available_ssids = get_all_available_ssids(driver)
|
||||
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)
|
||||
time.sleep(2)
|
||||
else:
|
||||
ssid_found = True
|
||||
print(WifiName+" : Found in Device")
|
||||
#allure.attach(name= body=str(WifiName+" : Found in Device"))
|
||||
break
|
||||
except:
|
||||
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"))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
except:
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
#-------------------------------------------------------
|
||||
|
||||
# Selecting WIFI
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
print("Selecting Wifi")
|
||||
wifiSelectionElement = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifiSelectionElement.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Set username
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(3)
|
||||
report.step_start("Set User name")
|
||||
print("Set User name")
|
||||
wifiUserElement = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/edittext' and @password='false']")
|
||||
wifiUserElement.send_keys(User)
|
||||
except NoSuchElementException:
|
||||
print("User name not Loaded")
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Set Password
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(6)
|
||||
report.step_start("Set Password")
|
||||
print("Set Password")
|
||||
wifiPasswordElement = driver.find_element_by_xpath(
|
||||
"//*[@text='Enter password']")
|
||||
wifiPasswordElement.send_keys(ttls_passwd)
|
||||
print("Entered Password")
|
||||
except NoSuchElementException:
|
||||
print("Password Page Not Loaded, password May be cached in the System")
|
||||
# -------------------------------------------------------
|
||||
# Selecting certificate
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(3)
|
||||
report.step_start("Selecting CA Cert")
|
||||
certElement = driver.find_element_by_xpath(
|
||||
"//*[@text='Select certificate']")
|
||||
certElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Selecting certificate failed")
|
||||
# -------------------------------------------------------
|
||||
# Validating certificate
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(3)
|
||||
report.step_start("Validting CA Cert")
|
||||
certElement = driver.find_element_by_xpath(
|
||||
"//*[@text=\"Don't validate\"]")
|
||||
certElement.click()
|
||||
except NoSuchElementException:
|
||||
print("validation failed")
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Click on connect button
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(3)
|
||||
report.step_start("Click Connect Button")
|
||||
joinBTNElement = driver.find_element_by_xpath("//*[@text='Connect']")
|
||||
joinBTNElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Connect Button Not Enabled...Verify if Password is set properly ")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
|
||||
#Verify if WiFi is connected
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='android:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
# time.sleep(5)
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected without internet']/parent::*/android.widget.TextView[@text='"
|
||||
+ WifiName + "']")))
|
||||
print("Wifi Successfully Connected without internet")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 60).until(EC.presence_of_element_located((
|
||||
MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + WifiName)
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
#Get into Additional Details
|
||||
#To Get an IP Address
|
||||
#To Forget connection
|
||||
#To turn off auto. connect
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
print("Into additional details")
|
||||
time.sleep(2)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='com.android.settings:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='android:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
print("IP address element not found")
|
||||
#allure.attach(name= body=str("IP address element not found"))
|
||||
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
driver.implicitly_wait(3)
|
||||
time.sleep(2)
|
||||
auto_reconnect_off = driver.find("//*[@resource-id='android:id/switch_widget']")
|
||||
auto_reconnect_off_text = auto_reconnect_off.text
|
||||
if auto_reconnect_off_text != "Off":
|
||||
auto_reconnect_off.click()
|
||||
print("Auto reconnect turning off")
|
||||
else:
|
||||
print("Auto reconnect is already off")
|
||||
except:
|
||||
print("Couldn't find auto reconnect element")
|
||||
|
||||
# ------------------------------- Forget SSID ----------------
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/forget_button']//*[@resource-id='com.android.settings:id/icon']")
|
||||
forget_ssid.click()
|
||||
print("Forgetting ssid")
|
||||
|
||||
#------------------------------- Wifi Switch ----------------
|
||||
try:
|
||||
print("clicking on wifi switch")
|
||||
get_switch_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(2)
|
||||
get_switch_element.click()
|
||||
except:
|
||||
print("couldn't click on wifi switch")
|
||||
#allure.attach(name= body=str("couldn't click on wifi switch"))
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
except:
|
||||
print("Couldn't get into Additional settings")
|
||||
# -------------------------------------------------------
|
||||
except:
|
||||
print("No Switch element found")
|
||||
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
|
||||
|
||||
except:
|
||||
print("Couldn't find wifi Button")
|
||||
# ------------------Open WIFI page----------------------------------
|
||||
|
||||
except:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
# -----------------To Open Connections page---------------------------
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
|
||||
def close_driver(driver):
|
||||
driver.close()
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
from logging import exception
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.client_connectivity
|
||||
,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise]
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, get_ip_address_eap_and
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
@allure.suite(suite_name="interop sanity")
|
||||
@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connectivity : Suite-A")
|
||||
@pytest.mark.suiteA
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connect and bridge and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4665", name="WIFI-4665")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnect_5g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android, radius_info):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
#ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
#print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4664", name="WIFI-4664")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnect_2g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4667", name="WIFI-4667")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnect_5g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4666", name="WIFI-4666")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnect_2g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
if ssidName not in get_vif_state:
|
||||
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
|
||||
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
|
||||
|
||||
report = setup_perfectoMobile_android[1]
|
||||
driver = setup_perfectoMobile_android[0]
|
||||
connData = get_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
Reference in New Issue
Block a user