@@ -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 coalesces tapOn inputText through native fill ' , ( ) => {
227227 const parsed = parseMaestroReplayFlow ( `appId: com.callstack.agentdevicelab
228228---
229229- tapOn:
@@ -234,11 +234,12 @@ test('parseMaestroReplayFlow marks tapOn before inputText for snapshot tap focus
234234 assert . deepEqual (
235235 parsed . actions . map ( ( entry ) => [ entry . command , entry . positionals ] ) ,
236236 [
237- [ '__maestroTapOn ' , [ 'id="editableNameInput"' ] ] ,
238- [ 'type ' , [ 'Saved list' ] ] ,
237+ [ 'wait ' , [ 'id="editableNameInput"' , '30000 '] ] ,
238+ [ 'fill ' , [ 'id="editableNameInput"' , 'Saved list' ] ] ,
239239 ] ,
240240 ) ;
241- assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , undefined ) ;
241+ assert . deepEqual ( parsed . actionLines , [ 3 , 3 ] ) ;
242+ assert . equal ( parsed . actions [ 1 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , true ) ;
242243} ) ;
243244
244245test ( 'parseMaestroReplayFlow coalesces tapOn inputText while preserving pressKey Enter submit' , ( ) => {
@@ -281,6 +282,27 @@ test('parseMaestroReplayFlow does not coalesce text entry for non-input-looking
281282 assert . equal ( parsed . actions [ 0 ] ?. flags ?. maestro ?. allowNonHittableCoordinateFallback , undefined ) ;
282283} ) ;
283284
285+ test ( 'parseMaestroReplayFlow maps focused input commands to native type and keyboard actions' , ( ) => {
286+ const parsed = parseMaestroReplayFlow ( `appId: com.callstack.agentdevicelab
287+ ---
288+ - inputText: hello
289+ - eraseText:
290+ charactersToErase: 3
291+ - pasteText: pasted
292+ - pressKey: Return
293+ ` ) ;
294+
295+ assert . deepEqual (
296+ parsed . actions . map ( ( entry ) => [ entry . command , entry . positionals ] ) ,
297+ [
298+ [ 'type' , [ 'hello' ] ] ,
299+ [ 'type' , [ '\b' . repeat ( 3 ) ] ] ,
300+ [ 'type' , [ 'pasted' ] ] ,
301+ [ '__maestroPressEnter' , [ ] ] ,
302+ ] ,
303+ ) ;
304+ } ) ;
305+
284306test ( 'parseMaestroReplayFlow rejects relative runScript paths without source path' , ( ) => {
285307 assert . throws (
286308 ( ) =>
@@ -658,10 +680,10 @@ test('parseMaestroReplayFlow parses the test-app Maestro suite fixture', () => {
658680 '__maestroAssertVisible' ,
659681 '__maestroTapOn' ,
660682 '__maestroAssertVisible' ,
661- '__maestroTapOn ' ,
662- 'type ' ,
663- '__maestroTapOn ' ,
664- 'type ' ,
683+ 'wait ' ,
684+ 'fill ' ,
685+ 'wait ' ,
686+ 'fill ' ,
665687 '__maestroTapOn' ,
666688 '__maestroAssertVisible' ,
667689 '__maestroAssertVisible' ,
0 commit comments