diff --git a/web/pgadmin/feature_tests/pg_datatype_validation_test.py b/web/pgadmin/feature_tests/pg_datatype_validation_test.py index 703f0c5..f700aab 100644 --- a/web/pgadmin/feature_tests/pg_datatype_validation_test.py +++ b/web/pgadmin/feature_tests/pg_datatype_validation_test.py @@ -103,7 +103,7 @@ class PGDataypeFeatureTest(BaseFeatureTest): '922337203685.922337203685', '-92233720368547758.08', '{1,2,3}', '{NaN,NaN,NaN}', 'Infinity', '{Infinity}', - r'[binary data]', r'[binary data[]]' + 'binary data', 'binary data[]' ] self.page.open_query_tool() diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/pgadmin/feature_tests/query_tool_journey_test.py index d608599..d42d5e5 100644 --- a/web/pgadmin/feature_tests/query_tool_journey_test.py +++ b/web/pgadmin/feature_tests/query_tool_journey_test.py @@ -70,7 +70,6 @@ class QueryToolJourneyTest(BaseFeatureTest): def _test_history_tab(self): self.__clear_query_tool() - editor_input = self.page.find_by_id("output-panel") self.page.click_element(editor_input) self._execute_query("SELECT * FROM shoes") @@ -79,45 +78,47 @@ class QueryToolJourneyTest(BaseFeatureTest): selected_history_entry = self.page.find_by_css_selector("#query_list .selected") self.assertIn("SELECT * FROM shoes", selected_history_entry.text) failed_history_detail_pane = self.page.find_by_id("query_detail") - - self.assertIn("Error Message relation \"shoes\" does not exist", failed_history_detail_pane.text) - + self.assertIn("ERROR: relation \"shoes\" does not exist", failed_history_detail_pane.text) ActionChains(self.page.driver) \ .send_keys(Keys.ARROW_DOWN) \ .perform() selected_history_entry = self.page.find_by_css_selector("#query_list .selected") self.assertIn("SELECT * FROM test_table ORDER BY value", selected_history_entry.text) - selected_history_detail_pane = self.page.find_by_id("query_detail") self.assertIn("SELECT * FROM test_table ORDER BY value", selected_history_detail_pane.text) - newly_selected_history_entry = self.page.find_by_xpath("//*[@id='query_list']/ul/li[1]") self.page.click_element(newly_selected_history_entry) selected_history_detail_pane = self.page.find_by_id("query_detail") self.assertIn("SELECT * FROM shoes", selected_history_detail_pane.text) self.__clear_query_tool() - self.page.click_element(editor_input) for _ in range(15): self._execute_query("SELECT * FROM hats") self.page.click_tab("History") - - query_we_need_to_scroll_to = self.page.find_by_xpath("//*[@id='query_list']/ul/li[17]") - - self.page.click_element(query_we_need_to_scroll_to) - self._assert_not_clickable_because_out_of_view(query_we_need_to_scroll_to) - + query_we_need_to_scroll_to = self.page.find_by_xpath( + "//*[@id='query_list']/ul/li[17]" + ) + self._assert_not_clickable_because_out_of_view( + query_we_need_to_scroll_to + ) for _ in range(17): ActionChains(self.page.driver) \ .send_keys(Keys.ARROW_DOWN) \ .perform() - self._assert_clickable(query_we_need_to_scroll_to) def __clear_query_tool(self): - self.page.click_element(self.page.find_by_xpath("//*[@id='btn-edit']")) + self.page.click_element( + self.page.find_by_xpath("//*[@id='btn-clear-dropdown']") + ) + ActionChains(self.driver)\ + .move_to_element(self.page.find_by_xpath("//*[@id='btn-clear']"))\ + .perform() + self.page.click_element( + self.page.find_by_xpath("//*[@id='btn-clear']") + ) self.page.click_modal('Yes') def _navigate_to_query_tool(self): @@ -137,7 +138,7 @@ class QueryToolJourneyTest(BaseFeatureTest): self.page.click_element(element) def _assert_not_clickable_because_out_of_view(self, element): - self.assertRaises(self.page.click_element(element)) + self.assertTrue(element.is_displayed()) def after(self): self.page.close_query_tool() diff --git a/web/pgadmin/feature_tests/query_tool_tests.py b/web/pgadmin/feature_tests/query_tool_tests.py index 6327ad2..8e13817 100644 --- a/web/pgadmin/feature_tests/query_tool_tests.py +++ b/web/pgadmin/feature_tests/query_tool_tests.py @@ -169,14 +169,16 @@ class QueryToolFeatureTest(BaseFeatureTest): self.page.toggle_open_tree_item('acceptance_test_db') def _clear_query_tool(self): - # clear codemirror. - self.page.find_by_id("btn-edit").click() - # wait for alertify dialog open animation to complete. - time.sleep(1) - - self.page.click_element(self.page.find_by_xpath("//button[contains(.,'Yes')]")) - # wait for alertify dialog close animation to complete. - time.sleep(1) + self.page.click_element( + self.page.find_by_xpath("//*[@id='btn-clear-dropdown']") + ) + ActionChains(self.driver)\ + .move_to_element(self.page.find_by_xpath("//*[@id='btn-clear']"))\ + .perform() + self.page.click_element( + self.page.find_by_xpath("//*[@id='btn-clear']") + ) + self.page.click_modal('Yes') def _on_demand_result(self): ON_DEMAND_CHUNKS = 2 @@ -314,24 +316,16 @@ SELECT generate_series(1, 1000) as id order by id desc""" SELECT generate_series(1, 1000) as id order by id desc""" wait = WebDriverWait(self.page.driver, 10) - self.page.fill_codemirror_area_with(query) - query_op = self.page.find_by_id("btn-query-dropdown") query_op.click() - ActionChains(self.driver).move_to_element( query_op.find_element_by_xpath( "//li[contains(.,'Explain Options')]")).perform() - self.page.find_by_id("btn-explain-verbose").click() - self.page.find_by_id("btn-explain").click() - self.page.wait_for_query_tool_loading_indicator_to_disappear() - self.page.click_tab('Data Output') - canvas = wait.until(EC.presence_of_element_located( (By.CSS_SELECTOR, "#datagrid .slick-viewport .grid-canvas")) ) diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html index cb70052..fa6f750 100644 --- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html +++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html @@ -239,7 +239,7 @@
-