From 5dd375dd2081c126b7b3b9f0dba21976d2a45a1f Mon Sep 17 00:00:00 2001 From: Wenlin Zhang Date: Fri, 25 Aug 2017 17:16:33 +0530 Subject: [PATCH] Fix the feature tests failuers. --- web/pgadmin/feature_tests/query_tool_journey_test.py | 7 ------- web/pgadmin/feature_tests/query_tool_tests.py | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py b/web/pgadmin/feature_tests/query_tool_journey_test.py index 4ffcff8f0..e7ccb22c7 100644 --- a/web/pgadmin/feature_tests/query_tool_journey_test.py +++ b/web/pgadmin/feature_tests/query_tool_journey_test.py @@ -103,7 +103,6 @@ class QueryToolJourneyTest(BaseFeatureTest): 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) for _ in range(17): ActionChains(self.page.driver) \ @@ -121,9 +120,6 @@ class QueryToolJourneyTest(BaseFeatureTest): 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) \ @@ -158,9 +154,6 @@ class QueryToolJourneyTest(BaseFeatureTest): def _assert_clickable(self, element): self.page.click_element(element) - def _assert_not_clickable_because_out_of_view(self, element): - self.assertRaises(self.page.click_element(element)) - def after(self): self.page.close_query_tool() self.page.remove_server(self.server) diff --git a/web/pgadmin/feature_tests/query_tool_tests.py b/web/pgadmin/feature_tests/query_tool_tests.py index 8e1381705..212885f02 100644 --- a/web/pgadmin/feature_tests/query_tool_tests.py +++ b/web/pgadmin/feature_tests/query_tool_tests.py @@ -643,7 +643,7 @@ SELECT 1/0;""" self.page.find_by_id("btn-flash").click() self.page.wait_for_query_tool_loading_indicator_to_disappear() self.page.click_tab('Messages') - self.driver.find_element_by_xpath( + self.page.find_by_xpath( '//div[contains(@class, "sql-editor-message") and contains(string(), "division by zero")]' ) @@ -660,7 +660,7 @@ END;""" self.page.find_by_id("btn-flash").click() self.page.wait_for_query_tool_loading_indicator_to_disappear() self.page.click_tab('Messages') - self.driver.find_element_by_xpath( + self.page.find_by_xpath( '//div[contains(@class, "sql-editor-message") and contains(string(), "Query returned successfully")]' ) @@ -689,7 +689,7 @@ SELECT relname FROM pg_class WHERE relkind IN ('r','s','t') and relnamespace = 2 -- 3. Execute long running query. -- 4. Cancel long running query execution. END; -SELECT 1, pg_sleep(10)""" +SELECT 1, pg_sleep(300)""" self.page.fill_codemirror_area_with(query) self.page.find_by_id("btn-query-dropdown").click() @@ -721,10 +721,10 @@ SELECT 1, pg_sleep(10)""" auto_commit_btn.click() self.page.find_by_id("btn-flash").click() - self.driver.find_element_by_xpath("//*[@id='fetching_data']") + self.page.find_by_xpath("//*[@id='fetching_data']") self.page.find_by_id("btn-cancel-query").click() self.page.wait_for_query_tool_loading_indicator_to_disappear() self.page.click_tab('Messages') - self.driver.find_element_by_xpath( + self.page.find_by_xpath( '//div[contains(@class, "sql-editor-message") and contains(string(), "canceling statement due to user request")]' )