@@ -62,6 +62,55 @@ test('cloud iOS snapshot captures through the provider session after open', asyn
6262 } ) ;
6363} , 15_000 ) ;
6464
65+ test ( 'cloud iOS engine-presented snapshot survives daemon publication' , async ( ) => {
66+ await withProviderScenarioResource ( createCloudIosWorld , async ( { daemon, server } ) => {
67+ const lease = await openCloudIosSession ( daemon ) ;
68+ server . sourceOverride =
69+ '<XCUIElementTypeApplication name="Demo" x="0" y="0" width="390" height="844">' +
70+ '<XCUIElementTypeNavigationBar name="Team Standup" x="0" y="56" width="390" height="44">' +
71+ '<XCUIElementTypeStaticText label="Team Standup" x="219" y="58" width="85" height="40" />' +
72+ '<XCUIElementTypeButton label="Video Call" x="300" y="56" width="46" height="44" />' +
73+ '<XCUIElementTypeTextField label="Team Standup" value="Team Standup" name="DisplayNameTextField" enabled="false" x="100" y="67" width="113" height="22" />' +
74+ '<XCUIElementTypeImage name="RoomDetailsIconImageView" x="81" y="80" width="14" height="14" />' +
75+ '</XCUIElementTypeNavigationBar>' +
76+ '<XCUIElementTypeTable label="Team Standup" x="0" y="100" width="390" height="600">' +
77+ '<XCUIElementTypeCell label="Team Standup" x="0" y="100" width="390" height="297">' +
78+ '<XCUIElementTypeButton label="Team Standup" x="20" y="200" width="362" height="27" />' +
79+ '</XCUIElementTypeCell>' +
80+ '</XCUIElementTypeTable>' +
81+ '</XCUIElementTypeApplication>' ;
82+
83+ const response = await daemon . callCommand (
84+ 'snapshot' ,
85+ [ ] ,
86+ { ...leaseFlags ( lease . leaseId ) , snapshotInteractiveOnly : true } ,
87+ { meta : leaseMeta ( lease . leaseId ) } ,
88+ ) ;
89+
90+ const data = assertRpcOk < {
91+ nodes ?: Array < { type ?: string ; label ?: string ; identifier ?: string ; enabled ?: boolean } > ;
92+ } > ( response ) ;
93+ assert . equal (
94+ data . nodes ?. some (
95+ ( node ) =>
96+ node . type === 'Button' &&
97+ node . label === 'Team Standup' &&
98+ node . identifier === 'DisplayNameTextField' &&
99+ node . enabled === true ,
100+ ) ,
101+ true ,
102+ ) ;
103+ assert . equal (
104+ data . nodes ?. some ( ( node ) => node . type === 'StaticText' && node . label === 'Team Standup' ) ,
105+ false ,
106+ ) ;
107+ assert . equal (
108+ data . nodes ?. some ( ( node ) => node . identifier === 'RoomDetailsIconImageView' ) ,
109+ false ,
110+ ) ;
111+ } ) ;
112+ } , 15_000 ) ;
113+
65114/**
66115 * #1658: `fill` tapped and sent its keys back-to-back. A WebView input takes
67116 * first responder asynchronously, so the keys arrived with nothing focused and
@@ -254,6 +303,7 @@ class FakeIosWebDriverServer extends CloudWebDriverTestServer {
254303 pollsUntilFocus = 1 ;
255304 fieldValues : Record < FieldName , string > = { email : '' , password : '' } ;
256305 focused : FieldName | undefined ;
306+ sourceOverride : string | undefined ;
257307
258308 private pollsRemaining = Number . POSITIVE_INFINITY ;
259309 private pendingFocus : FieldName | undefined ;
@@ -373,6 +423,7 @@ class FakeIosWebDriverServer extends CloudWebDriverTestServer {
373423 }
374424
375425 private source ( ) : string {
426+ if ( this . sourceOverride !== undefined ) return this . sourceOverride ;
376427 const field = ( name : FieldName , label : string ) =>
377428 `<XCUIElementTypeTextField name="${ name } " label="${ label } " value="${ this . fieldValues [ name ] } " ` +
378429 `x="${ FIELDS [ name ] . x } " y="${ FIELDS [ name ] . y } " width="${ FIELDS [ name ] . width } " ` +
0 commit comments