@@ -79,10 +79,7 @@ def __init__(
7979 self ._dispatcher_fiber = frame ._connection ._dispatcher_fiber
8080
8181 if has_text :
82- text_selector = "text=" + escape_for_text_selector (has_text , exact = False )
83- self ._selector += (
84- f" >> internal:has={ json .dumps (text_selector , ensure_ascii = False )} "
85- )
82+ self ._selector += f" >> internal:has-text={ escape_for_text_selector (has_text , exact = False )} "
8683
8784 if has :
8885 if has ._frame != frame :
@@ -200,6 +197,14 @@ async def fill(
200197 params = locals_to_params (locals ())
201198 return await self ._frame .fill (self ._selector , strict = True , ** params )
202199
200+ async def clear (
201+ self ,
202+ timeout : float = None ,
203+ noWaitAfter : bool = None ,
204+ force : bool = None ,
205+ ) -> None :
206+ await self .fill ("" , timeout = timeout , noWaitAfter = noWaitAfter , force = force )
207+
203208 def locator (
204209 self ,
205210 selector : str ,
@@ -311,6 +316,16 @@ async def focus(self, timeout: float = None) -> None:
311316 params = locals_to_params (locals ())
312317 return await self ._frame .focus (self ._selector , strict = True , ** params )
313318
319+ async def blur (self , timeout : float = None ) -> None :
320+ await self ._frame ._channel .send (
321+ "blur" ,
322+ {
323+ "selector" : self ._selector ,
324+ "strict" : True ,
325+ ** locals_to_params (locals ()),
326+ },
327+ )
328+
314329 async def count (
315330 self ,
316331 ) -> int :
@@ -345,6 +360,7 @@ async def hover(
345360 modifiers : List [KeyboardModifier ] = None ,
346361 position : Position = None ,
347362 timeout : float = None ,
363+ noWaitAfter : bool = None ,
348364 force : bool = None ,
349365 trial : bool = None ,
350366 ) -> None :
@@ -762,7 +778,7 @@ def get_by_placeholder_selector(
762778
763779
764780def get_by_text_selector (text : Union [str , Pattern [str ]], exact : bool = None ) -> str :
765- return "text=" + escape_for_text_selector (text , exact = exact )
781+ return "internal: text=" + escape_for_text_selector (text , exact = exact )
766782
767783
768784def get_by_role_selector (
@@ -801,4 +817,4 @@ def get_by_role_selector(
801817 if pressed is not None :
802818 props .append (("pressed" , str (pressed )))
803819 props_str = "" .join ([f"[{ t [0 ]} ={ t [1 ]} ]" for t in props ])
804- return f"role={ role } { props_str } "
820+ return f"internal: role={ role } { props_str } "
0 commit comments