agent-device 0.21.12 → 0.21.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.12.apk → agent-device-android-ime-helper-0.21.13.apk} +0 -0
  2. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.13.apk.sha256 +1 -0
  3. package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.12.manifest.json → agent-device-android-ime-helper-0.21.13.manifest.json} +4 -4
  4. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.12.apk → agent-device-android-snapshot-helper-0.21.13.apk} +0 -0
  5. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.13.apk.sha256 +1 -0
  6. package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.12.manifest.json → agent-device-android-snapshot-helper-0.21.13.manifest.json} +6 -6
  7. package/apple/macos-helper/Package.swift +4 -0
  8. package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +3 -6
  9. package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/ScreenshotResponseTests.swift +15 -0
  10. package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +47 -1
  11. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +99 -42
  12. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist +23 -0
  13. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +17 -0
  14. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAppScreenCapture.swift +21 -13
  15. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerScrollViewportPolicy.swift +1 -162
  16. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +0 -9
  17. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +0 -56
  18. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSystemSurfaceHostPolicy.swift +0 -48
  19. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +0 -50
  20. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +22 -568
  21. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +21 -9
  22. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+BlockingSystemModalResolution.swift +0 -36
  23. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +630 -0
  24. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +18 -2236
  25. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -338
  26. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +0 -12
  27. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+GestureExecution.swift +165 -0
  28. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +0 -24
  29. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +0 -142
  30. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +90 -39
  31. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+MainThreadWork.swift +78 -106
  32. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +23 -2
  33. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +147 -95
  34. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +0 -209
  35. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +86 -10
  36. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollDragExecution.swift +287 -0
  37. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +1 -200
  38. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +0 -185
  39. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +75 -285
  40. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +23 -10
  41. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +0 -78
  42. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +83 -578
  43. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +106 -0
  44. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +142 -0
  45. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +49 -78
  46. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +0 -44
  47. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +27 -97
  48. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +1 -11
  49. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +11 -87
  50. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +2 -10
  51. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +1 -1
  52. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +0 -35
  53. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +0 -31
  54. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +2 -18
  55. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +34 -52
  56. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +0 -22
  57. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +142 -0
  58. package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +22 -6
  59. package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +140 -20
  60. package/dist/src/absence-observation-errors.js +1 -1
  61. package/dist/src/adapter.js +1 -1
  62. package/dist/src/agent-device-client.js +1 -1
  63. package/dist/src/alert-runtime.js +1 -1
  64. package/dist/src/android-adb.d.ts +1 -1
  65. package/dist/src/app-launch.js +2 -2
  66. package/dist/src/app-log-runtime2.js +3 -3
  67. package/dist/src/app-resolution.js +2 -2
  68. package/dist/src/back-mode.js +1 -1
  69. package/dist/src/capture-disclosure.js +1 -1
  70. package/dist/src/capture.js +1 -1
  71. package/dist/src/cli-config.js +1 -1
  72. package/dist/src/cli-help.js +6 -5
  73. package/dist/src/cli-runner.js +1 -1
  74. package/dist/src/cli.js +1 -1
  75. package/dist/src/client-types.d.ts +4 -5
  76. package/dist/src/code-signature.js +1 -1
  77. package/dist/src/command-schema.js +3 -3
  78. package/dist/src/command-tools.js +3 -3
  79. package/dist/src/connection.js +1 -1
  80. package/dist/src/daemon-client-lifecycle.js +1 -1
  81. package/dist/src/daemon-resolution.js +1 -1
  82. package/dist/src/device-claim-rule.js +2 -2
  83. package/dist/src/device-input-state.d.ts +1 -1
  84. package/dist/src/device-session.js +1 -1
  85. package/dist/src/devicectl.js +1 -1
  86. package/dist/src/display-inventory.js +1 -1
  87. package/dist/src/doctor-facade.js +1 -1
  88. package/dist/src/find.js +1 -1
  89. package/dist/src/gesture-plan-types.d.ts +38 -0
  90. package/dist/src/harmonyos.js +1 -1
  91. package/dist/src/helper.js +1 -1
  92. package/dist/src/host.js +1 -1
  93. package/dist/src/install-source-network-transport.js +1 -1
  94. package/dist/src/install-source2.js +1 -1
  95. package/dist/src/interaction-ref-policy.js +1 -1
  96. package/dist/src/interaction2.js +1 -1
  97. package/dist/src/interactor-operation-catalog.js +1 -1
  98. package/dist/src/interactor.js +4 -4
  99. package/dist/src/interactor2.js +1 -1
  100. package/dist/src/internal/bin.js +1 -1
  101. package/dist/src/internal/daemon.js +2 -2
  102. package/dist/src/inventory2.js +1 -1
  103. package/dist/src/ios-snapshot-acquisition.js +1 -1
  104. package/dist/src/ios-snapshot-runtime.js +1 -1
  105. package/dist/src/limrun-runtime-dependencies.js +1 -1
  106. package/dist/src/limrun.d.ts +435 -4
  107. package/dist/src/linux.js +1 -1
  108. package/dist/src/local-interactor-operation-set.js +1 -1
  109. package/dist/src/managed-device-scope.js +1 -1
  110. package/dist/src/mechanics.js +4 -4
  111. package/dist/src/mobile-snapshot-semantics.js +1 -1
  112. package/dist/src/perf-facade.js +1 -2
  113. package/dist/src/perf-runtime-plan.js +1 -1
  114. package/dist/src/perf-target.js +2 -0
  115. package/dist/src/physical-device-apps.js +1 -0
  116. package/dist/src/physical-device-control.js +1 -1
  117. package/dist/src/platform-request-scope.js +1 -1
  118. package/dist/src/platform-runtime-operation-host.js +1 -1
  119. package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
  120. package/dist/src/platform-runtime-unavailable.js +1 -1
  121. package/dist/src/platform-runtime.js +1 -1
  122. package/dist/src/platform-runtime2.js +1 -1
  123. package/dist/src/provider-webdriver.js +1 -1
  124. package/dist/src/proxy.js +1 -1
  125. package/dist/src/quality-warnings.js +1 -1
  126. package/dist/src/react-native.js +1 -1
  127. package/dist/src/record-runtime.js +1 -1
  128. package/dist/src/registry.js +35 -35
  129. package/dist/src/request-admission.js +1 -1
  130. package/dist/src/request-runtime-binding.js +1 -1
  131. package/dist/src/runner-client.js +1 -1
  132. package/dist/src/runner-dev-tools-security.js +1 -1
  133. package/dist/src/runner-device-readiness.js +1 -1
  134. package/dist/src/runner-disposal.js +1 -1
  135. package/dist/src/runner-error-classification.js +3 -0
  136. package/dist/src/runner-operations-facade.js +1 -1
  137. package/dist/src/runner-presentation.js +1 -1
  138. package/dist/src/runner.js +1 -1
  139. package/dist/src/runtime.js +3 -3
  140. package/dist/src/runtime10.js +1 -1
  141. package/dist/src/runtime2.js +2 -2
  142. package/dist/src/runtime4.js +5 -5
  143. package/dist/src/runtime5.js +1 -1
  144. package/dist/src/runtime6.js +1 -1
  145. package/dist/src/runtime7.js +1 -1
  146. package/dist/src/runtime8.js +1 -1
  147. package/dist/src/runtime9.js +1 -1
  148. package/dist/src/screen-recording-admission-ledger.js +1 -1
  149. package/dist/src/screen-recording-resource-recovery.js +1 -1
  150. package/dist/src/screen-recording-transport.js +1 -1
  151. package/dist/src/screenshot-runtime.js +1 -1
  152. package/dist/src/screenshot3.js +1 -1
  153. package/dist/src/script.js +1 -1
  154. package/dist/src/scroll-command.d.ts +377 -0
  155. package/dist/src/scroll-command.js +1 -1
  156. package/dist/src/sdk-batch.js +2 -2
  157. package/dist/src/sdk-contracts.d.ts +9 -0
  158. package/dist/src/sdk-device.js +1 -1
  159. package/dist/src/sdk-selectors.d.ts +23 -726
  160. package/dist/src/selection.js +0 -0
  161. package/dist/src/selector-runtime.js +1 -1
  162. package/dist/src/semantic-index.js +1 -1
  163. package/dist/src/server.js +1 -1
  164. package/dist/src/session-observation.js +1 -1
  165. package/dist/src/session-snapshot.js +1 -1
  166. package/dist/src/session2.js +2 -2
  167. package/dist/src/simctl-facade.js +1 -1
  168. package/dist/src/simctl.js +1 -1
  169. package/dist/src/simulator-state.js +1 -1
  170. package/dist/src/simulator.js +1 -1
  171. package/dist/src/snapshot-runtime-binding.js +1 -1
  172. package/dist/src/snapshot-runtime.js +1 -1
  173. package/dist/src/snapshot-state.js +1 -1
  174. package/dist/src/snapshot4.js +1 -1
  175. package/dist/src/src7.js +1 -1
  176. package/dist/src/text-entry-focus.js +1 -1
  177. package/dist/src/tool-provider.js +1 -1
  178. package/dist/src/touch-runtime.js +1 -1
  179. package/dist/src/tree.js +1 -1
  180. package/dist/src/update-check.js +1 -1
  181. package/dist/src/version.js +1 -1
  182. package/dist/src/web2.js +1 -1
  183. package/package.json +3 -2
  184. package/server.json +2 -2
  185. package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.12.apk.sha256 +0 -1
  186. package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.12.apk.sha256 +0 -1
  187. package/dist/src/app-inventory.d.ts +0 -4
  188. package/dist/src/apps-simctl.js +0 -1
  189. package/dist/src/cloud-artifacts.d.ts +0 -61
  190. package/dist/src/runner-contract.js +0 -3
