@@ -14,6 +14,7 @@ import { assertPngFile } from '../provider-scenarios/assertions.ts';
1414import {
1515 assertFilesDiffer ,
1616 assertJsonContains ,
17+ assertMp4File ,
1718 assertWaitSelector ,
1819 assertWaitText ,
1920 capturePng ,
@@ -475,6 +476,29 @@ async function assertCapture(context: LiveContext): Promise<void> {
475476 assertJsonContains ( screenshot , screenshotPath , 'screenshot response should return artifact path' ) ;
476477 assertPngFile ( screenshotPath ) ;
477478 verifyCommand ( context , C . screenshot , 'captured fixture file has a valid PNG signature' ) ;
479+
480+ await assertWaitSelector ( context , 'id="home-open-catalog" visible=true' ) ;
481+ const recordingPath = path . join ( context . artifactDir , 'fixture.mp4' ) ;
482+ const recording = await runStep ( context , 'start screen recording' , [
483+ 'record' ,
484+ 'start' ,
485+ recordingPath ,
486+ '--hide-touches' ,
487+ '--debug' ,
488+ ] ) ;
489+ assert . equal ( recording . json ?. data ?. recording , 'started' , JSON . stringify ( recording . json ) ) ;
490+ assert . equal ( recording . json ?. data ?. recordingBackend , 'simctl recordVideo' ) ;
491+ assert . equal ( recording . json ?. data ?. activeSessionApp ?. bundleId , context . appId ) ;
492+ await runStep ( context , 'record a visible mutation' , [ 'press' , 'id="home-open-catalog"' ] ) ;
493+ await assertWaitSelector ( context , 'id="catalog-title" visible=true' ) ;
494+ const stopped = await runStep ( context , 'stop screen recording' , [ 'record' , 'stop' ] ) ;
495+ assert . equal ( stopped . json ?. data ?. recording , 'stopped' , JSON . stringify ( stopped . json ) ) ;
496+ await assertMp4File ( recordingPath ) ;
497+ verifyCommand (
498+ context ,
499+ C . record ,
500+ 'active-session capture records a visible mutation into a playable MP4' ,
501+ ) ;
478502}
479503
480504async function assertClose ( context : LiveContext ) : Promise < void > {
0 commit comments