Removed logging added for feature test failure. Added more assets to avoid false failures.

pull/5861/head
Yogesh Mahajan 2023-02-13 11:58:54 +05:30 committed by GitHub
parent 83ec0f3d90
commit 026334a71a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 22 deletions

View File

@ -31,12 +31,10 @@ class BrowserToolBarFeatureTest(BaseFeatureTest):
def before(self): def before(self):
self.page.wait_for_spinner_to_disappear() self.page.wait_for_spinner_to_disappear()
self.page.add_server(self.server) self.page.add_server(self.server)
print("Added server", file=sys.stderr)
self.test_table_name = "test_table" + str( self.test_table_name = "test_table" + str(
secrets.choice(range(1000, 3000))) secrets.choice(range(1000, 3000)))
test_utils.create_table(self.server, self.test_db, test_utils.create_table(self.server, self.test_db,
self.test_table_name) self.test_table_name)
print("before completed", file=sys.stderr)
def runTest(self): def runTest(self):
# Check for query tool button # Check for query tool button
@ -63,9 +61,12 @@ class BrowserToolBarFeatureTest(BaseFeatureTest):
self.test_table_name) self.test_table_name)
def test_query_tool_button(self): def test_query_tool_button(self):
self.page.expand_database_node("Servers", self.server['name'], self.assertTrue(self.page.expand_database_node("Servers",
self.server['db_password'], self.server['name'],
self.test_db) self.server[
'db_password'],
self.test_db),
'Tree is not expanded to database node')
self.assertTrue(self.page.retry_click( self.assertTrue(self.page.retry_click(
(By.CSS_SELECTOR, (By.CSS_SELECTOR,
BrowserToolBarLocators.open_query_tool_button_css), BrowserToolBarLocators.open_query_tool_button_css),
@ -74,9 +75,12 @@ class BrowserToolBarFeatureTest(BaseFeatureTest):
self.page.close_query_tool(prompt=False) self.page.close_query_tool(prompt=False)
def test_view_data_tool_button(self): def test_view_data_tool_button(self):
self.page.expand_tables_node("Servers", self.server['name'], self.assertTrue(
self.server['db_password'], self.test_db, self.page.expand_tables_node("Servers", self.server['name'],
"public") self.server['db_password'],
self.test_db,
"public"),
'Tree is not expanded to table node')
table_node = self.page.check_if_element_exists_with_scroll( table_node = self.page.check_if_element_exists_with_scroll(
TreeAreaLocators.table_node(self.test_table_name)) TreeAreaLocators.table_node(self.test_table_name))

View File

@ -40,6 +40,7 @@ class QueryToolJourneyTest(BaseFeatureTest):
query_history_tab_id = "id-history" query_history_tab_id = "id-history"
query_editor_tab_name = "Query Editor" query_editor_tab_name = "Query Editor"
query_editor_tab_id = "id-query" query_editor_tab_id = "id-query"
query_tool_opened = False
def before(self): def before(self):
self.test_table_name = "test_table" + str( self.test_table_name = "test_table" + str(
@ -421,10 +422,12 @@ class QueryToolJourneyTest(BaseFeatureTest):
self.page.click_modal('Yes') self.page.click_modal('Yes')
def _navigate_to_query_tool(self): def _navigate_to_query_tool(self):
self.page.expand_database_node("Server", self.server['name'], self.assertTrue(
self.server['db_password'], self.page.expand_database_node("Server", self.server['name'],
self.test_db) self.server['db_password'],
self.page.open_query_tool() self.test_db),
'Tree is not expanded to database node')
self.query_tool_opened = self.page.open_query_tool()
self.page.wait_for_spinner_to_disappear() self.page.wait_for_spinner_to_disappear()
def _explain_query(self, query): def _explain_query(self, query):
@ -498,7 +501,8 @@ class QueryToolJourneyTest(BaseFeatureTest):
QueryToolLocators.new_row_xpath) QueryToolLocators.new_row_xpath)
def after(self): def after(self):
self.page.close_query_tool() if self.query_tool_opened:
self.page.close_query_tool()
test_utils.delete_table( test_utils.delete_table(
self.server, self.test_db, self.test_table_name) self.server, self.test_db, self.test_table_name)
test_utils.delete_table( test_utils.delete_table(

View File

@ -38,7 +38,6 @@ class BaseFeatureTest(BaseTestGenerator):
try: try:
if self.parallel_ui_tests: if self.parallel_ui_tests:
self.page.login_to_app(self.server['login_details']) self.page.login_to_app(self.server['login_details'])
print("Login successful", file=sys.stderr)
test_utils.reset_layout_db() test_utils.reset_layout_db()
self.page.driver.switch_to.default_content() self.page.driver.switch_to.default_content()
self.page.wait_for_app() self.page.wait_for_app()

View File

@ -1371,7 +1371,6 @@ def launch_url_in_browser(driver_instance, url, title='pgAdmin 4', timeout=50):
driver_instance.get(url) driver_instance.get(url)
wait = WebDriverWait(driver_instance, 10) wait = WebDriverWait(driver_instance, 10)
wait.until(ec.title_is(title)) wait.until(ec.title_is(title))
print("pgAdmin launched in browser", file=sys.stderr)
break break
except WebDriverException as e: except WebDriverException as e:
time.sleep(6) time.sleep(6)

View File

@ -599,11 +599,9 @@ def run_parallel_tests(url_client, servers_details, parallel_tests_lists,
threads_list = [] threads_list = []
# Create thread for each server # Create thread for each server
for ser in servers_details: for ser in servers_details:
print("Running for ser", ser['name'], file=sys.stderr)
while True: while True:
# If active thread count <= max_thread_count, add new thread # If active thread count <= max_thread_count, add new thread
if threading.active_count() <= max_thread_count: if threading.active_count() <= max_thread_count:
print("Created a thread", file=sys.stderr)
# Get remote web-driver instance at server level # Get remote web-driver instance at server level
driver_object = \ driver_object = \
test_utils.get_remote_webdriver(hub_url, test_utils.get_remote_webdriver(hub_url,
@ -865,17 +863,12 @@ if __name__ == '__main__':
file=sys.stderr) file=sys.stderr)
time.sleep(int(pgAdmin_wait_time)) time.sleep(int(pgAdmin_wait_time))
print('pgAdmin sleep for debug over',
file=sys.stderr)
# Running Parallel tests # Running Parallel tests
if len(parallel_tests) > 0: if len(parallel_tests) > 0:
parallel_sessions = \ parallel_sessions = \
int(selenoid_config[ int(selenoid_config[
'max_parallel_sessions']) 'max_parallel_sessions'])
print("Running parallel test", file=sys.stderr)
print("parallel_sessions = ",
parallel_sessions, file=sys.stderr)
run_parallel_tests( run_parallel_tests(
client_url, servers_info, parallel_tests, client_url, servers_info, parallel_tests,