@@ -304,6 +304,50 @@ Suites.push({
304
304
] ,
305
305
} ) ;
306
306
307
+ Suites . push ( {
308
+ name : "TodoMVC-React-18" ,
309
+ url : "tentative/todomvc-react-18/dist" ,
310
+ tags : [ "todomvc" , "tentative" ] ,
311
+ async prepare ( page ) {
312
+ const element = await page . waitForElement ( "input[name=todoText]" ) ;
313
+ element . focus ( ) ;
314
+ } ,
315
+
316
+ tests : [
317
+ new BenchmarkTestStep ( "AddingLotsOfItems" , ( page ) => {
318
+ const button = page . querySelector ( ".add-lots-of-items-button" ) ;
319
+ button . click ( ) ;
320
+ } ) ,
321
+ new BenchmarkTestStep ( "CompletingSomeItems" , ( page ) => {
322
+ const checkboxes = page . querySelectorAll ( "input[type='checkbox']" ) ;
323
+
324
+ // We'll be checking 5 checkboxes, in different parts of the list.
325
+ const nbCheckboxesToCheck = 20 ;
326
+ const steps = checkboxes . length / nbCheckboxesToCheck ;
327
+
328
+ for ( let i = 0 ; i < nbCheckboxesToCheck ; i ++ )
329
+ checkboxes . at ( i * steps ) . click ( ) ;
330
+ } ) ,
331
+ new BenchmarkTestStep ( "Switching to seeing only pending items" , ( page ) => {
332
+ const link = page . querySelector ( "a[href$=active]" ) ;
333
+ link . click ( ) ;
334
+ } ) ,
335
+ new BenchmarkTestStep ( "Switching to seeing all items again" , ( page ) => {
336
+ const link = page . querySelector ( "a[href$='/']" ) ;
337
+ link . click ( ) ;
338
+ } ) ,
339
+ new BenchmarkTestStep ( "Removing completed items" , ( page ) => {
340
+ const button = page . querySelector ( "form[action$=removeCompleted] > button[type=submit]" ) ;
341
+ button . click ( ) ;
342
+ } ) ,
343
+ new BenchmarkTestStep ( "DeletingAllItems" , ( page ) => {
344
+ const deleteButtons = page . querySelectorAll ( "button[aria-label=remove]" ) ;
345
+ for ( let i = deleteButtons . length - 1 ; i >= 0 ; i -- )
346
+ deleteButtons [ i ] . click ( ) ;
347
+ } ) ,
348
+ ] ,
349
+ } ) ;
350
+
307
351
Suites . push ( {
308
352
name : "TodoMVC-React-Redux" ,
309
353
url : "todomvc/architecture-examples/react-redux/dist/index.html" ,
0 commit comments