pgadmin4/web/regression/python_test_utils/test_gui_helper.py
Usman Muzaffar be26fc540c Many fixes to the stability of the feature tests, including:
tree toggle issue
Query tool inteliSence issue eg. when there is only one option and drop down is not shown
Backup and restore windows locator changes
Fixes required due to resolving rm # 4041
Dependent tab not showing data sometime, so refreshed the page and handled it
Due to change of logic for auto commit, did the required changes
Due to fix of RM 4062, did the required workaround which broke the test case.
2019-03-21 12:04:37 +00:00

35 lines
1.2 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"):
tester.driver.find_element_by_css_selector(
".btn.btn-sm-sq.btn-primary.pg-bg-close > 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[@class='card-header bg-primary d-flex']/div[contains("
"text(), 'Restoring backup')]"):
tester.driver.find_element_by_css_selector(
".btn.btn-sm-sq.btn-primary.pg-bg-close > i").click()
except Exception:
pass