@@ -215,29 +215,17 @@ def test_accessibility_filtering_children_of_leaf_nodes_rich_text_editable_field
215215 "children" : [{"role" : "text" , "name" : "my fake image" }],
216216 }
217217 else :
218- if browser_channel :
219- golden = {
220- "role" : "textbox" ,
221- "name" : "" ,
222- "value" : "Edit this image: " ,
223- "children" : [
224- {"role" : "text" , "name" : "Edit this image:" },
225- {"role" : "img" , "name" : "my fake image" },
226- ],
227- "value" : "Edit this image: " ,
228- }
229- else :
230- golden = {
231- "role" : "textbox" ,
232- "name" : "" ,
233- "multiline" : True ,
234- "value" : "Edit this image: " ,
235- "children" : [
236- {"role" : "text" , "name" : "Edit this image:" },
237- {"role" : "img" , "name" : "my fake image" },
238- ],
239- "value" : "Edit this image: " ,
240- }
218+ golden = {
219+ "role" : "textbox" ,
220+ "name" : "" ,
221+ "multiline" : True ,
222+ "value" : "Edit this image: " ,
223+ "children" : [
224+ {"role" : "text" , "name" : "Edit this image:" },
225+ {"role" : "img" , "name" : "my fake image" },
226+ ],
227+ "value" : "Edit this image: " ,
228+ }
241229 snapshot = page .accessibility .snapshot ()
242230 assert snapshot ["children" ][0 ] == golden
243231
@@ -253,19 +241,12 @@ def test_accessibility_plain_text_field_with_role_should_not_have_children(
253241 <div contenteditable="plaintext-only" role='textbox'>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
254242 )
255243 snapshot = page .accessibility .snapshot ()
256- if browser_channel :
257- assert snapshot ["children" ][0 ] == {
258- "name" : "" ,
259- "role" : "textbox" ,
260- "value" : "Edit this image:" ,
261- }
262- else :
263- assert snapshot ["children" ][0 ] == {
264- "multiline" : True ,
265- "name" : "" ,
266- "role" : "textbox" ,
267- "value" : "Edit this image:" ,
268- }
244+ assert snapshot ["children" ][0 ] == {
245+ "multiline" : True ,
246+ "name" : "" ,
247+ "role" : "textbox" ,
248+ "value" : "Edit this image:" ,
249+ }
269250
270251
271252@pytest .mark .only_browser ("chromium" )
@@ -277,14 +258,11 @@ def test_accessibility_plain_text_field_without_role_should_not_have_content(
277258 <div contenteditable="plaintext-only">Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
278259 )
279260 snapshot = page .accessibility .snapshot ()
280- if browser_channel :
281- assert snapshot ["children" ][0 ] == {"name" : "" , "role" : "generic" }
282- else :
283- assert snapshot ["children" ][0 ] == {
284- "name" : "" ,
285- "role" : "generic" ,
286- "value" : "Edit this image:" ,
287- }
261+ assert snapshot ["children" ][0 ] == {
262+ "name" : "" ,
263+ "role" : "generic" ,
264+ "value" : "Edit this image:" ,
265+ }
288266
289267
290268@pytest .mark .only_browser ("chromium" )
@@ -296,14 +274,11 @@ def test_accessibility_plain_text_field_with_tabindex_and_without_role_should_no
296274 <div contenteditable="plaintext-only" tabIndex=0>Edit this image:<img src="fakeimage.png" alt="my fake image"></div>"""
297275 )
298276 snapshot = page .accessibility .snapshot ()
299- if browser_channel :
300- assert snapshot ["children" ][0 ] == {"name" : "" , "role" : "generic" }
301- else :
302- assert snapshot ["children" ][0 ] == {
303- "name" : "" ,
304- "role" : "generic" ,
305- "value" : "Edit this image:" ,
306- }
277+ assert snapshot ["children" ][0 ] == {
278+ "name" : "" ,
279+ "role" : "generic" ,
280+ "value" : "Edit this image:" ,
281+ }
307282
308283
309284def test_accessibility_non_editable_textbox_with_role_and_tabIndex_and_label_should_not_have_children (
0 commit comments