@@ -21,32 +21,33 @@ function formatElapsedTime() {
21
21
return `${ numberFormatter . format ( ( performance . now ( ) - startTime ) / 1000 ) } s` ;
22
22
}
23
23
24
- const yargsInput = yargs ( hideBin ( process . argv ) )
25
- . option ( 'example-urls' , {
26
- string : true ,
27
- type : 'array' ,
28
- demandOption : true ,
29
- } )
30
- . option ( 'parallel' , {
31
- boolean : true ,
32
- default : true ,
33
- } )
34
- . option ( 'times' , {
35
- describe : 'How many times do you want to run an example?' ,
36
- number : true ,
37
- default : 1 ,
38
- } )
39
- . option ( 'label' , { string : true , default : 'run' } )
40
- . option ( 'include-follow-up' , {
41
- boolean : true ,
42
- default : false ,
43
- } )
44
- . option ( 'test-target' , {
45
- describe : 'Which panel do you want to run the examples against?' ,
46
- choices : [ 'elements' , 'performance-main-thread' , 'performance-insights' ] ,
47
- demandOption : true ,
48
- } )
49
- . parseSync ( ) ;
24
+ const yargsInput =
25
+ yargs ( hideBin ( process . argv ) )
26
+ . option ( 'example-urls' , {
27
+ string : true ,
28
+ type : 'array' ,
29
+ demandOption : true ,
30
+ } )
31
+ . option ( 'parallel' , {
32
+ boolean : true ,
33
+ default : true ,
34
+ } )
35
+ . option ( 'times' , {
36
+ describe : 'How many times do you want to run an example?' ,
37
+ number : true ,
38
+ default : 1 ,
39
+ } )
40
+ . option ( 'label' , { string : true , default : 'run' } )
41
+ . option ( 'include-follow-up' , {
42
+ boolean : true ,
43
+ default : false ,
44
+ } )
45
+ . option ( 'test-target' , {
46
+ describe : 'Which panel do you want to run the examples against?' ,
47
+ choices : [ 'elements' , 'performance-main-thread' , 'performance-insights' , 'elements-multimodal' ] ,
48
+ demandOption : true ,
49
+ } )
50
+ . parseSync ( ) ;
50
51
51
52
// Map the args to a more accurate interface for better type safety.
52
53
const userArgs = /** @type {import('./types.d.ts').YargsInput } **/ ( yargsInput ) ;
@@ -409,7 +410,7 @@ class Example {
409
410
await devtoolsPage . keyboard . press ( 'Escape' ) ;
410
411
await devtoolsPage . keyboard . press ( 'Escape' ) ;
411
412
412
- if ( userArgs . testTarget === 'elements' ) {
413
+ if ( userArgs . testTarget === 'elements' || userArgs . testTarget === 'elements-multimodal' ) {
413
414
await devtoolsPage . locator ( ':scope >>> #tab-elements' ) . setTimeout ( 5000 ) . click ( ) ;
414
415
this . log ( '[Info]: Opened Elements panel' ) ;
415
416
@@ -513,6 +514,7 @@ class Example {
513
514
#getLocator( ) {
514
515
switch ( userArgs . testTarget ) {
515
516
case 'elements' :
517
+ case 'elements-multimodal' :
516
518
return 'aria/Ask a question about the selected element' ;
517
519
case 'performance-main-thread' :
518
520
return 'aria/Ask a question about the selected item and its call tree' ;
@@ -551,6 +553,10 @@ class Example {
551
553
}
552
554
const devtoolsPage = this . #devtoolsPage;
553
555
556
+ if ( userArgs . testTarget === 'elements-multimodal' ) {
557
+ await devtoolsPage . locator ( 'aria/Take screenshot' ) . click ( ) ;
558
+ }
559
+
554
560
const inputSelector = this . #getLocator( ) ;
555
561
await devtoolsPage . locator ( inputSelector ) . click ( ) ;
556
562
await devtoolsPage . locator ( inputSelector ) . fill ( query ) ;
0 commit comments