From fc0e36b313d04dfa514da0bec835b3699674ade8 Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Tue, 28 Mar 2023 11:27:16 +0530 Subject: [PATCH] Removed old path library used to validate client secret path while google authentication. #5750 --- web/pgadmin/misc/cloud/google/__init__.py | 3 +-- web/regression/feature_utils/pgadmin_page.py | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/web/pgadmin/misc/cloud/google/__init__.py b/web/pgadmin/misc/cloud/google/__init__.py index de5a2b520..c07f8f3e6 100644 --- a/web/pgadmin/misc/cloud/google/__init__.py +++ b/web/pgadmin/misc/cloud/google/__init__.py @@ -11,7 +11,6 @@ import pickle import json import os -from pathlib import Path from urllib.parse import unquote from config import root @@ -90,7 +89,7 @@ def verify_credentials(): except Exception as e: return bad_request(errormsg=str(e)) - if client_secret_path is not None and Path(client_secret_path).exists(): + if client_secret_path and os.path.exists(client_secret_path): with open(client_secret_path, 'r') as json_file: client_config = json.load(json_file) diff --git a/web/regression/feature_utils/pgadmin_page.py b/web/regression/feature_utils/pgadmin_page.py index 86702d0bf..636b684ed 100644 --- a/web/regression/feature_utils/pgadmin_page.py +++ b/web/regression/feature_utils/pgadmin_page.py @@ -62,14 +62,16 @@ class PgadminPage: self.driver.refresh() try: WebDriverWait(self.driver, 3).until(EC.alert_is_present()) - self.driver.switch_to_alert().accept() + self.driver.switch_to.alert.accept() attempt = attempt + 1 except TimeoutException: attempt = attempt + 1 self.click_element(self.find_by_css_selector( "li[data-label='Reset Layout']")) - self.click_modal('OK') + self.click_modal('Yes') + if WebDriverWait(self.driver, 3).until(EC.alert_is_present()): + self.driver.switch_to.alert.accept() self.wait_for_reloading_indicator_to_disappear() def refresh_page(self):