Skip to content

Commit

Permalink
selenium: update cookie logging
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Oct 7, 2024
1 parent f869673 commit 8f3aff9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions automon/integrations/seleniumWrapper/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,17 @@ def action_type_down(
raise Exception(f'action_type_down :: failed :: {error=} :: {key=}')

def add_cookie(self, cookie_dict: dict) -> bool:
logger.debug(f'add_cookie :: {cookie_dict=}')
logger.debug(
f'add_cookie :: {cookie_dict.get("domain")} :: '
f'{cookie_dict.get("path")} :: '
f'{cookie_dict.get("secure")} :: '
f'{cookie_dict.get("expiry")} :: '
f'{cookie_dict.get("name")}'
)

result = self.webdriver.add_cookie(cookie_dict=cookie_dict)

if result is None:
logger.debug(f'add_cookie :: domain :: {cookie_dict.get("domain")}')
logger.debug(f'add_cookie :: path :: {cookie_dict.get("path")}')
logger.debug(f'add_cookie :: secure :: {cookie_dict.get("secure")}')
logger.debug(f'add_cookie :: expiry :: {cookie_dict.get("expiry")}')
logger.debug(f'add_cookie :: name :: {cookie_dict.get("name")}')

logger.info(f'add_cookie :: done')
return True

Expand All @@ -331,11 +331,9 @@ def add_cookie_from_file(self, file: str) -> bool:

def add_cookies_from_list(self, cookies_list: list) -> bool:
"""add cookies from a list of cookies"""
logger.debug(f'add_cookies_from_list :: start')
logger.debug(f'add_cookies_from_list :: {len(cookies_list)} cookies found')

for cookie in cookies_list:
logger.debug(f'add_cookies_from_list :: {cookie=}')
self.add_cookie(cookie_dict=cookie)

logger.debug(f'add_cookies_from_list :: {len(cookies_list)} cookies added')
Expand Down

0 comments on commit 8f3aff9

Please sign in to comment.