Additional feature test fixes:

1) Changes required for working with Bootstrap 4.
2) Change to fix the timeout exception when waiting for element (tested multiple times on multiple server, did not occur to me thereafter)
3) Removed reset layout after each test case. Instead, delete the layout entry from sqlite db file and do a plain refresh. This will save some time and will also remove dependency on reset layout menu.
4) Disables tree state saving when feature test run starts. Feature tests got confused with auto expanding tree.
This commit is contained in:
Aditya Toshniwal
2018-10-17 11:50:22 +01:00
committed by Dave Page
parent ef0e53e8fc
commit 6fa6939f52
9 changed files with 85 additions and 25 deletions

View File

@@ -80,6 +80,7 @@ class BrowserToolBarFeatureTest(BaseFeatureTest):
self.page.find_by_xpath("//*[contains(@class,'wcTabIcon fa fa-bolt')]")
def test_view_data_tool_button(self):
self.page.select_tree_item(self.test_db)
self.page.toggle_open_tree_item('Schemas')
self.page.toggle_open_tree_item('public')
self.page.toggle_open_tree_item('Tables')

View File

@@ -41,7 +41,7 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
os.remove(self.XSS_FILE)
def after(self):
self.page.close_query_tool('sql', False)
self.page.close_query_tool('.sql', False)
self.page.remove_server(self.server)
def runTest(self):
@@ -179,3 +179,5 @@ class CheckFileManagerFeatureTest(BaseFeatureTest):
if not success:
raise Exception("Unable to sort in descending order while clicked "
"on 'Name' column")
self.page.click_modal('Cancel')

View File

@@ -74,11 +74,11 @@ class KeyboardShortcutFeatureTest(BaseFeatureTest):
EC.presence_of_element_located(
(By.XPATH, "//li[contains(@id, " +
s +
") and contains(@class, 'open')]")
") and contains(@class, 'show')]")
)
)
is_open = 'open' in self.page.find_by_id(s).get_attribute('class')
is_open = 'show' in self.page.find_by_id(s).get_attribute('class')
assert is_open is True, "Keyboard shortcut change is unsuccessful."

View File

@@ -29,6 +29,8 @@ try:
test_data_configuration['datatype_minimum_version']
except Exception as e:
print(str(e))
assert False, \
"datatype_test.json file load failed"
class PGDataypeFeatureTest(BaseFeatureTest):
@@ -88,7 +90,7 @@ class PGDataypeFeatureTest(BaseFeatureTest):
".ajs-dialog.pg-el-container .ajs-maximize").click()
sql_editor = self.page.find_by_xpath(
"//*[contains(@class,'aciTreeLi') and contains(.,'SQL Editor')]")
"//*[contains(@class,'aciTreeLi') and contains(.,'Query Tool')]")
sql_editor.find_element_by_xpath(
"//*[contains(@class,'aciTreeText') and contains(.,'Options')]"

View File

@@ -55,10 +55,10 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
self.page.find_by_partial_link_text("Backup...").click()
self.wait.until(EC.element_to_be_clickable(
(By.CSS_SELECTOR, ".browse_file_input")))
(By.CSS_SELECTOR, ".file [name='file']")))
self.wait.until(EC.element_to_be_clickable(
(By.CSS_SELECTOR, ".browse_file_input"))).click()
(By.CSS_SELECTOR, ".file [name='file']"))).click()
self.page.fill_input_by_field_name("file", "test_backup")
@@ -98,15 +98,10 @@ class PGUtilitiesBackupFeatureTest(BaseFeatureTest):
self.page.find_by_partial_link_text("Restore...").click()
self.wait.until(EC.element_to_be_clickable(
(By.CSS_SELECTOR, ".browse_file_input")))
self.page.find_by_xpath(
"//button[contains(@class,'fa-info') and "
"contains(@label, 'Restore')]"
)
(By.CSS_SELECTOR, ".file [name='file']")))
self.wait.until(EC.element_to_be_clickable(
(By.CSS_SELECTOR, ".browse_file_input"))).click()
(By.CSS_SELECTOR, ".file [name='file']"))).click()
self.page.fill_input_by_field_name("file", "test_backup")