Merge branch 'WIFI-4710' of https://github.com/Telecominfraproject/wlan-testing into WIFI-4222

This commit is contained in:
saurabh
2021-10-11 23:45:15 +05:30
24 changed files with 2944 additions and 170 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

@@ -158,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

@@ -2402,6 +2402,282 @@ def get_ip_address_eap_and(request, WifiName, User, ttls_passwd, setup_perfectoM
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

@@ -514,16 +514,22 @@ def verifyUploadDownloadSpeediOS(request, setup_perfectoMobile, get_APToMobileDe
driver.switch_to.context('WEBVIEW_1')
print("Launching Safari")
report.step_start("Google Home Page")
driver.get(connData["webURL"])
print("Enter Search Text")
elementFindTxt = driver.find_element_by_xpath(connData["lblSearch"])
elementFindTxt.send_keys("Internet Speed Test")
try:
print("Launching Safari")
report.step_start("Google Home Page")
driver.get(connData["webURL"])
print("Enter Search Text")
elementFindTxt = driver.find_element_by_xpath(connData["lblSearch"])
elementFindTxt.send_keys("Internet Speed Test")
except Exception as e:
print("Launching Safari Failed")
print(e)
try:
print("Click Search Button")
report.step_start("Click Search Button")
time.sleep(2)
driver.implicitly_wait(2)
# elelSearch = driver.find_element_by_xpath("//*[@class='aajZCb']/li[1]/div[1]")
elelSearch = driver.find_element_by_xpath("//*[@class='aajZCb']//*[@class='nz2CCf']/li[1]/div[2]")
elelSearch.click()
@@ -537,7 +543,7 @@ def verifyUploadDownloadSpeediOS(request, setup_perfectoMobile, get_APToMobileDe
driver.find_element_by_xpath(connData["BtnRunSpeedTest"]).click()
except NoSuchElementException:
currentResult = False
print("Run Speed Test Button element not found")
print("Run Speed Test Button element not found",NoSuchElementException)
return currentResult
#Get upload/Download Speed
@@ -1467,3 +1473,506 @@ 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, 35).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, 35).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")
time.sleep(4)
# (//*[@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-------------------------------
def wifi_connect_eap(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 is_internet
else:
print("Switch is Still OFF")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return 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 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)
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 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 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")
# ---------------------Click on join-------------------------------
try:
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)
print("Trust certificate")
report.step_start("Clicking Trust CA Cert")
certElement = driver.find_element_by_xpath("//*[@label='Trust']")
certElement.click()
print("Certificate selected")
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-------------------------------
# --------------------- close app-------------------------------
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
return is_internet
# ---------------------close app-------------------------------

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 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):
""" 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 sanity")
@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_Bridge(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_Bridge(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_Bridge(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_Bridge(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

@@ -57,9 +57,10 @@ class TestBridgeModeConnectSuiteOne(object):
pytest -m "client_connect and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4545", name="WIFI-4545")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnect_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
def test_ClientConnect_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
@@ -90,9 +91,10 @@ class TestBridgeModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4490", name="WIFI-4490")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnect_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_WPA2_Personal_Bridge(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"]
@@ -123,9 +125,10 @@ class TestBridgeModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4489", name="WIFI-4489")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnect_5g_WPA(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_WPA_Bridge(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"]
@@ -156,9 +159,10 @@ class TestBridgeModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4488", name="WIFI-4488")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnect_2g_WPA(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_WPA_Bridge(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"]
@@ -189,9 +193,10 @@ class TestBridgeModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4487", name="WIFI-4487")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnect_5g_Open(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_Open_Bridge(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"]
@@ -228,9 +233,10 @@ class TestBridgeModeConnectSuiteOne(object):
#ForgetWifi
# ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4486", name="WIFI-4486")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnect_2g_Open(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_Open_Bridge(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"]
@@ -302,9 +308,10 @@ class TestBridgeModeConnectSuiteTwo(object):
pytest -m "client_connect and bridge and InteropsuiteB"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4547", name="WIFI-4547")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal
def test_ClientConnect_5g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa3_personal_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
ssidName = profile_data["ssid_name"]
@@ -336,9 +343,10 @@ class TestBridgeModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4546", name="WIFI-4546")
@pytest.mark.twog
@pytest.mark.wpa3_personal
def test_ClientConnect_2g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa3_personal_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
ssidName = profile_data["ssid_name"]
@@ -370,9 +378,10 @@ class TestBridgeModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4549", name="WIFI-4549")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_5g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa3_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
ssidName = profile_data["ssid_name"]
@@ -404,9 +413,10 @@ class TestBridgeModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4548", name="WIFI-4548")
@pytest.mark.twog
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_2g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa3_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
ssidName = profile_data["ssid_name"]
@@ -438,9 +448,10 @@ class TestBridgeModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4551", name="WIFI-4551")
@pytest.mark.fiveg
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_5g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
ssidName = profile_data["ssid_name"]
@@ -472,10 +483,10 @@ class TestBridgeModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4550", name="WIFI-4550")
@pytest.mark.twog
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_2g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
ssidName = profile_data["ssid_name"]
@@ -506,52 +517,3 @@ class TestBridgeModeConnectSuiteTwo(object):
else:
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
# @allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
# @pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
# )
# @pytest.mark.usefixtures("setup_profiles")
# class TestAccessPointConnectivetyBridge(object):
#
# @pytest.mark.fiveg
# @pytest.mark.open
# @pytest.mark.sushant
# def test_AccessPointConnection_5g_OPEN_Bridge(self, request, get_vif_state, 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)
#
# # 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
# # set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#
# # Need An ip To ping
# # wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName)
# wifi_ip, is_internet = get_ip_address_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
# print(wifi_ip)
# print(is_internet)
# assert wifi_ip
# # assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#
# # # Open Ping Application
# # openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
# #
# # ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
#
# # ForgetWifi
# # ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)

View File

@@ -19,7 +19,8 @@ if 'perfecto_libs' not in sys.path:
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
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",
@@ -53,11 +54,12 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4665", name="WIFI-4665")
@pytest.mark.fiveg
@pytest.mark.wpa2_enterprise
def test_ClientConnect_5g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android, radius_info):
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 = profile_data["security_key"]
ssidPassword = ["BLANK"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
ttls_passwd = radius_info["password"]
@@ -71,30 +73,33 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
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:
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
assert True
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("Device is Unable to connect"))
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_ClientConnect_2g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android, radius_info):
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 = profile_data["security_key"]
ssidPassword = ["BLANK"]
print("SSID_NAME: " + ssidName)
# print ("SSID_PASS: " + ssidPassword)
ttls_passwd = radius_info["password"]
@@ -108,31 +113,34 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
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:
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
assert True
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("Device is Unable to connect"))
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_ClientConnect_5g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android, radius_info):
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 = profile_data["security_key"]
ssidPassword = ["BLANK"]
print("SSID_NAME: " + ssidName)
# print ("SSID_PASS: " + ssidPassword)
ttls_passwd = radius_info["password"]
@@ -146,31 +154,34 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
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:
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
assert True
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("Device is Unable to connect"))
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_ClientConnect_2g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android, radius_info):
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 = profile_data["security_key"]
ssidPassword = ["BLANK"]
print("SSID_NAME: " + ssidName)
# print ("SSID_PASS: " + ssidPassword)
ttls_passwd = radius_info["password"]
@@ -184,18 +195,21 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
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:
# Set Wifi/AP Mode
if is_internet:
if ip:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
else:
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
print(text_body)
allure.attach(name="Connection Status: ", body=str(text_body))
assert True
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("Device is Unable to connect"))
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False

View File

@@ -0,0 +1,223 @@
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, wifi_connect_eap, 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.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 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):
""" 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-4711", name="WIFI-4711")
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_ClientConnectivity_5g_WPA2_Eap_Bridge(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 = ["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_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 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_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-4710", name="WIFI-4710")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnectivity_2g_WPA2_Eap_Bridge(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 = ["BLANK"]
# 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 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_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-4715", name="WIFI-4715")
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_ClientConnectivity_5g_WPA3_Eap_Bridge(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 = ["BLANK"]
# 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 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_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-4714", name="WIFI-4714")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_2g_WPA3_Eap_Bridge(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 = ["BLANK"]
# 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 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_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

View File

@@ -57,6 +57,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
pytest -m "client_connectivity and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4557", name="WIFI-4557")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnectivity_5g_WPA2_Personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
@@ -93,6 +94,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4556", name="WIFI-4556")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnectivity_2g_WPA2_Personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -128,6 +130,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4555", name="WIFI-4555")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnectivity_5g_WPA_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -163,6 +166,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4554", name="WIFI-4554")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnectivity_2g_WPA_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -198,6 +202,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4553", name="WIFI-4553")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnectivity_5g_Open_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -233,6 +238,7 @@ class TestBridgeModeConnectivitySuiteOneBridge(object):
allure.attach(name="Connection Status: ", body=str("No Internet access"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4552", name="WIFI-4552")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnectivity_2g_Open_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -309,6 +315,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
pytest -m "client_connectivity and bridge and InteropsuiteB"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4559", name="WIFI-4559")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal
def test_ClientConnectivity_5g_wpa3_personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -343,6 +350,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4558", name="WIFI-4558")
@pytest.mark.twog
@pytest.mark.wpa3_personal
def test_ClientConnectivity_2g_wpa3_personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -377,6 +385,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4561", name="WIFI-4561")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal_mixed
def test_ClientConnectivity_5g_wpa3_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -411,6 +420,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4560", name="WIFI-4560")
@pytest.mark.twog
@pytest.mark.wpa3_personal_mixed
def test_ClientConnectivity_2g_wpa3_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -445,6 +455,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4563", name="WIFI-4563")
@pytest.mark.fiveg
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnectivity_5g_wpa_wpa2_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
@@ -480,7 +491,7 @@ class TestBridgeModeConnectivitySuiteBridgeTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4562", name="WIFI-4562")
@pytest.mark.twog
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnectivity_2g_wpa_wpa2_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):

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.nat, 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": "NAT",
"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="Nat 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 TestNatModeEnterpriseTTLSSuiteA(object):
""" Client Connect SuiteA
pytest -m "client_connect and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4823", name="WIFI-4823")
@pytest.mark.fiveg
@pytest.mark.wpa2_enterprise
def test_ClientConnect_5g_WPA2_enterprise_Nat(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-4822", name="WIFI-4822")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnect_2g_WPA2_enterprise_Nat(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-4825", name="WIFI-4825")
@pytest.mark.fiveg
@pytest.mark.wpa3_enterprise
def test_ClientConnect_5g_WPA3_enterprise_Nat(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-4824", name="WIFI-4824")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnect_2g_WPA3_enterprise_Nat(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.nat, pytest.mark.enterprise]
setup_params_enterprise = {
"mode": "NAT",
"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="Nat 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 TestNatModeEnterpriseTTLSSuiteA(object):
""" SuiteA Enterprise Test Cases
pytest -m "client_connect and nat and enterprise and ttls and interop and suiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4697", name="WIFI-4697")
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_ClientConnect_5g_WPA2_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and nat 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-4696", name="WIFI-4696")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnect_2g_WPA2_Eap_Nat(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-4701", name="WIFI-4701")
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_ClientConnect_5g_WPA3_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and nat 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-4700", name="WIFI-4700")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnect_2g_WPA3_Eap_Nat(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

