9090 assert . equal ( parsed . actions [ 3 ] ?. flags . intervalMs , 150 ) ;
9191 assert . equal ( parsed . actions [ 4 ] ?. flags . holdMs , 3000 ) ;
9292 assert . equal ( parsed . actions [ 1 ] ?. flags . maestro ?. allowNonHittableCoordinateFallback , true ) ;
93- assert . equal ( parsed . actions [ 6 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , undefined ) ;
93+ assert . equal ( parsed . actions [ 6 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , true ) ;
9494} ) ;
9595
9696test ( 'parseMaestroReplayFlow maps iOS openLink through the app id when available' , ( ) => {
@@ -223,7 +223,7 @@ test('parseMaestroReplayFlow keeps focused inputText and pressKey Enter as separ
223223 assert . deepEqual ( parsed . actionLines , [ 3 , 4 , 5 ] ) ;
224224} ) ;
225225
226- test ( 'parseMaestroReplayFlow marks tapOn before inputText for snapshot tap focus ' , ( ) => {
226+ test ( 'parseMaestroReplayFlow keeps tapOn inputText without Enter on Maestro path ' , ( ) => {
227227 const parsed = parseMaestroReplayFlow ( `appId: com.callstack.agentdevicelab
228228---
229229- tapOn:
@@ -238,7 +238,29 @@ test('parseMaestroReplayFlow marks tapOn before inputText for snapshot tap focus
238238 [ 'type' , [ 'Saved list' ] ] ,
239239 ] ,
240240 ) ;
241- assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , undefined ) ;
241+ assert . deepEqual ( parsed . actionLines , [ 3 , 5 ] ) ;
242+ assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , true ) ;
243+ } ) ;
244+
245+ test ( 'parseMaestroReplayFlow preserves optional tapOn before inputText without Enter' , ( ) => {
246+ const parsed = parseMaestroReplayFlow ( `appId: com.callstack.agentdevicelab
247+ ---
248+ - tapOn:
249+ id: editableNameInput
250+ optional: true
251+ - inputText: Saved list
252+ ` ) ;
253+
254+ assert . deepEqual (
255+ parsed . actions . map ( ( entry ) => [ entry . command , entry . positionals ] ) ,
256+ [
257+ [ '__maestroTapOn' , [ 'id="editableNameInput"' ] ] ,
258+ [ 'type' , [ 'Saved list' ] ] ,
259+ ] ,
260+ ) ;
261+ assert . deepEqual ( parsed . actionLines , [ 3 , 6 ] ) ;
262+ assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. optional , true ) ;
263+ assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , true ) ;
242264} ) ;
243265
244266test ( 'parseMaestroReplayFlow coalesces tapOn inputText while preserving pressKey Enter submit' , ( ) => {
@@ -281,6 +303,27 @@ test('parseMaestroReplayFlow does not coalesce text entry for non-input-looking
281303 assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , undefined ) ;
282304} ) ;
283305
306+ test ( 'parseMaestroReplayFlow maps focused input commands to native type and keyboard actions' , ( ) => {
307+ const parsed = parseMaestroReplayFlow ( `appId: com.callstack.agentdevicelab
308+ ---
309+ - inputText: hello
310+ - eraseText:
311+ charactersToErase: 3
312+ - pasteText: pasted
313+ - pressKey: Return
314+ ` ) ;
315+
316+ assert . deepEqual (
317+ parsed . actions . map ( ( entry ) => [ entry . command , entry . positionals ] ) ,
318+ [
319+ [ 'type' , [ 'hello' ] ] ,
320+ [ 'type' , [ '\b' . repeat ( 3 ) ] ] ,
321+ [ 'type' , [ 'pasted' ] ] ,
322+ [ '__maestroPressEnter' , [ ] ] ,
323+ ] ,
324+ ) ;
325+ } ) ;
326+
284327test ( 'parseMaestroReplayFlow rejects relative runScript paths without source path' , ( ) => {
285328 assert . throws (
286329 ( ) =>
0 commit comments