mirror of
				https://github.com/Telecominfraproject/wlan-testing.git
				synced 2025-10-31 02:48:11 +00:00 
			
		
		
		
	Merge pull request #358 from Telecominfraproject/WIFI-6790
Added time in ios lib
This commit is contained in:
		| @@ -931,7 +931,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa | |||||||
|             print("Exception: Verify Xpath - unable to click on Wifi") |             print("Exception: Verify Xpath - unable to click on Wifi") | ||||||
|  |  | ||||||
|         time.sleep(2) |         time.sleep(2) | ||||||
|         driver.implicitly_wait(2) |         driver.implicitly_wait(4) | ||||||
|         # --------------------To Turn on WIFi Switch if already OFF-------------------------------- |         # --------------------To Turn on WIFi Switch if already OFF-------------------------------- | ||||||
|         try: |         try: | ||||||
|             get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") |             get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") | ||||||
| @@ -988,11 +988,13 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa | |||||||
|         additional_details_element = driver.find_element_by_xpath("//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']") |         additional_details_element = driver.find_element_by_xpath("//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']") | ||||||
|         additional_details_element.click() |         additional_details_element.click() | ||||||
|         try: |         try: | ||||||
|  |             time.sleep(2) | ||||||
|             print("Forget Connected Network") |             print("Forget Connected Network") | ||||||
|             forget_ssid = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget This Network']"))) |             forget_ssid = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget This Network']"))) | ||||||
|             forget_ssid.click() |             forget_ssid.click() | ||||||
|             print("Forget old ssid") |             print("Forget old ssid") | ||||||
|             try: |             try: | ||||||
|  |                 time.sleep(2) | ||||||
|                 report.step_start("Forget SSID popup1") |                 report.step_start("Forget SSID popup1") | ||||||
|                 forget_ssid_popup = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget']"))) |                 forget_ssid_popup = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget']"))) | ||||||
|                 forget_ssid_popup.click() |                 forget_ssid_popup.click() | ||||||
| @@ -1054,7 +1056,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa | |||||||
|     # ---------------------This is to Select SSID------------------------------- |     # ---------------------This is to Select SSID------------------------------- | ||||||
|     # ---------------------Set Password------------------------------- |     # ---------------------Set Password------------------------------- | ||||||
|     try: |     try: | ||||||
|         time.sleep(3) |         driver.implicitly_wait(2) | ||||||
|         print("Entering Password") |         print("Entering Password") | ||||||
|         report.step_start("Entering Password") |         report.step_start("Entering Password") | ||||||
|         wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") |         wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") | ||||||
| @@ -1065,7 +1067,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa | |||||||
|  |  | ||||||
|     # ---------------------Click on join------------------------------- |     # ---------------------Click on join------------------------------- | ||||||
|     try: |     try: | ||||||
|         time.sleep(2) |         driver.implicitly_wait(3) | ||||||
|         print("Selecting join") |         print("Selecting join") | ||||||
|         report.step_start("Clicking JOIN") |         report.step_start("Clicking JOIN") | ||||||
|         joinBTN = driver.find_element_by_xpath("//*[@label='Join']") |         joinBTN = driver.find_element_by_xpath("//*[@label='Join']") | ||||||
| @@ -1090,13 +1092,14 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa | |||||||
|     try: |     try: | ||||||
|         print("Selecting SSID: ", WifiName) |         print("Selecting SSID: ", WifiName) | ||||||
|         report.step_start("Additional details of SSID") |         report.step_start("Additional details of SSID") | ||||||
|         additional_details_element = WebDriverWait(driver, 30).until( |         additional_details_element = WebDriverWait(driver, 35).until( | ||||||
|             EC.presence_of_element_located((MobileBy.XPATH, |             EC.presence_of_element_located((MobileBy.XPATH, | ||||||
|                                             "//*[@label='" + WifiName + "']"))) |                                             "//*[@label='" + WifiName + "']"))) | ||||||
|         # //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info'] |         # //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info'] | ||||||
|         additional_details_element.click() |         additional_details_element.click() | ||||||
|  |  | ||||||
|         try: |         try: | ||||||
|  |             driver.implicitly_wait(2) | ||||||
|             report.step_start("Checking SSID Name as Expected") |             report.step_start("Checking SSID Name as Expected") | ||||||
|             print("Checking SSID Name") |             print("Checking SSID Name") | ||||||
|             ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text |             ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text | ||||||
| @@ -1684,7 +1687,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|             print("Exception: Verify Xpath - unable to click on Wifi") |             print("Exception: Verify Xpath - unable to click on Wifi") | ||||||
|  |  | ||||||
|         time.sleep(2) |         time.sleep(2) | ||||||
|         driver.implicitly_wait(2) |         driver.implicitly_wait(4) | ||||||
|         # --------------------To Turn on WIFi Switch if already OFF-------------------------------- |         # --------------------To Turn on WIFi Switch if already OFF-------------------------------- | ||||||
|         try: |         try: | ||||||
|             get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") |             get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") | ||||||
| @@ -1735,19 +1738,21 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|     # ---------------------This is to Forget current connected SSID------------------------------- |     # ---------------------This is to Forget current connected SSID------------------------------- | ||||||
|  |  | ||||||
|     try: |     try: | ||||||
|         time.sleep(2) |         time.sleep(3) | ||||||
|         report.step_start("Selecting Connected SSID Info") |         report.step_start("Selecting Connected SSID Info") | ||||||
|         print("getting in to Additional details") |         print("getting in to Additional details") | ||||||
|         additional_details_element = driver.find_element_by_xpath( |         additional_details_element = driver.find_element_by_xpath( | ||||||
|             "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']") |             "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']") | ||||||
|         additional_details_element.click() |         additional_details_element.click() | ||||||
|         try: |         try: | ||||||
|  |             time.sleep(2) | ||||||
|             print("Forget Connected Network") |             print("Forget Connected Network") | ||||||
|             report.step_start("Forget Connected SSID") |             report.step_start("Forget Connected SSID") | ||||||
|             forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']") |             forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']") | ||||||
|             forget_ssid.click() |             forget_ssid.click() | ||||||
|             print("Forget old ssid") |             print("Forget old ssid") | ||||||
|             try: |             try: | ||||||
|  |                 time.sleep(2) | ||||||
|                 report.step_start("Forget SSID popup1") |                 report.step_start("Forget SSID popup1") | ||||||
|                 forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']") |                 forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']") | ||||||
|                 forget_ssid_popup.click() |                 forget_ssid_popup.click() | ||||||
| @@ -1765,7 +1770,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|     # ---------------------To get all available SSID------------------------------- |     # ---------------------To get all available SSID------------------------------- | ||||||
|     print("Searching for Wifi: " + WifiName) |     print("Searching for Wifi: " + WifiName) | ||||||
|     # allure.attach(name= body=str("Searching for Wifi: " + WifiName)) |     # allure.attach(name= body=str("Searching for Wifi: " + WifiName)) | ||||||
|     time.sleep(2) |     time.sleep(5) | ||||||
|     print("Selecting Wifi: " + WifiName) |     print("Selecting Wifi: " + WifiName) | ||||||
|     ssid_found = False |     ssid_found = False | ||||||
|     available_ssids = False |     available_ssids = False | ||||||
| @@ -1807,7 +1812,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|     # Set username |     # Set username | ||||||
|     # ------------------------------------------------------- |     # ------------------------------------------------------- | ||||||
|     try: |     try: | ||||||
|         driver.implicitly_wait(5) |         driver.implicitly_wait(2) | ||||||
|         report.step_start("Entering User") |         report.step_start("Entering User") | ||||||
|         print("Entering User name") |         print("Entering User name") | ||||||
|         wifiUserElement = driver.find_element_by_xpath("//*[@label='Username']") |         wifiUserElement = driver.find_element_by_xpath("//*[@label='Username']") | ||||||
| @@ -1818,7 +1823,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|  |  | ||||||
|     # ---------------------Set Password------------------------------- |     # ---------------------Set Password------------------------------- | ||||||
|     try: |     try: | ||||||
|         driver.implicitly_wait(5) |         driver.implicitly_wait(2) | ||||||
|         report.step_start("Entering Password") |         report.step_start("Entering Password") | ||||||
|         print("Entering password") |         print("Entering password") | ||||||
|         wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") |         wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") | ||||||
| @@ -1830,6 +1835,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|  |  | ||||||
|     # ---------------------Click on join------------------------------- |     # ---------------------Click on join------------------------------- | ||||||
|     try: |     try: | ||||||
|  |         driver.implicitly_wait(2) | ||||||
|         report.step_start("Clicking Join") |         report.step_start("Clicking Join") | ||||||
|         print("Clicking Join") |         print("Clicking Join") | ||||||
|         joinBTN = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Join']"))) |         joinBTN = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Join']"))) | ||||||
| @@ -1840,6 +1846,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|     # Selecting certificate |     # Selecting certificate | ||||||
|     # ------------------------------------------------------- |     # ------------------------------------------------------- | ||||||
|     try: |     try: | ||||||
|  |         driver.implicitly_wait(3) | ||||||
|         report.step_start("Clicking Trust CA Cert") |         report.step_start("Clicking Trust CA Cert") | ||||||
|         print("Clicking Trust CA Cert") |         print("Clicking Trust CA Cert") | ||||||
|         certElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Trust']"))) |         certElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Trust']"))) | ||||||
| @@ -1861,7 +1868,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|  |  | ||||||
|     # ---------------------Additional INFO------------------------------- |     # ---------------------Additional INFO------------------------------- | ||||||
|     try: |     try: | ||||||
|         driver.implicitly_wait(2) |         driver.implicitly_wait(4) | ||||||
|         print("Selecting SSID: ", WifiName) |         print("Selecting SSID: ", WifiName) | ||||||
|         report.step_start("Selecting More Info") |         report.step_start("Selecting More Info") | ||||||
|         additional_details_element = WebDriverWait(driver, 35).until( |         additional_details_element = WebDriverWait(driver, 35).until( | ||||||
| @@ -1871,6 +1878,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|         additional_details_element.click() |         additional_details_element.click() | ||||||
|  |  | ||||||
|         try: |         try: | ||||||
|  |             driver.implicitly_wait(2) | ||||||
|             report.step_start("Checking SSID Name as Expected") |             report.step_start("Checking SSID Name as Expected") | ||||||
|             print("Checking SSID Name") |             print("Checking SSID Name") | ||||||
|             ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text |             ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text | ||||||
| @@ -1898,7 +1906,6 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM | |||||||
|             print("WiFi-Address not Found") |             print("WiFi-Address not Found") | ||||||
|             allure.attach(name="No Connected SSID WiFi-Address Found") |             allure.attach(name="No Connected SSID WiFi-Address Found") | ||||||
|         try: |         try: | ||||||
|             driver.implicitly_wait(5) |  | ||||||
|             print("Checking IP address") |             print("Checking IP address") | ||||||
|             report.step_start("Checking IP address") |             report.step_start("Checking IP address") | ||||||
|             time.sleep(4) |             time.sleep(4) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Shivam Thakur
					Shivam Thakur