@@ -153,19 +153,22 @@ extension RunnerTests {
153153 let retryOnSessionLoss : Bool
154154 let launchPolicy : CommandLaunchPolicy
155155 let convertsRecordedFailure : Bool
156+ let retainsJournalResponseJson : Bool
156157 }
157158
158159 private func expectation (
159160 interaction : Bool ,
160161 retry : Bool ,
161162 launch : CommandLaunchPolicy ,
162- converts : Bool
163+ converts : Bool ,
164+ retains : Bool
163165 ) -> ExpectedTraits {
164166 ExpectedTraits (
165167 isInteraction : interaction ,
166168 retryOnSessionLoss : retry ,
167169 launchPolicy : launch ,
168- convertsRecordedFailure : converts
170+ convertsRecordedFailure : converts ,
171+ retainsJournalResponseJson : retains
169172 )
170173 }
171174
@@ -186,6 +189,11 @@ extension RunnerTests {
186189 expectation . convertsRecordedFailure ,
187190 " \( request ) convertsRecordedFailure "
188191 )
192+ XCTAssertEqual (
193+ traits . retainsJournalResponseJson ,
194+ expectation . retainsJournalResponseJson ,
195+ " \( request ) retainsJournalResponseJson "
196+ )
189197 }
190198
191199 /// The commands the merge-base classified read-only, copied from its `CommandType.traits`
@@ -244,54 +252,54 @@ extension RunnerTests {
244252 /// a concrete launch case, so re-pointing a command at another policy fails that row.
245253 func testEveryCommandDeclaresEveryRunnerSideDecisionTogether ( ) throws {
246254 let table : [ ( CommandType , ExpectedTraits ) ] = [
247- ( . tap , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
248- ( . mouseClick , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true ) ) ,
249- ( . longPress , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
250- ( . drag , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
251- ( . remotePress , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
252- ( . type , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
253- ( . swipe , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
254- ( . scroll , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
255- ( . desktopScroll , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
256- ( . findText , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false ) ) ,
255+ ( . tap , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
256+ ( . mouseClick , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
257+ ( . longPress , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
258+ ( . drag , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
259+ ( . remotePress , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
260+ ( . type , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
261+ ( . swipe , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
262+ ( . scroll , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
263+ ( . desktopScroll , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
264+ ( . findText , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false , retains : true ) ) ,
257265 (
258266 . querySelector ,
259- expectation ( interaction : false , retry : false , launch : . existingApp , converts : true )
267+ expectation ( interaction : false , retry : false , launch : . existingApp , converts : true , retains : true )
260268 ) ,
261- ( . readText , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false ) ) ,
262- ( . snapshot , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false ) ) ,
263- ( . screenshot , expectation ( interaction : false , retry : true , launch : . noApp , converts : false ) ) ,
264- ( . backInApp , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
265- ( . backSystem , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
266- ( . home , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true ) ) ,
267- ( . rotate , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
268- ( . appSwitcher , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
269+ ( . readText , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false , retains : true ) ) ,
270+ ( . snapshot , expectation ( interaction : false , retry : true , launch : . existingApp , converts : false , retains : false ) ) ,
271+ ( . screenshot , expectation ( interaction : false , retry : true , launch : . noApp , converts : false , retains : false ) ) ,
272+ ( . backInApp , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
273+ ( . backSystem , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
274+ ( . home , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
275+ ( . rotate , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
276+ ( . appSwitcher , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
269277 (
270278 . actionButton ,
271- expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true )
279+ expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true , retains : true )
272280 ) ,
273- ( . keyboardDismiss , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
274- ( . keyboardReturn , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
281+ ( . keyboardDismiss , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
282+ ( . keyboardReturn , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
275283 (
276284 . alert ,
277- expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false )
285+ expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false , retains : true )
278286 ) ,
279- ( . sequence , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
280- ( . gesture , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true ) ) ,
287+ ( . sequence , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
288+ ( . gesture , expectation ( interaction : true , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
281289 (
282290 . gestureViewport ,
283- expectation ( interaction : false , retry : true , launch : . existingApp , converts : false )
291+ expectation ( interaction : false , retry : true , launch : . existingApp , converts : false , retains : true )
284292 ) ,
285- ( . recordStart , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true ) ) ,
286- ( . recordStop , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) ) ,
287- ( . status , expectation ( interaction : false , retry : true , launch : . noApp , converts : false ) ) ,
288- ( . uptime , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) ) ,
289- ( . appState , expectation ( interaction : false , retry : true , launch : . noApp , converts : false ) ) ,
290- ( . pasteboardWrite , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) ) ,
291- ( . activate , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true ) ) ,
292- ( . terminate , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) ) ,
293- ( . targetReset , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) ) ,
294- ( . shutdown , expectation ( interaction : false , retry : false , launch : . noApp , converts : false ) )
293+ ( . recordStart , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
294+ ( . recordStop , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) ) ,
295+ ( . status , expectation ( interaction : false , retry : true , launch : . noApp , converts : false , retains : true ) ) ,
296+ ( . uptime , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) ) ,
297+ ( . appState , expectation ( interaction : false , retry : true , launch : . noApp , converts : false , retains : true ) ) ,
298+ ( . pasteboardWrite , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) ) ,
299+ ( . activate , expectation ( interaction : false , retry : false , launch : . mayLaunch , converts : true , retains : true ) ) ,
300+ ( . terminate , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) ) ,
301+ ( . targetReset , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) ) ,
302+ ( . shutdown , expectation ( interaction : false , retry : false , launch : . noApp , converts : false , retains : true ) )
295303 ]
296304 for ( type , rowExpectation ) in table {
297305 let request = #"{"command":" \#( type . rawValue ) "}"#
@@ -314,15 +322,15 @@ extension RunnerTests {
314322 // The one payload-dependent command settles each fact per action: `get` changes nothing and may
315323 // be replayed, while `accept` and `dismiss` mutate and must not be.
316324 let alertCases : [ ( action : String ? , expectation : ExpectedTraits ) ] = [
317- ( nil , expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false ) ) ,
318- ( " get " , expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false ) ) ,
325+ ( nil , expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false , retains : true ) ) ,
326+ ( " get " , expectation ( interaction : false , retry : true , launch : . presentedSurface , converts : false , retains : true ) ) ,
319327 (
320328 " accept " ,
321- expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true )
329+ expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true , retains : true )
322330 ) ,
323331 (
324332 " dismiss " ,
325- expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true )
333+ expectation ( interaction : false , retry : false , launch : . presentedSurface , converts : true , retains : true )
326334 )
327335 ]
328336 for alertCase in alertCases {
0 commit comments