mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-12-02 13:29:11 -06:00
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2019, 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
|