Fix the feature tests failuers.

This commit is contained in:
Wenlin Zhang 2017-08-25 17:16:33 +05:30 committed by Ashesh Vashi
parent 8579909558
commit 5dd375dd20
2 changed files with 5 additions and 12 deletions

View File

@ -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)

View File

@ -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")]'
)