@@ -57,9 +57,10 @@ class TestNatModeConnectSuiteOne(object):
pytest -m "client_connect and nat and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4501", name="WIFI-4502")
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ClientConnect_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
def test_ClientConnect_5g_WPA2_Personal_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
@@ -90,9 +91,10 @@ class TestNatModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4485", name="WIFI-4485")
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnect_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_WPA2_Personal_Nat(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"]
@@ -123,9 +125,10 @@ class TestNatModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4484", name="WIFI-4484")
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnect_5g_WPA(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_WPA_Nat(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"]
@@ -156,9 +159,10 @@ class TestNatModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4483", name="WIFI-4483")
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnect_2g_WPA(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_WPA_Nat(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"]
@@ -189,9 +193,10 @@ class TestNatModeConnectSuiteOne(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4482", name="WIFI-4482")
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnect_5g_Open(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_Open_Nat(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"]
@@ -228,9 +233,10 @@ class TestNatModeConnectSuiteOne(object):
#ForgetWifi
# ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4481", name="WIFI-4481")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnect_2g_Open(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_Open_Nat(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"]
@@ -302,9 +308,10 @@ class TestNatModeConnectSuiteTwo(object):
pytest -m "client_connect and nat and InteropsuiteB"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4529", name="WIFI-4529")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal
def test_ClientConnect_5g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa3_personal_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
ssidName = profile_data["ssid_name"]
@@ -336,9 +343,10 @@ class TestNatModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4532", name="WIFI-4532")
@pytest.mark.twog
@pytest.mark.wpa3_personal
def test_ClientConnect_2g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa3_personal_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
ssidName = profile_data["ssid_name"]
@@ -370,9 +378,10 @@ class TestNatModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4532", name="WIFI-4532")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_5g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa3_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
ssidName = profile_data["ssid_name"]
@@ -404,9 +413,10 @@ class TestNatModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4529", name="WIFI-4529")
@pytest.mark.twog
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_2g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa3_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
ssidName = profile_data["ssid_name"]
@@ -438,9 +448,10 @@ class TestNatModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4538", name="WIFI-4538")
@pytest.mark.fiveg
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_5g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
ssidName = profile_data["ssid_name"]
@@ -472,10 +483,10 @@ class TestNatModeConnectSuiteTwo(object):
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
assert False
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4537", name="WIFI-4537")
@pytest.mark.twog
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_2g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
ssidName = profile_data["ssid_name"]

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.nat, 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": "NAT",
"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="Nat 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 TestNatModeEnterpriseTTLSSuiteA(object):
""" Client Connect SuiteA
pytest -m "client_connect and bridge and InteropsuiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4673", name="WIFI-4673")
@pytest.mark.fiveg
@pytest.mark.wpa2_enterprise
def test_ClientConnectivity_5g_WPA2_enterprise_Nat(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-4672", name="WIFI-4672")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnectivity_2g_WPA2_enterprise_Nat(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-4675", name="WIFI-4675")
@pytest.mark.fiveg
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_5g_WPA3_enterprise_Nat(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-4674", name="WIFI-4674")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_2g_WPA3_enterprise_Nat(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,224 @@
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, wifi_connect_eap, 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.nat, pytest.mark.enterprise]
setup_params_enterprise = {
"mode": "NAT",
"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="Nat 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 TestNatModeEnterpriseTTLSSuiteA(object):
""" SuiteA Enterprise Test Cases
pytest -m "client_connect and nat and enterprise and ttls and interop and suiteA"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4717", name="WIFI-4717")
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_ClientConnectivity_5g_WPA2_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and nat 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 = ["BLANK"]
# 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 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_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-4716", name="WIFI-4716")
@pytest.mark.twog
@pytest.mark.wpa2_enterprise
def test_ClientConnectivity_2g_WPA2_Eap_Nat(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 = ["BLANK"]
# 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 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_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-4721", name="WIFI-4721")
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_ClientConnectivity_5g_WPA3_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
""" wpa2 enterprise 5g
pytest -m "client_connect and nat 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 = ["BLANK"]
# 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 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_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-4720", name="WIFI-4720")
@pytest.mark.twog
@pytest.mark.wpa3_enterprise
def test_ClientConnectivity_2g_WPA3_Eap_Nat(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 = ["BLANK"]
# 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 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_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

View File

@@ -56,7 +56,7 @@ class TestVlanModeConnectSuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -90,7 +90,7 @@ class TestVlanModeConnectSuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -124,7 +124,7 @@ class TestVlanModeConnectSuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -159,7 +159,7 @@ class TestVlanModeConnectSuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -194,11 +194,259 @@ class TestVlanModeConnectSuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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
@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
setup_params_general_two = {
"mode": "VLAN",
"ssid_modes": {
"wpa3_personal": [
{"ssid_name": "ssid_wpa3_p_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa3_personal_mixed": [
{"ssid_name": "ssid_wpa3_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_m_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa_wpa2_personal_mixed": [
{"ssid_name": "ssid_wpa_wpa2_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_wpa2_p_m_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-B")
@pytest.mark.InteropsuiteB
@allure.feature("VLAN MODE CLIENT CONNECT")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general_two],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectSuiteTwo(object):
""" Client Connect SuiteA
pytest -m "client_connect and vlan and InteropsuiteB"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4617", name="WIFI-4617")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal
def test_ClientConnect_5g_wpa3_personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_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-4616", name="WIFI-4616")
@pytest.mark.twog
@pytest.mark.wpa3_personal
def test_ClientConnect_2g_wpa3_personal_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_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-4623", name="WIFI-4623")
@pytest.mark.fiveg
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_5g_wpa3_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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-4621", name="WIFI-4621")
@pytest.mark.twog
@pytest.mark.wpa3_personal_mixed
def test_ClientConnect_2g_wpa3_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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-4625", name="WIFI-4625")
@pytest.mark.fiveg
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
get_vif_state.append(ssidName)
@@ -226,20 +474,14 @@ class TestVlanModeConnectSuiteOne(object):
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")
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4624", name="WIFI-4624")
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnect_2g_Open_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
@pytest.mark.wpa_wpa2_personal_mixed
def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
get_vif_state.append(ssidName)
@@ -268,6 +510,3 @@ class TestVlanModeConnectSuiteOne(object):
assert False

View File

@@ -59,7 +59,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data,
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]
@@ -92,7 +92,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -125,7 +125,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -158,7 +158,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -191,7 +191,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -230,7 +230,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]

View File

@@ -57,7 +57,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -96,7 +96,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -135,7 +135,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -174,7 +174,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -213,7 +213,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -252,7 +252,7 @@ class TestVlanModeConnectivitySuiteOne(object):
@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_ToggleAirplaneMode_data, setup_perfectoMobile_android):
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"]
@@ -289,4 +289,272 @@ class TestVlanModeConnectivitySuiteOne(object):
assert False
setup_params_general_two = {
"mode": "VLAN",
"ssid_modes": {
"wpa3_personal": [
{"ssid_name": "ssid_wpa3_p_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa3_personal_mixed": [
{"ssid_name": "ssid_wpa3_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_m_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa_wpa2_personal_mixed": [
{"ssid_name": "ssid_wpa_wpa2_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_wpa2_p_m_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 Connectivity : Suite-B")
@pytest.mark.InteropsuiteB
@allure.feature("Vlan MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general_two],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVlanModeConnectivitySuiteTwo(object):
""" Client Connect SuiteB
pytest -m "client_connect and vlan and InteropsuiteB"
"""
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4632", name="WIFI-4632")
@pytest.mark.wpa3_personal
@pytest.mark.twog
def test_ClientConnectivity_wpa3_personal_ssid_2g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_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-4633", name="WIFI-4633")
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
def test_ClientConnectivity_wpa3_personal_ssid_5g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_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-4634", name="WIFI-4634")
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
def test_ClientConnectivity_wpa3_personal_mixed_ssid_2g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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-4635", name="WIFI-4635")
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
def test_ClientConnectivity_wpa3_personal_mixed_ssid_5g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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-4636", name="WIFI-4636")
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
def test_ClientConnectivity_wpa_wpa2_personal_ssid_2g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][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-4637", name="WIFI-4637")
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
def test_ClientConnectivity_wpa_wpa2_personal_ssid_5g_Vlan(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][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

View File

@@ -59,7 +59,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data,
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]
@@ -96,7 +96,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -131,7 +131,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -167,7 +167,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -203,7 +203,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]
@@ -239,7 +239,7 @@ class TestVlanModeConnectSuiteOneVlan(object):
@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_APToMobileDevice_data, setup_perfectoMobile_iOS):
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"]