Merge branch 'feature-wifi-3381' of https://github.com/Telecominfraproject/wlan-testing into feature-wifi-3381

This commit is contained in:
anjalirahamatkar
2021-10-12 23:07:58 +05:30
27 changed files with 2800 additions and 26 deletions

View File

@@ -97,9 +97,9 @@ jobs:
id: marker
run: |
if [ "${{ matrix.test_type }}" = "android" ]; then
MARKER_EXPRESSION="interop_and and interop_uc_sanity"
MARKER_EXPRESSION="interop_and and interop_uc_sanity and client_connect"
else
MARKER_EXPRESSION="interop_ios and interop_uc_sanity"
MARKER_EXPRESSION="interop_ios and interop_uc_sanity and client_connect"
fi
ADDITIONAL_MARKERS="${{ github.event.inputs.additional_markers || '' }}"
@@ -153,7 +153,7 @@ jobs:
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
until [ -s test_everything.xml ]
do

View File

@@ -74,6 +74,11 @@ jobs:
needs: [ build ]
steps:
- name: install JRE
run: |
sudo apt-get update
sudo apt-get install -y default-jre
- name: install aws CLI tool
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
@@ -153,7 +158,7 @@ jobs:
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
kubectl logs -f $podname &
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]

View File

@@ -156,7 +156,7 @@ jobs:
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]
do

View File

@@ -499,7 +499,7 @@ jobs:
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
kubectl logs -f $podname &
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]

View File

@@ -212,7 +212,7 @@ jobs:
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
#sleep 30 # wait for the pod to come up

View File

@@ -153,7 +153,7 @@ jobs:
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
until [ -s test_everything.xml ]
do

View File

@@ -293,7 +293,7 @@ jobs:
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
kubectl wait "pod/$podname" --for condition=ready --timeout=600s
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]
do

View File

@@ -411,7 +411,7 @@ class UProfileUtility:
"band": "2G",
"country": "US",
# "channel-mode": "HE",
"channel-width": 20,
"channel-width": 40,
# "channel": 11
})
self.base_profile_config["radios"].append({

View File

@@ -302,6 +302,8 @@ class RunTest:
# self.client_connect.sta_prefix = self.twog_prefix
if band == "fiveg":
self.client_connect.radio = self.fiveg_radios[0]
if band == "ax":
self.client_connect.radio = self.ax_radios[0]
self.client_connect.build()
self.client_connect.wait_for_ip(station_name)
print(self.client_connect.wait_for_ip(station_name))

View File

@@ -2062,6 +2062,622 @@ 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
#only to connect to wifi
def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile, connData):
print("\n-------------------------------------")
print("Select Wifi/AccessPoint Connection")
print("-------------------------------------")
print("Verifying Wifi Connection Details....")
#allure.attach(name= body=str("\n-------------------------------------"))
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
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)
#allure.attach(name= body=str("\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")
wifiElement = driver.find_element_by_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 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 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 ssid_with_internet
except:
print("Couldn't get into additional details")
except:
print("No Connected SSIDS")
#----------------------This is to Forget current connected SSID--------------------------------
print("Searching for Wifi: " + WifiName)
#allure.attach(name= body=str("Searching for Wifi: " + WifiName))
time.sleep(2)
print("Selecting Wifi: " + WifiName)
ssid_found = False
available_ssids = False
# This is To get all available ssids
# ------------------------------------------------------
try:
for check_for_all_ssids in range(2):
available_ssids = get_all_available_ssids(driver)
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("1538")
pass
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 ssid_with_internet
except:
closeApp(connData["appPackage-android"], setup_perfectoMobile)
return 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 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")
#allure.attach(name= body=str("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")
#allure.attach(name= body=str("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")
#allure.attach(name=body=str("Wifi Successfully Connected"))
except NoSuchElementException:
print("Wifi Connection Error: " + WifiName)
#allure.attach(name=body=str("Wifi Connection Error: " + WifiName))
closeApp(connData["appPackage-android"], setup_perfectoMobile)
return ssid_with_internet
except NoSuchElementException:
print("No Switch element found")
#allure.attach(name= body=str("No Switch element found"))
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
except NoSuchElementException:
print("Couldn't find wifi Button")
#allure.attach(name= body=str("Couldn't find wifi Button"))
# ------------------Open WIFI page----------------------------------
except NoSuchElementException:
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
#allure.attach(name= body=str("Exception: Verify Xpath - Update/check Xpath for Click Connections"))
# -----------------To Open Connections page---------------------------
closeApp(connData["appPackage-android"], setup_perfectoMobile)
return ssid_with_internet
def close_driver(driver):
driver.close()

