@@ -73,8 +73,8 @@ const TEST_DEPENDENCIES = {
7373test ( 'iOS device session exposes reusable capabilities without its raw client' , async ( ) => {
7474 const pressKey = vi . fn ( async ( ) => undefined ) ;
7575 const readLogs = vi . fn ( async ( ) => 'line one\nline two\n' ) ;
76- const startRecording = vi . fn ( async ( ) => undefined ) ;
77- const stopRecording = vi . fn ( async ( ) => 'https://ios.example/recording' ) ;
76+ const startRecordingSession = vi . fn ( async ( ) => 'recording-id' ) ;
77+ const stopRecordingSession = vi . fn ( async ( ) => 'https://ios.example/recording' ) ;
7878 const simctlWait = vi . fn ( async ( ) => ( { code : 0 , stdout : 'ok' , stderr : '' } ) ) ;
7979 const simctl = vi . fn ( ( ) => commandExecution ( simctlWait ) ) ;
8080 const session = createLimrunDeviceSession (
@@ -83,8 +83,8 @@ test('iOS device session exposes reusable capabilities without its raw client',
8383 listApps : vi . fn ( async ( ) => IOS_APPS ) ,
8484 pressKey,
8585 appLogTail : readLogs ,
86- startRecording ,
87- stopRecording ,
86+ startRecordingSession ,
87+ stopRecordingSession ,
8888 simctl,
8989 } ) ,
9090 ) ;
@@ -103,8 +103,10 @@ test('iOS device session exposes reusable capabilities without its raw client',
103103 assert . deepEqual ( session . viewport , { width : 402 , height : 874 } ) ;
104104 await session . pressKey ( 'enter' , [ 'command' ] ) ;
105105 assert . equal ( await session . readLogs ( 'com.example.ios' , 200 ) , 'line one\nline two\n' ) ;
106- await session . startRecording ( { quality : 8 } ) ;
107- assert . deepEqual ( await session . stopRecording ( ) , { downloadUrl : 'https://ios.example/recording' } ) ;
106+ await session . startRecording ( { recordingId : 'recording-id' , quality : 8 } ) ;
107+ assert . deepEqual ( await session . stopRecording ( 'recording-id' ) , {
108+ downloadUrl : 'https://ios.example/recording' ,
109+ } ) ;
108110 await session . downloadRecording ( {
109111 downloadUrl : 'https://ios.example/recording' ,
110112 outPath : '/tmp/ios-recording.mp4' ,
@@ -117,8 +119,10 @@ test('iOS device session exposes reusable capabilities without its raw client',
117119
118120 assert . deepEqual ( pressKey . mock . calls [ 0 ] , [ 'enter' , [ 'command' ] ] ) ;
119121 assert . deepEqual ( readLogs . mock . calls [ 0 ] , [ 'com.example.ios' , 200 ] ) ;
120- assert . deepEqual ( startRecording . mock . calls [ 0 ] , [ { quality : 8 } ] ) ;
121- assert . deepEqual ( stopRecording . mock . calls [ 0 ] , [ { } ] ) ;
122+ assert . deepEqual ( startRecordingSession . mock . calls [ 0 ] , [
123+ { recordingId : 'recording-id' , quality : 8 } ,
124+ ] ) ;
125+ assert . deepEqual ( stopRecordingSession . mock . calls [ 0 ] , [ 'recording-id' ] ) ;
122126 assert . deepEqual ( downloadFile . mock . calls . at ( - 1 ) , [
123127 {
124128 url : 'https://ios.example/recording' ,
@@ -175,11 +179,11 @@ test('Android device session exposes semantic ADB capabilities without its raw c
175179 } ,
176180 } ;
177181 const pressKey = vi . fn ( async ( ) => undefined ) ;
178- const startRecording = vi . fn ( async ( ) => undefined ) ;
179- const stopRecording = vi . fn ( async ( ) => 'https://android.example/recording' ) ;
182+ const startRecordingSession = vi . fn ( async ( ) => 'recording-id' ) ;
183+ const stopRecordingSession = vi . fn ( async ( ) => 'https://android.example/recording' ) ;
180184 const sendAsset = vi . fn ( async ( ) => undefined ) ;
181185 const session = createLimrunDeviceSession (
182- androidSession ( provider , { pressKey, startRecording , stopRecording , sendAsset } ) ,
186+ androidSession ( provider , { pressKey, startRecordingSession , stopRecordingSession , sendAsset } ) ,
183187 ) ;
184188
185189 assert . equal ( session . platform , 'android' ) ;
@@ -195,8 +199,8 @@ test('Android device session exposes semantic ADB capabilities without its raw c
195199 assert . equal ( await session . readLogs ( 20 ) , 'log line\n' ) ;
196200 assert . equal ( await session . installRemoteApp ( 'https://assets.example/android.apk' ) , undefined ) ;
197201 await session . pressKey ( 'KEYCODE_ENTER' , [ 'shift' ] ) ;
198- await session . startRecording ( { quality : 7 } ) ;
199- assert . deepEqual ( await session . stopRecording ( ) , {
202+ await session . startRecording ( { recordingId : 'recording-id' , quality : 7 } ) ;
203+ assert . deepEqual ( await session . stopRecording ( 'recording-id' ) , {
200204 downloadUrl : 'https://android.example/recording' ,
201205 } ) ;
202206 await session . downloadRecording ( {
@@ -207,8 +211,10 @@ test('Android device session exposes semantic ADB capabilities without its raw c
207211
208212 assert . deepEqual ( sendAsset . mock . calls [ 0 ] , [ 'https://assets.example/android.apk' ] ) ;
209213 assert . deepEqual ( pressKey . mock . calls [ 0 ] , [ 'KEYCODE_ENTER' , [ 'shift' ] ] ) ;
210- assert . deepEqual ( startRecording . mock . calls [ 0 ] , [ { quality : 7 } ] ) ;
211- assert . deepEqual ( stopRecording . mock . calls [ 0 ] , [ { } ] ) ;
214+ assert . deepEqual ( startRecordingSession . mock . calls [ 0 ] , [
215+ { recordingId : 'recording-id' , quality : 7 } ,
216+ ] ) ;
217+ assert . deepEqual ( stopRecordingSession . mock . calls [ 0 ] , [ 'recording-id' ] ) ;
212218 assert . deepEqual ( downloadFile . mock . calls . at ( - 1 ) , [
213219 {
214220 url : 'https://android.example/recording' ,
0 commit comments