@@ -104,7 +104,7 @@ await Page.SetContentAsync(@"
104104 } ;
105105 await Page . FocusAsync ( "[placeholder='Empty input']" ) ;
106106 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
107- Assert . AreEqual ( nodeToCheck , snapshot ) ;
107+ Assert . That ( snapshot , Is . EqualTo ( nodeToCheck ) ) ;
108108 }
109109
110110 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "should report uninteresting nodes" ) ]
@@ -115,8 +115,12 @@ public async Task ShouldReportUninterestingNodes()
115115
116116 // This object has more children than in upstream.
117117 // Because upstream uses `toMatchObject` which stops going deeper if the element has not Children.
118- Assert . AreEqual (
119- new SerializedAXNode
118+ Assert . That (
119+ FindFocusedNode ( await Page . Accessibility . SnapshotAsync ( new AccessibilitySnapshotOptions
120+ {
121+ InterestingOnly = false
122+ } ) ) ,
123+ Is . EqualTo ( new SerializedAXNode
120124 {
121125 Role = "textbox" ,
122126 Name = "" ,
@@ -144,11 +148,7 @@ public async Task ShouldReportUninterestingNodes()
144148 }
145149 }
146150 }
147- } ,
148- FindFocusedNode ( await Page . Accessibility . SnapshotAsync ( new AccessibilitySnapshotOptions
149- {
150- InterestingOnly = false
151- } ) ) ) ;
151+ } ) ) ;
152152 }
153153
154154 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "get snapshots while the tree is re-calculated" ) ]
@@ -188,7 +188,7 @@ await Page.SetContentAsync(@"
188188 </html>" ) ;
189189
190190 var button = await Page . QuerySelectorAsync ( "button" ) ;
191- Assert . AreEqual ( "Show" , await GetAccessibleNameAsync ( Page , button ) ) ;
191+ Assert . That ( await GetAccessibleNameAsync ( Page , button ) , Is . EqualTo ( "Show" ) ) ;
192192 await button ! . ClickAsync ( ) ;
193193 await Page . WaitForSelectorAsync ( "aria/Hide" ) ;
194194 }
@@ -207,39 +207,39 @@ public async Task RoleDescription()
207207 await Page . SetContentAsync ( "<div tabIndex=-1 aria-roledescription='foo'>Hi</div>" ) ;
208208 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
209209 // See https://chromium-review.googlesource.com/c/chromium/src/+/3088862
210- Assert . Null ( snapshot . Children [ 0 ] . RoleDescription ) ;
210+ Assert . That ( snapshot . Children [ 0 ] . RoleDescription , Is . Null ) ;
211211 }
212212
213213 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "orientation" ) ]
214214 public async Task Orientation ( )
215215 {
216216 await Page . SetContentAsync ( "<a href='' role='slider' aria-orientation='vertical'>11</a>" ) ;
217217 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
218- Assert . AreEqual ( "vertical" , snapshot . Children [ 0 ] . Orientation ) ;
218+ Assert . That ( snapshot . Children [ 0 ] . Orientation , Is . EqualTo ( "vertical" ) ) ;
219219 }
220220
221221 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "autocomplete" ) ]
222222 public async Task AutoComplete ( )
223223 {
224224 await Page . SetContentAsync ( "<input type='number' aria-autocomplete='list' />" ) ;
225225 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
226- Assert . AreEqual ( "list" , snapshot . Children [ 0 ] . AutoComplete ) ;
226+ Assert . That ( snapshot . Children [ 0 ] . AutoComplete , Is . EqualTo ( "list" ) ) ;
227227 }
228228
229229 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "multiselectable" ) ]
230230 public async Task MultiSelectable ( )
231231 {
232232 await Page . SetContentAsync ( "<div role='grid' tabIndex=-1 aria-multiselectable=true>hey</div>" ) ;
233233 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
234- Assert . True ( snapshot . Children [ 0 ] . Multiselectable ) ;
234+ Assert . That ( snapshot . Children [ 0 ] . Multiselectable , Is . True ) ;
235235 }
236236
237237 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "Accessibility" , "keyshortcuts" ) ]
238238 public async Task KeyShortcuts ( )
239239 {
240240 await Page . SetContentAsync ( "<div role='grid' tabIndex=-1 aria-keyshortcuts='foo'>hey</div>" ) ;
241241 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
242- Assert . AreEqual ( "foo" , snapshot . Children [ 0 ] . KeyShortcuts ) ;
242+ Assert . That ( snapshot . Children [ 0 ] . KeyShortcuts , Is . EqualTo ( "foo" ) ) ;
243243 }
244244
245245 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "should not report text nodes inside controls" ) ]
@@ -250,8 +250,9 @@ await Page.SetContentAsync(@"
250250 <div role='tab' aria-selected='true'><b>Tab1</b></div>
251251 <div role='tab'>Tab2</div>
252252 </div>" ) ;
253- Assert . AreEqual (
254- new SerializedAXNode
253+ Assert . That (
254+ await Page . Accessibility . SnapshotAsync ( ) ,
255+ Is . EqualTo ( new SerializedAXNode
255256 {
256257 Role = "RootWebArea" ,
257258 Name = "" ,
@@ -267,8 +268,7 @@ await Page.SetContentAsync(@"
267268 Name = "Tab2"
268269 }
269270 }
270- } ,
271- await Page . Accessibility . SnapshotAsync ( ) ) ;
271+ } ) ) ;
272272 }
273273
274274 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "rich text editable fields should have children" ) ]
@@ -278,8 +278,9 @@ await Page.SetContentAsync(@"
278278 <div contenteditable='true'>
279279 Edit this image: <img src='fakeimage.png' alt='my fake image'>
280280 </div>" ) ;
281- Assert . AreEqual (
282- new SerializedAXNode
281+ Assert . That (
282+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
283+ Is . EqualTo ( new SerializedAXNode
283284 {
284285 Role = "generic" ,
285286 Name = "" ,
@@ -295,8 +296,7 @@ await Page.SetContentAsync(@"
295296 Name = "my fake image"
296297 }
297298 }
298- } ,
299- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
299+ } ) ) ;
300300 }
301301
302302 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "rich text editable fields with role should have children" ) ]
@@ -306,8 +306,9 @@ await Page.SetContentAsync(@"
306306 <div contenteditable='true' role='textbox'>
307307 Edit this image: <img src='fakeimage.png' alt='my fake image'>
308308 </div>" ) ;
309- Assert . AreEqual (
310- new SerializedAXNode
309+ Assert . That (
310+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
311+ Is . EqualTo ( new SerializedAXNode
311312 {
312313 Role = "textbox" ,
313314 Name = "" ,
@@ -320,23 +321,22 @@ await Page.SetContentAsync(@"
320321 Name = "Edit this image: "
321322 } ,
322323 }
323- } ,
324- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
324+ } ) ) ;
325325 }
326326
327327 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "plaintext contenteditable" , "plain text field with role should not have children" ) ]
328328 public async Task PlainTextFieldWithRoleShouldNotHaveChildren ( )
329329 {
330330 await Page . SetContentAsync ( "<div contenteditable='plaintext-only' role='textbox'>Edit this image:<img src='fakeimage.png' alt='my fake image'></div>" ) ;
331- Assert . AreEqual (
332- new SerializedAXNode
331+ Assert . That (
332+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
333+ Is . EqualTo ( new SerializedAXNode
333334 {
334335 Role = "textbox" ,
335336 Name = "" ,
336337 Value = "Edit this image:" ,
337338 Multiline = true ,
338- } ,
339- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
339+ } ) ) ;
340340 }
341341
342342 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "plaintext contenteditable" , "plain text field with tabindex and without role should not have content" ) ]
@@ -345,8 +345,8 @@ public async Task PlainTextFieldWithoutRoleShouldNotHaveContent()
345345 await Page . SetContentAsync (
346346 "<div contenteditable='plaintext-only'>Edit this image:<img src='fakeimage.png' alt='my fake image'></div>" ) ;
347347 var snapshot = await Page . Accessibility . SnapshotAsync ( ) ;
348- Assert . AreEqual ( "generic" , snapshot . Children [ 0 ] . Role ) ;
349- Assert . AreEqual ( string . Empty , snapshot . Children [ 0 ] . Name ) ;
348+ Assert . That ( snapshot . Children [ 0 ] . Role , Is . EqualTo ( "generic" ) ) ;
349+ Assert . That ( snapshot . Children [ 0 ] . Name , Is . EqualTo ( string . Empty ) ) ;
350350 }
351351
352352 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "non editable textbox with role and tabIndex and label should not have children" ) ]
@@ -357,14 +357,14 @@ await Page.SetContentAsync(@"
357357 this is the inner content
358358 <img alt='yo' src='fakeimg.png'>
359359 </div>" ) ;
360- Assert . AreEqual (
361- new SerializedAXNode
360+ Assert . That (
361+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
362+ Is . EqualTo ( new SerializedAXNode
362363 {
363364 Role = "textbox" ,
364365 Name = "my favorite textbox" ,
365366 Value = "this is the inner content "
366- } ,
367- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
367+ } ) ) ;
368368 }
369369
370370 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "checkbox with and tabIndex and label should not have children" ) ]
@@ -375,14 +375,14 @@ await Page.SetContentAsync(@"
375375 this is the inner content
376376 <img alt='yo' src='fakeimg.png'>
377377 </div>" ) ;
378- Assert . AreEqual (
379- new SerializedAXNode
378+ Assert . That (
379+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
380+ Is . EqualTo ( new SerializedAXNode
380381 {
381382 Role = "checkbox" ,
382383 Name = "my favorite checkbox" ,
383384 Checked = CheckedState . True
384- } ,
385- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
385+ } ) ) ;
386386 }
387387
388388 [ Test , Retry ( 2 ) , PuppeteerTest ( "accessibility.spec" , "filtering children of leaf nodes" , "checkbox without label should not have children" ) ]
@@ -393,14 +393,14 @@ await Page.SetContentAsync(@"
393393 this is the inner content
394394 <img alt='yo' src='fakeimg.png'>
395395 </div>" ) ;
396- Assert . AreEqual (
397- new SerializedAXNode
396+ Assert . That (
397+ ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ,
398+ Is . EqualTo ( new SerializedAXNode
398399 {
399400 Role = "checkbox" ,
400401 Name = "this is the inner content yo" ,
401402 Checked = CheckedState . True
402- } ,
403- ( await Page . Accessibility . SnapshotAsync ( ) ) . Children [ 0 ] ) ;
403+ } ) ) ;
404404 }
405405
406406 private SerializedAXNode FindFocusedNode ( SerializedAXNode serializedAXNode )
0 commit comments