mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
- Move the duplicate code for closing the background process dialog into 'test_gui_helper.py', - Simplify the logic by removing the duplicate steps to insert/update binary paths for each server type from 'test_utils.py'.
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2018, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
|
|
def close_bgprocess_popup(tester):
|
|
"""
|
|
Allow us to close the background process popup window
|
|
"""
|
|
tester._screenshot()
|
|
|
|
# In cases where backup div is not closed (sometime due to some error)
|
|
try:
|
|
if tester.driver.find_element_by_css_selector(
|
|
".ajs-message.ajs-bg-bgprocess.ajs-visible > div > "
|
|
"div > div > i"):
|
|
tester.driver.find_element_by_css_selector(
|
|
".ajs-message.ajs-bg-bgprocess.ajs-visible >div >div "
|
|
">div>i").click()
|
|
except Exception:
|
|
pass
|
|
|
|
# In cases where restore div is not closed (sometime due to some error)
|
|
try:
|
|
if tester.driver.find_element_by_xpath(
|
|
"//div[contains(text(), 'Process Watcher - "
|
|
"Restoring backup')]"):
|
|
tester.driver.find_element_by_xpath(
|
|
"//div[div[div[div[contains(text(), 'Process Watcher "
|
|
"- Restoring backup')]]]]"
|
|
"/following-sibling::div/div/div").click()
|
|
except Exception:
|
|
pass
|