mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-03 20:38:05 +00:00
- reduced testcase execution time
- refactored configuration Signed-off-by: Sushant Bawiskar <sushant.bawiskar@candelatech.com>
This commit is contained in:
committed by
Sushant Bawiskar
parent
a573489949
commit
909c4c73d8
@@ -13,7 +13,7 @@ import allure
|
|||||||
import requests
|
import requests
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from configuration import EXPRESS_WIFI
|
from configuration import open_flow
|
||||||
|
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter
|
||||||
import logging
|
import logging
|
||||||
@@ -392,9 +392,9 @@ class UProfileUtility:
|
|||||||
self.base_profile_config["interfaces"][1]["services"] = ["ssh", "lldp", "open-flow"]
|
self.base_profile_config["interfaces"][1]["services"] = ["ssh", "lldp", "open-flow"]
|
||||||
self.base_profile_config["interfaces"][1]["ipv4"]["subnet"] = "192.168.97.1/24"
|
self.base_profile_config["interfaces"][1]["ipv4"]["subnet"] = "192.168.97.1/24"
|
||||||
self.base_profile_config["interfaces"][1]["ipv4"]["dhcp"]["lease-count"] = 100
|
self.base_profile_config["interfaces"][1]["ipv4"]["dhcp"]["lease-count"] = 100
|
||||||
self.base_profile_config['services'] = EXPRESS_WIFI["services"]
|
self.base_profile_config['services']["open-flow"] = open_flow
|
||||||
self.base_profile_config['metrics']['wifi-frames'] = EXPRESS_WIFI["wifi_frames"]
|
self.base_profile_config['services']['lldp']['describe'] = "OpenWiFi - expressWiFi"
|
||||||
self.base_profile_config['metrics']['dhcp-snooping'] = EXPRESS_WIFI["dhcp_snooping"]
|
self.base_profile_config['services']['lldp']['location'] = "Hotspot"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ def scrollDown(setup_perfectoMobile):
|
|||||||
params2["start"] = "50%,90%"
|
params2["start"] = "50%,90%"
|
||||||
params2["end"] = "50%,20%"
|
params2["end"] = "50%,20%"
|
||||||
params2["duration"] = "4"
|
params2["duration"] = "4"
|
||||||
time.sleep(5)
|
time.sleep(2)
|
||||||
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
|
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
|
||||||
time.sleep(5)
|
time.sleep(1)
|
||||||
|
|
||||||
|
|
||||||
def getDeviceID(setup_perfectoMobile):
|
def getDeviceID(setup_perfectoMobile):
|
||||||
@@ -1063,7 +1063,7 @@ def check_if_no_internet_popup(driver):#To check and kill if any popups related
|
|||||||
print("**alert** popup **alert**")
|
print("**alert** popup **alert**")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
driver.implicitly_wait(3)
|
driver.implicitly_wait(2)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
kill_popup = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/keep_btn']")
|
kill_popup = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/keep_btn']")
|
||||||
kill_popup.click()
|
kill_popup.click()
|
||||||
@@ -1784,8 +1784,8 @@ def wifi_disconnect_and_forget(request, WifiName, WifiPass, setup_perfectoMobile
|
|||||||
def get_all_available_ssids(driver):
|
def get_all_available_ssids(driver):
|
||||||
active_ssid_list = []
|
active_ssid_list = []
|
||||||
try:
|
try:
|
||||||
time.sleep(8)
|
time.sleep(5)
|
||||||
driver.implicitly_wait(10)
|
driver.implicitly_wait(5)
|
||||||
elements = driver.find_elements_by_xpath("//*[@resource-id='com.android.settings:id/title']")
|
elements = driver.find_elements_by_xpath("//*[@resource-id='com.android.settings:id/title']")
|
||||||
# print("elements: ", elements)
|
# print("elements: ", elements)
|
||||||
print(len(elements))
|
print(len(elements))
|
||||||
@@ -2700,7 +2700,7 @@ def expressWifi(request, WifiName, setup_perfectoMobile, connData):
|
|||||||
driver = setup_perfectoMobile[0]
|
driver = setup_perfectoMobile[0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
click_on_ssid = WebDriverWait(driver, 60).until(EC.presence_of_element_located((
|
click_on_ssid = WebDriverWait(driver, 10).until(EC.presence_of_element_located((
|
||||||
MobileBy.XPATH,
|
MobileBy.XPATH,
|
||||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Sign in to the network.']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
"//*[@resource-id='com.android.settings:id/summary' and @text='Sign in to the network.']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||||
click_on_ssid.click()
|
click_on_ssid.click()
|
||||||
@@ -2714,7 +2714,7 @@ def expressWifi(request, WifiName, setup_perfectoMobile, connData):
|
|||||||
driver.implicitly_wait(2)
|
driver.implicitly_wait(2)
|
||||||
ExpressWifiBytesLeft = driver.find_element_by_xpath("//*[@label='0KB left']")
|
ExpressWifiBytesLeft = driver.find_element_by_xpath("//*[@label='0KB left']")
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
driver.implicitly_wait(25)
|
# driver.implicitly_wait(25)
|
||||||
#Add function to Toggle Wifi if Express Wifi Home Page not Triggerd
|
#Add function to Toggle Wifi if Express Wifi Home Page not Triggerd
|
||||||
print("Express Wifi Page Not Logged In - ")
|
print("Express Wifi Page Not Logged In - ")
|
||||||
|
|
||||||
@@ -2743,9 +2743,11 @@ def expressWifi(request, WifiName, setup_perfectoMobile, connData):
|
|||||||
LogOut = driver.find_element_by_xpath(expressWifiOutputMsg)
|
LogOut = driver.find_element_by_xpath(expressWifiOutputMsg)
|
||||||
print("----" + LogOut.text + "\n")
|
print("----" + LogOut.text + "\n")
|
||||||
if 'test completed successfully' in LogOut.text:
|
if 'test completed successfully' in LogOut.text:
|
||||||
assert True
|
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
assert False
|
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||||
|
return False
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Exception Verify Results")
|
print("Exception Verify Results")
|
||||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||||
|
|||||||
@@ -1369,7 +1369,7 @@ def expressWifi(request, setup_perfectoMobile, connData):
|
|||||||
driver.implicitly_wait(2)
|
driver.implicitly_wait(2)
|
||||||
ExpressWifiBytesLeft = driver.find_element_by_xpath("//*[@label='0KB left']")
|
ExpressWifiBytesLeft = driver.find_element_by_xpath("//*[@label='0KB left']")
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
driver.implicitly_wait(25)
|
# driver.implicitly_wait(25)
|
||||||
# Add function to Toggle Wifi if Express Wifi Home Page not Triggerd
|
# Add function to Toggle Wifi if Express Wifi Home Page not Triggerd
|
||||||
print("Express Wifi Page Not Logged In - ")
|
print("Express Wifi Page Not Logged In - ")
|
||||||
|
|
||||||
@@ -1411,10 +1411,13 @@ def expressWifi(request, setup_perfectoMobile, connData):
|
|||||||
print("ExpressWifi Verify Test Complete Msg")
|
print("ExpressWifi Verify Test Complete Msg")
|
||||||
report.step_start("ExpressWifi Verify Test Complete Msg")
|
report.step_start("ExpressWifi Verify Test Complete Msg")
|
||||||
ExpressWifiRunTests = driver.find_element_by_xpath("//*[contains (@label,'test completed successfully')]")
|
ExpressWifiRunTests = driver.find_element_by_xpath("//*[contains (@label,'test completed successfully')]")
|
||||||
|
# closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||||
|
return True
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
assert False
|
# closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||||
print(" !! ExpressWifi Failure Test Complete Msg")
|
print(" !! ExpressWifi Failure Test Complete Msg")
|
||||||
|
return False
|
||||||
|
|
||||||
# 2)Settings to Logout
|
# 2)Settings to Logout
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ class TestExpressWifiAndroid(object):
|
|||||||
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||||
|
|
||||||
#Express Wifi
|
#Express Wifi
|
||||||
expressWifi(request, ssidName, setup_perfectoMobile_android, connData)
|
if expressWifi(request, ssidName, setup_perfectoMobile_android, connData):
|
||||||
|
assert True
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
#ForgetWifi
|
#ForgetWifi
|
||||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,10 @@ class TestExpressWifi(object):
|
|||||||
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
# Express Wifi
|
# Express Wifi
|
||||||
expressWifi(request, setup_perfectoMobile_iOS, connData)
|
if expressWifi(request, setup_perfectoMobile_iOS, connData):
|
||||||
|
assert True
|
||||||
|
else:
|
||||||
|
assert False
|
||||||
|
|
||||||
# ForgetWifi
|
# ForgetWifi
|
||||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user