View File

@@ -1467,3 +1467,298 @@ def wifi_disconnect_and_forget(request, WifiName, WifiPass, setup_perfectoMobile
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
#To get an IP address
def get_ip_address_eap_ios(request, WifiName ,User, ttls_passwd, setup_perfectoMobile, connData):
print("\n-------------------------------------")
print("Select Wifi/AccessPoint Connection")
print("-------------------------------------")
reportFlag = True
is_internet = False
ip_address_element_text = False
print("Verifying Wifi/AP Connection Details....")
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
report.step_start("Switching Driver Context")
print("Switching Context to Native")
driver.switch_to.context('NATIVE_APP')
# driver.switch_to.context(contexts[0])
report.step_start("Set Wifi Network to " + WifiName)
# Open Settings Application
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
try:
time.sleep(2)
driver.implicitly_wait(2)
try:
print("Verifying Connected Wifi Connection")
report.step_start("Loading Wifi Page")
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']")
element.click()
except NoSuchElementException:
print("Exception: Verify Xpath - unable to click on Wifi")
time.sleep(2)
driver.implicitly_wait(2)
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
try:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
get_wifi_switch_element_text = get_wifi_switch_element.text
try:
if get_wifi_switch_element_text == "0" or get_wifi_switch_element_text == 0:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
driver.implicitly_wait(1)
get_wifi_switch_element.click()
driver.implicitly_wait(1)
i = 0
for i in range(5):
try:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
get_wifi_switch_element_text = get_wifi_switch_element.text
except:
print("switch is OFF")
if get_wifi_switch_element_text == "1" or get_wifi_switch_element_text == 1:
print("WIFI Switch is ON")
break
else:
try:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
get_wifi_switch_element_text = get_wifi_switch_element.text
except:
print("WIFi switch is ON")
if(get_wifi_switch_element_text == "0" or get_wifi_switch_element_text == 0):
print("switch is still OFF")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
else:
print("Switch is Still OFF")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
except:
print("No switch element found")
except:
print("get_wifi_switch_element is ON")
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
except:
print("Cannot find WIFI element")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
# ---------------------This is to Forget current connected SSID-------------------------------
try:
print("getting in to Additional details")
additional_details_element = driver.find_element_by_xpath(
"//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']")
additional_details_element.click()
try:
print("Forget Connected Network")
forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']")
forget_ssid.click()
print("Forget old ssid")
try:
report.step_start("Forget SSID popup1")
forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']")
forget_ssid_popup.click()
print("**alert** Forget SSID popup killed **alert**")
except:
print("Forget SSID popup not found")
except:
print("couldn't find forget ssid element")
except:
print("No connected SSID")
# ---------------------This is to Forget current connected SSID-------------------------------
# ---------------------To get all available SSID-------------------------------
print("Searching for Wifi: " + WifiName)
# allure.attach(name= body=str("Searching for Wifi: " + WifiName))
time.sleep(2)
print("Selecting Wifi: " + WifiName)
ssid_found = False
available_ssids = False
try:
for check_for_all_ssids in range(2):
available_ssids = get_all_available_ssids(driver)
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:
pass
if not ssid_found:
print("could not found " + WifiName + " in device")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
except:
pass
# ---------------------To get all available SSID-------------------------------
# ---------------------This is to Select SSID-------------------------------
try:
wifiSelectionElement = WebDriverWait(driver, 30).until(
EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']")))
wifiSelectionElement.click()
print("Selecting SSID")
except Exception as e:
print("couldn't connect to " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
# ---------------------This is to Select SSID-------------------------------
# Set username
# -------------------------------------------------------
try:
driver.implicitly_wait(5)
report.step_start("Set User name")
print("Set User name")
wifiUserElement = driver.find_element_by_xpath("//*[@label='Username']")
wifiUserElement.send_keys(User)
except NoSuchElementException:
print("Password Page Not Loaded, password May be cached in the System")
# -------------------------------------------------------
# ---------------------Set Password-------------------------------
try:
driver.implicitly_wait(5)
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
wifiPassword.send_keys(ttls_passwd)
except NoSuchElementException:
print("Enter Password Page Not Loaded")
# ---------------------Set Password-------------------------------
# -------------------------------------------------------
# ---------------------Click on join-------------------------------
try:
driver.implicitly_wait(5)
joinBTN = driver.find_element_by_xpath("//*[@label='Join']")
joinBTN.click()
except Exception as e:
print("Join Button Not Enabled...Password may not be needed")
# ---------------------Click on join-------------------------------
# Selecting certificate
# -------------------------------------------------------
try:
driver.implicitly_wait(3)
report.step_start("Clicking Trust CA Cert")
certElement = driver.find_element_by_xpath("//*[@label='Trust']")
certElement.click()
except NoSuchElementException:
print("Password Page Not Loaded, password May be cached in the System")
# ---------------------check if internet-------------------------------
try:
WifiInternetErrMsg2 = WebDriverWait(driver, 30).until(
EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']")))
# = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
except Exception as e:
is_internet = True
print("No Wifi-AP Error Internet Error: " + WifiName)
# Need to add Wait for Selected Wifi Xpath
# time.sleep(3)
# ---------------------check if internet-------------------------------
# ---------------------Additional INFO-------------------------------
try:
print("Selecting SSID: ",WifiName)
report.step_start("Selecting SSID")
additional_details_element = WebDriverWait(driver, 30).until(
EC.presence_of_element_located((MobileBy.XPATH,
"//*[@label='"+ WifiName+"']")))
# //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']
additional_details_element.click()
try:
print("Checking IP address")
# (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2]
ip_address_element_text = driver.find_element_by_xpath("(//*[@label='IP Address']/parent::*/XCUIElementTypeStaticText)[2]").text
print("ip_address_element_text: ", ip_address_element_text)
except Exception as e:
print("IP Address not Found")
request.config.cache.set(key="select IP failed", value=str(e))
try:
time.sleep(2)
driver.implicitly_wait(2)
report.step_start("Forget Network")
forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']")
forget_ssid.click()
print("Forget old ssid")
# time.sleep(2)
# driver.implicitly_wait(3)
try:
report.step_start("Forget Network popup")
forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']")
forget_ssid_popup.click()
except:
print("in popup exception")
except:
print("error on ssid element")
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
try:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
get_wifi_switch_element_text = get_wifi_switch_element.text
print("switch state is : ", get_wifi_switch_element_text)
try:
if get_wifi_switch_element_text == "1" or get_wifi_switch_element_text == 1:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
driver.implicitly_wait(1)
get_wifi_switch_element.click()
driver.implicitly_wait(1)
i = 0
for i in range(5):
try:
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
get_wifi_switch_element_text = get_wifi_switch_element.text
except:
print("switch is ON")
if get_wifi_switch_element_text == "0" or get_wifi_switch_element_text == 0:
print("WIFI Switch is OFF")
break
else:
try:
get_wifi_switch_element = driver.find_element_by_xpath(
"//*[@label='Wi-Fi' and @value='1']")
get_wifi_switch_element.click()
get_wifi_switch_element_text = get_wifi_switch_element.text
except:
print("WIFi switch is OFF")
else:
print("Switch is Still OFF")
except:
pass
except:
print("get_wifi_switch_element is ON")
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
except Exception as e:
request.config.cache.set(key="select additional info failed", value=str(e))
# ---------------------Additional INFO-------------------------------
# --------------------- close app-------------------------------
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return ip_address_element_text, is_internet
# ---------------------close app-------------------------------

View File

@@ -101,6 +101,12 @@ def station_names_fiveg(request, get_configuration):
station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i))
yield station_names
@pytest.fixture(scope="session")
def station_names_ax(request, get_configuration):
station_names = []
for i in range(0, int(request.config.getini("num_stations"))):
station_names.append(get_configuration["traffic_generator"]["details"]["AX-Station-Name"] + "0" + str(i))
yield station_names
@pytest.fixture(scope="session")
def num_stations(request):

View File

@@ -40,7 +40,7 @@ class TestDataplaneThroughputBRIDGE(object):
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-3913", name="WIFI-3913")
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_tcp_upd_wpa2_personal_bridge_2g_band(self, get_vif_state, lf_tools,
def test_tcp_upd_wpa2_personal_bridge_2g_band_ac_station(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput BRIDGE Mode
@@ -54,9 +54,7 @@ class TestDataplaneThroughputBRIDGE(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
if ssid_name 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")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan)
@@ -76,7 +74,8 @@ class TestDataplaneThroughputBRIDGE(object):
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-3914", name="WIFI-3914")
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_tcp_upd_wpa2_personal_bridge_5g_band(self, get_vif_state, lf_tools,
@pytest.mark.nikita
def test_tcp_upd_wpa2_personal_bridge_5g_band_ac_station(self, get_vif_state, lf_tools,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE and wpa2_personal and fiveg"
@@ -89,9 +88,7 @@ class TestDataplaneThroughputBRIDGE(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
if ssid_name 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")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan)
@@ -107,3 +104,73 @@ class TestDataplaneThroughputBRIDGE(object):
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_tcp_upd_wpa2_personal_bridge_5g_band_ax_station(self, get_vif_state, lf_tools,
lf_test, station_names_ax, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "BRIDGE"
band = "ax"
vlan = 1
dut_name = create_lanforge_chamberview_dut
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_ax, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_ax, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_5G_BRIDGE_AX",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_ax)
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_tcp_upd_wpa2_personal_bridge_2g_band_ax_station(self, get_vif_state, lf_tools,
lf_test, station_names_ax, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput BRIDGE Mode
pytest -m "dataplane_throughput_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "BRIDGE"
band = "ax"
vlan = 1
dut_name = create_lanforge_chamberview_dut
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_ax, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_ax, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_2G_BRIDGE_AX",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G")
lf_test.Client_disconnect(station_name=station_names_ax)
assert station
else:
assert False

View File

@@ -40,7 +40,7 @@ class TestDataplaneThroughputNAT(object):
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-3913", name="WIFI-3913")
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_tcp_upd_wpa2_personal_nat_2g_band(self, get_vif_state, lf_tools,
def test_tcp_upd_wpa2_personal_nat_2g_band_ac_station(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput nat Mode
@@ -54,9 +54,6 @@ class TestDataplaneThroughputNAT(object):
band = "twog"
vlan = 1
dut_name = create_lanforge_chamberview_dut
if ssid_name 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")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan)
@@ -75,7 +72,7 @@ class TestDataplaneThroughputNAT(object):
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-3914", name="WIFI-3914")
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_tcp_upd_wpa2_personal_nat_5g_band(self, get_vif_state, lf_tools,
def test_tcp_upd_wpa2_personal_nat_5g_band_ac_station(self, get_vif_state, lf_tools,
lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat and wpa2_personal and fiveg"
@@ -88,9 +85,6 @@ class TestDataplaneThroughputNAT(object):
band = "fiveg"
vlan = 1
dut_name = create_lanforge_chamberview_dut
if ssid_name 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")
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan)
@@ -106,3 +100,66 @@ class TestDataplaneThroughputNAT(object):
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.twog
def test_tcp_upd_wpa2_personal_nat_2g_band_ax_station(self, get_vif_state, lf_tools,
lf_test, station_names_ax, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat and wpa2_personal and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "NAT"
band = "ax"
vlan = 1
dut_name = create_lanforge_chamberview_dut
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_ax, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_ax, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_2G_NAT_AX",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 2.4G")
lf_test.Client_disconnect(station_name=station_names_ax)
assert station
else:
assert False
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
def test_tcp_upd_wpa2_personal_nat_5g_band_aX_station(self, get_vif_state, lf_tools,
lf_test, station_names_ax, create_lanforge_chamberview_dut,
get_configuration):
"""Dataplane THroughput nat Mode
pytest -m "dataplane_throughput_test and nat and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "NAT"
band = "ax"
vlan = 1
dut_name = create_lanforge_chamberview_dut
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_ax, vlan_id=vlan)
if station:
dp_obj = lf_test.dataplane(station_name=station_names_ax, mode=mode,
instance_name="TIP_DPT_DPT_WPA2_5G_NAT_AX",
vlan_id=vlan, dut_name=dut_name)
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dataplane Throughput Test - TCP-UDP 5G")
print("Test Completed... Cleaning up Stations")
lf_test.Client_disconnect(station_name=station_names_ax)
assert station
else:
assert False

View File

@@ -0,0 +1,202 @@
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_connect
,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-4836", name="WIFI-4836")
@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, get_ap_logs):
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-4835", name="WIFI-4835")
@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, get_ap_logs):
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-4838", name="WIFI-4838")
@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, get_ap_logs):
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-4837", name="WIFI-4837")
@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, get_ap_logs):
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

View File

@@ -0,0 +1,209 @@
from logging import exception
import io
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')
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \
Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\
verifyUploadDownloadSpeediOS, get_ip_address_eap_ios
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_connect
,pytest.mark.interop_uc_sanity, pytest.mark.bridge, pytest.mark.enterprise]
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")
@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client Connect : 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):
""" SuiteA Enterprise Test Cases
pytest -m "client_connect and bridge and enterprise and ttls and interop and suiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4691", name="WIFI-4691")
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_ClientConnect_5g_WPA2_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg"
"""
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS,
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-4690", name="WIFI-4690")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnect_2g_WPA2_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, 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-4695", name="WIFI-4695")
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_ClientConnect_5g_WPA3_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg"
"""
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS,
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-4694", name="WIFI-4694")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnect_2g_WPA3_Eap(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, 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

View File

@@ -0,0 +1,215 @@
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, verifyUploadDownloadSpeed_android, wifi_connect_eap, wifi_disconnect_and_forget
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_ClientConnectivity_5g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_android, radius_info, get_ap_logs):
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = ["BLANK"]
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
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4664", name="WIFI-4664")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnectivity_2g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_android, radius_info, get_ap_logs):
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = ["BLANK"]
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
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
connData)
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4667", name="WIFI-4667")
@pytest.mark.fiveg
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_5g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_android, radius_info, get_ap_logs):
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = ["BLANK"]
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
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
connData)
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4666", name="WIFI-4666")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_2g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_android, radius_info, get_ap_logs):
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = ["BLANK"]
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
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
connData)
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False

View File

@@ -0,0 +1,273 @@
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_connect
,pytest.mark.interop_uc_sanity, pytest.mark.vlan]
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, get_ip_address_and
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"open": [{"ssid_name": "ssid_open_2g_vlan", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_open_5g_vlan", "appliedRadios": ["5G"], "vlan": 100}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa2_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}]},
"rf": {},
"radius": False
}
@allure.suite(suite_name="interop sanity")
@allure.sub_suite(sub_suite_name="Vlan Mode Client Connect : Suite-A")
@pytest.mark.InteropsuiteA
@allure.feature("VLAN MODE CLIENT CONNECT")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectSuiteOne(object):
""" Client Connect SuiteA
pytest -m "client_connect and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4613", name="WIFI-4613")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnect_5g_WPA2_Personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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-4612", name="WIFI-4612")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnect_2g_WPA2_Personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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-4611", name="WIFI-4611")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnect_5g_WPA_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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-4609", name="WIFI-4609")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnect_2g_WPA_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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-4607", name="WIFI-4607")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnect_5g_Open_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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
#Toggle AirplaneMode
# assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
# ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4606", name="WIFI-4606")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnect_2g_Open_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, 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

View File

@@ -0,0 +1,262 @@
from logging import exception
import io
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')
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \
Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\
verifyUploadDownloadSpeediOS, get_ip_address_ios
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios,
pytest.mark.client_connect, pytest.mark.interop_uc_sanity, pytest.mark.vlan]
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"], "security_key": "something", "vlan": 100}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}]},
"rf": {},
"radius": False
}
@allure.suite(suite_name="interop sanity")
@allure.sub_suite(sub_suite_name="Vlan Mode Client Connect : Suite-A")
@pytest.mark.InteropsuiteA
@allure.feature("VLAN MODE CLIENT CONNECT")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectSuiteOneVlan(object):
""" Client Connect SuiteA
pytest -m "client_connect and vlan and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4594", name="WIFI-4594")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnect_5g_WPA2_Personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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-4593", name="WIFI-4593")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnect_2g_WPA2_Personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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-4586", name="WIFI-4586")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnect_5g_WPA_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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-4585", name="WIFI-4585")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnect_2g_WPA_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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-4583", name="WIFI-4583")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnect_5g_Open_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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
#Toggle AirplaneMode
# assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
# ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4581", name="WIFI-4581")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnect_2g_Open_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, 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

View File

@@ -0,0 +1,292 @@
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.vlan]
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, \
get_ip_address_and, verifyUploadDownloadSpeed_android, wifi_connect, wifi_disconnect_and_forget
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}]},
"rf": {},
"radius": False
}
@allure.suite(suite_name="interop sanity")
@allure.sub_suite(sub_suite_name="Vlan Mode Client Connectivity : Suite-A")
@pytest.mark.InteropsuiteA
@allure.feature("VLAN MODE CLIENT CONNECT")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectivitySuiteOne(object):
""" Client Connect SuiteA
pytest -m "client_connectivity and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4631", name="WIFI-4631")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnectivity_5g_WPA2_Personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4630", name="WIFI-4630")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnectivity_2g_WPA2_Personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4629", name="WIFI-4629")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnectivity_5g_WPA_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4630", name="WIFI-4630")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnectivity_2g_WPA_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4627", name="WIFI-4627")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnectivity_5g_Open_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4626", name="WIFI-4626")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnectivity_2g_Open_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False

View File

@@ -0,0 +1,273 @@
from logging import exception
import io
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')
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \
Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\
verifyUploadDownloadSpeediOS, get_ip_address_ios, wifi_connect, wifi_disconnect_and_forget
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios,
pytest.mark.client_connectivity, pytest.mark.interop_uc_sanity, pytest.mark.vlan]
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}]},
"rf": {},
"radius": False
}
@allure.suite(suite_name="interop sanity")
@allure.sub_suite(sub_suite_name="Vlan Mode Client Connect : Suite-A")
@pytest.mark.InteropsuiteA
@allure.feature("VLAN MODE CLIENT CONNECT")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectSuiteOneVlan(object):
""" Client Connect SuiteA
pytest -m "client_connect and vlan and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4610", name="WIFI-4610")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnectivity_5g_WPA2_Personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4608", name="WIFI-4608")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnectivity_2g_WPA2_Personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4604", name="WIFI-4604")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnectivity_5g_WPA_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4603", name="WIFI-4603")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnectivity_2g_WPA_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4602", name="WIFI-4602")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnectivity_5g_Open_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4601", name="WIFI-4601")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnectivity_2g_Open_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
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_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
else:
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False