Skip to content

Commit

Permalink
selenium: fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
naisanzaa committed Aug 1, 2024
1 parent c8de42b commit 2006536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions automon/integrations/seleniumWrapper/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ async def find_anything(
logger.info(f'find_anything :: done')
return MATCHED

logger.debug(f'find_anything :: {len(MATCH)} result(s) found')
logger.debug(f'find_anything :: {len(MATCHED)} results found')
logger.info(f'find_anything :: done')
return MATCHED

Expand All @@ -622,7 +622,7 @@ async def find_elements(
logger.debug(f'find_elements :: {self.current_url} :: {value=} :: {by=} :: {kwargs=}')

find_elements = self.webdriver.find_elements(value=value, by=by, **kwargs)
logger.debug(f'find_elements :: {len(find_elements)} element(s) found')
logger.debug(f'find_elements :: {len(find_elements)} elements found')

logger.info(f'find_elements :: done')
return find_elements
Expand Down Expand Up @@ -935,7 +935,7 @@ async def wait_for_anything(
exact_match=exact_match,
return_first=return_first,
**kwargs)
logger.debug(f'wait_for_anything :: {len(find)} element(s) found')
logger.debug(f'wait_for_anything :: {len(find)} elements found')

if find:
logger.info(f'wait_for_anything :: done')
Expand Down Expand Up @@ -1007,7 +1007,7 @@ async def wait_for_elements(
value=value,
by=by,
**kwargs)
logger.debug(f'wait_for_elements :: {len(find)} element(s) found')
logger.debug(f'wait_for_elements :: {len(find)} elements found')

if find:
logger.info(f'wait_for_elements :: done')
Expand Down
3 changes: 2 additions & 1 deletion automon/integrations/seleniumWrapper/webdriver_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,11 @@ def set_user_agent(self, user_agent: str):

def set_window_size(self, *args, **kwargs):
"""has to be set after setting webdriver"""
logger.debug(f'webdriver :: chrome :: set_window_size :: {args=} :: {kwargs=}')
self._window_size = set_window_size(*args, **kwargs)
width, height = self.window_size
self.webdriver.set_window_size(width=width, height=height)
logger.debug(f'{width}, {height}')
logger.info(f'webdriver :: chrome :: set_window_size :: {width=} {height=}')
return self

async def start(self):
Expand Down

0 comments on commit 2006536

Please sign in to comment.