Fixed/Update Android-latest

Signed-off-by: raj-TIP <rpasupathy@perfectomobile.com>
This commit is contained in:
raj-TIP
2021-06-02 15:23:44 -05:00
parent 157503ef6a
commit c4b8ec5e41
5 changed files with 33 additions and 34 deletions

View File

@@ -106,7 +106,8 @@ def setup_perfectoMobile_android(request):
testFailed = request.session.testsfailed
if testFailed>0:
print ("Test Case Failure, please check report link: " + testCaseName)
reporting_client.test_stop(TestResultFactory.create_failure(request.config.cache.get("SelectingWifiFailed", None)))
exceptionFailure = request.config.cache.get("SelectingWifiFailed", None)
reporting_client.test_stop(TestResultFactory.create_failure(exceptionFailure))
#seen = {None}
#session = request.node
#print(session)
@@ -233,8 +234,8 @@ def set_APconnMobileDevice_android(request, WifiName, WifiPass, setup_perfectoMo
wifiSelectionElement.click()
except NoSuchElementException or TimeoutException as e:
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
request.config.cache.set(key="SelectingWifiFailed", value=e)
pytest.xfail("Selecting Wifi Failed", e)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
pytest.xfail("Selecting Wifi Failed: " + e)
#Set password if Needed
try:

View File

@@ -4,6 +4,7 @@
1. controller_data/sdk_base_url
2. login credentials
"""
from ast import Str
from logging import exception
import unittest
import warnings
@@ -46,7 +47,7 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
print("-------------------------------------")
reportFlag = True
print("Verifying Wifi/AP Connection Details....")
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
@@ -101,23 +102,17 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
else:
print("Selecting Wifi: " + WifiName)
#try:
print("Selecting Wifi: " + WifiName)
report.step_start("Selecting Wifi...: " + WifiName)
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
element.click()
# except NoSuchElementException:
# print("Exception: Selection Wifi Network")
try:
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
wifiXpath2.click()
except NoSuchElementException or TimeoutException as e:
print("\n Can't find Wifi/AP NAME.....CheckXpath & Wifi Name")
reportFlag = False
pytest.xfail("Selecting Wifi Failed", e)
request.config.cache.set(key="SelectingWifiFailed", value=e)
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))
pytest.xfail("Selecting Wifi Failed: " + e)
#allure.attach(name="Raj", body="hello world")
#Set password if Needed

View File

@@ -153,6 +153,7 @@ def setup_perfectoMobile_iOS(request):
if testFailed>0:
print ("Test Case Failure, please check report link: " + testCaseName)
reporting_client.test_stop(TestResultFactory.create_failure(request.config.cache.get("SelectingWifiFailed", None)))
request.config.cache.set(key="SelectingWifiFailed", value="Cache Cleared!!")
#seen = {None}
#session = request.node
#print(session)
@@ -259,8 +260,6 @@ def get_ToggleWifiMode_data(request):
yield passPoint_data
@pytest.fixture(scope="function")
def get_lanforge_data(testbed):
lanforge_data = {}

View File

@@ -33,23 +33,27 @@ setup_params_general = {
@pytest.mark.AccessPassPointConnectivety
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
#@pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
#)
#@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.usefixtures("setup_profiles")
class TestAccessPointConnectivety(object):
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_AccessPointConnection_5g_WPA2_Personal(self, request, get_AccessPointConn_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
#profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
#ssidName = profile_data["ssid_name"]
# ssidPassword = profile_data["security_key"]
ssidName = "Hello"
ssidPassword = "Password"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)

View File

@@ -34,12 +34,12 @@ setup_params_general = {
#@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
#@pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
#)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoaming(object):
@@ -64,7 +64,7 @@ class TestOpenRoaming(object):
downloadInstallOpenRoamingProfile(request, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
#verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)