mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed following feature tests:
1. Process watcher loading logs fix 2. Auto commit/rollback issue in query_tool_tests 3. Fixed the scrolling issue while verifying values in a table. 4. Modified some functions in pgadmin_page.py
This commit is contained in:
parent
de878b3198
commit
dc47c8f898
@ -15,6 +15,7 @@ import time
|
|||||||
from selenium.webdriver.common.keys import Keys
|
from selenium.webdriver.common.keys import Keys
|
||||||
from selenium.webdriver.support.ui import WebDriverWait
|
from selenium.webdriver.support.ui import WebDriverWait
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
|
from selenium.webdriver.support import expected_conditions as EC
|
||||||
from selenium.common.exceptions import StaleElementReferenceException, \
|
from selenium.common.exceptions import StaleElementReferenceException, \
|
||||||
TimeoutException
|
TimeoutException
|
||||||
from regression.feature_utils.base_feature_test import BaseFeatureTest
|
from regression.feature_utils.base_feature_test import BaseFeatureTest
|
||||||
@ -83,7 +84,7 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
|
|||||||
self.page.find_by_css_selector('.change_file_types')
|
self.page.find_by_css_selector('.change_file_types')
|
||||||
self.page.fill_input_by_css_selector(
|
self.page.fill_input_by_css_selector(
|
||||||
QueryToolLocators.input_file_path_css,
|
QueryToolLocators.input_file_path_css,
|
||||||
"/tmp/", key_after_input=Keys.RETURN)
|
"/tmp", key_after_input=Keys.RETURN)
|
||||||
|
|
||||||
if self.page.driver.capabilities['browserName'] == 'firefox':
|
if self.page.driver.capabilities['browserName'] == 'firefox':
|
||||||
table = self.page.wait_for_element_to_reload(
|
table = self.page.wait_for_element_to_reload(
|
||||||
@ -91,6 +92,12 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
|
|||||||
QueryToolLocators.select_file_content_css)
|
QueryToolLocators.select_file_content_css)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
self.wait.until(EC.visibility_of_element_located(
|
||||||
|
(By.CSS_SELECTOR, QueryToolLocators.select_file_content_css)))
|
||||||
|
self.wait.until(lambda element:
|
||||||
|
self.page.driver.find_element_by_css_selector(
|
||||||
|
'[name=home]').is_enabled())
|
||||||
|
|
||||||
table = self.page.driver.find_element_by_css_selector(
|
table = self.page.driver.find_element_by_css_selector(
|
||||||
QueryToolLocators.select_file_content_css)
|
QueryToolLocators.select_file_content_css)
|
||||||
retry_count = 0
|
retry_count = 0
|
||||||
@ -113,7 +120,8 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
|
|||||||
# For XSS we need to search against element's html code
|
# For XSS we need to search against element's html code
|
||||||
assert source_code.find(
|
assert source_code.find(
|
||||||
string_to_find
|
string_to_find
|
||||||
) != -1, "{0} might be vulnerable to XSS ".format(source)
|
) != -1, "{0} might be vulnerable to XSS, source code is: {1}".format(
|
||||||
|
source, source_code)
|
||||||
|
|
||||||
def _check_file_sorting(self):
|
def _check_file_sorting(self):
|
||||||
load_file = self.page.find_by_css_selector(
|
load_file = self.page.find_by_css_selector(
|
||||||
|
@ -108,16 +108,17 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
|
|||||||
|
|
||||||
status = test_utils.get_watcher_dialogue_status(self)
|
status = test_utils.get_watcher_dialogue_status(self)
|
||||||
|
|
||||||
if status != "Successfully completed.":
|
|
||||||
test_gui_helper.close_bgprocess_popup(self)
|
|
||||||
|
|
||||||
self.assertEquals(status, "Successfully completed.")
|
|
||||||
|
|
||||||
self.page.retry_click(
|
self.page.retry_click(
|
||||||
(By.CSS_SELECTOR,
|
(By.CSS_SELECTOR,
|
||||||
NavMenuLocators.status_alertifier_more_btn_css),
|
NavMenuLocators.status_alertifier_more_btn_css),
|
||||||
(By.XPATH,
|
(By.XPATH,
|
||||||
NavMenuLocators.process_watcher_alertfier))
|
NavMenuLocators.process_watcher_alertfier))
|
||||||
|
self.page.wait_for_element_to_disappear(
|
||||||
|
lambda driver: driver.find_element_by_css_selector(".loading-logs")
|
||||||
|
)
|
||||||
|
|
||||||
|
if status != "Successfully completed.":
|
||||||
|
self.assertEquals(status, "Successfully completed.")
|
||||||
|
|
||||||
backup_file = None
|
backup_file = None
|
||||||
# Check for XSS in Backup details
|
# Check for XSS in Backup details
|
||||||
@ -177,16 +178,17 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
|
|||||||
|
|
||||||
status = test_utils.get_watcher_dialogue_status(self)
|
status = test_utils.get_watcher_dialogue_status(self)
|
||||||
|
|
||||||
if status != "Successfully completed.":
|
|
||||||
test_gui_helper.close_bgprocess_popup(self)
|
|
||||||
|
|
||||||
self.assertEquals(status, "Successfully completed.")
|
|
||||||
|
|
||||||
self.page.retry_click(
|
self.page.retry_click(
|
||||||
(By.CSS_SELECTOR,
|
(By.CSS_SELECTOR,
|
||||||
NavMenuLocators.status_alertifier_more_btn_css),
|
NavMenuLocators.status_alertifier_more_btn_css),
|
||||||
(By.XPATH,
|
(By.XPATH,
|
||||||
NavMenuLocators.process_watcher_alertfier))
|
NavMenuLocators.process_watcher_alertfier))
|
||||||
|
self.page.wait_for_element_to_disappear(
|
||||||
|
lambda driver: driver.find_element_by_css_selector(".loading-logs")
|
||||||
|
)
|
||||||
|
|
||||||
|
if status != "Successfully completed.":
|
||||||
|
self.assertEquals(status, "Successfully completed.")
|
||||||
|
|
||||||
# Check for XSS in Restore details
|
# Check for XSS in Restore details
|
||||||
if self.is_xss_check:
|
if self.is_xss_check:
|
||||||
|
@ -26,19 +26,19 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
|
|
||||||
scenarios = [
|
scenarios = [
|
||||||
("Test for PG maintenance: database", dict(
|
("Test for PG maintenance: database", dict(
|
||||||
database_name='pg_maintenance',
|
database_name='pg_maintenance_',
|
||||||
table_name='pg_maintenance_table',
|
table_name='table_',
|
||||||
test_level='database',
|
test_level='database',
|
||||||
is_xss_check=False,
|
is_xss_check=False,
|
||||||
)),
|
)),
|
||||||
("Test for PG maintenance: table", dict(
|
("Test for PG maintenance: table", dict(
|
||||||
database_name='pg_maintenance',
|
database_name='pg_maintenance_',
|
||||||
table_name='pg_maintenance_table',
|
table_name='table_',
|
||||||
test_level='table',
|
test_level='table',
|
||||||
is_xss_check=False,
|
is_xss_check=False,
|
||||||
)),
|
)),
|
||||||
("Test for XSS in maintenance dialog", dict(
|
("Test for XSS in maintenance dialog", dict(
|
||||||
database_name='pg_maintenance',
|
database_name='pg_maintenance_',
|
||||||
table_name='<h1>test_me</h1>',
|
table_name='<h1>test_me</h1>',
|
||||||
test_level='table',
|
test_level='table',
|
||||||
is_xss_check=True,
|
is_xss_check=True,
|
||||||
@ -67,7 +67,9 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
self.server['sslmode']
|
self.server['sslmode']
|
||||||
)
|
)
|
||||||
|
|
||||||
self.table_name = self.table_name + str(random.randint(1000, 3000))
|
self.table_name = self.table_name + str(random.randint(100, 1000))
|
||||||
|
self.database_name = \
|
||||||
|
self.database_name + str(random.randint(100, 1000))
|
||||||
test_utils.drop_database(connection, self.database_name)
|
test_utils.drop_database(connection, self.database_name)
|
||||||
test_utils.create_database(self.server, self.database_name)
|
test_utils.create_database(self.server, self.database_name)
|
||||||
test_utils.create_table(self.server, self.database_name,
|
test_utils.create_table(self.server, self.database_name,
|
||||||
@ -87,7 +89,6 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
self.wait.until(EC.visibility_of_element_located(
|
self.wait.until(EC.visibility_of_element_located(
|
||||||
(By.CSS_SELECTOR,
|
(By.CSS_SELECTOR,
|
||||||
NavMenuLocators.bcg_process_status_alertifier_css)))
|
NavMenuLocators.bcg_process_status_alertifier_css)))
|
||||||
|
|
||||||
self.verify_command()
|
self.verify_command()
|
||||||
|
|
||||||
def _open_maintenance_dialogue(self):
|
def _open_maintenance_dialogue(self):
|
||||||
@ -101,9 +102,18 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
self.page.toggle_open_tables_node(self.server['name'],
|
self.page.toggle_open_tables_node(self.server['name'],
|
||||||
self.server['db_password'],
|
self.server['db_password'],
|
||||||
self.database_name, 'public')
|
self.database_name, 'public')
|
||||||
self.page.click_a_tree_node(
|
retry = 5
|
||||||
self.table_name,
|
status = False
|
||||||
TreeAreaLocators.sub_nodes_of_tables_node)
|
while retry > 0:
|
||||||
|
status = self.page.click_a_tree_node(
|
||||||
|
self.table_name,
|
||||||
|
TreeAreaLocators.sub_nodes_of_tables_node)
|
||||||
|
if status:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retry -= 1
|
||||||
|
self.assertTrue(status, "Table name {} is not selected".format(
|
||||||
|
self.table_name))
|
||||||
|
|
||||||
self.page.retry_click(
|
self.page.retry_click(
|
||||||
(By.LINK_TEXT,
|
(By.LINK_TEXT,
|
||||||
@ -118,17 +128,17 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
|
|
||||||
def verify_command(self):
|
def verify_command(self):
|
||||||
status = test_utils.get_watcher_dialogue_status(self)
|
status = test_utils.get_watcher_dialogue_status(self)
|
||||||
if status != "Successfully completed.":
|
|
||||||
|
|
||||||
test_gui_helper.close_bgprocess_popup(self)
|
|
||||||
|
|
||||||
self.assertEquals(status, "Successfully completed.")
|
|
||||||
|
|
||||||
self.page.retry_click(
|
self.page.retry_click(
|
||||||
(By.CSS_SELECTOR,
|
(By.CSS_SELECTOR,
|
||||||
NavMenuLocators.status_alertifier_more_btn_css),
|
NavMenuLocators.status_alertifier_more_btn_css),
|
||||||
(By.XPATH,
|
(By.XPATH,
|
||||||
NavMenuLocators.process_watcher_alertfier))
|
NavMenuLocators.process_watcher_alertfier))
|
||||||
|
self.page.wait_for_element_to_disappear(
|
||||||
|
lambda driver: driver.find_element_by_css_selector(".loading-logs")
|
||||||
|
)
|
||||||
|
|
||||||
|
if status != "Successfully completed.":
|
||||||
|
self.assertEquals(status, "Successfully completed.")
|
||||||
|
|
||||||
command = self.page.find_by_css_selector(
|
command = self.page.find_by_css_selector(
|
||||||
NavMenuLocators.
|
NavMenuLocators.
|
||||||
@ -158,9 +168,9 @@ class PGUtilitiesMaintenanceFeatureTest(BaseFeatureTest):
|
|||||||
|
|
||||||
def after(self):
|
def after(self):
|
||||||
test_gui_helper.close_bgprocess_popup(self)
|
test_gui_helper.close_bgprocess_popup(self)
|
||||||
self.page.remove_server(self.server)
|
|
||||||
test_utils.delete_table(self.server, self.database_name,
|
test_utils.delete_table(self.server, self.database_name,
|
||||||
self.table_name)
|
self.table_name)
|
||||||
|
self.page.remove_server(self.server)
|
||||||
connection = test_utils.get_db_connection(
|
connection = test_utils.get_db_connection(
|
||||||
self.server['db'],
|
self.server['db'],
|
||||||
self.server['username'],
|
self.server['username'],
|
||||||
|
@ -135,18 +135,10 @@ class QueryToolFeatureTest(BaseFeatureTest):
|
|||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
# disable auto rollback only if they are enabled
|
# disable auto rollback only if they are enabled
|
||||||
btn = self.page.find_by_css_selector(
|
self.uncheck_execute_option('auto_rollback')
|
||||||
QueryToolLocators.btn_auto_rollback)
|
|
||||||
check = btn.find_element_by_tag_name('i')
|
|
||||||
if 'visibility-hidden' not in check.get_attribute('class'):
|
|
||||||
btn.click()
|
|
||||||
|
|
||||||
# enable autocommit only if it's disabled
|
# enable autocommit only if it's disabled
|
||||||
btn = self.page.find_by_css_selector(
|
self.check_execute_option('auto_commit')
|
||||||
QueryToolLocators.btn_auto_commit)
|
|
||||||
check = btn.find_element_by_tag_name('i')
|
|
||||||
if 'visibility-hidden' in check.get_attribute('class'):
|
|
||||||
btn.click()
|
|
||||||
|
|
||||||
# close menu
|
# close menu
|
||||||
query_op.click()
|
query_op.click()
|
||||||
@ -181,8 +173,7 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
|
|||||||
|
|
||||||
print("On demand result set on grid select all... ",
|
print("On demand result set on grid select all... ",
|
||||||
file=sys.stderr, end="")
|
file=sys.stderr, end="")
|
||||||
self.page.find_by_css_selector(
|
self.page.click_execute_query_button()
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
# wait for header of the table to be visible
|
# wait for header of the table to be visible
|
||||||
canvas = self.page.find_by_css_selector(
|
canvas = self.page.find_by_css_selector(
|
||||||
@ -213,8 +204,7 @@ SELECT generate_series(1, {}) as id1, 'dummy' as id2""".format(
|
|||||||
|
|
||||||
print("On demand result set on column select all... ",
|
print("On demand result set on column select all... ",
|
||||||
file=sys.stderr, end="")
|
file=sys.stderr, end="")
|
||||||
self.page.find_by_css_selector(
|
self.page.click_execute_query_button()
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
|
|
||||||
@ -349,18 +339,16 @@ CREATE TABLE public.{}();""".format(table_name)
|
|||||||
|
|
||||||
self.page.fill_codemirror_area_with(query)
|
self.page.fill_codemirror_area_with(query)
|
||||||
|
|
||||||
# open auto commit option and disable it
|
# disable auto commit option
|
||||||
query_op = self.page.find_by_css_selector(
|
query_op = self.page.find_by_css_selector(
|
||||||
QueryToolLocators.btn_query_dropdown)
|
QueryToolLocators.btn_query_dropdown)
|
||||||
query_op.click()
|
query_op.click()
|
||||||
self.page.find_by_css_selector(
|
self.uncheck_execute_option('auto_commit')
|
||||||
QueryToolLocators.btn_auto_commit).click()
|
|
||||||
# close option
|
# close option
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
# execute query
|
# execute query
|
||||||
self.page.find_by_css_selector(
|
self.page.click_execute_query_button()
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
self.page.click_tab('Messages')
|
self.page.click_tab('Messages')
|
||||||
@ -424,13 +412,12 @@ END;"""
|
|||||||
QueryToolLocators.btn_query_dropdown)
|
QueryToolLocators.btn_query_dropdown)
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
self.page.find_by_css_selector(
|
# Enable auto_commit if it is disabled
|
||||||
QueryToolLocators.btn_auto_commit).click()
|
self.check_execute_option('auto_commit')
|
||||||
|
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
self.page.find_by_css_selector(
|
self.page.click_execute_query_button()
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
|
|
||||||
@ -504,14 +491,13 @@ END;"""
|
|||||||
QueryToolLocators.btn_query_dropdown)
|
QueryToolLocators.btn_query_dropdown)
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
# uncheckt auto commit and check auto-rollback
|
# uncheck auto commit and check auto-rollback
|
||||||
self.uncheck_execute_option('auto_commit')
|
self.uncheck_execute_option('auto_commit')
|
||||||
self.check_execute_option('auto_rollback')
|
self.check_execute_option('auto_rollback')
|
||||||
|
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
|
||||||
self.page.find_by_css_selector(
|
self.page.click_execute_query_button()
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
self.page.clear_query_tool()
|
self.page.clear_query_tool()
|
||||||
@ -606,11 +592,20 @@ SELECT 1, pg_sleep(300)"""
|
|||||||
self.uncheck_execute_option('auto_rollback')
|
self.uncheck_execute_option('auto_rollback')
|
||||||
# close drop down
|
# close drop down
|
||||||
query_op.click()
|
query_op.click()
|
||||||
|
# Execute query
|
||||||
|
retry = 5
|
||||||
|
execute_button = self.page.find_by_css_selector(
|
||||||
|
QueryToolLocators.btn_execute_query_css)
|
||||||
|
while retry > 0:
|
||||||
|
execute_button.click()
|
||||||
|
if self.page.wait_for_query_tool_loading_indicator_to_appear():
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retry -= 1
|
||||||
|
# Providing a second of sleep since clicks on the execute and stop
|
||||||
|
# query button is too quick that the query is not able run properly
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
self.page.find_by_css_selector(
|
|
||||||
QueryToolLocators.btn_execute_query_css).click()
|
|
||||||
|
|
||||||
self.page.find_by_xpath("//*[@id='fetching_data']")
|
|
||||||
self.page.find_by_css_selector(
|
self.page.find_by_css_selector(
|
||||||
QueryToolLocators.btn_cancel_query).click()
|
QueryToolLocators.btn_cancel_query).click()
|
||||||
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
self.page.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
|
@ -308,7 +308,11 @@ CREATE TABLE public.nonintpkey
|
|||||||
self._verify_row_data(False, updated_row_data)
|
self._verify_row_data(False, updated_row_data)
|
||||||
|
|
||||||
def _add_update_save_row(self, data, row=1):
|
def _add_update_save_row(self, data, row=1):
|
||||||
for idx in data.keys():
|
items = list(data.keys())
|
||||||
|
for item in range(0, len(items)):
|
||||||
|
items[item] = int(items[item])
|
||||||
|
items.sort(reverse=False)
|
||||||
|
for idx in items:
|
||||||
cell_xpath = CheckForViewDataTest._get_cell_xpath(
|
cell_xpath = CheckForViewDataTest._get_cell_xpath(
|
||||||
'r' + str(idx), row
|
'r' + str(idx), row
|
||||||
)
|
)
|
||||||
@ -347,9 +351,21 @@ CREATE TABLE public.nonintpkey
|
|||||||
|
|
||||||
result_row = self.page.find_by_xpath(xpath)
|
result_row = self.page.find_by_xpath(xpath)
|
||||||
|
|
||||||
# List of row values in an array
|
# Verify the List of actual values with the expected list
|
||||||
for idx in config_check_data.keys():
|
actual_list = list(config_check_data.keys())
|
||||||
element = result_row.find_element_by_class_name("r" + str(idx))
|
for value in range(0, len(actual_list)):
|
||||||
|
actual_list[value] = int(actual_list[value])
|
||||||
|
actual_list.sort(reverse=False)
|
||||||
|
retry = 5
|
||||||
|
for idx in actual_list:
|
||||||
|
while retry > 0:
|
||||||
|
try:
|
||||||
|
element = \
|
||||||
|
result_row.find_element_by_class_name("r" + str(idx))
|
||||||
|
break
|
||||||
|
except Exception:
|
||||||
|
print("stale reference exception at id:", idx)
|
||||||
|
retry -= 1
|
||||||
self.page.driver.execute_script(
|
self.page.driver.execute_script(
|
||||||
"arguments[0].scrollIntoView(false)", element)
|
"arguments[0].scrollIntoView(false)", element)
|
||||||
time.sleep(0.4)
|
time.sleep(0.4)
|
||||||
|
@ -176,6 +176,18 @@ class PgadminPage:
|
|||||||
execute_button.click()
|
execute_button.click()
|
||||||
self.wait_for_query_tool_loading_indicator_to_disappear()
|
self.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
|
|
||||||
|
def click_execute_query_button(self):
|
||||||
|
retry = 5
|
||||||
|
execute_button = self.find_by_css_selector(
|
||||||
|
QueryToolLocators.btn_execute_query_css)
|
||||||
|
while retry > 0:
|
||||||
|
execute_button.click()
|
||||||
|
if self.wait_for_query_tool_loading_indicator_to_appear():
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retry -= 1
|
||||||
|
self.wait_for_query_tool_loading_indicator_to_disappear()
|
||||||
|
|
||||||
def check_execute_option(self, option):
|
def check_execute_option(self, option):
|
||||||
""""This function will check auto commit or auto roll back based on
|
""""This function will check auto commit or auto roll back based on
|
||||||
user input. If button is already checked, no action will be taken"""
|
user input. If button is already checked, no action will be taken"""
|
||||||
@ -394,6 +406,7 @@ class PgadminPage:
|
|||||||
name_of_database):
|
name_of_database):
|
||||||
"""will expand database node under databases node"""
|
"""will expand database node under databases node"""
|
||||||
db_node_expanded_status = False
|
db_node_expanded_status = False
|
||||||
|
retry = 5
|
||||||
if self.expand_databases_node(server_name, server_password):
|
if self.expand_databases_node(server_name, server_password):
|
||||||
sub_nodes_of_databases_node = self.find_by_xpath_list(
|
sub_nodes_of_databases_node = self.find_by_xpath_list(
|
||||||
TreeAreaLocators.sub_nodes_of_databases_node(server_name))
|
TreeAreaLocators.sub_nodes_of_databases_node(server_name))
|
||||||
@ -410,9 +423,17 @@ class PgadminPage:
|
|||||||
self.driver.execute_script("arguments[0].scrollIntoView()",
|
self.driver.execute_script("arguments[0].scrollIntoView()",
|
||||||
sub_nodes_of_databases_node[
|
sub_nodes_of_databases_node[
|
||||||
index_of_required_db_node])
|
index_of_required_db_node])
|
||||||
webdriver.ActionChains(self.driver).double_click(
|
while retry > 0:
|
||||||
sub_nodes_of_databases_node[
|
webdriver.ActionChains(self.driver).double_click(
|
||||||
index_of_required_db_node]).perform()
|
sub_nodes_of_databases_node[
|
||||||
|
index_of_required_db_node]).perform()
|
||||||
|
if self.check_if_element_exist_by_xpath(
|
||||||
|
"//div[@class='ajs-header'and text()='INTERNAL SERVER "
|
||||||
|
"ERROR']", 1):
|
||||||
|
self.click_modal('OK')
|
||||||
|
retry -= 1
|
||||||
|
else:
|
||||||
|
break
|
||||||
if self.wait_for_elements_to_appear(
|
if self.wait_for_elements_to_appear(
|
||||||
self.driver, TreeAreaLocators.
|
self.driver, TreeAreaLocators.
|
||||||
sub_nodes_of_database_node(
|
sub_nodes_of_database_node(
|
||||||
@ -935,7 +956,7 @@ class PgadminPage:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except NoSuchElementException:
|
except (NoSuchElementException, StaleElementReferenceException):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return self._wait_for("element to disappear", element_if_it_disappears)
|
return self._wait_for("element to disappear", element_if_it_disappears)
|
||||||
@ -976,9 +997,10 @@ class PgadminPage:
|
|||||||
self._wait_for("spinner to disappear", spinner_has_disappeared, 20)
|
self._wait_for("spinner to disappear", spinner_has_disappeared, 20)
|
||||||
|
|
||||||
def wait_for_query_tool_loading_indicator_to_appear(self):
|
def wait_for_query_tool_loading_indicator_to_appear(self):
|
||||||
self.check_if_element_exist_by_xpath(
|
status = self.check_if_element_exist_by_xpath(
|
||||||
"//div[@id='editor-panel']//"
|
"//div[@id='editor-panel']//"
|
||||||
"div[@class='pg-sp-container sql-editor-busy-fetching']")
|
"div[@class='pg-sp-container sql-editor-busy-fetching']", 1)
|
||||||
|
return status
|
||||||
|
|
||||||
def wait_for_app(self):
|
def wait_for_app(self):
|
||||||
def page_shows_app(driver):
|
def page_shows_app(driver):
|
||||||
|
@ -234,6 +234,8 @@ def get_test_modules(arguments):
|
|||||||
if 'headless_chrome' in test_setup.config_data:
|
if 'headless_chrome' in test_setup.config_data:
|
||||||
if test_setup.config_data['headless_chrome']:
|
if test_setup.config_data['headless_chrome']:
|
||||||
options.add_argument("--headless")
|
options.add_argument("--headless")
|
||||||
|
options.add_argument("--no-sandbox")
|
||||||
|
options.add_argument("--disable-setuid-sandbox")
|
||||||
options.add_argument("--window-size=1280,1024")
|
options.add_argument("--window-size=1280,1024")
|
||||||
options.add_argument("--disable-infobars")
|
options.add_argument("--disable-infobars")
|
||||||
options.add_experimental_option('w3c', False)
|
options.add_experimental_option('w3c', False)
|
||||||
|
Loading…
Reference in New Issue
Block a user