File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11from playwright .sync_api import Page , expect
22from utils .click_helper import click
3-
3+ import logging
44
55class BasePage :
66 def __init__ (self , page : Page ):
@@ -105,6 +105,12 @@ def go_to_screening_subject_search_page(self)->None:
105105 click (self .page , self .screening_subject_search_page )
106106
107107 def click (self , locator ) -> None :
108+ """
109+ This is used to click on a locator
110+ The reason for this being used over the normal playwright click method is due to:
111+ - BCSS sometimes takes a while to render and so the normal click function 'clicks' on a locator before its available
112+ - Increases the reliability of clicks to avoid issues with the normal click method
113+ """
108114 try :
109115 self .page .wait_for_load_state ('load' )
110116 self .page .wait_for_load_state ('domcontentloaded' )
@@ -113,5 +119,5 @@ def click(self, locator) -> None:
113119 locator .click ()
114120
115121 except Exception as locatorClickError :
116- print (f"Failed to click element with error: { locatorClickError } , trying again..." )
122+ logging . warning (f"Failed to click element with error: { locatorClickError } , trying again..." )
117123 locator .click ()
You can’t perform that action at this time.
0 commit comments