@@ -1212,7 +1212,7 @@ describe('registerToolCommands', () => {
12121212 expect ( output . data . waitMatch . matches ) . toEqual ( [ 'e11|none|text|No matches||' ] ) ;
12131213 } ) ;
12141214
1215- it ( 'keeps UI action runtime snapshots compact for verbose JSON output' , async ( ) => {
1215+ it ( 'renders full UI action runtime snapshots for verbose JSON output' , async ( ) => {
12161216 mockInvokeDirectThroughHandler ( ) ;
12171217 const stdoutChunks = captureStdoutChunks ( ) ;
12181218
@@ -1271,21 +1271,23 @@ describe('registerToolCommands', () => {
12711271
12721272 const output = JSON . parse ( stdoutChunks . join ( '' ) ) as {
12731273 schema : string ;
1274- data : { capture : { targets : string [ ] ; elements ?: unknown [ ] } } ;
1274+ data : { capture : { targets ? : string [ ] ; elements ?: unknown [ ] } } ;
12751275 } ;
12761276 expect ( output . schema ) . toBe ( 'xcodebuildmcp.output.ui-action-result' ) ;
12771277 expect ( output . data . capture ) . toEqual (
12781278 expect . objectContaining ( {
12791279 type : 'runtime-snapshot' ,
1280- rs : '1' ,
1281- targets : [ 'e2|tap|button|Continue||' ] ,
1282- scroll : [ 'e1|swipe|application|Weather||' ] ,
1280+ protocol : 'rs/1' ,
1281+ simulatorId : 'SIMULATOR-1' ,
1282+ screenHash : 'screen-hash' ,
1283+ seq : 1 ,
12831284 } ) ,
12841285 ) ;
1285- expect ( output . data . capture . elements ) . toBeUndefined ( ) ;
1286+ expect ( output . data . capture . elements ) . toBeDefined ( ) ;
1287+ expect ( output . data . capture . elements ) . toHaveLength ( 2 ) ;
12861288 } ) ;
12871289
1288- it ( 'keeps capture runtime snapshots compact for verbose JSON output' , async ( ) => {
1290+ it ( 'renders full capture runtime snapshots for verbose JSON output' , async ( ) => {
12891291 mockInvokeDirectThroughHandler ( ) ;
12901292 const stdoutChunks : string [ ] = [ ] ;
12911293 vi . spyOn ( process . stdout , 'write' ) . mockImplementation ( ( chunk ) => {
@@ -1337,17 +1339,20 @@ describe('registerToolCommands', () => {
13371339
13381340 const output = JSON . parse ( stdoutChunks . join ( '' ) ) as {
13391341 schema : string ;
1340- data : { capture : { scroll : string [ ] ; elements ?: unknown [ ] } } ;
1342+ data : { capture : { scroll ? : string [ ] ; elements ?: unknown [ ] } } ;
13411343 } ;
13421344 expect ( output . schema ) . toBe ( 'xcodebuildmcp.output.capture-result' ) ;
13431345 expect ( output . data . capture ) . toEqual (
13441346 expect . objectContaining ( {
13451347 type : 'runtime-snapshot' ,
1346- rs : '1' ,
1347- scroll : [ 'e1|swipe|application|Weather||' ] ,
1348+ protocol : 'rs/1' ,
1349+ simulatorId : 'SIMULATOR-1' ,
1350+ screenHash : 'screen-hash' ,
1351+ seq : 1 ,
13481352 } ) ,
13491353 ) ;
1350- expect ( output . data . capture . elements ) . toBeUndefined ( ) ;
1354+ expect ( output . data . capture . elements ) . toBeDefined ( ) ;
1355+ expect ( output . data . capture . elements ) . toHaveLength ( 1 ) ;
13511356 } ) ;
13521357
13531358 it ( 'writes one NDJSON line per domain fragment for jsonl output and omits the final envelope' , async ( ) => {
0 commit comments