@@ -121,7 +121,7 @@ test('Provider-backed integration Android Maestro replay uses fresh selector sna
121121 world . adbCalls . find ( ( call ) => call . slice ( 0 , 3 ) . join ( ' ' ) === 'shell input swipe' ) ,
122122 [ 'shell' , 'input' , 'swipe' , '351' , '390' , '39' , '390' , '300' ] ,
123123 ) ;
124- assert . equal ( snapshots >= 2 , true ) ;
124+ assert . equal ( snapshots , 2 ) ;
125125 } ,
126126 ) ;
127127} ) ;
@@ -167,18 +167,74 @@ test('Provider-backed integration Android Maestro replay test suite discovers YA
167167 world . adbCalls . find ( ( call ) => call . slice ( 0 , 3 ) . join ( ' ' ) === 'shell input tap' ) ,
168168 [ 'shell' , 'input' , 'tap' , '180' , '330' ] ,
169169 ) ;
170- assert . equal ( snapshots >= 2 , true ) ;
170+ assert . equal ( snapshots , 2 ) ;
171171 } ,
172172 ) ;
173173} ) ;
174174
175- test ( 'Provider-backed integration Android Maestro coalesces tapOn inputText and pressKey Enter through native paths ' , async ( ) => {
175+ test ( 'Provider-backed integration Android Maestro fills tapOn inputText without trailing Enter' , async ( ) => {
176176 await withProviderScenarioResource (
177177 async ( ) => await createAndroidSettingsWorld ( { nativeTextInjection : true } ) ,
178178 async ( world ) => {
179179 const client = world . daemon . client ( ) ;
180180 const suiteRoot = path . join ( world . tempRoot , 'suite-maestro-input' ) ;
181181 fs . mkdirSync ( suiteRoot , { recursive : true } ) ;
182+ const flowPath = path . join ( suiteRoot , 'input-only.yaml' ) ;
183+ fs . writeFileSync (
184+ flowPath ,
185+ [
186+ 'appId: com.android.settings' ,
187+ '---' ,
188+ '- launchApp' ,
189+ '- tapOn: Search' ,
190+ '- inputText: "Łódź café"' ,
191+ '' ,
192+ ] . join ( '\n' ) ,
193+ ) ;
194+
195+ const suite = await client . replay . test ( {
196+ paths : [ flowPath ] ,
197+ backend : 'maestro' ,
198+ artifactsDir : path . join ( suiteRoot , 'artifacts' ) ,
199+ timeoutMs : 30000 ,
200+ ...world . selection ,
201+ } ) ;
202+
203+ assert . equal ( suite . total , 1 , JSON . stringify ( suite ) ) ;
204+ assert . equal ( suite . passed , 1 , JSON . stringify ( suite ) ) ;
205+ assert . equal ( suite . failed , 0 , JSON . stringify ( suite ) ) ;
206+ assert . deepEqual ( world . textInjectionCalls , [
207+ {
208+ action : 'fill' ,
209+ target : { x : 195 , y : 52 } ,
210+ text : 'Łódź café' ,
211+ delayMs : 0 ,
212+ } ,
213+ ] ) ;
214+ assert . equal (
215+ world . adbCalls . some (
216+ ( call ) => call [ 0 ] === 'shell' && call [ 1 ] === 'input' && call [ 2 ] === 'text' ,
217+ ) ,
218+ false ,
219+ JSON . stringify ( world . adbCalls ) ,
220+ ) ;
221+ assert . equal (
222+ world . adbCalls . some ( ( call ) => call . slice ( 0 , 4 ) . join ( ' ' ) === 'shell input keyevent ENTER' ) ,
223+ false ,
224+ JSON . stringify ( world . adbCalls ) ,
225+ ) ;
226+ world . assertNoHostAdbCalls ( ) ;
227+ } ,
228+ ) ;
229+ } ) ;
230+
231+ test ( 'Provider-backed integration Android Maestro preserves pressKey Enter after native fill' , async ( ) => {
232+ await withProviderScenarioResource (
233+ async ( ) => await createAndroidSettingsWorld ( { nativeTextInjection : true } ) ,
234+ async ( world ) => {
235+ const client = world . daemon . client ( ) ;
236+ const suiteRoot = path . join ( world . tempRoot , 'suite-maestro-input-submit' ) ;
237+ fs . mkdirSync ( suiteRoot , { recursive : true } ) ;
182238 const flowPath = path . join ( suiteRoot , 'input-submit.yaml' ) ;
183239 fs . writeFileSync (
184240 flowPath ,
@@ -277,7 +333,7 @@ test('Provider-backed integration Android Maestro executes runFlow conditions an
277333 world . adbCalls . find ( ( call ) => call . slice ( 0 , 3 ) . join ( ' ' ) === 'shell input tap' ) ,
278334 [ 'shell' , 'input' , 'tap' , '180' , '330' ] ,
279335 ) ;
280- assert . equal ( snapshots >= 3 , true ) ;
336+ assert . equal ( snapshots , 3 ) ;
281337 } ,
282338 ) ;
283339} ) ;
0 commit comments