@@ -221,29 +221,17 @@ async def test_accessibility_filtering_children_of_leaf_nodes_rich_text_editable
221221 "children" : [{"role" : "text" , "name" : "my fake image" }],
222222 }
223223 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+ }
247235 snapshot = await page .accessibility .snapshot ()
248236 assert snapshot ["children" ][0 ] == golden
249237
@@ -259,19 +247,12 @@ async def test_accessibility_plain_text_field_with_role_should_not_have_children
259247 <div contenteditable="plaintext-only" role='textbox'>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
260248 )
261249 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+ }
275256
276257
277258@pytest .mark .only_browser ("chromium" )
@@ -283,14 +264,11 @@ async def test_accessibility_plain_text_field_without_role_should_not_have_conte
283264 <div contenteditable="plaintext-only">Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
284265 )
285266 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+ }
294272
295273
296274@pytest .mark .only_browser ("chromium" )
@@ -302,14 +280,11 @@ async def test_accessibility_plain_text_field_with_tabindex_and_without_role_sho
302280 <div contenteditable="plaintext-only" tabIndex=0>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
303281 )
304282 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+ }
313288
314289
315290async def test_accessibility_non_editable_textbox_with_role_and_tabIndex_and_label_should_not_have_children (
0 commit comments