Fix feature test failures caused due to invalid binary path.
parent
8c8be6461c
commit
3de2e625b5
|
@ -9,6 +9,7 @@
|
|||
|
||||
import os
|
||||
|
||||
from selenium.common.exceptions import TimeoutException
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
|
@ -169,6 +170,9 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
|
|||
(By.CSS_SELECTOR, NavMenuLocators.backup_obj_css)))
|
||||
backup_object.click()
|
||||
|
||||
self.assertFalse(self.page.check_utility_error(),
|
||||
'Binary path is not configured.')
|
||||
|
||||
# Enter the file name of the backup to be taken
|
||||
self.wait.until(EC.visibility_of_element_located(
|
||||
(By.NAME, NavMenuLocators.backup_filename_txt_box_name)))
|
||||
|
@ -204,6 +208,9 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
|
|||
NavMenuLocators.restore_obj_css)
|
||||
restore_obj.click()
|
||||
|
||||
self.assertFalse(self.page.check_utility_error(),
|
||||
'Binary path is not configured.')
|
||||
|
||||
self.wait.until(EC.visibility_of_element_located(
|
||||
(By.NAME, NavMenuLocators.restore_file_name_txt_box_name)))
|
||||
|
||||
|
|
|
@ -116,6 +116,9 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||
(By.CSS_SELECTOR, NavMenuLocators.maintenance_obj_css)))
|
||||
maintenance_obj.click()
|
||||
|
||||
self.assertFalse(self.page.check_utility_error(),
|
||||
'Binary path is not configured.')
|
||||
|
||||
self.page.check_if_element_exist_by_xpath(
|
||||
NavMenuLocators.maintenance_operation, 10)
|
||||
|
||||
|
|
|
@ -127,6 +127,9 @@ class CheckDebuggerForXssFeatureTest(BaseFeatureTest):
|
|||
source_code = self.page.find_by_xpath(
|
||||
"//div[@id='id-debugger-messages'] //div[@id='debugger-msg']"
|
||||
).get_attribute('innerHTML')
|
||||
|
||||
self.assertIsNotNone(source_code, 'Messages tab is empty.')
|
||||
|
||||
self._check_escaped_characters(
|
||||
source_code,
|
||||
'NOTICE: <img src="x" onerror="console.log(1)">',
|
||||
|
|
|
@ -1267,3 +1267,30 @@ class PgadminPage:
|
|||
def clear_edit_box(self, edit_box_webelement):
|
||||
while edit_box_webelement.get_attribute("value") != "":
|
||||
edit_box_webelement.send_keys(Keys.BACK_SPACE)
|
||||
|
||||
def check_utility_error(self):
|
||||
wait = WebDriverWait(self.driver, 2)
|
||||
try:
|
||||
is_error = wait.until(EC.presence_of_element_located(
|
||||
(By.XPATH, "//div[contains(@class,'MuiDialogTitle-root')]"
|
||||
"//div[text()='Utility not found']")
|
||||
))
|
||||
except TimeoutException:
|
||||
is_error = None
|
||||
|
||||
# If debugger plugin is not found
|
||||
if is_error and is_error.text == "Utility not found":
|
||||
click = True
|
||||
while click:
|
||||
try:
|
||||
self.click_modal('OK')
|
||||
wait.until(EC.invisibility_of_element(
|
||||
(By.XPATH, "//div[@class ='MuiDialogTitle-root']"
|
||||
"//div[text()='Utility not found']")
|
||||
))
|
||||
click = False
|
||||
except TimeoutException:
|
||||
pass
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue