Hi Hackers,
This patch is about fixing the feature tests failure.
Thanks,
Wenlin, Violet & Hao
diff --git a/web/pgadmin/feature_tests/query_tool_journey_test.py
b/web/pgadmin/feature_tests/query_tool_journey_test.py
index 0795028c..dcab7241 100644
--- a/web/pgadmin/feature_tests/query_tool_journey_test.py
+++ b/web/pgadmin/feature_tests/query_tool_journey_test.py
@@ -100,9 +100,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) \
@@ -137,8 +134,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()
diff --git a/web/pgadmin/feature_tests/query_tool_tests.py
b/web/pgadmin/feature_tests/query_tool_tests.py
index 8e138170..212885f0 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")]'
)