@@ -67,7 +67,7 @@ def _not(self) -> "PageAssertions":
67
67
return PageAssertions (self ._actual_page , not self ._is_not )
68
68
69
69
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
71
71
) -> None :
72
72
expected_values = to_expected_text_values (
73
73
[title_or_reg_exp ], normalize_white_space = True
@@ -81,13 +81,13 @@ async def to_have_title(
81
81
)
82
82
83
83
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
85
85
) -> None :
86
86
__tracebackhide__ = True
87
87
await self ._not .to_have_title (title_or_reg_exp , timeout )
88
88
89
89
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
91
91
) -> None :
92
92
__tracebackhide__ = True
93
93
base_url = self ._actual_page .context ._options .get ("baseURL" )
@@ -102,7 +102,7 @@ async def to_have_url(
102
102
)
103
103
104
104
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
106
106
) -> None :
107
107
__tracebackhide__ = True
108
108
await self ._not .to_have_url (url_or_reg_exp , timeout )
@@ -119,7 +119,7 @@ def _not(self) -> "LocatorAssertions":
119
119
120
120
async def to_contain_text (
121
121
self ,
122
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
122
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
123
123
use_inner_text : bool = None ,
124
124
timeout : float = None ,
125
125
ignore_case : bool = None ,
@@ -162,7 +162,7 @@ async def to_contain_text(
162
162
163
163
async def not_to_contain_text (
164
164
self ,
165
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
165
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
166
166
use_inner_text : bool = None ,
167
167
timeout : float = None ,
168
168
ignore_case : bool = None ,
@@ -173,7 +173,7 @@ async def not_to_contain_text(
173
173
async def to_have_attribute (
174
174
self ,
175
175
name : str ,
176
- value : Union [str , Pattern ],
176
+ value : Union [str , Pattern [ str ] ],
177
177
timeout : float = None ,
178
178
) -> None :
179
179
__tracebackhide__ = True
@@ -190,15 +190,15 @@ async def to_have_attribute(
190
190
async def not_to_have_attribute (
191
191
self ,
192
192
name : str ,
193
- value : Union [str , Pattern ],
193
+ value : Union [str , Pattern [ str ] ],
194
194
timeout : float = None ,
195
195
) -> None :
196
196
__tracebackhide__ = True
197
197
await self ._not .to_have_attribute (name , value , timeout )
198
198
199
199
async def to_have_class (
200
200
self ,
201
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
201
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
202
202
timeout : float = None ,
203
203
) -> None :
204
204
__tracebackhide__ = True
@@ -221,7 +221,7 @@ async def to_have_class(
221
221
222
222
async def not_to_have_class (
223
223
self ,
224
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
224
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
225
225
timeout : float = None ,
226
226
) -> None :
227
227
__tracebackhide__ = True
@@ -251,7 +251,7 @@ async def not_to_have_count(
251
251
async def to_have_css (
252
252
self ,
253
253
name : str ,
254
- value : Union [str , Pattern ],
254
+ value : Union [str , Pattern [ str ] ],
255
255
timeout : float = None ,
256
256
) -> None :
257
257
__tracebackhide__ = True
@@ -268,15 +268,15 @@ async def to_have_css(
268
268
async def not_to_have_css (
269
269
self ,
270
270
name : str ,
271
- value : Union [str , Pattern ],
271
+ value : Union [str , Pattern [ str ] ],
272
272
timeout : float = None ,
273
273
) -> None :
274
274
__tracebackhide__ = True
275
275
await self ._not .to_have_css (name , value , timeout )
276
276
277
277
async def to_have_id (
278
278
self ,
279
- id : Union [str , Pattern ],
279
+ id : Union [str , Pattern [ str ] ],
280
280
timeout : float = None ,
281
281
) -> None :
282
282
__tracebackhide__ = True
@@ -290,7 +290,7 @@ async def to_have_id(
290
290
291
291
async def not_to_have_id (
292
292
self ,
293
- id : Union [str , Pattern ],
293
+ id : Union [str , Pattern [ str ] ],
294
294
timeout : float = None ,
295
295
) -> None :
296
296
__tracebackhide__ = True
@@ -323,7 +323,7 @@ async def not_to_have_js_property(
323
323
324
324
async def to_have_value (
325
325
self ,
326
- value : Union [str , Pattern ],
326
+ value : Union [str , Pattern [ str ] ],
327
327
timeout : float = None ,
328
328
) -> None :
329
329
__tracebackhide__ = True
@@ -337,15 +337,15 @@ async def to_have_value(
337
337
338
338
async def not_to_have_value (
339
339
self ,
340
- value : Union [str , Pattern ],
340
+ value : Union [str , Pattern [ str ] ],
341
341
timeout : float = None ,
342
342
) -> None :
343
343
__tracebackhide__ = True
344
344
await self ._not .to_have_value (value , timeout )
345
345
346
346
async def to_have_values (
347
347
self ,
348
- values : List [Union [Pattern , str ]],
348
+ values : List [Union [Pattern [ str ] , str ]],
349
349
timeout : float = None ,
350
350
) -> None :
351
351
__tracebackhide__ = True
@@ -359,15 +359,15 @@ async def to_have_values(
359
359
360
360
async def not_to_have_values (
361
361
self ,
362
- values : List [Union [Pattern , str ]],
362
+ values : List [Union [Pattern [ str ] , str ]],
363
363
timeout : float = None ,
364
364
) -> None :
365
365
__tracebackhide__ = True
366
366
await self ._not .to_have_values (values , timeout )
367
367
368
368
async def to_have_text (
369
369
self ,
370
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
370
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
371
371
use_inner_text : bool = None ,
372
372
timeout : float = None ,
373
373
ignore_case : bool = None ,
@@ -406,7 +406,7 @@ async def to_have_text(
406
406
407
407
async def not_to_have_text (
408
408
self ,
409
- expected : Union [List [Union [Pattern , str ]], Pattern , str ],
409
+ expected : Union [List [Union [Pattern [ str ] , str ]], Pattern [ str ] , str ],
410
410
use_inner_text : bool = None ,
411
411
timeout : float = None ,
412
412
ignore_case : bool = None ,
@@ -602,7 +602,7 @@ async def not_to_be_ok(self) -> None:
602
602
603
603
604
604
def expected_regex (
605
- pattern : Pattern ,
605
+ pattern : Pattern [ str ] ,
606
606
match_substring : bool ,
607
607
normalize_white_space : bool ,
608
608
ignore_case : Optional [bool ] = None ,
@@ -620,7 +620,7 @@ def expected_regex(
620
620
621
621
622
622
def 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 ] ]]],
624
624
match_substring : bool = False ,
625
625
normalize_white_space : bool = False ,
626
626
ignore_case : Optional [bool ] = None ,
0 commit comments