+
);
@@ -334,7 +334,7 @@ export function JsonTextEditor({row, column, onRowChange, onClose}) {
{
setEditorPosition(getCellElement(column.idx), ele);
- }} className={classes.jsonEditor}>
+ }} className={classes.jsonEditor} data-label="pg-editor">
{
+ if((e.ctrlKey || e.metaKey) && e.key !== 'Control' && e.keyCode == 67) {
+ handleCopy();
+ }
+ };
+}
+
+function SelectAllHeaderRenderer({onAllRowsSelectionChange, isCellSelected}) {
const [checked, setChecked] = useState(false);
+ const cellRef = useRef();
const eventBus = useContext(QueryToolEventsContext);
+ const dataGridExtras = useContext(DataGridExtrasContext);
const onClick = ()=>{
eventBus.fireEvent(QUERY_TOOL_EVENTS.FETCH_MORE_ROWS, true, ()=>{
setChecked(!checked);
- props.onAllRowsSelectionChange(!checked);
+ onAllRowsSelectionChange(!checked);
});
};
- return ;
+
+ useLayoutEffect(() => {
+ if (!isCellSelected) return;
+ cellRef.current?.focus({ preventScroll: true });
+ }, [isCellSelected]);
+
+ return ;
}
SelectAllHeaderRenderer.propTypes = {
onAllRowsSelectionChange: PropTypes.func,
+ isCellSelected: PropTypes.bool,
};
function SelectableHeaderRenderer({column, selectedColumns, onSelectedColumnsChange, isCellSelected}) {
const classes = useStyles();
+ const cellRef = useRef();
const eventBus = useContext(QueryToolEventsContext);
const dataGridExtras = useContext(DataGridExtrasContext);
@@ -168,11 +187,17 @@ function SelectableHeaderRenderer({column, selectedColumns, onSelectedColumnsCha
const isSelected = selectedColumns.has(column.idx);
+ useLayoutEffect(() => {
+ if (!isCellSelected) return;
+ cellRef.current?.focus({ preventScroll: true });
+ }, [isCellSelected]);
+
return (
-
+
{(column.column_type_internal == 'geometry' || column.column_type_internal == 'geography') &&
- } size="small" style={{marginRight: '0.25rem'}} onClick={(e)=>{
+ } size="small" style={{marginRight: '0.25rem'}} onClick={(e)=>{
e.stopPropagation();
eventBus.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_RENDER_GEOMETRIES, column);
}}/>
@@ -182,8 +207,8 @@ function SelectableHeaderRenderer({column, selectedColumns, onSelectedColumnsCha
{column.display_type}
{column.can_edit ?
- :
-
+ :
+
}
);
@@ -372,7 +397,7 @@ export default function QueryToolDataGrid({columns, rows, totalRowCount, dataCha
}
return (
-
+
{saveFile(true);}}>{gettext('Save as')}
@@ -544,6 +545,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
anchorRef={editMenuRef}
open={openMenuName=='menu-edit'}
onClose={onMenuClose}
+ label={gettext('Edit Menu')}
>
{eventBus.fireEvent(QUERY_TOOL_EVENTS.EDITOR_FIND_REPLACE, false);}}>{gettext('Find')}
@@ -567,6 +569,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
anchorRef={filterMenuRef}
open={openMenuName=='menu-filter'}
onClose={onMenuClose}
+ label={gettext('Filter Options Menu')}
>
{eventBus.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_INCLUDE_EXCLUDE_FILTER, true);}}>{gettext('Filter by Selection')}
{eventBus.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_INCLUDE_EXCLUDE_FILTER, false);}}>{gettext('Exclude by Selection')}
@@ -576,6 +579,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
anchorRef={autoCommitMenuRef}
open={openMenuName=='menu-autocommit'}
onClose={onMenuClose}
+ label={gettext('Execute Options Menu')}
>
{gettext('Auto commit?')}
@@ -586,6 +590,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
anchorRef={explainMenuRef}
open={openMenuName=='menu-explain'}
onClose={onMenuClose}
+ label={gettext('Explain Options Menu')}
>
{gettext('Verbose')}
@@ -604,6 +609,7 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
anchorRef={macrosMenuRef}
open={openMenuName=='menu-macros'}
onClose={onMenuClose}
+ label={gettext('Macros Menu')}
>
{gettext('Manage macros')}
diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/Notifications.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/Notifications.jsx
index ea6a1607d..b56a5399f 100644
--- a/web/pgadmin/tools/sqleditor/static/js/components/sections/Notifications.jsx
+++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/Notifications.jsx
@@ -47,10 +47,10 @@ export function Notifications() {
{notices.map((notice, i)=>{
return
- {notice.recorded_time} |
- {notice.channel} |
- {notice.pid} |
- {notice.payload} |
+ {notice.recorded_time} |
+ {notice.channel} |
+ {notice.pid} |
+ {notice.payload} |
;
})}
diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/QueryHistory.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/QueryHistory.jsx
index 2f2246a85..efdd1959c 100644
--- a/web/pgadmin/tools/sqleditor/static/js/components/sections/QueryHistory.jsx
+++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/QueryHistory.jsx
@@ -239,11 +239,11 @@ class QueryHistoryUtils {
function QuerySourceIcon({source}) {
switch(JSON.stringify(source)) {
case JSON.stringify(QuerySources.EXECUTE):
- return ;
+ return ;
case JSON.stringify(QuerySources.EXPLAIN):
- return ;
+ return ;
case JSON.stringify(QuerySources.EXPLAIN_ANALYZE):
- return ;
+ return ;
case JSON.stringify(QuerySources.COMMIT):
return ;
case JSON.stringify(QuerySources.ROLLBACK):
@@ -262,7 +262,7 @@ QuerySourceIcon.propTypes = {
function HistoryEntry({entry, formatEntryDate, itemKey, selectedItemKey, onClick}) {
const classes = useStyles();
- return {
+ return {
selectedItemKey==itemKey && ele && ele.scrollIntoView({
block: 'center',
behavior: 'smooth',
@@ -324,7 +324,7 @@ function QueryHistoryDetails({entry}) {
return (
<>
{entry.info && {entry.info}}
-
+
{entry.start_time.toLocaleDateString() + ' ' + entry.start_time.toLocaleTimeString()}
{entry?.row_affected > 0 && entry.row_affected}
diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
index 95982ba8f..095a0b7ab 100644
--- a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
+++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSet.jsx
@@ -1225,7 +1225,7 @@ export function ResultSet() {
return (
-
+
{!queryData &&
}
diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx
index bdab9e7d8..e525776fe 100644
--- a/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx
+++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/ResultSetToolbar.jsx
@@ -163,6 +163,7 @@ export function ResultSetToolbar({containerRef, canEdit, totalRowCount}) {
anchorRef={copyMenuRef}
open={menuOpenId=='menu-copyheader'}
onClose={handleMenuClose}
+ label={gettext('Copy Options Menu')}
>
{gettext('Copy with headers')}
diff --git a/web/regression/feature_utils/locators.py b/web/regression/feature_utils/locators.py
index 23ccd0ee9..4ae72b84a 100644
--- a/web/regression/feature_utils/locators.py
+++ b/web/regression/feature_utils/locators.py
@@ -108,105 +108,127 @@ class NavMenuLocators:
"//*[contains(@class,'wcTabTop')]//*[contains(@class,'wcPanelTab') " \
"and contains(.,'{}')]"
+ rcdock_tab = "div.dock-tab-btn[id$='{0}']"
+
process_watcher_error_close_xpath = \
".btn.btn-sm-sq.btn-primary.pg-bg-close > i"
class QueryToolLocators:
- btn_save_file = "#btn-save-file"
+ btn_save_file = "button[data-label='Save File']"
- btn_save_data = "#btn-save-data"
+ btn_save_data = "button[data-label='Save Data Changes']"
- btn_query_dropdown = "#btn-query-dropdown"
+ btn_query_dropdown = "button[data-label='Execute options']"
- btn_auto_rollback = "#btn-auto-rollback"
+ btn_auto_rollback = "li[data-label='Auto rollback on error?']"
btn_auto_rollback_check_status = "#btn-auto-rollback > i"
- btn_auto_commit = "#btn-auto-commit"
+ btn_auto_commit = "li[data-label='Auto commit?']"
btn_auto_commit_check_status = "#btn-auto-commit > i"
- btn_cancel_query = "#btn-cancel-query"
+ btn_cancel_query = "button[data-label='Cancel query']"
- btn_explain = "#btn-explain"
+ btn_explain = "button[data-label='Explain']"
- btn_explain_analyze = "#btn-explain-analyze"
+ btn_explain_analyze = "button[data-label='Explain Analyze']"
- btn_explain_options_dropdown = "#btn-explain-options-dropdown"
+ btn_explain_options_dropdown = "button[data-label='Explain Settings']"
- btn_explain_verbose = "#btn-explain-verbose"
+ btn_explain_verbose = "li[data-label='Verbose']"
- btn_explain_costs = "#btn-explain-costs"
+ btn_explain_costs = "li[data-label='Costs']"
- btn_explain_buffers = "#btn-explain-buffers"
+ btn_explain_buffers = "li[data-label='Buffers']"
- btn_explain_timing = "#btn-explain-timing"
+ btn_explain_timing = "li[data-label='Timing']"
- btn_clear_dropdown = "#btn-clear-dropdown"
+ btn_edit_dropdown = "button[data-label='Edit']"
btn_clear_history = "#btn-clear-history"
- btn_clear = "#btn-clear"
+ btn_clear = "li[data-label='Clear Query']"
- query_editor_panel = "#output-panel"
+ btn_add_row = "button[data-label='Add row']"
- query_history_selected = "#query_list .selected"
+ query_tool_menu = "ul[aria-label='{0}']"
- query_history_entries = "#query_list>.query-group>ul>li"
+ query_editor_panel = "#id-query"
+
+ query_history_selected = \
+ "#id-history li[data-label='history-entry'].Mui-selected"
+
+ query_history_entries = "#id-history li[data-label='history-entry']"
query_history_specific_entry = \
- "#query_list>.query-group>ul>li:nth-child({})"
+ "#id-history li[data-label='history-entry']:nth-child({0})"
- query_history_detail = "#query_detail"
+ query_history_detail = "#id-history div[data-label='history-detail']"
- invalid_query_history_entry_css = "#query_list .entry.error .query"
+ query_history_selected_icon = query_history_selected + ' svg'
+
+ invalid_query_history_entry_css = \
+ "#id-history li[data-label='history-entry'][class*='itemError']"
+
+ explain_details = "#id-explain div[data-label='explain-details']"
editor_panel = "#output-panel"
- query_messages_panel = ".sql-editor-message"
+ query_messages_panel = "#id-messages"
- output_row_xpath = "//div[contains(@class, 'slick-row')][{}]/*[1]"
+ output_row = "#id-dataoutput div.rdg-row[aria-rowindex={0}]"
- output_column_header_css = "[data-column-id='{}']"
+ output_row_col = "#id-dataoutput div.rdg-row[aria-rowindex='{0}']" \
+ " div.rdg-cell[aria-colindex='{1}']"
- output_column_data_xpath = "//div[contains(@class, 'slick-cell')]" \
+ output_column_header_css = \
+ "#id-dataoutput div.rdg-cell div[data-column-key='{0}']"
+
+ output_column_data_xpath = "//div[contains(@class, 'rdg-cell')]" \
"[contains(., '{}')]"
- output_cell_xpath = "//div[contains(@class, 'slick-cell') and " \
- "contains(@class, 'l{0} r{1}')]"
+ output_row_xpath = "//div[@aria-rowindex='{0}']"
+ output_cell_xpath = "//div[@aria-rowindex='{0}']/div[@aria-colindex='{1}']"
select_all_column = \
- "//div[contains(@id,'row-header-column')]"
+ "//div[@role='columnheader'][@aria-colindex='1']"
new_row_xpath = "//div[contains(@class, 'new-row')]"
- scratch_pad_css = ".sql-scratch > textarea"
+ scratch_pad_css = "#id-scratch textarea"
- copy_button_css = "#btn-copy-row"
+ copy_button_css = "#id-dataoutput button[data-label='Copy']"
- paste_button_css = "#btn-paste-row"
+ copy_options_css = "#id-dataoutput button[data-label='Copy options']"
- row_editor_text_area_css = ".pg-text-editor > textarea"
+ copy_headers_btn_css = "li[data-label='Copy with headers']"
+
+ paste_button_css = "#id-dataoutput button[data-label='Paste']"
+
+ row_editor_text_area_css = "div[data-label='pg-editor'] textarea"
json_editor_text_area_css = \
"div.ace_layer.ace_text-layer .ace_line_group .ace_line"
- text_editor_ok_btn_css = ".btn.btn-primary.long_text_editor"
+ row_editor_checkbox_css = "div[data-label='pg-checkbox-editor']"
- btn_load_file_css = "#btn-load-file"
+ text_editor_ok_btn_css = \
+ "div[data-label='pg-editor'] button[data-label='OK']"
- btn_execute_query_css = "#btn-flash"
+ btn_load_file_css = "button[data-label='Open File']"
+
+ btn_execute_query_css = "button[data-label='Execute/Refresh']"
input_file_path_css = "input#file-input-path"
select_file_content_css = "table#contents"
- query_output_canvas_css = "#datagrid .slick-viewport .grid-canvas"
+ query_output_canvas_css = "#id-dataoutput .rdg"
- query_output_cells = ".slick-cell"
+ query_output_cells = ".rdg-cell[role='gridcell']"
- sql_editor_message = "//div[contains(@class, 'sql-editor-message') and " \
- "contains(string(), '{}')]"
+ sql_editor_message = "//div[@id='id-messages'][contains(string(), '{}')]"
code_mirror_hint_box_xpath = "//ul[@class='CodeMirror-hints default']"
@@ -215,32 +237,19 @@ class QueryToolLocators:
code_mirror_data_xpath = "//pre[@class=' CodeMirror-line ']/span"
- save_data_icon = "icon-save-data-changes"
+ btn_commit = "button[data-label='Commit']"
- commit_icon = "icon-commit"
-
- execute_icon = "fa-play"
-
- explain_icon = "fa-hand-pointer"
-
- explain_analyze_icon = "fa-list-alt"
-
- query_history_selected_icon = '#query_list .selected #query_source_icon'
-
- btn_commit = "#btn-commit"
+ btn_history_remove_all = "#id-history button[data-label='Remove All']"
show_query_internally_btn = \
- "//div[label[contains(normalize-space(text())," \
- "'Show queries generated internally by')]]//" \
- "div[contains(@class,'toggle btn')]"
+ "//div[contains(normalize-space(text())," \
+ "'Show queries generated internally by')]/span/span[1]"
- editable_column_icon_xpath = "//div[contains(@class," \
- " 'editable-column-header-icon')]" \
- "/i[contains(@class, 'fa-pencil-alt')]"
+ editable_column_icon_xpath = \
+ "//div[@role='columnheader']/div/div/*[@data-label='EditIcon']"
- read_only_column_icon_xpath = "//div[contains(@class," \
- " 'editable-column-header-icon')]" \
- "/i[contains(@class, 'fa-lock')]"
+ read_only_column_icon_xpath = \
+ "//div[@role='columnheader']/div/div/*[@data-label='LockIcon']"
class ConnectToServerDiv:
diff --git a/web/regression/feature_utils/pgadmin_page.py b/web/regression/feature_utils/pgadmin_page.py
index f99b1aeb5..d9d53c446 100644
--- a/web/regression/feature_utils/pgadmin_page.py
+++ b/web/regression/feature_utils/pgadmin_page.py
@@ -87,9 +87,9 @@ class PgadminPage:
# In case of react dialog we use different xpath
if react_dialog:
- modal_button = self.find_by_xpath(
- "//button[contains(@class,'MuiButtonBase-root')]"
- "//span[text()='%s']" % button_text)
+ modal_button = self.find_by_css_selector(
+ ".react-draggable button[data-label='{0}']"
+ .format(button_text))
else:
modal_button = self.find_by_xpath(
"//div[contains(@class, 'alertify') and "
@@ -203,9 +203,7 @@ class PgadminPage:
self.driver.switch_to.frame(
self.driver.find_elements(By.TAG_NAME, "iframe")[0])
time.sleep(.5)
- self.click_element(self.find_by_xpath(
- '//button[contains(@class, "ajs-button") and '
- 'contains(.,"Don\'t save")]'))
+ self.find_by_css_selector("button[data-test='dont-save']").click()
if self.check_if_element_exist_by_xpath(
"//button[text()='Rollback']", 1):
@@ -214,15 +212,22 @@ class PgadminPage:
self.driver.switch_to.default_content()
def clear_query_tool(self):
- self.click_element(
- self.find_by_css_selector(QueryToolLocators.btn_clear_dropdown)
- )
+ retry = 3
+ edit_options = self.find_by_css_selector(
+ QueryToolLocators.btn_edit_dropdown)
+ while retry > 0:
+ self.click_element(edit_options)
+ time.sleep(0.3)
+ if edit_options.get_attribute("data-state") == "open":
+ break
+ else:
+ retry -= 1
+
ActionChains(self.driver).move_to_element(
self.find_by_css_selector(QueryToolLocators.btn_clear)).perform()
self.click_element(
self.find_by_css_selector(QueryToolLocators.btn_clear)
)
- self.driver.switch_to.default_content()
self.click_modal('Yes', True)
def execute_query(self, query):
@@ -230,90 +235,76 @@ class PgadminPage:
self.click_execute_query_button()
def click_execute_query_button(self, timeout=20):
- retry = 5
execute_button = self.find_by_css_selector(
QueryToolLocators.btn_execute_query_css)
- first_click = execute_button.get_attribute('data-click-counter')
- while retry > 0:
- execute_button.click()
- execute_button = self.find_by_css_selector(
- QueryToolLocators.btn_execute_query_css)
- second_click = execute_button.get_attribute(
- 'data-click-counter')
- if first_click != second_click:
- self.wait_for_query_tool_loading_indicator_to_appear()
- break
- else:
- retry -= 1
+ execute_button.click()
self.wait_for_query_tool_loading_indicator_to_disappear(timeout)
def check_execute_option(self, option):
""""This function will check auto commit or auto roll back based on
user input. If button is already checked, no action will be taken"""
- query_options = self.driver.find_element(
- By.CSS_SELECTOR, QueryToolLocators.btn_query_dropdown)
- expanded = query_options.get_attribute("aria-expanded")
- if expanded == "false":
- query_options.click()
+ menu_btn = self.driver.find_element_by_css_selector(
+ QueryToolLocators.btn_query_dropdown)
+ if menu_btn.get_attribute('data-state') == "closed":
+ menu_btn.click()
- def update_execute_option_setting(
- css_selector_of_option_status, css_selector_of_option,):
+ def update_execute_option_setting(css_selector_of_option):
retry = 3
- check_status = self.driver.find_element(
- By.CSS_SELECTOR, css_selector_of_option_status)
- if 'visibility-hidden' in check_status.get_attribute('class'):
+ menu_option = self.driver.find_element_by_css_selector(
+ css_selector_of_option)
+ if menu_option.get_attribute('data-checked') == 'false':
while retry > 0:
- self.find_by_css_selector(css_selector_of_option).click()
+ menu_option.click()
time.sleep(0.2)
- if 'visibility-hidden' not in \
- check_status.get_attribute('class'):
+ if menu_option.get_attribute('data-checked') == 'true':
break
else:
retry -= 1
if option == 'auto_commit':
update_execute_option_setting(
- QueryToolLocators.btn_auto_commit_check_status,
QueryToolLocators.btn_auto_commit)
if option == 'auto_rollback':
update_execute_option_setting(
- QueryToolLocators.btn_auto_rollback_check_status,
QueryToolLocators.btn_auto_rollback)
+ if menu_btn.get_attribute('data-state') == "open":
+ menu_btn.click()
+
def uncheck_execute_option(self, option):
""""This function will uncheck auto commit or auto roll back based on
user input. If button is already unchecked, no action will be taken"""
- query_options = self.driver.find_element_by_css_selector(
- QueryToolLocators.btn_query_dropdown)
- expanded = query_options.get_attribute("aria-expanded")
- if expanded == "false":
- query_options.click()
+ menu = self.driver.find_element_by_css_selector(
+ QueryToolLocators.query_tool_menu.format('Execute Options Menu'))
- def update_execute_option_setting(
- css_selector_of_option_status, css_selector_of_option):
+ if menu.get_attribute('data-state') == "closed":
+ self.driver.find_element_by_css_selector(
+ QueryToolLocators.btn_query_dropdown).click()
+
+ def update_execute_option_setting(css_selector_of_option):
retry = 3
- check_status = self.driver.find_element_by_css_selector(
- css_selector_of_option_status)
- if 'visibility-hidden' not in check_status.get_attribute('class'):
+ menu_option = self.driver.find_element_by_css_selector(
+ css_selector_of_option)
+ if menu_option.get_attribute('data-checked') == 'true':
while retry > 0:
- self.find_by_css_selector(
- css_selector_of_option).click()
+ menu_option.click()
time.sleep(0.2)
- if 'visibility-hidden' in \
- check_status.get_attribute('class'):
+ if menu_option.get_attribute('data-checked') == 'false':
break
else:
retry -= 1
if option == 'auto_commit':
update_execute_option_setting(
- QueryToolLocators.btn_auto_commit_check_status,
QueryToolLocators.btn_auto_commit)
if option == 'auto_rollback':
update_execute_option_setting(
- QueryToolLocators.btn_auto_rollback_check_status,
QueryToolLocators.btn_auto_rollback)
+ if menu.get_attribute('data-state') == "open":
+ self.driver.find_element_by_css_selector(
+ QueryToolLocators.btn_query_dropdown).click()
+
def close_data_grid(self):
self.driver.switch_to.default_content()
xpath = "//*[@id='dockerContainer']/div/div[3]/div/div[2]/div[1]"
@@ -331,6 +322,7 @@ class PgadminPage:
self.click_element(object_menu_item)
delete_menu_item = self.find_by_partial_link_text("Remove Server")
self.click_element(delete_menu_item)
+ self.driver.switch_to.default_content()
self.click_modal('Yes', True)
time.sleep(1)
else:
@@ -1054,15 +1046,15 @@ class PgadminPage:
driver.switch_to.default_content()
driver.switch_to.frame(
driver.find_element_by_tag_name("iframe"))
- element = driver.find_element_by_css_selector(
- "#output-panel .CodeMirror")
+ element = driver.find_element(
+ By.CSS_SELECTOR, "#sqleditor-container .CodeMirror")
if element.is_displayed() and element.is_enabled():
return element
except (NoSuchElementException, WebDriverException):
return False
time.sleep(1)
- self.wait_for_query_tool_loading_indicator_to_disappear(12)
+ # self.wait_for_query_tool_loading_indicator_to_disappear(12)
retry = 2
while retry > 0:
@@ -1071,7 +1063,9 @@ class PgadminPage:
WebDriverWait(self.driver, 10).until(
EC.frame_to_be_available_and_switch_to_it(
(By.TAG_NAME, "iframe")))
- self.find_by_xpath("//a[text()='Query Editor']").click()
+ self.find_by_css_selector(
+ "div.dock-tab-btn[id$=\"id-query\"]").click()
+ # self.find_by_xpath("//div[text()='Query Editor']").click()
codemirror_ele = WebDriverWait(
self.driver, timeout=self.timeout, poll_frequency=0.01) \
@@ -1099,11 +1093,16 @@ class PgadminPage:
"arguments[0].CodeMirror.lineCount(),0);",
codemirror_ele, field_content)
- def click_tab(self, tab_name):
+ def click_tab(self, tab_name, rc_dock=False):
+ if rc_dock:
+ tab = self.find_by_css_selector(
+ NavMenuLocators.rcdock_tab.format(tab_name))
+ self.click_element(tab)
+ return
+
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable(
(By.XPATH, NavMenuLocators.select_tab_xpath.format(tab_name))))
- click_tab = True
- while click_tab:
+ while True:
tab = self.find_by_xpath(
NavMenuLocators.select_tab_xpath.format(tab_name))
self.click_element(tab)
@@ -1188,15 +1187,16 @@ class PgadminPage:
self._wait_for("spinner to disappear", spinner_has_disappeared, 20)
- def wait_for_query_tool_loading_indicator_to_disappear(self, timeout=20):
+ def wait_for_query_tool_loading_indicator_to_disappear(
+ self, timeout=20, container_id="id-dataoutput"):
def spinner_has_disappeared(driver):
try:
# Refer the status message as spinner appears only on the
# the data output panel
- spinner = driver.find_element(
+ driver.find_element(
By.CSS_SELECTOR,
- ".sql-editor .sql-editor-busy-text-status")
- return "d-none" in spinner.get_attribute("class")
+ "#{0} div[data-label='loader']".format(container_id))
+ return False
except NoSuchElementException:
# wait for loading indicator disappear animation to complete.
time.sleep(0.5)
@@ -1207,8 +1207,7 @@ class PgadminPage:
def wait_for_query_tool_loading_indicator_to_appear(self):
status = self.check_if_element_exist_by_xpath(
- "//div[@id='editor-panel']//"
- "div[@class='pg-sp-container sql-editor-busy-fetching']", 1)
+ "//div[@id='id-dataoutput']//div[@data-label='loader']", 1)
return status
def wait_for_app(self):
@@ -1340,14 +1339,15 @@ class PgadminPage:
if required_status == 'Yes':
status_changed_successfully = \
- self.toggle_switch_box(switch_box_element,
- expected_attr_in_class_tag='success',
- unexpected_attr_in_class_tag='off')
+ self.toggle_switch_box(
+ switch_box_element,
+ expected_attr_in_class_tag='Mui-checked',
+ unexpected_attr_in_class_tag='')
else:
status_changed_successfully = \
- self.toggle_switch_box(switch_box_element,
- expected_attr_in_class_tag='off',
- unexpected_attr_in_class_tag='success')
+ self.toggle_switch_box(
+ switch_box_element, expected_attr_in_class_tag='',
+ unexpected_attr_in_class_tag='Mui-checked')
return status_changed_successfully
def toggle_switch_box(self, switch_box_ele, expected_attr_in_class_tag,
diff --git a/web/regression/runtests.py b/web/regression/runtests.py
index 6bc82a317..083402895 100644
--- a/web/regression/runtests.py
+++ b/web/regression/runtests.py
@@ -298,7 +298,7 @@ def setup_webdriver_specification(arguments):
options.add_argument("--window-size=1790,1080")
options.add_argument("--disable-infobars")
# options.add_experimental_option('w3c', False)
- driver_local = webdriver.Chrome(chrome_options=options)
+ driver_local = webdriver.Chrome(options=options)
# maximize browser window
driver_local.maximize_window()