@@ -67,7 +67,7 @@ def _not(self) -> "PageAssertions":
6767 return PageAssertions (self ._actual_page , not self ._is_not )
6868
6969 async def to_have_title (
70- self , title_or_reg_exp : Union [Pattern , str ], timeout : float = None
70+ self , title_or_reg_exp : Union [Pattern [ str ] , str ], timeout : float = None
7171 ) -> None :
7272 expected_values = to_expected_text_values (
7373 [title_or_reg_exp ], normalize_white_space = True
@@ -81,13 +81,13 @@ async def to_have_title(
8181 )
8282
8383 async def not_to_have_title (
84- self , title_or_reg_exp : Union [Pattern , str ], timeout : float = None
84+ self , title_or_reg_exp : Union [Pattern [ str ] , str ], timeout : float = None
8585 ) -> None :
8686 __tracebackhide__ = True
8787 await self ._not .to_have_title (title_or_reg_exp , timeout )
8888
8989 async def to_have_url (
90- self , url_or_reg_exp : Union [str , Pattern ], timeout : float = None
90+ self , url_or_reg_exp : Union [str , Pattern [ str ] ], timeout : float = None
9191 ) -> None :
9292 __tracebackhide__ = True
9393 base_url = self ._actual_page .context ._options .get ("baseURL" )
@@ -102,7 +102,7 @@ async def to_have_url(
102102 )
103103
104104 async def not_to_have_url (
105- self , url_or_reg_exp : Union [Pattern , str ], timeout : float = None
105+ self , url_or_reg_exp : Union [Pattern [ str ] , str ], timeout : float = None
106106 ) -> None :
107107 __tracebackhide__ = True
108108 await self ._not .to_have_url (url_or_reg_exp , timeout )
@@ -119,7 +119,7 @@ def _not(self) -> "LocatorAssertions":
119119
120120 async def to_contain_text (
121121 self ,
122- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
122+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
123123 use_inner_text : bool = None ,
124124 timeout : float = None ,
125125 ignore_case : bool = None ,
@@ -162,7 +162,7 @@ async def to_contain_text(
162162
163163 async def not_to_contain_text (
164164 self ,
165- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
165+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
166166 use_inner_text : bool = None ,
167167 timeout : float = None ,
168168 ignore_case : bool = None ,
@@ -173,7 +173,7 @@ async def not_to_contain_text(
173173 async def to_have_attribute (
174174 self ,
175175 name : str ,
176- value : Union [str , Pattern ],
176+ value : Union [str , Pattern [ str ] ],
177177 timeout : float = None ,
178178 ) -> None :
179179 __tracebackhide__ = True
@@ -190,15 +190,15 @@ async def to_have_attribute(
190190 async def not_to_have_attribute (
191191 self ,
192192 name : str ,
193- value : Union [str , Pattern ],
193+ value : Union [str , Pattern [ str ] ],
194194 timeout : float = None ,
195195 ) -> None :
196196 __tracebackhide__ = True
197197 await self ._not .to_have_attribute (name , value , timeout )
198198
199199 async def to_have_class (
200200 self ,
201- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
201+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
202202 timeout : float = None ,
203203 ) -> None :
204204 __tracebackhide__ = True
@@ -221,7 +221,7 @@ async def to_have_class(
221221
222222 async def not_to_have_class (
223223 self ,
224- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
224+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
225225 timeout : float = None ,
226226 ) -> None :
227227 __tracebackhide__ = True
@@ -251,7 +251,7 @@ async def not_to_have_count(
251251 async def to_have_css (
252252 self ,
253253 name : str ,
254- value : Union [str , Pattern ],
254+ value : Union [str , Pattern [ str ] ],
255255 timeout : float = None ,
256256 ) -> None :
257257 __tracebackhide__ = True
@@ -268,15 +268,15 @@ async def to_have_css(
268268 async def not_to_have_css (
269269 self ,
270270 name : str ,
271- value : Union [str , Pattern ],
271+ value : Union [str , Pattern [ str ] ],
272272 timeout : float = None ,
273273 ) -> None :
274274 __tracebackhide__ = True
275275 await self ._not .to_have_css (name , value , timeout )
276276
277277 async def to_have_id (
278278 self ,
279- id : Union [str , Pattern ],
279+ id : Union [str , Pattern [ str ] ],
280280 timeout : float = None ,
281281 ) -> None :
282282 __tracebackhide__ = True
@@ -290,7 +290,7 @@ async def to_have_id(
290290
291291 async def not_to_have_id (
292292 self ,
293- id : Union [str , Pattern ],
293+ id : Union [str , Pattern [ str ] ],
294294 timeout : float = None ,
295295 ) -> None :
296296 __tracebackhide__ = True
@@ -323,7 +323,7 @@ async def not_to_have_js_property(
323323
324324 async def to_have_value (
325325 self ,
326- value : Union [str , Pattern ],
326+ value : Union [str , Pattern [ str ] ],
327327 timeout : float = None ,
328328 ) -> None :
329329 __tracebackhide__ = True
@@ -337,15 +337,15 @@ async def to_have_value(
337337
338338 async def not_to_have_value (
339339 self ,
340- value : Union [str , Pattern ],
340+ value : Union [str , Pattern [ str ] ],
341341 timeout : float = None ,
342342 ) -> None :
343343 __tracebackhide__ = True
344344 await self ._not .to_have_value (value , timeout )
345345
346346 async def to_have_values (
347347 self ,
348- values : List [Union [Pattern , str ]],
348+ values : List [Union [Pattern [ str ] , str ]],
349349 timeout : float = None ,
350350 ) -> None :
351351 __tracebackhide__ = True
@@ -359,15 +359,15 @@ async def to_have_values(
359359
360360 async def not_to_have_values (
361361 self ,
362- values : List [Union [Pattern , str ]],
362+ values : List [Union [Pattern [ str ] , str ]],
363363 timeout : float = None ,
364364 ) -> None :
365365 __tracebackhide__ = True
366366 await self ._not .to_have_values (values , timeout )
367367
368368 async def to_have_text (
369369 self ,
370- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
370+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
371371 use_inner_text : bool = None ,
372372 timeout : float = None ,
373373 ignore_case : bool = None ,
@@ -406,7 +406,7 @@ async def to_have_text(
406406
407407 async def not_to_have_text (
408408 self ,
409- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
409+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
410410 use_inner_text : bool = None ,
411411 timeout : float = None ,
412412 ignore_case : bool = None ,
@@ -602,7 +602,7 @@ async def not_to_be_ok(self) -> None:
602602
603603
604604def expected_regex (
605- pattern : Pattern ,
605+ pattern : Pattern [ str ] ,
606606 match_substring : bool ,
607607 normalize_white_space : bool ,
608608 ignore_case : Optional [bool ] = None ,
@@ -620,7 +620,7 @@ def expected_regex(
620620
621621
622622def to_expected_text_values (
623- items : Union [List [Pattern ] , List [str ], List [Union [str , Pattern ]]],
623+ items : Union [List [Pattern [ str ]] , List [str ], List [Union [str , Pattern [ str ] ]]],
624624 match_substring : bool = False ,
625625 normalize_white_space : bool = False ,
626626 ignore_case : Optional [bool ] = None ,
0 commit comments