pgadmin4/web/regression/python_test_utils/test_gui_helper.py
Aditya Toshniwal 862f101772
Significant changes to use ReactJS extensively.
1. Replace the current layout library wcDocker with ReactJS based rc-dock. #6479
2. Have close buttons on individual panel tabs instead of common. #2821
3. Changes in the context menu on panel tabs - Add close, close all and close others menu items. #5394
4. Allow closing all the tabs, including SQL and Properties. #4733
5. Changes in docking behaviour of different tabs based on user requests and remove lock layout menu.
6. Fix an issue where the scroll position of panels was not remembered on Firefox. #2986
7. Reset layout now will not require page refresh and is done spontaneously.
8. Use the zustand store for storing preferences instead of plain JS objects. This will help reflecting preferences immediately.
9. The above fix incorrect format (no indent) of SQL stored functions/procedures. #6720
10. New version check is moved to an async request now instead of app start to improve startup performance.
11. Remove jQuery and Bootstrap completely.
12. Replace jasmine and karma test runner with jest. Migrate all the JS test cases to jest. This will save time in writing and debugging JS tests.
13. Other important code improvements and cleanup.
2023-10-23 17:43:17 +05:30

67 lines
2.0 KiB
Python

##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2023, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
import time
from regression.feature_utils.locators import NavMenuLocators
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
def close_bgprocess_start_popup(tester):
"""
Allows us to close the background process popup window
"""
tester.driver.find_element(
By.CSS_SELECTOR,
NavMenuLocators.process_start_close_selector).click()
def wait_for_process_start(tester):
tester.wait.until(EC.visibility_of_element_located(
(By.CSS_SELECTOR,
NavMenuLocators.process_start_close_selector)))
close_bgprocess_start_popup(tester)
def wait_for_process_end(self):
"""This will wait for process to complete dialogue status"""
attempts = 120
status = False
while attempts > 0:
try:
button = self.page.find_by_css_selector(
NavMenuLocators.process_end_close_selector)
status = True
button.click()
break
except Exception:
attempts -= 1
time.sleep(.5)
return status
def open_process_details(tester):
status = wait_for_process_end(tester)
if not status:
raise RuntimeError("Process not completed")
tester.page.click_tab("Processes")
time.sleep(3)
tester.page.find_by_css_selector(
"div[data-test='processes'] "
"div[data-test='row-container']:nth-child(1) "
"div[role='row'] div[role='cell']:nth-child(3) button").click()
tester.page.wait_for_element_to_disappear(
lambda driver: driver.find_element(
By.CSS_SELECTOR, "span[data-test='loading-logs']"))
def close_process_watcher(tester):
tester.page.click_modal('Close', docker=True)