@@ -106,11 +106,8 @@ test('test command prints suite summary and exits non-zero on failures', async (
106106 assert . equal ( result . calls . length , 1 ) ;
107107 assert . equal ( result . calls [ 0 ] ?. meta ?. requestProgress , 'replay-test' ) ;
108108 assert . doesNotMatch ( result . stderr , / R u n n i n g r e p l a y s u i t e \. \. \. / ) ;
109- assert . match ( result . stdout , / P A S S 0 1 - p a s s \. a d \( 0 \. 0 1 s \) / ) ;
110- assert . match (
111- result . stdout ,
112- / F A I L " C h e c k o u t f a i l u r e " i n 0 2 - f a i l \. a d a f t e r 2 a t t e m p t s \( t o t a l 0 \. 0 0 5 s \) / ,
113- ) ;
109+ assert . doesNotMatch ( result . stdout , / ✓ 0 1 - p a s s \. a d \( 0 \. 0 1 s \) / ) ;
110+ assert . doesNotMatch ( result . stdout , / ⨯ " C h e c k o u t f a i l u r e " i n 0 2 - f a i l \. a d / ) ;
114111 assert . match ( result . stdout , / R e p l a y f a i l e d a t s t e p 1 \( o p e n D e m o \) : b o o m / ) ;
115112 assert . match ( result . stdout , / a r t i f a c t s : \/ t m p \/ t e s t - a r t i f a c t s \/ 0 2 - f a i l / ) ;
116113 assert . doesNotMatch ( result . stdout , / S K I P \/ t m p \/ 0 3 - s k i p \. a d / ) ;
@@ -125,11 +122,12 @@ test('test command --verbose prints all test statuses', async () => {
125122 assert . equal ( result . code , 1 ) ;
126123 assert . equal ( result . calls [ 0 ] ?. meta ?. debug , false ) ;
127124 assert . doesNotMatch ( result . stderr , / R u n n i n g r e p l a y s u i t e \. \. \. / ) ;
128- assert . match ( result . stdout , / P A S S 0 1 - p a s s \. a d \( 0 \. 0 1 s \) / ) ;
129- assert . match ( result . stdout , / S K I P 0 3 - s k i p \. a d / ) ;
125+ assert . doesNotMatch ( result . stdout , / ✓ 0 1 - p a s s \. a d \( 0 \. 0 1 s \) / ) ;
126+ assert . doesNotMatch ( result . stdout , / S K I P 0 3 - s k i p \. a d / ) ;
127+ assert . match ( result . stdout , / T e s t s u m m a r y : 1 p a s s e d , 1 f a i l e d i n 0 \. 0 2 5 s / ) ;
130128} ) ;
131129
132- test ( 'test command --verbose prints step telemetry for passing tests without debug mode' , async ( ) => {
130+ test ( 'test command --verbose omits step telemetry for passing tests without debug mode' , async ( ) => {
133131 const tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'agent-device-cli-test-verbose-' ) ) ;
134132 const artifactsDir = path . join ( tmpDir , 'auth-flow' ) ;
135133 const attemptDir = path . join ( artifactsDir , 'attempt-1' ) ;
@@ -203,16 +201,16 @@ test('test command --verbose prints step telemetry for passing tests without deb
203201
204202 assert . equal ( result . code , null ) ;
205203 assert . equal ( result . calls [ 0 ] ?. meta ?. debug , false ) ;
206- assert . match ( result . stdout , / P A S S " A u t h e n t i c a t i o n f l o w " \( 0 \. 5 s \) / ) ;
207- assert . match ( result . stdout , / s t e p s : / ) ;
208- assert . match ( result . stdout , / t a p O n " t e x t = \\ " L o g i n \\ " " \( l i n e 3 , 0 \. 2 5 s \) / ) ;
209- assert . match ( result . stdout , / a s s e r t V i s i b l e " t e x t = \\ " H o m e \\ " " \( l i n e 4 , 0 \. 0 7 5 s \) / ) ;
204+ assert . doesNotMatch ( result . stdout , / ✓ " A u t h e n t i c a t i o n f l o w " i n a u t h - f l o w \. y m l \( 0 \. 5 s \) / ) ;
205+ assert . doesNotMatch ( result . stdout , / s t e p s : / ) ;
206+ assert . doesNotMatch ( result . stdout , / t a p O n " t e x t = \\ " L o g i n \\ " " / ) ;
207+ assert . doesNotMatch ( result . stdout , / a s s e r t V i s i b l e " t e x t = \\ " H o m e \\ " " / ) ;
210208 } finally {
211209 await fs . rm ( tmpDir , { recursive : true , force : true } ) ;
212210 }
213211} ) ;
214212
215- test ( 'test command --verbose keeps nested retry and open step telemetry distinct ' , async ( ) => {
213+ test ( 'test command --verbose omits nested passing step telemetry' , async ( ) => {
216214 const tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'agent-device-cli-test-verbose-retry-' ) ) ;
217215 const artifactsDir = path . join ( tmpDir , 'material-top-tabs' ) ;
218216 const attemptDir = path . join ( artifactsDir , 'attempt-1' ) ;
@@ -300,15 +298,15 @@ test('test command --verbose keeps nested retry and open step telemetry distinct
300298 } ) ) ;
301299
302300 assert . equal ( result . code , null ) ;
303- assert . match (
301+ assert . doesNotMatch (
304302 result . stdout ,
305303 / o p e n " o r g \. r e a c t n a v i g a t i o n \. p l a y g r o u n d " " r n e : \/ \/ m a t e r i a l - t o p - t a b s - b a s i c " \( l i n e 4 , 0 \. 7 2 7 s \) / ,
306304 ) ;
307- assert . match (
305+ assert . doesNotMatch (
308306 result . stdout ,
309307 / a s s e r t V i s i b l e " l a b e l = \\ " C h a t \\ " \| \| t e x t = \\ " C h a t \\ " \| \| i d = \\ " C h a t \\ " " " 6 0 0 0 0 " \( l i n e 4 , 2 \. 5 8 s \) / ,
310308 ) ;
311- assert . match ( result . stdout , / r e t r y " 3 " \( l i n e 4 , 3 \. 3 1 s \) / ) ;
309+ assert . doesNotMatch ( result . stdout , / r e t r y " 3 " \( l i n e 4 , 3 \. 3 1 s \) / ) ;
312310 assert . doesNotMatch (
313311 result . stdout ,
314312 / o p e n " o r g \. r e a c t n a v i g a t i o n \. p l a y g r o u n d " " r n e : \/ \/ m a t e r i a l - t o p - t a b s - b a s i c " \( l i n e 4 , 3 \. 3 1 s \) / ,
@@ -354,30 +352,45 @@ test('test command reports flaky passed-on-retry cases in the default summary',
354352 assert . equal ( result . code , null ) ;
355353 assert . doesNotMatch ( result . stderr , / R u n n i n g r e p l a y s u i t e \. \. \. / ) ;
356354 assert . doesNotMatch ( result . stdout , / F L A K Y / ) ;
357- assert . match (
355+ assert . doesNotMatch (
358356 result . stdout ,
359- / P A S S " A u t h e n t i c a t i o n f l o w " a f t e r 2 a t t e m p t s \( p a s s e d a t t e m p t 1 7 \. 5 s , t o t a l 1 1 2 \. 2 s \) / ,
357+ / ^ ✓ " A u t h e n t i c a t i o n f l o w " i n a u t h - f l o w \. y m l \( p a s s e d a t t e m p t 1 7 \. 5 s , t o t a l 1 1 2 \. 2 s \) $ / m ,
360358 ) ;
361359 assert . match ( result . stdout , / T e s t s u m m a r y : 1 p a s s e d , 0 f a i l e d , 1 f l a k y i n 0 \. 0 2 5 s / ) ;
362360 assert . match ( result . stdout , / F l a k y t e s t s : / ) ;
363361 assert . match (
364362 result . stdout ,
365- / P A S S " A u t h e n t i c a t i o n f l o w " a f t e r 2 a t t e m p t s \( p a s s e d a t t e m p t 1 7 \. 5 s , t o t a l 1 1 2 \. 2 s \) / ,
363+ / ✓ " A u t h e n t i c a t i o n f l o w " i n a u t h - f l o w \. y m l a f t e r 2 a t t e m p t s \( p a s s e d a t t e m p t 1 7 \. 5 s , t o t a l 1 1 2 \. 2 s \) / ,
366364 ) ;
367365 assert . match (
368366 result . stdout ,
369367 / a t t e m p t 1 f a i l e d \( 9 4 \. 7 s \) : R e p l a y f a i l e d a t s t e p 3 \( t a p O n " L o g i n " \) : s e l e c t o r n o t f o u n d / ,
370368 ) ;
371369} ) ;
372370
373- test ( 'test command prints failed attempt step telemetry when timing trace exists' , async ( ) => {
371+ test ( 'test command --debug prints failed attempt step window when timing trace exists' , async ( ) => {
374372 const tmpDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'agent-device-cli-test-steps-' ) ) ;
375373 const artifactsDir = path . join ( tmpDir , 'checkout-flow' ) ;
376374 const attemptDir = path . join ( artifactsDir , 'attempt-2' ) ;
377375 await fs . mkdir ( attemptDir , { recursive : true } ) ;
378376 await fs . writeFile (
379377 path . join ( attemptDir , 'replay-timing.ndjson' ) ,
380378 [
379+ {
380+ type : 'replay_action_start' ,
381+ step : 0 ,
382+ line : 2 ,
383+ command : 'close' ,
384+ positionals : [ 'Demo' ] ,
385+ } ,
386+ {
387+ type : 'replay_action_stop' ,
388+ step : 0 ,
389+ line : 2 ,
390+ command : 'close' ,
391+ ok : true ,
392+ durationMs : 50 ,
393+ } ,
381394 {
382395 type : 'replay_action_start' ,
383396 step : 1 ,
@@ -406,6 +419,21 @@ test('test command prints failed attempt step telemetry when timing trace exists
406419 step : 2 ,
407420 line : 4 ,
408421 command : '__maestroTapOn' ,
422+ ok : true ,
423+ durationMs : 200 ,
424+ } ,
425+ {
426+ type : 'replay_action_start' ,
427+ step : 3 ,
428+ line : 5 ,
429+ command : '__maestroAssertVisible' ,
430+ positionals : [ 'text="Receipt"' , '3000' ] ,
431+ } ,
432+ {
433+ type : 'replay_action_stop' ,
434+ step : 3 ,
435+ line : 5 ,
436+ command : '__maestroAssertVisible' ,
409437 ok : false ,
410438 durationMs : 1500 ,
411439 errorCode : 'ASSERTION_FAILED' ,
@@ -426,10 +454,10 @@ test('test command prints failed attempt step telemetry when timing trace exists
426454 artifactsDir,
427455 error : {
428456 code : 'ASSERTION_FAILED' ,
429- message : 'Replay failed at step 2 (click "Pay "): selector not found' ,
457+ message : 'Replay failed at step 3 (assertVisible "Receipt "): selector not found' ,
430458 } ,
431459 } ;
432- const result = await runCliCapture ( [ 'test' , './suite' ] , async ( ) => ( {
460+ const result = await runCliCapture ( [ 'test' , './suite' , '--debug' ] , async ( ) => ( {
433461 ok : true ,
434462 data : {
435463 total : 1 ,
@@ -445,11 +473,18 @@ test('test command prints failed attempt step telemetry when timing trace exists
445473 } ) ) ;
446474
447475 assert . equal ( result . code , 1 ) ;
476+ assert . equal ( result . calls [ 0 ] ?. meta ?. debug , true ) ;
477+ assert . match (
478+ result . stdout ,
479+ / R e p l a y f a i l e d a t s t e p 3 \( a s s e r t V i s i b l e " R e c e i p t " \) : s e l e c t o r n o t f o u n d / ,
480+ ) ;
448481 assert . match ( result . stdout , / s t e p s \( a t t e m p t 2 \) : / ) ;
482+ assert . doesNotMatch ( result . stdout , / c l o s e " D e m o " \( l i n e 2 , 0 \. 0 5 0 s \) / ) ;
449483 assert . match ( result . stdout , / o p e n " D e m o " \( l i n e 3 , 0 \. 1 2 5 s , t i m i n g \{ " l a u n c h M s " : 1 0 0 \} \) / ) ;
484+ assert . match ( result . stdout , / t a p O n " t e x t = \\ " P a y \\ " " \( l i n e 4 , 0 \. 2 s \) / ) ;
450485 assert . match (
451486 result . stdout ,
452- / \[ F A I L \] t a p O n " t e x t = \\ " P a y \\ " " \( l i n e 4 , 1 \. 5 0 s , A S S E R T I O N _ F A I L E D \) / ,
487+ / \[ F A I L \] a s s e r t V i s i b l e " t e x t = \\ " R e c e i p t \\ " " " 3 0 0 0 " \( l i n e 5 , 1 \. 5 0 s , A S S E R T I O N _ F A I L E D \) / ,
453488 ) ;
454489 } finally {
455490 await fs . rm ( tmpDir , { recursive : true , force : true } ) ;
0 commit comments