Use a common function for sever setup in the testsuite.

This commit is contained in:
Murtuza Zabuawala 2018-03-19 13:23:29 +00:00 committed by Dave Page
parent 34f1ebc88e
commit 2abff8f5d4
2 changed files with 3 additions and 25 deletions

View File

@ -43,9 +43,9 @@ class CheckDebuggerForXssFeatureTest(BaseFeatureTest):
self._debug_function()
def after(self):
self.page.remove_server(self.server)
test_utils.drop_debug_function(self.server, "postgres",
"a_test_function")
self.page.remove_server(self.server)
def _function_node_expandable(self):
self.page.toggle_open_server(self.server['name'])

View File

@ -34,38 +34,16 @@ class CheckRoleMembershipControlFeatureTest(BaseFeatureTest):
def runTest(self):
self.page.wait_for_spinner_to_disappear()
self._connects_to_server()
self.page.add_server(self.server)
self._role_node_expandable()
self._check_role_membership_control()
def after(self):
self.page.remove_server(self.server)
test_utils.drop_role(self.server, "postgres",
"test_role")
test_utils.drop_role(self.server, "postgres",
"<h1>test</h1>")
self.page.remove_server(self.server)
def _connects_to_server(self):
self.page.find_by_xpath(
"//*[@class='aciTreeText' and .='Servers']").click()
self.page.driver.find_element_by_link_text("Object").click()
ActionChains(
self.page.driver
).move_to_element(
self.page.driver.find_element_by_link_text("Create")
).perform()
self.page.find_by_partial_link_text("Server...").click()
server_config = self.server
self.page.fill_input_by_field_name("name", server_config['name'])
self.page.find_by_partial_link_text("Connection").click()
self.page.fill_input_by_field_name("host", server_config['host'])
self.page.fill_input_by_field_name("port", server_config['port'])
self.page.fill_input_by_field_name(
"username", server_config['username'])
self.page.fill_input_by_field_name(
"password", server_config['db_password'])
self.page.find_by_xpath("//button[contains(.,'Save')]").click()
def _role_node_expandable(self):
self.page.toggle_open_server(self.server['name'])