@@ -89,45 +89,45 @@ def _not(self) -> "PageAssertions":
89
89
)
90
90
91
91
async def to_have_title (
92
- self , title_or_reg_exp : Union [Pattern [str ], str ], timeout : float = None
92
+ self , titleOrRegExp : Union [Pattern [str ], str ], timeout : float = None
93
93
) -> None :
94
94
expected_values = to_expected_text_values (
95
- [title_or_reg_exp ], normalize_white_space = True
95
+ [titleOrRegExp ], normalize_white_space = True
96
96
)
97
97
__tracebackhide__ = True
98
98
await self ._expect_impl (
99
99
"to.have.title" ,
100
100
FrameExpectOptions (expectedText = expected_values , timeout = timeout ),
101
- title_or_reg_exp ,
101
+ titleOrRegExp ,
102
102
"Page title expected to be" ,
103
103
)
104
104
105
105
async def not_to_have_title (
106
- self , title_or_reg_exp : Union [Pattern [str ], str ], timeout : float = None
106
+ self , titleOrRegExp : Union [Pattern [str ], str ], timeout : float = None
107
107
) -> None :
108
108
__tracebackhide__ = True
109
- await self ._not .to_have_title (title_or_reg_exp , timeout )
109
+ await self ._not .to_have_title (titleOrRegExp , timeout )
110
110
111
111
async def to_have_url (
112
- self , url_or_reg_exp : Union [str , Pattern [str ]], timeout : float = None
112
+ self , urlOrRegExp : Union [str , Pattern [str ]], timeout : float = None
113
113
) -> None :
114
114
__tracebackhide__ = True
115
115
base_url = self ._actual_page .context ._options .get ("baseURL" )
116
- if isinstance (url_or_reg_exp , str ) and base_url :
117
- url_or_reg_exp = urljoin (base_url , url_or_reg_exp )
118
- expected_text = to_expected_text_values ([url_or_reg_exp ])
116
+ if isinstance (urlOrRegExp , str ) and base_url :
117
+ urlOrRegExp = urljoin (base_url , urlOrRegExp )
118
+ expected_text = to_expected_text_values ([urlOrRegExp ])
119
119
await self ._expect_impl (
120
120
"to.have.url" ,
121
121
FrameExpectOptions (expectedText = expected_text , timeout = timeout ),
122
- url_or_reg_exp ,
122
+ urlOrRegExp ,
123
123
"Page URL expected to be" ,
124
124
)
125
125
126
126
async def not_to_have_url (
127
- self , url_or_reg_exp : Union [Pattern [str ], str ], timeout : float = None
127
+ self , urlOrRegExp : Union [Pattern [str ], str ], timeout : float = None
128
128
) -> None :
129
129
__tracebackhide__ = True
130
- await self ._not .to_have_url (url_or_reg_exp , timeout )
130
+ await self ._not .to_have_url (urlOrRegExp , timeout )
131
131
132
132
133
133
class LocatorAssertions (AssertionsBase ):
@@ -156,9 +156,9 @@ async def to_contain_text(
156
156
Pattern [str ],
157
157
str ,
158
158
],
159
- use_inner_text : bool = None ,
159
+ useInnerText : bool = None ,
160
160
timeout : float = None ,
161
- ignore_case : bool = None ,
161
+ ignoreCase : bool = None ,
162
162
) -> None :
163
163
__tracebackhide__ = True
164
164
if isinstance (expected , collections .abc .Sequence ) and not isinstance (
@@ -168,13 +168,13 @@ async def to_contain_text(
168
168
expected ,
169
169
match_substring = True ,
170
170
normalize_white_space = True ,
171
- ignore_case = ignore_case ,
171
+ ignoreCase = ignoreCase ,
172
172
)
173
173
await self ._expect_impl (
174
174
"to.contain.text.array" ,
175
175
FrameExpectOptions (
176
176
expectedText = expected_text ,
177
- useInnerText = use_inner_text ,
177
+ useInnerText = useInnerText ,
178
178
timeout = timeout ,
179
179
),
180
180
expected ,
@@ -185,13 +185,13 @@ async def to_contain_text(
185
185
[expected ],
186
186
match_substring = True ,
187
187
normalize_white_space = True ,
188
- ignore_case = ignore_case ,
188
+ ignoreCase = ignoreCase ,
189
189
)
190
190
await self ._expect_impl (
191
191
"to.have.text" ,
192
192
FrameExpectOptions (
193
193
expectedText = expected_text ,
194
- useInnerText = use_inner_text ,
194
+ useInnerText = useInnerText ,
195
195
timeout = timeout ,
196
196
),
197
197
expected ,
@@ -207,22 +207,22 @@ async def not_to_contain_text(
207
207
Pattern [str ],
208
208
str ,
209
209
],
210
- use_inner_text : bool = None ,
210
+ useInnerText : bool = None ,
211
211
timeout : float = None ,
212
- ignore_case : bool = None ,
212
+ ignoreCase : bool = None ,
213
213
) -> None :
214
214
__tracebackhide__ = True
215
- await self ._not .to_contain_text (expected , use_inner_text , timeout , ignore_case )
215
+ await self ._not .to_contain_text (expected , useInnerText , timeout , ignoreCase )
216
216
217
217
async def to_have_attribute (
218
218
self ,
219
219
name : str ,
220
220
value : Union [str , Pattern [str ]],
221
- ignore_case : bool = None ,
221
+ ignoreCase : bool = None ,
222
222
timeout : float = None ,
223
223
) -> None :
224
224
__tracebackhide__ = True
225
- expected_text = to_expected_text_values ([value ], ignore_case = ignore_case )
225
+ expected_text = to_expected_text_values ([value ], ignoreCase = ignoreCase )
226
226
await self ._expect_impl (
227
227
"to.have.attribute.value" ,
228
228
FrameExpectOptions (
@@ -236,12 +236,12 @@ async def not_to_have_attribute(
236
236
self ,
237
237
name : str ,
238
238
value : Union [str , Pattern [str ]],
239
- ignore_case : bool = None ,
239
+ ignoreCase : bool = None ,
240
240
timeout : float = None ,
241
241
) -> None :
242
242
__tracebackhide__ = True
243
243
await self ._not .to_have_attribute (
244
- name , value , ignore_case = ignore_case , timeout = timeout
244
+ name , value , ignoreCase = ignoreCase , timeout = timeout
245
245
)
246
246
247
247
async def to_have_class (
@@ -440,9 +440,9 @@ async def to_have_text(
440
440
Pattern [str ],
441
441
str ,
442
442
],
443
- use_inner_text : bool = None ,
443
+ useInnerText : bool = None ,
444
444
timeout : float = None ,
445
- ignore_case : bool = None ,
445
+ ignoreCase : bool = None ,
446
446
) -> None :
447
447
__tracebackhide__ = True
448
448
if isinstance (expected , collections .abc .Sequence ) and not isinstance (
@@ -451,27 +451,27 @@ async def to_have_text(
451
451
expected_text = to_expected_text_values (
452
452
expected ,
453
453
normalize_white_space = True ,
454
- ignore_case = ignore_case ,
454
+ ignoreCase = ignoreCase ,
455
455
)
456
456
await self ._expect_impl (
457
457
"to.have.text.array" ,
458
458
FrameExpectOptions (
459
459
expectedText = expected_text ,
460
- useInnerText = use_inner_text ,
460
+ useInnerText = useInnerText ,
461
461
timeout = timeout ,
462
462
),
463
463
expected ,
464
464
"Locator expected to have text" ,
465
465
)
466
466
else :
467
467
expected_text = to_expected_text_values (
468
- [expected ], normalize_white_space = True , ignore_case = ignore_case
468
+ [expected ], normalize_white_space = True , ignoreCase = ignoreCase
469
469
)
470
470
await self ._expect_impl (
471
471
"to.have.text" ,
472
472
FrameExpectOptions (
473
473
expectedText = expected_text ,
474
- useInnerText = use_inner_text ,
474
+ useInnerText = useInnerText ,
475
475
timeout = timeout ,
476
476
),
477
477
expected ,
@@ -487,12 +487,12 @@ async def not_to_have_text(
487
487
Pattern [str ],
488
488
str ,
489
489
],
490
- use_inner_text : bool = None ,
490
+ useInnerText : bool = None ,
491
491
timeout : float = None ,
492
- ignore_case : bool = None ,
492
+ ignoreCase : bool = None ,
493
493
) -> None :
494
494
__tracebackhide__ = True
495
- await self ._not .to_have_text (expected , use_inner_text , timeout , ignore_case )
495
+ await self ._not .to_have_text (expected , useInnerText , timeout , ignoreCase )
496
496
497
497
async def to_be_attached (
498
498
self ,
@@ -754,14 +754,14 @@ def expected_regex(
754
754
pattern : Pattern [str ],
755
755
match_substring : bool ,
756
756
normalize_white_space : bool ,
757
- ignore_case : Optional [bool ] = None ,
757
+ ignoreCase : Optional [bool ] = None ,
758
758
) -> ExpectedTextValue :
759
759
expected = ExpectedTextValue (
760
760
regexSource = pattern .pattern ,
761
761
regexFlags = escape_regex_flags (pattern ),
762
762
matchSubstring = match_substring ,
763
763
normalizeWhiteSpace = normalize_white_space ,
764
- ignoreCase = ignore_case ,
764
+ ignoreCase = ignoreCase ,
765
765
)
766
766
if expected ["ignoreCase" ] is None :
767
767
del expected ["ignoreCase" ]
@@ -774,7 +774,7 @@ def to_expected_text_values(
774
774
],
775
775
match_substring : bool = False ,
776
776
normalize_white_space : bool = False ,
777
- ignore_case : Optional [bool ] = None ,
777
+ ignoreCase : Optional [bool ] = None ,
778
778
) -> Sequence [ExpectedTextValue ]:
779
779
out : List [ExpectedTextValue ] = []
780
780
assert isinstance (items , list )
@@ -784,15 +784,13 @@ def to_expected_text_values(
784
784
string = item ,
785
785
matchSubstring = match_substring ,
786
786
normalizeWhiteSpace = normalize_white_space ,
787
- ignoreCase = ignore_case ,
787
+ ignoreCase = ignoreCase ,
788
788
)
789
789
if o ["ignoreCase" ] is None :
790
790
del o ["ignoreCase" ]
791
791
out .append (o )
792
792
elif isinstance (item , Pattern ):
793
793
out .append (
794
- expected_regex (
795
- item , match_substring , normalize_white_space , ignore_case
796
- )
794
+ expected_regex (item , match_substring , normalize_white_space , ignoreCase )
797
795
)
798
796
return out
0 commit comments