mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-02 11:57:49 +00:00
Updated iOS test case
Signed-off-by: raj-TIP <rpasupathy@perfectomobile.com>
This commit is contained in:
@@ -31,7 +31,13 @@ def closeApp(appName, setup_perfectoMobile):
|
|||||||
params = {'identifier': appName}
|
params = {'identifier': appName}
|
||||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||||
|
|
||||||
def set_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
def rebootPhone(setup_perfectoMobile):
|
||||||
|
#print("Closing App.." + appName)
|
||||||
|
setup_perfectoMobile[1].step_start("Rebooting Phone...")
|
||||||
|
params = {}
|
||||||
|
setup_perfectoMobile[0].execute_script('mobile:handset:reboot', params)
|
||||||
|
|
||||||
|
def set_APconnMobileDevice_iOS(WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||||
|
|
||||||
print("Verifying Wifi/AP Connection Details....")
|
print("Verifying Wifi/AP Connection Details....")
|
||||||
report = setup_perfectoMobile[1]
|
report = setup_perfectoMobile[1]
|
||||||
@@ -75,10 +81,10 @@ def set_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
|||||||
try:
|
try:
|
||||||
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
report.assertSoft
|
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
|
||||||
print("Wifi-AP Connected Successfully: " + Wifi_AP_Name)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
print("Selecting Wifi...: " + WifiName)
|
||||||
try:
|
try:
|
||||||
report.step_start("Selecting Wifi...: " + WifiName)
|
report.step_start("Selecting Wifi...: " + WifiName)
|
||||||
element.click()
|
element.click()
|
||||||
@@ -90,13 +96,15 @@ def set_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
|||||||
wifiXpath2.click()
|
wifiXpath2.click()
|
||||||
|
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
|
#PerfectoErrorHandleClass
|
||||||
|
#Pass a list of errors that can be ignored
|
||||||
print("\n Can't find Wifi/AP NAME.....CheckXpath & Wifi Name")
|
print("\n Can't find Wifi/AP NAME.....CheckXpath & Wifi Name")
|
||||||
# print (e.message)
|
# print (e.message)
|
||||||
|
|
||||||
#Set password if Needed
|
#Set password if Needed
|
||||||
try:
|
try:
|
||||||
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
|
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
|
||||||
wifiPassword.send_keys(connData["wifi-SSID-2g-Pwd"])
|
wifiPassword.send_keys(WifiPass)
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Enter Password Page Not Loaded ")
|
print("Enter Password Page Not Loaded ")
|
||||||
|
|
||||||
@@ -109,7 +117,7 @@ def set_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
|||||||
try:
|
try:
|
||||||
WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Wifi-AP Connected Successfully: " + WifiName)
|
print("No Wifi-AP Error Internet Error: " + WifiName)
|
||||||
|
|
||||||
def Toggle_AirplaneMode_iOS(setup_perfectoMobile, connData):
|
def Toggle_AirplaneMode_iOS(setup_perfectoMobile, connData):
|
||||||
report = setup_perfectoMobile[1]
|
report = setup_perfectoMobile[1]
|
||||||
@@ -133,6 +141,7 @@ def Toggle_AirplaneMode_iOS(setup_perfectoMobile, connData):
|
|||||||
#ssertEqual(CellularMsgEle.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
#ssertEqual(CellularMsgEle.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
||||||
print("Verify Cellular Mode Text: Airplane Mode Success")
|
print("Verify Cellular Mode Text: Airplane Mode Success")
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
|
|
||||||
print("Cellular Mode Not in Airplane Mode: ERROR")
|
print("Cellular Mode Not in Airplane Mode: ERROR")
|
||||||
|
|
||||||
#Set Airplane Mode Back
|
#Set Airplane Mode Back
|
||||||
@@ -189,6 +198,64 @@ def verify_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
|||||||
print("Exception Checking Wifi/AP connection NAME...")
|
print("Exception Checking Wifi/AP connection NAME...")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def ForgetWifiConnection(setup_perfectoMobile, wifiName, connData):
|
||||||
|
report = setup_perfectoMobile[1]
|
||||||
|
driver = setup_perfectoMobile[0]
|
||||||
|
|
||||||
|
report.step_start("Forget Existing Wifi")
|
||||||
|
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# print("Verifying Connected Wifi Connection")
|
||||||
|
report.step_start("Verifying Existing Connected Wifi Connection")
|
||||||
|
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||||
|
Wifi_AP_Name = element.text
|
||||||
|
except NoSuchElementException:
|
||||||
|
print("Exception: Verify Xpath - UpdateXpath")
|
||||||
|
|
||||||
|
if Wifi_AP_Name.__eq__(wifiName):
|
||||||
|
print("Wifi Name Matches Connected To: " + Wifi_AP_Name)
|
||||||
|
element.click()
|
||||||
|
|
||||||
|
print("More Info on Wifi: " + Wifi_AP_Name)
|
||||||
|
report.step_start("Click on More Info on Wifi")
|
||||||
|
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||||
|
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
|
||||||
|
elementMoreInfo.click()
|
||||||
|
|
||||||
|
print("Forget Wifi Network " + Wifi_AP_Name)
|
||||||
|
report.step_start("Forget Wifi Network")
|
||||||
|
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
|
||||||
|
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||||
|
elementforgetWifi.click()
|
||||||
|
|
||||||
|
print("Forget Wifi PopUp: " + Wifi_AP_Name)
|
||||||
|
report.step_start("Forget Wifi Network PopUp Confirm")
|
||||||
|
WifiXpathForgetWifi = "//*[@label='Forget']"
|
||||||
|
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||||
|
elementforgetWifi.click()
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Connected To: " + Wifi_AP_Name)
|
||||||
|
print("Initial Wifi: " + wifiName)
|
||||||
|
element.click()
|
||||||
|
|
||||||
|
report.step_start("Click on More Info on Wifi")
|
||||||
|
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ wifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||||
|
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
|
||||||
|
elementMoreInfo.click()
|
||||||
|
|
||||||
|
print("Forget Wifi Network " + wifiName)
|
||||||
|
report.step_start("Forget Wifi Network")
|
||||||
|
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
|
||||||
|
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||||
|
elementforgetWifi.click()
|
||||||
|
|
||||||
|
report.step_start("Confirm Forget Wifi Network")
|
||||||
|
WifiXpathForgetWifi = "//*[@label='Forget']"
|
||||||
|
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||||
|
elementforgetWifi.click()
|
||||||
|
|
||||||
def Toggle_WifiMode_iOS(setup_perfectoMobile, connData):
|
def Toggle_WifiMode_iOS(setup_perfectoMobile, connData):
|
||||||
report = setup_perfectoMobile[1]
|
report = setup_perfectoMobile[1]
|
||||||
driver = setup_perfectoMobile[0]
|
driver = setup_perfectoMobile[0]
|
||||||
@@ -216,7 +283,7 @@ def Toggle_WifiMode_iOS(setup_perfectoMobile, connData):
|
|||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Airplane Wifi Button not loaded...")
|
print("Airplane Wifi Button not loaded...")
|
||||||
|
|
||||||
def get_WifiIPAddress_iOS(setup_perfectoMobile, connData):
|
def get_WifiIPAddress_iOS(setup_perfectoMobile, connData, wifiName):
|
||||||
report = setup_perfectoMobile[1]
|
report = setup_perfectoMobile[1]
|
||||||
driver = setup_perfectoMobile[0]
|
driver = setup_perfectoMobile[0]
|
||||||
|
|
||||||
@@ -231,7 +298,7 @@ def get_WifiIPAddress_iOS(setup_perfectoMobile, connData):
|
|||||||
print("Exception: Verify Xpath - unable to click on Wifi")
|
print("Exception: Verify Xpath - unable to click on Wifi")
|
||||||
|
|
||||||
report.step_start("Wifi Page")
|
report.step_start("Wifi Page")
|
||||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ connData["Default-SSID-perfecto-b"] + "']"
|
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ wifiName + "']"
|
||||||
elementWifName = driver.find_element_by_xpath(WifiXpath)
|
elementWifName = driver.find_element_by_xpath(WifiXpath)
|
||||||
#Check AP Internet Error Msg
|
#Check AP Internet Error Msg
|
||||||
print("Checking Internet Connection Error...")
|
print("Checking Internet Connection Error...")
|
||||||
@@ -243,20 +310,20 @@ def get_WifiIPAddress_iOS(setup_perfectoMobile, connData):
|
|||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
#Need to fail test case
|
#Need to fail test case
|
||||||
driver.implicitly_wait(25)
|
driver.implicitly_wait(25)
|
||||||
print("Wifi Connected without any errors: " + connData["Default-SSID-perfecto-b"])
|
print("Wifi Connected without any errors: " + wifiName)
|
||||||
#Fail TEST CASE
|
#Fail TEST CASE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
WifiInternetInfo=driver.find_element_by_xpath("(//XCUIElementTypeButton[@label='More Info'])[1]")
|
WifiInternetInfo=driver.find_element_by_xpath("(//XCUIElementTypeButton[@label='More Info'])[1]")
|
||||||
WifiInternetInfo.click()
|
WifiInternetInfo.click()
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Wifi-AP Connected Successfully: " + connData["Default-SSID-perfecto-b"])
|
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
WifiIPaddress= driver.find_element_by_xpath("(//*[@label='Router']/parent::*/XCUIElementTypeStaticText)[2]").text
|
WifiIPaddress= driver.find_element_by_xpath("(//*[@label='Router']/parent::*/XCUIElementTypeStaticText)[2]").text
|
||||||
return WifiIPaddress
|
return WifiIPaddress
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
print("Wifi-AP Connected Successfully: " + connData["Default-SSID-perfecto-b"])
|
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -350,7 +417,6 @@ def tearDown(setup_perfectoMobile):
|
|||||||
print(" -- Exception Not Able To Quit --")
|
print(" -- Exception Not Able To Quit --")
|
||||||
print (e.message)
|
print (e.message)
|
||||||
|
|
||||||
|
|
||||||
def verifyUploadDownloadSpeediOS(setup_perfectoMobile, get_APToMobileDevice_data):
|
def verifyUploadDownloadSpeediOS(setup_perfectoMobile, get_APToMobileDevice_data):
|
||||||
report = setup_perfectoMobile[1]
|
report = setup_perfectoMobile[1]
|
||||||
driver = setup_perfectoMobile[0]
|
driver = setup_perfectoMobile[0]
|
||||||
@@ -392,4 +458,66 @@ def verifyUploadDownloadSpeediOS(setup_perfectoMobile, get_APToMobileDevice_data
|
|||||||
|
|
||||||
assert currentResult
|
assert currentResult
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print (e.message)
|
print (e.message)
|
||||||
|
|
||||||
|
def verifyUploadDownloadSpeediOSRemoteDriver(setup_perfectoMobile, get_APToMobileDevice_data):
|
||||||
|
report = setup_perfectoMobile[1]
|
||||||
|
driver = setup_perfectoMobile[0]
|
||||||
|
connData = get_APToMobileDevice_data
|
||||||
|
|
||||||
|
report.step_start("Launch Safari")
|
||||||
|
openApp(connData["bundleId-iOS-Safari"], setup_perfectoMobile)
|
||||||
|
|
||||||
|
print("Search Google Page Internet Speed Test")
|
||||||
|
#driver.get(connData["webURL"])
|
||||||
|
report.step_start("Search Internet Speed Test")
|
||||||
|
elementFindTxt0 = driver.find_element_by_xpath("//XCUIElementTypeButton[@label='Address']")
|
||||||
|
elementFindTxt0.click()
|
||||||
|
|
||||||
|
print("Send Keys")
|
||||||
|
elementFindTxt1 = driver.find_element_by_xpath("//*[@label='Address']")
|
||||||
|
elementFindTxt1.send_keys("Internet Speed Test")
|
||||||
|
|
||||||
|
print("Click Go Search")
|
||||||
|
report.step_start("Click Go Search")
|
||||||
|
elementGo = driver.find_element_by_xpath("//*[@label='go']")
|
||||||
|
elementGo.click()
|
||||||
|
|
||||||
|
# print("Switching to Dom Tree")
|
||||||
|
# context = driver.contexts[2]
|
||||||
|
#print("WebView: " + context)
|
||||||
|
print("AvaiableContext: " + driver.getContexts())
|
||||||
|
#driver.switch_to.window("handle")
|
||||||
|
driver.switch_to.context('WEBVIEW_1')
|
||||||
|
|
||||||
|
print("--Click Run Speed Test Btn ")
|
||||||
|
try:
|
||||||
|
elelSearch2 = driver.find_element_by_xpath("//*[@id='knowledge-verticals-internetspeedtest__test_button']")
|
||||||
|
elelSearch2.click()
|
||||||
|
except NoSuchElementException:
|
||||||
|
print("Enter Not Active...")
|
||||||
|
|
||||||
|
report.step_start("Verify Run Button")
|
||||||
|
driver.find_element_by_xpath(connData["BtnRunSpeedTest"]).click()
|
||||||
|
|
||||||
|
#Get upload/Download Speed
|
||||||
|
try:
|
||||||
|
report.step_start("Get upload/Download Speed")
|
||||||
|
time.sleep(60)
|
||||||
|
downloadMbps = driver.find_element_by_xpath(connData["downloadMbps"])
|
||||||
|
downloadSpeed = downloadMbps.text
|
||||||
|
print("Download: " + downloadSpeed + " Mbps")
|
||||||
|
|
||||||
|
UploadMbps = driver.find_element_by_xpath(connData["UploadMbps"])
|
||||||
|
uploadSpeed = UploadMbps.text
|
||||||
|
print("Upload: " + uploadSpeed + " Mbps")
|
||||||
|
|
||||||
|
print("Access Point Verification Completed Successfully")
|
||||||
|
|
||||||
|
except NoSuchElementException:
|
||||||
|
driver.switch_to.context('NATIVE_APP')
|
||||||
|
print("Access Point Verification NOT Completed, checking Connection....")
|
||||||
|
|
||||||
|
driver.switch_to.context('NATIVE_APP')
|
||||||
|
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ def pytest_addoption(parser):
|
|||||||
parser.addini("bundleId-iOS", "iOS Devices")
|
parser.addini("bundleId-iOS", "iOS Devices")
|
||||||
parser.addini("bundleId-iOS-Settings", "iOS Settings App")
|
parser.addini("bundleId-iOS-Settings", "iOS Settings App")
|
||||||
parser.addini("appPackage-android", "Android Devices")
|
parser.addini("appPackage-android", "Android Devices")
|
||||||
parser.addini("wifi-SSID-5gl-Pwd", "Wifi 5g Password")
|
parser.addini("bundleId-iOS-Safari", "Safari BundleID")
|
||||||
parser.addini("wifi-SSID-2g-Pwd", "Wifi 2g Password")
|
parser.addini("wifi-SSID-2g-Pwd", "Wifi 2g Password")
|
||||||
parser.addini("Default-SSID-5gl-perfecto-b", "Wifi 5g AP Name")
|
parser.addini("Default-SSID-5gl-perfecto-b", "Wifi 5g AP Name")
|
||||||
parser.addini("Default-SSID-2g-perfecto-b", "Wifi 2g AP Name")
|
parser.addini("Default-SSID-2g-perfecto-b", "Wifi 2g AP Name")
|
||||||
|
|||||||
@@ -1,129 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
import unittest
|
|
||||||
from unittest.loader import getTestCaseNames
|
|
||||||
import warnings
|
|
||||||
from perfecto.model.model import Job, Project
|
|
||||||
import urllib3
|
|
||||||
import argparse
|
|
||||||
from perfecto import (PerfectoExecutionContext, PerfectoReportiumClient,TestContext, TestResultFactory)
|
|
||||||
from appium import webdriver
|
|
||||||
#rom selenium import webdriver
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
class TestConf(unittest.TestCase):
|
|
||||||
projectname = 'TIP Project'
|
|
||||||
projectversion = '1.0'
|
|
||||||
jobname = 'Tip-CI-Regression'
|
|
||||||
jobnumber = 1
|
|
||||||
tags = 'TestTag'
|
|
||||||
|
|
||||||
#testCaseName = 'ToggleWifiModeAndroid'
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
#Suppress InsecureRequestWarning: Unverified HTTPS request is being made
|
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
||||||
|
|
||||||
self.securityToken = 'eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw'
|
|
||||||
self.host = 'tip.perfectomobile.com'
|
|
||||||
self.driver = None
|
|
||||||
self.reporting_client = None
|
|
||||||
self.running = False
|
|
||||||
self.suitesetup = False
|
|
||||||
self.setupclient = None
|
|
||||||
self.tags = ''
|
|
||||||
self.testCaseName = 'ToggleWifiModeAndroid'
|
|
||||||
super(TestConf, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def init_listener(self, projectname=None, projectversion=None, jobname=None, jobnumber=None):
|
|
||||||
"""
|
|
||||||
This key word helps to initialize the listener with proper project info
|
|
||||||
:param projectname: current project name
|
|
||||||
:param projectversion: current project version
|
|
||||||
:param jobname: the CI job name
|
|
||||||
:param jobnumber: the CI job number
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
if projectname != None:
|
|
||||||
self.projectname = projectname
|
|
||||||
if projectversion != None:
|
|
||||||
self.projectversion = projectversion
|
|
||||||
if jobname != None:
|
|
||||||
self.jobname = jobname
|
|
||||||
if jobnumber != None:
|
|
||||||
self.jobnumber = int(float(jobnumber))
|
|
||||||
|
|
||||||
# def suitesetup_result(self):
|
|
||||||
# if self.suitesetup:
|
|
||||||
# if self.bi.get_variable_value('${TEST STATUS}') == 'FAIL':
|
|
||||||
# self.setupclient.test_stop(
|
|
||||||
## TestResultFactory.create_failure(self.bi.get_variable_value('${TEST MESSAGE}')))
|
|
||||||
# else:
|
|
||||||
# self.setupclient.test_stop(TestResultFactory.create_success())
|
|
||||||
# self.suitesetup = False
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
capabilities = {
|
|
||||||
'platformName': 'Android',
|
|
||||||
'appPackage': 'com.android.settings',
|
|
||||||
'securityToken' : "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw",
|
|
||||||
}
|
|
||||||
|
|
||||||
self.driver = webdriver.Remote('https://tip.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
|
||||||
self.driver.implicitly_wait(20)
|
|
||||||
self.create_reporting_client()
|
|
||||||
#self.suitesetup_result()
|
|
||||||
self.reporting_client.test_start(self.testCaseName, TestContext([], 'TipCustomTag'))
|
|
||||||
|
|
||||||
def run(self, result=None):
|
|
||||||
self.currentResult = True # remember result for use in tearDown
|
|
||||||
#print('Before' + self.currentResult)
|
|
||||||
unittest.TestCase.run(self, result) # call superclass run method
|
|
||||||
#print('Result' + result)
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
print("-------------------------------------------")
|
|
||||||
print(" -- Tear Down --")
|
|
||||||
|
|
||||||
self.reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
#print('Report-Url: ' + self.reporting_client.report_url() + '\n')
|
|
||||||
|
|
||||||
# if self.currentResult.wasSuccessful():
|
|
||||||
# print(" -- Test Successful --")
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
# else:
|
|
||||||
# print(" -- Test Not Successful --")
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_failure('failure 4096' * 1000))
|
|
||||||
|
|
||||||
# self.reporting_client.test_stop(TestResultFactory.create_failure(self.currentResult.errors,self.currentResult.failures))
|
|
||||||
#Print report's url
|
|
||||||
print('Report-Url: ' + self.reporting_client.report_url() + '\n')
|
|
||||||
except Exception as e:
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.driver.close()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To close --")
|
|
||||||
print (e.message)
|
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
self.driver.quit()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To Quit --")
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
def create_reporting_client(self):
|
|
||||||
perfecto_execution_context = PerfectoExecutionContext(self.driver, self.tags, Job(self.jobname, self.jobnumber),
|
|
||||||
Project(self.projectname, self.projectversion))
|
|
||||||
#perfecto_execution_context = PerfectoExecutionContext(self.driver, ['execution tag1', 'execution tag2'])
|
|
||||||
self.reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
import unittest
|
|
||||||
import warnings
|
|
||||||
import urllib3
|
|
||||||
import argparse
|
|
||||||
from perfecto.model.model import Job, Project
|
|
||||||
from perfecto import (PerfectoExecutionContext, PerfectoReportiumClient,TestContext, TestResultFactory)
|
|
||||||
|
|
||||||
#from appium import webdriver
|
|
||||||
from selenium import webdriver
|
|
||||||
|
|
||||||
class TestConf(unittest.TestCase):
|
|
||||||
projectname = 'TIP Project'
|
|
||||||
projectversion = '1.0'
|
|
||||||
jobname = 'Tip-CI-Regression'
|
|
||||||
jobnumber = 1
|
|
||||||
tags = 'TestTag'
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
#Suppress InsecureRequestWarning: Unverified HTTPS request is being made
|
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
||||||
|
|
||||||
self.securityToken = 'eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw'
|
|
||||||
self.host = 'tip.perfectomobile.com'
|
|
||||||
self.driver = None
|
|
||||||
self.reporting_client = None
|
|
||||||
self.running = False
|
|
||||||
self.suitesetup = False
|
|
||||||
self.setupclient = None
|
|
||||||
self.tags = ''
|
|
||||||
self.testCaseName = 'VerifyAPToMobileDeviceAndroid'
|
|
||||||
|
|
||||||
super(TestConf, self).__init__(*args, **kwargs)
|
|
||||||
|
|
||||||
def init_listener(self, projectname=None, projectversion=None, jobname=None, jobnumber=None):
|
|
||||||
"""
|
|
||||||
This key word helps to initialize the listener with proper project info
|
|
||||||
:param projectname: current project name
|
|
||||||
:param projectversion: current project version
|
|
||||||
:param jobname: the CI job name
|
|
||||||
:param jobnumber: the CI job number
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
if projectname != None:
|
|
||||||
self.projectname = projectname
|
|
||||||
if projectversion != None:
|
|
||||||
self.projectversion = projectversion
|
|
||||||
if jobname != None:
|
|
||||||
self.jobname = jobname
|
|
||||||
if jobnumber != None:
|
|
||||||
self.jobnumber = int(float(jobnumber))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
capabilities = {
|
|
||||||
'platformName': 'Android',
|
|
||||||
'securityToken' : 'eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw',
|
|
||||||
#browserName Chrome/Safari/MobileOS/MobileDefault/PerfectoMobile
|
|
||||||
'browserName': 'MobileOS'
|
|
||||||
#'bundleId': 'com.apple.mobilesafari',
|
|
||||||
#'enableAppiumBehavior': True, # Enable new architecture of Appium
|
|
||||||
# 'autoLaunch': True, # To work with hybrid applications, install the iOS/Android application as instrumented.
|
|
||||||
#'OS': 'Android.*'
|
|
||||||
}
|
|
||||||
|
|
||||||
#self.driver = webdriver.Remote('https://tip.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
|
||||||
|
|
||||||
self.driver = webdriver.Remote('https://tip.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
|
||||||
self.driver.implicitly_wait(30)
|
|
||||||
self.create_reporting_client()
|
|
||||||
self.reporting_client.test_start(self.testCaseName, TestContext([], 'TipCustomTag'))
|
|
||||||
|
|
||||||
|
|
||||||
def run(self, result=None):
|
|
||||||
self.currentResult = True # remember result for use in tearDown
|
|
||||||
unittest.TestCase.run(self, result) # call superclass run method
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
print("-------------------------------------------")
|
|
||||||
print(" -- Tear Down --")
|
|
||||||
self.reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
#if self.currentResult.wasSuccessful():
|
|
||||||
# self.reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
# else:
|
|
||||||
# self.reporting_client.test_stop(TestResultFactory.create_failure('failure 4096' * 1000))
|
|
||||||
|
|
||||||
# self.reporting_client.test_stop(TestResultFactory.create_failure(self.currentResult.errors,
|
|
||||||
# self.currentResult.failures))
|
|
||||||
# Print report's url
|
|
||||||
print('Report-Url: ' + self.reporting_client.report_url() + '\n')
|
|
||||||
except Exception as e:
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.driver.close()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To close --")
|
|
||||||
print (e.message)
|
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
self.driver.quit()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To Quit --")
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def create_reporting_client(self):
|
|
||||||
perfecto_execution_context = PerfectoExecutionContext(self.driver, self.tags, Job(self.jobname, self.jobnumber),
|
|
||||||
Project(self.projectname, self.projectversion))
|
|
||||||
#perfecto_execution_context = PerfectoExecutionContext(self.driver, ['execution tag1', 'execution tag2'])
|
|
||||||
self.reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
import time
|
|
||||||
import unittest
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
#from perfecto import TestResultFactory
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
import argparse
|
|
||||||
from BaseClassAndroid import TestConf
|
|
||||||
|
|
||||||
|
|
||||||
class ReportingTests(TestConf):
|
|
||||||
|
|
||||||
def test_navigation(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
# assert 'Perfecto' in self.driver.title
|
|
||||||
print("-------------------------------------------")
|
|
||||||
#REPORTIUM TEST START
|
|
||||||
#self.reporting_client.step_start("BasicConnectionTest")
|
|
||||||
|
|
||||||
#Open Setting Application
|
|
||||||
print("Opening Settings App..")
|
|
||||||
self.reporting_client.step_start("Opening Settings App..")
|
|
||||||
params = {'identifier': 'com.android.settings'}
|
|
||||||
self.driver.execute_script('mobile:application:close', params)
|
|
||||||
self.driver.execute_script('mobile:application:open', params)
|
|
||||||
|
|
||||||
print("Load Wifi/BlueTooth/AirplaneMode Connection Settings..")
|
|
||||||
self.reporting_client.step_start("Load Connection Settings")
|
|
||||||
element = self.driver.find_element_by_xpath("//*[@text='Connections']")
|
|
||||||
element.click()
|
|
||||||
|
|
||||||
#Verifies if AP is connected to Wifi status
|
|
||||||
# print("Verify AirplaneMode Connection Status..")
|
|
||||||
# try:
|
|
||||||
# WifiXpath = "//*[@text='Airplane mode']/parent::*/android.widget.TextView[2]"
|
|
||||||
## elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
|
||||||
# print("Airplane Mode StatusMsg: " + elementWifName.text)
|
|
||||||
# except NoSuchElementException:
|
|
||||||
# print("Exception: Unable to Toggle Airplane Radio Button...Check Xpath")
|
|
||||||
|
|
||||||
|
|
||||||
print("Toggle Airplane AP Mode..")
|
|
||||||
self.reporting_client.step_start("Toggle Airplane AP Mode")
|
|
||||||
try:
|
|
||||||
WifiInternet = self.driver.find_element_by_xpath("//*[@content-desc='Airplane mode']")
|
|
||||||
WifiInternet.click()
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Unable to Toggle Airplane Radio Button...Check Xpath")
|
|
||||||
|
|
||||||
|
|
||||||
#Ensure Wifi Radio Button Disabled
|
|
||||||
print("Verify Airplane Disconnected Status..")
|
|
||||||
self.reporting_client.step_start("Verify Airplane Disconnected Status")
|
|
||||||
try:
|
|
||||||
WifiXpathDisconnected = "//*[@text='Airplane mode']/parent::*/android.widget.TextView[2]"
|
|
||||||
elementWifiDiscont = self.driver.find_element_by_xpath(WifiXpathDisconnected)
|
|
||||||
print("AirPlane Disconnected Name: " + "Please " + elementWifiDiscont.text)
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Warning...No Airplane Mode Msg...Check Xpath")
|
|
||||||
|
|
||||||
print("Toggle Airplane Radio Button On..")
|
|
||||||
self.reporting_client.step_start("Toggle Airplane Radio Button On")
|
|
||||||
try:
|
|
||||||
#Toggle Wifi Radio Button
|
|
||||||
WifiInternet2 = self.driver.find_element_by_xpath("//*[@content-desc='Airplane mode']")
|
|
||||||
WifiInternet2.click()
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Unable to Toggle Airplane Radio...Check Xpath")
|
|
||||||
|
|
||||||
#Verifies if AP is connected to Wifi status
|
|
||||||
print("Verify Wifi ReConnection Status..")
|
|
||||||
self.reporting_client.step_start("Verify Wifi ReConnection Status..")
|
|
||||||
try:
|
|
||||||
WifiXpathToggle = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
|
||||||
elementWifNameToggle = self.driver.find_element_by_xpath(WifiXpathToggle)
|
|
||||||
print("Wifi Connected AP Status: " + elementWifNameToggle.text)
|
|
||||||
self.reporting_client.step_start("Connection Status Successfull")
|
|
||||||
#self.assertEqual("elementWifName.text","elementWifNameToggle.text","Connection Successfull Reconnected")
|
|
||||||
print("Connection Successfull Reconnected")
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: AirplaneMode Not Connected Back...Check Xpath")
|
|
||||||
|
|
||||||
except NoSuchElementException as ex:
|
|
||||||
self.currentResult = False
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
|
||||||
print (ex.message)
|
|
||||||
self.currentResult = True
|
|
||||||
#self.reporting_client.test_stop(Tes
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
|
||||||
|
|
||||||
#parser.add_argument(
|
|
||||||
# "-c",
|
|
||||||
# "--cloud_name",
|
|
||||||
# metavar="cloud_name",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
#)
|
|
||||||
# parser.add_argument(
|
|
||||||
# "-s",
|
|
||||||
# "--security_token",
|
|
||||||
# metavar="security_token",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
# )
|
|
||||||
|
|
||||||
#args = vars(parser.parse_args())
|
|
||||||
|
|
||||||
#if not args["cloud_name"]:
|
|
||||||
# parser.print_help()
|
|
||||||
# parser.error(
|
|
||||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
|
||||||
# )
|
|
||||||
# exit
|
|
||||||
|
|
||||||
#print(str(args["cloud_name"]))
|
|
||||||
|
|
||||||
unittest.main()
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
import time
|
|
||||||
import unittest
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
from perfecto import TestResultFactory
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
import argparse
|
|
||||||
from BaseClassAndroid import TestConf
|
|
||||||
|
|
||||||
|
|
||||||
class ReportingTests(TestConf):
|
|
||||||
|
|
||||||
#reportTagStart = reportTagStart()
|
|
||||||
|
|
||||||
def test_navigation(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
# assert 'Perfecto' in self.driver.title
|
|
||||||
print("-------------------------------------------")
|
|
||||||
#REPORTIUM TEST START
|
|
||||||
|
|
||||||
#Open Setting Application
|
|
||||||
print("Opening Settings App..")
|
|
||||||
#self.reportTagStart()
|
|
||||||
self.reporting_client.step_start("Opening Settings App..")
|
|
||||||
params = {'identifier': 'com.android.settings'}
|
|
||||||
self.driver.execute_script('mobile:application:close', params)
|
|
||||||
self.driver.execute_script('mobile:application:open', params)
|
|
||||||
|
|
||||||
self.reporting_client.step_start("Load Wifi/BlueTooth/AirplaneMode Connection Settings..")
|
|
||||||
print("Load Wifi/BlueTooth/AirplaneMode Connection Settings..")
|
|
||||||
element = self.driver.find_element_by_xpath("//*[@text='Connections']")
|
|
||||||
element.click()
|
|
||||||
|
|
||||||
|
|
||||||
#Verifies if AP is connected to Wifi status
|
|
||||||
print("Verify Wifi Connection Status..")
|
|
||||||
self.reporting_client.step_start("Verify Wifi Connection Status..")
|
|
||||||
try:
|
|
||||||
WifiXpath = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
|
||||||
elementWifName = self.driver.find_element_by_xpath(WifiXpath)
|
|
||||||
print("Wifi Connected AP Name: " + elementWifName.text)
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Unable to Toggle Wifi Radio Button...Check Xpath")
|
|
||||||
|
|
||||||
|
|
||||||
print("Toggle Wifi AP Mode..")
|
|
||||||
self.reporting_client.step_start("Toggle Wifi AP Mode..")
|
|
||||||
try:
|
|
||||||
WifiInternet = self.driver.find_element_by_xpath("//*[@content-desc='Wi-Fi']")
|
|
||||||
WifiInternet.click()
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Unable to Toggle Wifi Radio Button...Check Xpath")
|
|
||||||
|
|
||||||
|
|
||||||
#Ensure Wifi Radio Button Disabled
|
|
||||||
print("Verify Wifi Disconnected Status..")
|
|
||||||
self.reporting_client.step_start("Verify Wifi Disconnected Status..")
|
|
||||||
try:
|
|
||||||
WifiXpathDisconnected = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
|
||||||
elementWifiDiscont = self.driver.find_element_by_xpath(WifiXpathDisconnected)
|
|
||||||
print("Wifi Disconnected Name: " + "Please " + elementWifiDiscont.text)
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Warning...No Wifi Disconnected Msg...Check Xpath")
|
|
||||||
|
|
||||||
|
|
||||||
print("Toggle Wifi Radio Button On..")
|
|
||||||
self.reporting_client.step_start("Toggle Wifi Radio Button On..")
|
|
||||||
try:
|
|
||||||
#Toggle Wifi Radio Button
|
|
||||||
WifiInternet2 = self.driver.find_element_by_xpath("//*[@content-desc='Wi-Fi']")
|
|
||||||
WifiInternet2.click()
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Unable to Toggle Wifi Radio...Check Xpath")
|
|
||||||
|
|
||||||
#Verifies if AP is connected to Wifi status
|
|
||||||
print("Verify Wifi ReConnection Status..")
|
|
||||||
self.reporting_client.step_start("Verify Wifi ReConnection Status..")
|
|
||||||
try:
|
|
||||||
WifiXpathToggle = "//*[@text='Wi-Fi']/parent::*/android.widget.TextView[2]"
|
|
||||||
elementWifNameToggle = self.driver.find_element_by_xpath(WifiXpathToggle)
|
|
||||||
print("Wifi Connected AP Status: " + elementWifNameToggle.text)
|
|
||||||
#self.assertEqual("elementWifName.text","elementWifNameToggle.text","Connection Successfull Reconnected")
|
|
||||||
print("Connection Successfull Reconnected")
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Exception: Wifi Not Connected Back.Check Xpath")
|
|
||||||
|
|
||||||
except NoSuchElementException as ex:
|
|
||||||
self.currentResult = False
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
|
||||||
print (ex.message)
|
|
||||||
#self.currentResult = True
|
|
||||||
#self.reporting_client.test_stop(Tes
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
|
||||||
|
|
||||||
#parser.add_argument(
|
|
||||||
# "-c",
|
|
||||||
# "--cloud_name",
|
|
||||||
# metavar="cloud_name",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
#)
|
|
||||||
# parser.add_argument(
|
|
||||||
# "-s",
|
|
||||||
# "--security_token",
|
|
||||||
# metavar="security_token",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
# )
|
|
||||||
|
|
||||||
#args = vars(parser.parse_args())
|
|
||||||
|
|
||||||
#if not args["cloud_name"]:
|
|
||||||
# parser.print_help()
|
|
||||||
# parser.error(
|
|
||||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
|
||||||
# )
|
|
||||||
# exit
|
|
||||||
|
|
||||||
#print(str(args["cloud_name"]))
|
|
||||||
|
|
||||||
unittest.main()
|
|
||||||
|
|
||||||
#def reportTagStart(self, stepName):
|
|
||||||
# self.reporting_client.step_start(stepName)
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
import time
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import warnings
|
|
||||||
from selenium.webdriver.common.keys import Keys
|
|
||||||
#from perfecto import TestResultFactory
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
import argparse
|
|
||||||
|
|
||||||
from urllib3.exceptions import HeaderParsingError
|
|
||||||
from BaseClassWebAndroid import TestConf
|
|
||||||
|
|
||||||
|
|
||||||
class ReportingTests(TestConf):
|
|
||||||
|
|
||||||
def test_navigation(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
print("-----------------AP TO MOBILE DEVICE--------------------------")
|
|
||||||
#REPORTIUM TEST START
|
|
||||||
#self.reporting_client.step_start("BasicConnectionTest")
|
|
||||||
|
|
||||||
#Search
|
|
||||||
try:
|
|
||||||
self.reporting_client.step_start("Go to URL..")
|
|
||||||
self.driver.get('https://www.google.com')
|
|
||||||
lblSearch = "//*[@class='gLFyf']"
|
|
||||||
elementFindTxt = self.driver.find_element_by_xpath(lblSearch)
|
|
||||||
elementFindTxt.send_keys("Internet Speed Test")
|
|
||||||
|
|
||||||
try:
|
|
||||||
self.reporting_client.step_start("Verify Speed Test Page Btn")
|
|
||||||
elelSearch = self.driver.find_element_by_xpath("(//*[@class='sbic sb43'])[1]")
|
|
||||||
elelSearch.click()
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Enter Not Active...")
|
|
||||||
time.sleep(15)
|
|
||||||
|
|
||||||
self.reporting_client.step_start("Start Speed Test")
|
|
||||||
BtnRunSpeedTest = "//*[@id='knowledge-verticals-internetspeedtest__test_button']"
|
|
||||||
self.driver.find_element_by_xpath(BtnRunSpeedTest).click()
|
|
||||||
|
|
||||||
#Get upload/Download Speed
|
|
||||||
try:
|
|
||||||
self.reporting_client.step_start("Verify Upload/Download Speed")
|
|
||||||
time.sleep(60)
|
|
||||||
downloadMbps = self.driver.find_element_by_xpath("//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']")
|
|
||||||
downloadSpeed = downloadMbps.text
|
|
||||||
print("Download: " + downloadSpeed + " Mbps")
|
|
||||||
|
|
||||||
UploadMbps = self.driver.find_element_by_xpath("//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']")
|
|
||||||
uploadSpeed = UploadMbps.text
|
|
||||||
print("Upload: " + uploadSpeed + " Mbps")
|
|
||||||
|
|
||||||
print("Access Point Verification Completed Successfully")
|
|
||||||
|
|
||||||
except NoSuchElementException:
|
|
||||||
print("Access Point Verification NOT Completed, checking Connection....")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
#refresh page //*[@label="reload"]
|
|
||||||
#TestAgain: //*[text()="TEST AGAIN"]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# time.sleep(20)
|
|
||||||
|
|
||||||
|
|
||||||
#Close Settings App
|
|
||||||
# self.driver.execute_script('mobile:application:close', params2)
|
|
||||||
|
|
||||||
#REPORTIUM TEST END
|
|
||||||
#self.reporting_client.step_end()
|
|
||||||
|
|
||||||
except NoSuchElementException as ex:
|
|
||||||
self.currentResult = False
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
|
||||||
print (ex.message)
|
|
||||||
self.currentResult = True
|
|
||||||
#self.reporting_client.test_stop(Tes
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
|
||||||
|
|
||||||
#parser.add_argument(
|
|
||||||
# "-c",
|
|
||||||
# "--cloud_name",
|
|
||||||
# metavar="cloud_name",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
#)
|
|
||||||
# parser.add_argument(
|
|
||||||
# "-s",
|
|
||||||
# "--security_token",
|
|
||||||
# metavar="security_token",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
# )
|
|
||||||
|
|
||||||
#args = vars(parser.parse_args())
|
|
||||||
|
|
||||||
#if not args["cloud_name"]:
|
|
||||||
# parser.print_help()
|
|
||||||
# parser.error(
|
|
||||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
|
||||||
# )
|
|
||||||
# exit
|
|
||||||
|
|
||||||
#print(str(args["cloud_name"]))
|
|
||||||
unittest.main()
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
import time
|
|
||||||
import unittest
|
|
||||||
import warnings
|
|
||||||
|
|
||||||
#from perfecto import TestResultFactory
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
import argparse
|
|
||||||
from BaseClassAndroid import TestConf
|
|
||||||
|
|
||||||
|
|
||||||
class ReportingTests(TestConf):
|
|
||||||
|
|
||||||
def test_navigation(self):
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
|
||||||
try:
|
|
||||||
# assert 'Perfecto' in self.driver.title
|
|
||||||
print("-------------------------------------------")
|
|
||||||
#REPORTIUM TEST START
|
|
||||||
#self.reporting_client.step_start("BasicConnectionTest")
|
|
||||||
#DefaultGateWayAccessPoint = self.driver.find_element_by_xpath("//*[@label='Default Gateway IP']/parent::*/XCUIElementTypeButton").text
|
|
||||||
# print("Device-DefaultGateWay-AP: " + "'"+ DefaultGateWayAccessPoint + "'")
|
|
||||||
#self.assertNotEqual(DefaultGateWayAccessPoint, "N/A", "Check Wifi Access Point")
|
|
||||||
# print("Verify Internet Connection..")
|
|
||||||
# networkAccessPoint = self.driver.find_element_by_xpath("//*[@label='Network Connected']/parent::*/XCUIElementTypeButton").text
|
|
||||||
# print("Network-AccessPoint-Connected: " + "'"+ networkAccessPoint + "'")
|
|
||||||
|
|
||||||
#Open Setting Application
|
|
||||||
# print("Opening Settings App..")
|
|
||||||
# params = {'identifier': 'com.android.settings'}
|
|
||||||
#self.driver.execute_script('mobile:application:open', params)
|
|
||||||
# self.driver.execute_script('mobile:application:close', params)
|
|
||||||
# self.driver.execute_script('mobile:application:open', params)
|
|
||||||
|
|
||||||
# params = {'property': 'All'}
|
|
||||||
# deviceProperty = self.driver.execute_script('mobile:handset:info', params)
|
|
||||||
# print("ModelName: " + deviceProperty)
|
|
||||||
self.reporting_client.step_start("Pass Point Verification")
|
|
||||||
params = {'property': 'deviceId'}
|
|
||||||
deviceID = self.driver.execute_script('mobile:handset:info', params)
|
|
||||||
params = {'property': 'model'}
|
|
||||||
deviceModel = self.driver.execute_script('mobile:handset:info', params)
|
|
||||||
print("ModelName: " + deviceModel + " DeviceId: " + deviceID)
|
|
||||||
|
|
||||||
#modelName = self.driver.desired_capabilities['model']
|
|
||||||
#deviceID = self.driver.desired_capabilities['deviceId']
|
|
||||||
#
|
|
||||||
# print("DeviceID: " + deviceID)
|
|
||||||
|
|
||||||
#Close Settings App
|
|
||||||
# print("Close Settings App")
|
|
||||||
#self.driver.execute_script('mobile:application:close', params)
|
|
||||||
|
|
||||||
except NoSuchElementException as ex:
|
|
||||||
self.currentResult = False
|
|
||||||
#self.reporting_client.test_stop(TestResultFactory.create_failure("NoSuchElementException", ex))
|
|
||||||
print (ex.message)
|
|
||||||
self.currentResult = True
|
|
||||||
#self.reporting_client.test_stop(Tes
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# parser = argparse.ArgumentParser(description="Perfecto Arguments")
|
|
||||||
|
|
||||||
#parser.add_argument(
|
|
||||||
# "-c",
|
|
||||||
# "--cloud_name",
|
|
||||||
# metavar="cloud_name",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
#)
|
|
||||||
# parser.add_argument(
|
|
||||||
# "-s",
|
|
||||||
# "--security_token",
|
|
||||||
# metavar="security_token",
|
|
||||||
# help="Perfecto cloud name. (E.g. demo)",
|
|
||||||
# )
|
|
||||||
|
|
||||||
#args = vars(parser.parse_args())
|
|
||||||
|
|
||||||
#if not args["cloud_name"]:
|
|
||||||
# parser.print_help()
|
|
||||||
# parser.error(
|
|
||||||
# "cloud_name parameter is empty. Pass the argument -c followed by cloud_name"
|
|
||||||
# )
|
|
||||||
# exit
|
|
||||||
|
|
||||||
#print(str(args["cloud_name"]))
|
|
||||||
|
|
||||||
unittest.main()
|
|
||||||
@@ -49,7 +49,7 @@ from urllib3 import exceptions
|
|||||||
@pytest.fixture(scope="class")
|
@pytest.fixture(scope="class")
|
||||||
def setup_perfectoMobileWeb(request):
|
def setup_perfectoMobileWeb(request):
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
driver = None
|
rdriver = None
|
||||||
reporting_client = None
|
reporting_client = None
|
||||||
|
|
||||||
warnings.simplefilter("ignore", ResourceWarning)
|
warnings.simplefilter("ignore", ResourceWarning)
|
||||||
@@ -59,12 +59,12 @@ def setup_perfectoMobileWeb(request):
|
|||||||
'platformName': request.config.getini("platformName-iOS"),
|
'platformName': request.config.getini("platformName-iOS"),
|
||||||
'model': request.config.getini("model-iOS"),
|
'model': request.config.getini("model-iOS"),
|
||||||
'browserName': request.config.getini("browserType-iOS"),
|
'browserName': request.config.getini("browserType-iOS"),
|
||||||
'securityToken' : request.config.getini("securityToken")
|
'securityToken' : request.config.getini("securityToken"),
|
||||||
}
|
}
|
||||||
|
|
||||||
driver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
rdriver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
||||||
driver.implicitly_wait(25)
|
rdriver.implicitly_wait(35)
|
||||||
|
|
||||||
projectname = request.config.getini("projectName")
|
projectname = request.config.getini("projectName")
|
||||||
projectversion = request.config.getini("projectVersion")
|
projectversion = request.config.getini("projectVersion")
|
||||||
jobname = request.config.getini("jobName")
|
jobname = request.config.getini("jobName")
|
||||||
@@ -73,29 +73,33 @@ def setup_perfectoMobileWeb(request):
|
|||||||
testCaseName = request.config.getini("jobName")
|
testCaseName = request.config.getini("jobName")
|
||||||
|
|
||||||
print("Setting Perfecto ReportClient....")
|
print("Setting Perfecto ReportClient....")
|
||||||
perfecto_execution_context = PerfectoExecutionContext(driver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
perfecto_execution_context = PerfectoExecutionContext(rdriver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
||||||
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
||||||
reporting_client.test_start(testCaseName, TestContext([], "Raj"))
|
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||||
|
|
||||||
if driver is None:
|
def teardown():
|
||||||
|
try:
|
||||||
|
print(" -- Tear Down --")
|
||||||
|
reporting_client.test_stop(TestResultFactory.create_success())
|
||||||
|
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
||||||
|
rdriver.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(" -- Exception Not Able To close --")
|
||||||
|
print (e.message)
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
rdriver.quit()
|
||||||
|
except Exception as e:
|
||||||
|
print(" -- Exception Not Able To Quit --")
|
||||||
|
print (e.message)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
|
if rdriver is None:
|
||||||
yield -1
|
yield -1
|
||||||
else:
|
else:
|
||||||
yield driver,reporting_client
|
yield rdriver,reporting_client
|
||||||
|
|
||||||
try:
|
|
||||||
print(" -- Tear Down --")
|
|
||||||
reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
|
||||||
driver.close()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To close --")
|
|
||||||
print (e.message)
|
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
driver.quit()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To Quit --")
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
@pytest.fixture(scope="class")
|
@pytest.fixture(scope="class")
|
||||||
def setup_perfectoMobile_iOS(request):
|
def setup_perfectoMobile_iOS(request):
|
||||||
@@ -114,7 +118,7 @@ def setup_perfectoMobile_iOS(request):
|
|||||||
}
|
}
|
||||||
|
|
||||||
driver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
driver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
||||||
driver.implicitly_wait(25)
|
driver.implicitly_wait(35)
|
||||||
|
|
||||||
projectname = request.config.getini("projectName")
|
projectname = request.config.getini("projectName")
|
||||||
projectversion = request.config.getini("projectVersion")
|
projectversion = request.config.getini("projectVersion")
|
||||||
@@ -126,27 +130,32 @@ def setup_perfectoMobile_iOS(request):
|
|||||||
print("Setting Perfecto ReportClient....")
|
print("Setting Perfecto ReportClient....")
|
||||||
perfecto_execution_context = PerfectoExecutionContext(driver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
perfecto_execution_context = PerfectoExecutionContext(driver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
||||||
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
||||||
reporting_client.test_start(testCaseName, TestContext([], "Raj"))
|
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||||
|
|
||||||
|
def teardown():
|
||||||
|
try:
|
||||||
|
print(" -- Tear Down --")
|
||||||
|
reporting_client.test_stop(TestResultFactory.create_success())
|
||||||
|
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
||||||
|
driver.close()
|
||||||
|
except Exception as e:
|
||||||
|
print(" -- Exception Not Able To close --")
|
||||||
|
print (e.message)
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
driver.quit()
|
||||||
|
except Exception as e:
|
||||||
|
print(" -- Exception Not Able To Quit --")
|
||||||
|
print (e.message)
|
||||||
|
|
||||||
|
request.addfinalizer(teardown)
|
||||||
|
|
||||||
if driver is None:
|
if driver is None:
|
||||||
yield -1
|
yield -1
|
||||||
else:
|
else:
|
||||||
yield driver,reporting_client
|
yield driver,reporting_client
|
||||||
|
|
||||||
try:
|
|
||||||
print(" -- Tear Down --")
|
|
||||||
reporting_client.test_stop(TestResultFactory.create_success())
|
|
||||||
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
|
||||||
driver.close()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To close --")
|
|
||||||
print (e.message)
|
|
||||||
finally:
|
|
||||||
try:
|
|
||||||
driver.quit()
|
|
||||||
except Exception as e:
|
|
||||||
print(" -- Exception Not Able To Quit --")
|
|
||||||
print (e.message)
|
|
||||||
|
|
||||||
@pytest.fixture(scope="function")
|
@pytest.fixture(scope="function")
|
||||||
def get_PassPointConniOS_data(request):
|
def get_PassPointConniOS_data(request):
|
||||||
@@ -164,6 +173,8 @@ def get_APToMobileDevice_data(request):
|
|||||||
"lblSearch": "//*[@class='gLFyf']",
|
"lblSearch": "//*[@class='gLFyf']",
|
||||||
"elelSearch": "(//*[@class='sbic sb43'])[1]",
|
"elelSearch": "(//*[@class='sbic sb43'])[1]",
|
||||||
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
||||||
|
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||||
|
"bundleId-iOS-Safari": request.config.getini("bundleId-iOS-Safari"),
|
||||||
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
||||||
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
||||||
"lblSearch2": "test "
|
"lblSearch2": "test "
|
||||||
@@ -175,8 +186,6 @@ def get_AccessPointConn_data(request):
|
|||||||
passPoint_data = {
|
passPoint_data = {
|
||||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||||
"bundleId-iOS-Ping": request.config.getini("bundleId-iOS-Ping"),
|
"bundleId-iOS-Ping": request.config.getini("bundleId-iOS-Ping"),
|
||||||
"Default-SSID-5gl-perfecto-b": request.config.getini("Default-SSID-5gl-perfecto-b"),
|
|
||||||
"Default-SSID-2g-perfecto-b": request.config.getini("Default-SSID-2g-perfecto-b"),
|
|
||||||
"Default-SSID-perfecto-b": request.config.getini("Default-SSID-perfecto-b")
|
"Default-SSID-perfecto-b": request.config.getini("Default-SSID-perfecto-b")
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -187,7 +196,7 @@ def get_ToggleAirplaneMode_data(request):
|
|||||||
passPoint_data = {
|
passPoint_data = {
|
||||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||||
"lblSearch": "//*[@class='gLFyf']",
|
"lblSearch": "//*[@class='gLFyf']",
|
||||||
"elelSearch": "(//*[@class='sbic sb43'])[1]",
|
"elelSearch": "(//*[@class='fSXkBc'])[1]",
|
||||||
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
||||||
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
||||||
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
if 'perfecto_libs' not in sys.path:
|
|
||||||
sys.path.append(f'../libs/perfecto_libs')
|
|
||||||
|
|
||||||
from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
|
||||||
|
|
||||||
@pytest.mark.APToMobileDevice
|
|
||||||
@pytest.mark.wifi5
|
|
||||||
@pytest.mark.wifi6
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
'setup_profiles, create_profiles',
|
|
||||||
[(["NAT"], ["NAT"])],
|
|
||||||
indirect=True,
|
|
||||||
scope="class"
|
|
||||||
)
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("setup_profiles")
|
|
||||||
@pytest.mark.usefixtures("create_profiles")
|
|
||||||
class TestVerifyAPToMobileDevice(object):
|
|
||||||
|
|
||||||
def test_VerifyApTo_MobileDeviceWeb(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
|
||||||
ssidName = profile_data["ssid_name"]
|
|
||||||
security_key = profile_data["security_key"]
|
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
|
||||||
ssidPassword = profile_data["ssid_name"]
|
|
||||||
security_key = profile_data["security_key"]
|
|
||||||
|
|
||||||
print ("SSID_NAME: " + ssidName)
|
|
||||||
print ("SSID_PASS: " + ssidPassword)
|
|
||||||
|
|
||||||
report = setup_perfectoMobileWeb[1]
|
|
||||||
driver = setup_perfectoMobileWeb[0]
|
|
||||||
connData = get_APToMobileDevice_data
|
|
||||||
|
|
||||||
#Set Wifi/AP Mode
|
|
||||||
set_APconnMobileDevice_iOS("Default-SSID-5gl-perfecto-b", setup_perfectoMobileWeb, connData)
|
|
||||||
|
|
||||||
#Verify Upload download Speed from device Selection
|
|
||||||
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ import sys
|
|||||||
if 'perfecto_libs' not in sys.path:
|
if 'perfecto_libs' not in sys.path:
|
||||||
sys.path.append(f'../libs/perfecto_libs')
|
sys.path.append(f'../libs/perfecto_libs')
|
||||||
|
|
||||||
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ping_deftapps_iOS, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
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
|
||||||
|
|
||||||
@pytest.mark.TestPassPointConnectivetyIOS
|
@pytest.mark.AccessPassPointConnectivety
|
||||||
@pytest.mark.wifi5
|
@pytest.mark.wifi5
|
||||||
@pytest.mark.wifi6
|
@pytest.mark.wifi6
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
@@ -29,24 +29,52 @@ from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ping_deftapps_iOS,
|
|||||||
|
|
||||||
@pytest.mark.usefixtures("setup_profiles")
|
@pytest.mark.usefixtures("setup_profiles")
|
||||||
@pytest.mark.usefixtures("create_profiles")
|
@pytest.mark.usefixtures("create_profiles")
|
||||||
class TestPassPointConnectivetyIOS(object):
|
class TestAccessPointConnectivety(object):
|
||||||
|
|
||||||
def test_AccessPointConnection(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_AccessPointConnection_5g_WPA2_Personal(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||||
#profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
|
||||||
ssidName = profile_data["ssid_name"]
|
ssidName = profile_data["ssid_name"]
|
||||||
ssidPassword = profile_data["security_key"]
|
ssidPassword = profile_data["security_key"]
|
||||||
|
|
||||||
print ("SSID_NAME: " + ssidName)
|
print ("SSID_NAME: " + ssidName)
|
||||||
print ("SSID_PASS: " + ssidPassword)
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
report = setup_perfectoMobile_iOS[1]
|
report = setup_perfectoMobile_iOS[1]
|
||||||
driver = setup_perfectoMobile_iOS[0]
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
connData = get_AccessPointConn_data
|
connData = get_AccessPointConn_data
|
||||||
|
|
||||||
#Set Wifi/AP Mode
|
#Set Wifi/AP Mode
|
||||||
set_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Need An ip To ping
|
||||||
|
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||||
|
|
||||||
|
#Open Ping Application
|
||||||
|
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_AccessPointConnection_2g_WPA2_Personal(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_AccessPointConn_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
#Need An ip To ping
|
#Need An ip To ping
|
||||||
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData)
|
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
@@ -55,3 +83,62 @@ class TestPassPointConnectivetyIOS(object):
|
|||||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_AccessPointConnection_5g_WPA(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_AccessPointConn_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Need An ip To ping
|
||||||
|
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||||
|
|
||||||
|
#Open Ping Application
|
||||||
|
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_AccessPointConnection_2g_WPA(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_AccessPointConn_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Need An ip To ping
|
||||||
|
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||||
|
|
||||||
|
#Open Ping Application
|
||||||
|
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
@@ -15,7 +15,7 @@ import sys
|
|||||||
if 'perfecto_libs' not in sys.path:
|
if 'perfecto_libs' not in sys.path:
|
||||||
sys.path.append(f'../libs/perfecto_libs')
|
sys.path.append(f'../libs/perfecto_libs')
|
||||||
|
|
||||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||||
|
|
||||||
@pytest.mark.ToggleAirplaneMode
|
@pytest.mark.ToggleAirplaneMode
|
||||||
@pytest.mark.wifi5
|
@pytest.mark.wifi5
|
||||||
@@ -31,16 +31,13 @@ from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobile
|
|||||||
@pytest.mark.usefixtures("create_profiles")
|
@pytest.mark.usefixtures("create_profiles")
|
||||||
class TestToggleAirplaneMode(object):
|
class TestToggleAirplaneMode(object):
|
||||||
|
|
||||||
def test_ToogleAirplaneMode(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ToogleAirplaneMode_5g_WPA2_Personal(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||||
ssidName = profile_data["ssid_name"]
|
ssidName = profile_data["ssid_name"]
|
||||||
security_key = profile_data["security_key"]
|
ssidPassword = profile_data["security_key"]
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
|
||||||
ssidPassword = profile_data["ssid_name"]
|
|
||||||
security_key = profile_data["security_key"]
|
|
||||||
|
|
||||||
print ("SSID_NAME: " + ssidName)
|
print ("SSID_NAME: " + ssidName)
|
||||||
print ("SSID_PASS: " + ssidPassword)
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
@@ -49,13 +46,91 @@ class TestToggleAirplaneMode(object):
|
|||||||
connData = get_ToggleAirplaneMode_data
|
connData = get_ToggleAirplaneMode_data
|
||||||
|
|
||||||
#Set Wifi/AP Mode
|
#Set Wifi/AP Mode
|
||||||
set_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
#Toggle AirplaneMode
|
#Toggle AirplaneMode
|
||||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
#Verify AP After AirplaneMode
|
#Verify AP After AirplaneMode
|
||||||
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ToogleAirplaneMode_2g_WPA2_Personal(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleAirplaneMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle AirplaneMode
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ToogleAirplaneMode_5g_WPA(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleAirplaneMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle AirplaneMode
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ToogleAirplaneMode_2g_WPA(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleAirplaneMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle AirplaneMode
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
@@ -17,7 +17,7 @@ from urllib3 import exceptions
|
|||||||
if 'perfecto_libs' not in sys.path:
|
if 'perfecto_libs' not in sys.path:
|
||||||
sys.path.append(f'../libs/perfecto_libs')
|
sys.path.append(f'../libs/perfecto_libs')
|
||||||
|
|
||||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||||
|
|
||||||
@pytest.mark.PassPointConnection
|
@pytest.mark.PassPointConnection
|
||||||
@pytest.mark.wifi5
|
@pytest.mark.wifi5
|
||||||
@@ -32,17 +32,14 @@ from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobile
|
|||||||
@pytest.mark.usefixtures("setup_profiles")
|
@pytest.mark.usefixtures("setup_profiles")
|
||||||
@pytest.mark.usefixtures("create_profiles")
|
@pytest.mark.usefixtures("create_profiles")
|
||||||
class TestPassPointConnection(object):
|
class TestPassPointConnection(object):
|
||||||
|
|
||||||
def test_PassPointConnection_Mobile(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
def test_PassPointConnection_5g_WPA2_Personal(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||||
ssidName = profile_data["ssid_name"]
|
ssidName = profile_data["ssid_name"]
|
||||||
security_key = profile_data["security_key"]
|
ssidPassword = profile_data["security_key"]
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
|
||||||
ssidPassword = profile_data["ssid_name"]
|
|
||||||
security_key = profile_data["security_key"]
|
|
||||||
|
|
||||||
print ("SSID_NAME: " + ssidName)
|
print ("SSID_NAME: " + ssidName)
|
||||||
print ("SSID_PASS: " + ssidPassword)
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
@@ -51,12 +48,91 @@ class TestPassPointConnection(object):
|
|||||||
connData = get_PassPointConniOS_data
|
connData = get_PassPointConniOS_data
|
||||||
|
|
||||||
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||||
set_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
#Toggle Airplane Mode and Ensure Wifi Connection.
|
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
#Close Settings App
|
#Close Settings App
|
||||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_PassPointConnection_2g_WPA2_Personal(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_PassPointConniOS_data
|
||||||
|
|
||||||
|
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
#Close Settings App
|
||||||
|
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_PassPointConnection_2g_WPA(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_PassPointConniOS_data
|
||||||
|
|
||||||
|
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
#Close Settings App
|
||||||
|
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_PassPointConnection_5g_WPA(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_PassPointConniOS_data
|
||||||
|
|
||||||
|
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||||
|
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
#Close Settings App
|
||||||
|
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||||
@@ -15,7 +15,7 @@ import sys
|
|||||||
if 'perfecto_libs' not in sys.path:
|
if 'perfecto_libs' not in sys.path:
|
||||||
sys.path.append(f'../libs/perfecto_libs')
|
sys.path.append(f'../libs/perfecto_libs')
|
||||||
|
|
||||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||||
|
|
||||||
@pytest.mark.ToggleWifiMode
|
@pytest.mark.ToggleWifiMode
|
||||||
@pytest.mark.wifi5
|
@pytest.mark.wifi5
|
||||||
@@ -31,13 +31,13 @@ from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, set_APconnMobile
|
|||||||
@pytest.mark.usefixtures("create_profiles")
|
@pytest.mark.usefixtures("create_profiles")
|
||||||
class TestToggleWifiMode(object):
|
class TestToggleWifiMode(object):
|
||||||
|
|
||||||
def test_ToogleWifiMode(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ToogleWifiMode_5g_WPA2_Personal(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||||
#profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
|
||||||
ssidName = profile_data["ssid_name"]
|
ssidName = profile_data["ssid_name"]
|
||||||
ssidPassword = profile_data["security_key"]
|
ssidPassword = profile_data["security_key"]
|
||||||
|
|
||||||
print ("SSID_NAME: " + ssidName)
|
print ("SSID_NAME: " + ssidName)
|
||||||
print ("SSID_PASS: " + ssidPassword)
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ class TestToggleWifiMode(object):
|
|||||||
connData = get_ToggleWifiMode_data
|
connData = get_ToggleWifiMode_data
|
||||||
|
|
||||||
#Set Wifi/AP Mode
|
#Set Wifi/AP Mode
|
||||||
set_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
#Toggle WifiMode
|
#Toggle WifiMode
|
||||||
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
@@ -54,4 +54,87 @@ class TestToggleWifiMode(object):
|
|||||||
#Verify AP After AirplaneMode
|
#Verify AP After AirplaneMode
|
||||||
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
assert value
|
assert value
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ToogleWifiMode_2g_WPA2_Personal(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleWifiMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle WifiMode
|
||||||
|
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
assert value
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ToogleWifiMode_5g_WPA(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleWifiMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle WifiMode
|
||||||
|
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
assert value
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ToogleWifiMode_2g_WPA(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobile_iOS[1]
|
||||||
|
driver = setup_perfectoMobile_iOS[0]
|
||||||
|
connData = get_ToggleWifiMode_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Toggle WifiMode
|
||||||
|
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify AP After AirplaneMode
|
||||||
|
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||||
|
assert value
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||||
126
tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py
Normal file
126
tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
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
|
||||||
|
#pytestmark = [pytest.mark.ClientConnectivity, pytest.mark.nat, pytest.mark.interop]
|
||||||
|
|
||||||
|
if 'perfecto_libs' not in sys.path:
|
||||||
|
sys.path.append(f'../libs/perfecto_libs')
|
||||||
|
|
||||||
|
from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, verifyUploadDownloadSpeediOSRemoteDriver, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||||
|
|
||||||
|
@pytest.mark.ClientConnectivity
|
||||||
|
@pytest.mark.wifi5
|
||||||
|
@pytest.mark.wifi6
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
'setup_profiles, create_profiles',
|
||||||
|
[(["NAT"], ["NAT"])],
|
||||||
|
indirect=True,
|
||||||
|
scope="class"
|
||||||
|
)
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("setup_profiles")
|
||||||
|
@pytest.mark.usefixtures("create_profiles")
|
||||||
|
class TestNatMode(object):
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ClientConnectivity_5g_WPA2_Personal(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobileWeb[1]
|
||||||
|
driver = setup_perfectoMobileWeb[0]
|
||||||
|
connData = get_APToMobileDevice_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
#set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||||
|
|
||||||
|
#Verify Upload download Speed from device Selection
|
||||||
|
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||||
|
#verifyUploadDownloadSpeediOSRemoteDriver(setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa2_personal
|
||||||
|
def test_ClientConnectivity_2g_WPA2_Personal(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobileWeb[1]
|
||||||
|
driver = setup_perfectoMobileWeb[0]
|
||||||
|
connData = get_APToMobileDevice_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#Verify Upload download Speed from device Selection
|
||||||
|
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.twog
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ClientConnectivity_2g_WPA(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobileWeb[1]
|
||||||
|
driver = setup_perfectoMobileWeb[0]
|
||||||
|
connData = get_APToMobileDevice_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#Verify Upload download Speed from device Selection
|
||||||
|
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||||
|
|
||||||
|
@pytest.mark.fiveg
|
||||||
|
@pytest.mark.wpa
|
||||||
|
def test_ClientConnectivity_5g_WPA(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||||
|
|
||||||
|
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||||
|
ssidName = profile_data["ssid_name"]
|
||||||
|
ssidPassword = profile_data["security_key"]
|
||||||
|
print ("SSID_NAME: " + ssidName)
|
||||||
|
print ("SSID_PASS: " + ssidPassword)
|
||||||
|
|
||||||
|
report = setup_perfectoMobileWeb[1]
|
||||||
|
driver = setup_perfectoMobileWeb[0]
|
||||||
|
connData = get_APToMobileDevice_data
|
||||||
|
|
||||||
|
#Set Wifi/AP Mode
|
||||||
|
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#Verify Upload download Speed from device Selection
|
||||||
|
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||||
|
|
||||||
|
#ForgetWifi
|
||||||
|
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||||
@@ -37,9 +37,9 @@ perfectoURL=tip
|
|||||||
securityToken=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw
|
securityToken=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw
|
||||||
|
|
||||||
# Perfecto CI Report
|
# Perfecto CI Report
|
||||||
projectName = TIP-Project
|
projectName = TIP-PyTest-Execution
|
||||||
projectVersion = 1.0
|
projectVersion = 1.0
|
||||||
jobName = Tip-CI-Test
|
jobName = Tip-PyTest-Execution
|
||||||
jobNumber = 1
|
jobNumber = 1
|
||||||
reportTags = TestTag
|
reportTags = TestTag
|
||||||
|
|
||||||
@@ -52,17 +52,9 @@ bundleId-iOS=com.apple.Preferences
|
|||||||
bundleId-iOS-Settings=com.apple.Preferences
|
bundleId-iOS-Settings=com.apple.Preferences
|
||||||
bundleId-iOS-Ping=com.deftapps.ping
|
bundleId-iOS-Ping=com.deftapps.ping
|
||||||
browserType-iOS=safari
|
browserType-iOS=safari
|
||||||
|
bundleId-iOS-Safari=com.apple.mobilesafari
|
||||||
|
|
||||||
# Android Device Capabilities
|
# Android Device Capabilities
|
||||||
platformName-android=Android
|
platformName-android=Android
|
||||||
model-android=Android.*
|
model-android=Android.*
|
||||||
appPackage-android=com.android.settings
|
appPackage-android=com.android.settings
|
||||||
|
|
||||||
wifi-SSID-5gl-Pwd=12345678
|
|
||||||
wifi-SSID-2g-Pwd=12345678
|
|
||||||
|
|
||||||
Default-SSID-5gl-perfecto-b=Default-SSID-5gl-perfecto-b
|
|
||||||
Default-SSID-2g-perfecto-b=Default-SSID-2g-perfecto-b
|
|
||||||
|
|
||||||
Default-SSID-perfecto-b=Default-SSID-5gl-perfecto-b
|
|
||||||
#--- Perfecto parameters -----
|
|
||||||
Reference in New Issue
Block a user