@@ -55,14 +55,10 @@ extension RunnerTests {
55
55
  static func privateAXCustomActionCoverage(_ raw: Any?) -> SnapshotCustomActionCoverage? {
56
56
  guard let coverage = raw as? [String: Any],
57
57
  let read = (coverage[RunnerAXSnapshotCustomActionsReadKey] as? NSNumber)?.intValue,
58
- let candidates = (coverage[RunnerAXSnapshotCustomActionsCandidatesKey] as? NSNumber)?.intValue
58
+ let candidates = (coverage[RunnerAXSnapshotCustomActionsCandidatesKey] as? NSNumber)?.intValue,
59
+ let truncated = (coverage[RunnerAXSnapshotCustomActionsTruncatedKey] as? NSNumber)?.intValue,
60
+ let blocked = (coverage[RunnerAXSnapshotCustomActionsBlockedKey] as? NSNumber)?.boolValue
59
61
  else { return nil }
60
-
61
-
62
-
63
- let truncated =
64
- (coverage[RunnerAXSnapshotCustomActionsTruncatedKey] as? NSNumber)?.intValue ?? 0
65
- let blocked = (coverage[RunnerAXSnapshotCustomActionsBlockedKey] as? NSNumber)?.boolValue ?? false
66
62
  return SnapshotCustomActionCoverage(
67
63
  read: read, candidates: candidates, truncated: truncated, blocked: blocked)
68
64
  }
@@ -114,14 +110,16 @@ extension RunnerTests {
114
110
 
115
111
 
116
112
  func recordPrivateAXAcceptedDepth(
113
+ bundleId: String?,
114
+ processIdentifier: Int?,
117
115
  exactDepthRequested: Bool,
118
116
  effectiveDepth: Int,
119
117
  attemptDepths: [Int]
120
118
  ) {
121
119
  guard !exactDepthRequested, effectiveDepth != attemptDepths.first else { return }
122
120
  rememberPrivateAXAcceptedDepth(
123
- bundleId: currentBundleId,
124
- processIdentifier: currentAppProcessIdentifier,
121
+ bundleId: bundleId,
122
+ processIdentifier: processIdentifier,
125
123
  depth: effectiveDepth
126
124
  )
127
125
  }
@@ -164,11 +162,12 @@ extension RunnerTests {
164
162
  }
165
163
 
166
164
  func privateAXSnapshotAcquisition(
167
- app: XCUIApplication,
165
+ target: SnapshotCaptureTarget,
168
166
  hint: CaptureHint,
169
167
  deadline: Date = .distantFuture
170
168
  ) -> SnapshotAcquisition? {
171
169
  #if os(iOS) && targetEnvironment(simulator)
170
+ let app = target.app
172
171
  let requestedDepth = hint.rawTraversalDepth ?? 64
173
172
 
174
173
 
@@ -177,8 +176,8 @@ extension RunnerTests {
177
176
  exactDepthRequested
178
177
  ? nil
179
178
  : rememberedPrivateAXAcceptedDepth(
180
- bundleId: currentBundleId,
181
- processIdentifier: currentAppProcessIdentifier
179
+ bundleId: target.bundleId,
180
+ processIdentifier: target.processIdentifier
182
181
  )
183
182
  let attemptDepths = Self.privateAXAttemptDepths(
184
183
  requestedDepth: requestedDepth,
@@ -206,6 +205,8 @@ extension RunnerTests {
206
205
  return nil
207
206
  }
208
207
  recordPrivateAXAcceptedDepth(
208
+ bundleId: target.bundleId,
209
+ processIdentifier: target.processIdentifier,
209
210
  exactDepthRequested: exactDepthRequested,
210
211
  effectiveDepth: effectiveDepth,
211
212
  attemptDepths: attemptDepths
@@ -216,7 +217,11 @@ extension RunnerTests {
216
217
  }
217
218
 
218
219
  let rootFrame = privateAXRect(root["frame"])
219
- let geometry = privateAXSnapshotGeometry(app: app, rootFrame: rootFrame)
220
+ let geometry = privateAXSnapshotGeometry(
221
+ app: app,
222
+ bundleId: target.bundleId,
223
+ rootFrame: rootFrame
224
+ )
220
225
  let viewport = geometry.viewport
221
226
  let nodes = privateAXAcquisition(
222
227
  rawRoot: root,
@@ -266,8 +271,8 @@ extension RunnerTests {
266
271
 
267
272
 
268
273
 
269
- func shouldReadPrivateAXViewportViaXCTest() -> Bool {
270
- !hasAbandonedMainThreadWork() && !isSnapshotXCTestChannelPenalized(bundleId: currentBundleId)
274
+ func shouldReadPrivateAXViewportViaXCTest(bundleId: String?) -> Bool {
275
+ !hasAbandonedMainThreadWork() && !isSnapshotXCTestChannelPenalized(bundleId: bundleId)
271
276
  }
272
277
 
273
278
 
@@ -276,10 +281,11 @@ extension RunnerTests {
276
281
 
277
282
  private func privateAXSnapshotGeometry(
278
283
  app: XCUIApplication,
284
+ bundleId: String?,
279
285
  rootFrame: CGRect
280
286
  ) -> (viewport: CGRect, interfaceOrientation: Int) {
281
287
  let fallback = rootFrame.isEmpty ? CGRect.infinite : rootFrame
282
- guard shouldReadPrivateAXViewportViaXCTest() else {
288
+ guard shouldReadPrivateAXViewportViaXCTest(bundleId: bundleId) else {
283
289
  return (fallback, RunnerInterfaceOrientation.unknown)
284
290
  }
285
291
  do {
@@ -321,555 +327,3 @@ extension RunnerTests {
321
327
  return nil
322
328
  }
323
329
  }
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
-
369
-
370
-
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
-
388
-
389
-
390
-
391
-
392
-
393
-
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
-
407
-
408
-
409
-
410
-
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
-
419
-
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
-
449
-
450
-
451
-
452
-
453
-
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
-
462
-
463
-
464
-
465
-
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
-
484
-
485
-
486
-
487
-
488
-
489
-
490
-
491
-
492
-
493
-
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
-
516
-
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
-
526
-
527
-
528
-
529
-
530
-
531
-
532
-
533
-
534
-
535
-
536
-
537
-
538
-
539
-
540
-
541
-
542
-
543
-
544
-
545
-
546
-
547
-
548
-
549
-
550
-
551
-
552
-
553
-
554
-
555
-
556
-
557
-
558
-
559
-
560
-
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
-
571
-
572
-
573
-
574
-
575
-
576
-
577
-
578
-
579
-
580
-
581
-
582
-
583
-
584
-
585
-
586
-
587
-
588
-
589
-
590
-
591
-
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
-
624
-
625
-
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
-
639
-
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
-
656
-
657
-
658
-
659
-
660
-
661
-
662
-
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
-
678
-
679
-
680
-
681
-
682
-
683
-
684
-
685
-
686
-
687
-
688
-
689
-
690
-
691
-
692
-
693
-
694
-
695
-
696
-
697
-
698
-
699
-
700
-
701
-
702
-
703
-
704
-
705
-
706
-
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
-
715
-
716
-
717
-
718
-
719
-
720
-
721
-
722
-
723
-
724
-
725
-
726
-
727
-
728
-
729
-
730
-
731
-
732
-
733
-
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
-
746
-
747
-
748
-
749
-
750
-
751
-
752
-
753
-
754
-
755
-
756
-
757
-
758
-
759
-
760
-
761
-
762
-
763
-
764
-
765
-
766
-
767
-
768
-
769
-
770
-
771
-
772
-
773
-
774
-
775
-
776
-
777
-
778
-
779
-
780
-
781
-
782
-
783
-
784
-
785
-
786
-
787
-
788
-
789
-
790
-
791
-
792
-
793
-
794
-
795
-
796
-
797
-
798
-
799
-
800
-
801
-
802
-
803
-
804
-
805
-
806
-
807
-
808
-
809
-
810
-
811
-
812
-
813
-
814
-
815
-
816
-
817
-
818
-
819
-
820
-
821
-
822
-
823
-
824
-
825
-
826
-
827
-
828
-
829
-
830
-
831
-
832
-
833
-
834
-
835
-
836
-
837
-
838
-
839
-
840
-
841
-
842
-
843
-
844
-
845
-
846
-
847
-
848
-
849
-
850
-
851
-
852
-
853
-
854
-
855
-
856
-
857
-
858
-
859
-
860
-
861
-
862
-
863
-
864
-
865
-
866
-
867
-
868
-
869
-
870
-
871
-
872
-
873
-
874
-
875
-
@@ -83,8 +83,10 @@ extension RunnerTests {
83
83
 
84
84
 
85
85
  var outcome = RunnerInteractionOutcome.performed
86
- withBoundedInteractionIdleTimeoutIfSupported(alert.ownerApp, waits: .preEventSkipped) {
87
- outcome = activateElement(app: alert.ownerApp, element: button, action: "alert \(action)")
86
+ withUIInterruptionHandlingDisabledIfSupported(alert.ownerApp) {
87
+ withBoundedInteractionIdleTimeoutIfSupported(alert.ownerApp, waits: .preEventSkipped) {
88
+ outcome = activateElement(app: alert.ownerApp, element: button, action: "alert \(action)")
89
+ }
88
90
  }
89
91
  if let response = unsupportedResponse(for: outcome) {
90
92
  return response
@@ -114,6 +116,22 @@ extension RunnerTests {
114
116
  )
115
117
  }
116
118
 
119
+
120
+
121
+
122
+
123
+ private func withUIInterruptionHandlingDisabledIfSupported(_ target: XCUIApplication, operation: () -> Void) {
124
+ let key = "doesNotHandleUIInterruptions"
125
+ guard target.responds(to: NSSelectorFromString("setDoesNotHandleUIInterruptions:")) else {
126
+ operation()
127
+ return
128
+ }
129
+ let previous = target.value(forKey: key) as? NSNumber
130
+ target.setValue(true, forKey: key)
131
+ defer { target.setValue(previous?.boolValue ?? false, forKey: key) }
132
+ operation()
133
+ }
134
+
117
135
  private func runnerAlert(_ modal: ResolvedBlockingSystemModal) -> RunnerAlert? {
118
136
  let buttons = modal.actions.filter { isEnabledElement($0) }
119
137
  guard !buttons.isEmpty else {
@@ -170,7 +188,7 @@ extension RunnerTests {
170
188
  return buttons.first(where: { isDismissButton($0.label) }) ?? buttons.last
171
189
  }
172
190
 
173
- private func isAcceptButton(_ label: String) -> Bool {
191
+ func isAcceptButton(_ label: String) -> Bool {
174
192
  let normalized = label.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
175
193
  return [
176
194
  "ok",
@@ -183,12 +201,6 @@ extension RunnerTests {
183
201
  ].contains(normalized) || normalized.hasPrefix("confirm")
184
202
  }
185
203
 
186
-
187
-
188
-
189
-
190
-
191
-
192
204
  private func isDismissButton(_ label: String) -> Bool {
193
205
  [
194
206
  "cancel",