@@ -16,6 +16,7 @@ import {
1616 unsupportedHintForDevice ,
1717} from '../../src/core/capabilities.ts' ;
1818import { parseReplayScriptDetailed } from '@agent-device/ad-script' ;
19+ import { isValidSelectorExpression } from '@agent-device/selectors' ;
1920import { IOS_SIMULATOR_BEHAVIOR_COVERAGE } from './ios-simulator-e2e/behavior-coverage.ts' ;
2021import {
2122 IOS_SIMULATOR_E2E_COVERAGE ,
@@ -207,6 +208,31 @@ test('fixture replay gestures fit the smallest supported iPhone viewport', () =>
207208 for ( const replayPath of replayPaths ) assertReplayFitsViewports ( replayPath , compactViewports ) ;
208209} ) ;
209210
211+ test ( 'drag replay fixtures use parseable source and destination selectors' , ( ) => {
212+ const replayPaths = [
213+ 'examples/test-app/replays/drag.ad' ,
214+ 'examples/test-app/replays/drag-android.ad' ,
215+ ] ;
216+
217+ for ( const replayPath of replayPaths ) {
218+ const drag = parseReplayScriptDetailed ( fs . readFileSync ( replayPath , 'utf8' ) ) . actions . find (
219+ ( action ) => action . command === 'gesture' && action . positionals ?. [ 0 ] === 'drag' ,
220+ ) ;
221+ assert . ok ( drag , `${ replayPath } must contain a drag gesture` ) ;
222+
223+ const source = drag . positionals ?. [ 1 ] ;
224+ const destination = drag . positionals ?. [ 2 ] ;
225+ assert . ok (
226+ source && isValidSelectorExpression ( source ) ,
227+ `${ replayPath } source must be a selector` ,
228+ ) ;
229+ assert . ok (
230+ destination && isValidSelectorExpression ( destination ) ,
231+ `${ replayPath } destination must be a selector` ,
232+ ) ;
233+ }
234+ } ) ;
235+
210236test ( 'fixture navigation uses edge-aware traversal without losing direct swipe evidence' , ( ) => {
211237 const actions = parseReplayScriptDetailed (
212238 fs . readFileSync ( 'test/integration/replays/ios/fixture/01-navigation-scroll.ad' , 'utf8' ) ,
0 commit comments