@@ -221,29 +221,17 @@ async def test_accessibility_filtering_children_of_leaf_nodes_rich_text_editable
221
221
"children" : [{"role" : "text" , "name" : "my fake image" }],
222
222
}
223
223
else :
224
- if browser_channel :
225
- golden = {
226
- "role" : "textbox" ,
227
- "name" : "" ,
228
- "value" : "Edit this image: " ,
229
- "children" : [
230
- {"role" : "text" , "name" : "Edit this image:" },
231
- {"role" : "img" , "name" : "my fake image" },
232
- ],
233
- "value" : "Edit this image: " ,
234
- }
235
- else :
236
- golden = {
237
- "role" : "textbox" ,
238
- "name" : "" ,
239
- "multiline" : True ,
240
- "value" : "Edit this image: " ,
241
- "children" : [
242
- {"role" : "text" , "name" : "Edit this image:" },
243
- {"role" : "img" , "name" : "my fake image" },
244
- ],
245
- "value" : "Edit this image: " ,
246
- }
224
+ golden = {
225
+ "role" : "textbox" ,
226
+ "name" : "" ,
227
+ "multiline" : True ,
228
+ "value" : "Edit this image: " ,
229
+ "children" : [
230
+ {"role" : "text" , "name" : "Edit this image:" },
231
+ {"role" : "img" , "name" : "my fake image" },
232
+ ],
233
+ "value" : "Edit this image: " ,
234
+ }
247
235
snapshot = await page .accessibility .snapshot ()
248
236
assert snapshot ["children" ][0 ] == golden
249
237
@@ -259,19 +247,12 @@ async def test_accessibility_plain_text_field_with_role_should_not_have_children
259
247
<div contenteditable="plaintext-only" role='textbox'>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
260
248
)
261
249
snapshot = await page .accessibility .snapshot ()
262
- if browser_channel :
263
- assert snapshot ["children" ][0 ] == {
264
- "name" : "" ,
265
- "role" : "textbox" ,
266
- "value" : "Edit this image:" ,
267
- }
268
- else :
269
- assert snapshot ["children" ][0 ] == {
270
- "multiline" : True ,
271
- "name" : "" ,
272
- "role" : "textbox" ,
273
- "value" : "Edit this image:" ,
274
- }
250
+ assert snapshot ["children" ][0 ] == {
251
+ "multiline" : True ,
252
+ "name" : "" ,
253
+ "role" : "textbox" ,
254
+ "value" : "Edit this image:" ,
255
+ }
275
256
276
257
277
258
@pytest .mark .only_browser ("chromium" )
@@ -283,14 +264,11 @@ async def test_accessibility_plain_text_field_without_role_should_not_have_conte
283
264
<div contenteditable="plaintext-only">Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
284
265
)
285
266
snapshot = await page .accessibility .snapshot ()
286
- if browser_channel :
287
- assert snapshot ["children" ][0 ] == {"name" : "" , "role" : "generic" }
288
- else :
289
- assert snapshot ["children" ][0 ] == {
290
- "name" : "" ,
291
- "role" : "generic" ,
292
- "value" : "Edit this image:" ,
293
- }
267
+ assert snapshot ["children" ][0 ] == {
268
+ "name" : "" ,
269
+ "role" : "generic" ,
270
+ "value" : "Edit this image:" ,
271
+ }
294
272
295
273
296
274
@pytest .mark .only_browser ("chromium" )
@@ -302,14 +280,11 @@ async def test_accessibility_plain_text_field_with_tabindex_and_without_role_sho
302
280
<div contenteditable="plaintext-only" tabIndex=0>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
303
281
)
304
282
snapshot = await page .accessibility .snapshot ()
305
- if browser_channel :
306
- assert snapshot ["children" ][0 ] == {"name" : "" , "role" : "generic" }
307
- else :
308
- assert snapshot ["children" ][0 ] == {
309
- "name" : "" ,
310
- "role" : "generic" ,
311
- "value" : "Edit this image:" ,
312
- }
283
+ assert snapshot ["children" ][0 ] == {
284
+ "name" : "" ,
285
+ "role" : "generic" ,
286
+ "value" : "Edit this image:" ,
287
+ }
313
288
314
289
315
290
async def test_accessibility_non_editable_textbox_with_role_and_tabIndex_and_label_should_not_have_children (
0 commit comments