Support running feature tests against Firefox. Fixes #3270

This commit is contained in:
Akshay Joshi
2018-05-15 15:10:11 +01:00
committed by Dave Page
parent 8d9e9eab13
commit ccf58570b1
9 changed files with 104 additions and 15 deletions

View File

@@ -200,7 +200,7 @@ class CopySelectedQueryResultsFeatureTest(BaseFeatureTest):
ActionChains(self.page.driver).key_down(
Keys.CONTROL).send_keys('c').key_up(Keys.CONTROL).perform()
self.assertEqual('"cool info"', pyperclip.paste())
self.assertIn('"cool info"', pyperclip.paste())
def after(self):
self.page.close_query_tool()

View File

@@ -185,6 +185,8 @@ CREATE TABLE public.defaults_{0}
(By.XPATH, xpath)), CheckForViewDataTest.TIMEOUT_STRING
)
cell_el = self.page.find_by_xpath(xpath)
self.page.driver.execute_script("arguments[0].scrollIntoView()",
cell_el)
ActionChains(self.driver).move_to_element(cell_el).double_click(
cell_el
).perform()

View File

@@ -8,6 +8,7 @@
##########################################################################
import os
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
@@ -98,7 +99,18 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
self.page.find_by_id("file-input-path").send_keys(
Keys.RETURN
)
contents = self.page.find_by_id("contents").get_attribute('innerHTML')
if self.page.driver.capabilities['browserName'] == 'firefox':
table = self.page.wait_for_element_to_reload(
lambda driver:
driver.find_element_by_css_selector("table#contents")
)
else:
table = self.page.driver \
.find_element_by_css_selector("table#contents")
contents = table.get_attribute('innerHTML')
self.page.click_modal('Cancel')
self.page.wait_for_query_tool_loading_indicator_to_disappear()
self._check_escaped_characters(