agent-device 0.21.11 → 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.
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.11.apk → agent-device-android-ime-helper-0.21.13.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.13.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.11.manifest.json → agent-device-android-ime-helper-0.21.13.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.11.apk → agent-device-android-snapshot-helper-0.21.13.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.13.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.11.manifest.json → agent-device-android-snapshot-helper-0.21.13.manifest.json} +6 -6
- package/apple/fold-helper/Fold.m +97 -0
- package/apple/macos-helper/Package.swift +3 -6
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +3 -8
- package/apple/macos-helper/Tests/AgentDeviceMacOSHelperTests/ScreenshotResponseTests.swift +15 -0
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +47 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +99 -42
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/Info.plist +23 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj/project.pbxproj +17 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAppScreenCapture.swift +21 -13
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerScrollViewportPolicy.swift +1 -162
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +0 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +0 -56
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSystemSurfaceHostPolicy.swift +0 -48
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +0 -50
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +22 -568
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +21 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+BlockingSystemModalResolution.swift +0 -36
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +630 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +18 -2236
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -338
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +0 -12
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+GestureExecution.swift +165 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +0 -24
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +0 -142
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +90 -39
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+MainThreadWork.swift +78 -106
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +23 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +147 -95
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +0 -209
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +86 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollDragExecution.swift +287 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +1 -200
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +0 -185
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +75 -285
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +23 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +0 -78
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +83 -578
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +106 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +142 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +49 -78
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +0 -44
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +27 -97
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +1 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +11 -87
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +2 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +0 -35
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +0 -31
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +2 -18
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +34 -52
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +0 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +142 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +22 -6
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +140 -20
- package/dist/src/absence-observation-errors.js +1 -1
- package/dist/src/adapter.js +1 -1
- package/dist/src/agent-device-client.js +1 -1
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/android-adb.d.ts +1 -1
- package/dist/src/app-launch.js +2 -2
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/back-mode.js +1 -1
- package/dist/src/capture-disclosure.js +1 -1
- package/dist/src/capture.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +10 -7
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +1 -1
- package/dist/src/client-types.d.ts +5 -8
- package/dist/src/code-signature.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/command-tools.js +3 -3
- package/dist/src/connection.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon-resolution.js +1 -1
- package/dist/src/device-claim-rule.js +2 -2
- package/dist/src/device-input-state.d.ts +1 -1
- package/dist/src/device-rotation.js +1 -1
- package/dist/src/device-session.js +1 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/display-inventory.js +1 -1
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/gesture-plan-types.d.ts +38 -0
- package/dist/src/harmonyos.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/host.js +1 -1
- package/dist/src/install-source-network-transport.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-ref-policy.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-catalog.js +1 -1
- package/dist/src/interactor.js +4 -4
- package/dist/src/interactor2.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +2 -2
- package/dist/src/inventory2.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +435 -4
- package/dist/src/linux.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/macos-facade.js +1 -1
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/mechanics.js +4 -4
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/perf-facade.js +1 -2
- package/dist/src/perf-runtime-plan.js +1 -1
- package/dist/src/perf-target.js +2 -0
- package/dist/src/physical-device-apps.js +1 -0
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-request-scope.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/proxy.js +1 -1
- package/dist/src/quality-warnings.js +1 -1
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/registry.js +35 -35
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-dev-tools-security.js +1 -1
- package/dist/src/runner-device-readiness.js +1 -1
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-error-classification.js +3 -0
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-presentation.js +1 -1
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime.js +3 -3
- package/dist/src/runtime10.js +1 -1
- package/dist/src/runtime2.js +2 -2
- package/dist/src/runtime4.js +5 -5
- package/dist/src/runtime5.js +1 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +1 -1
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +1 -1
- package/dist/src/screen-recording-admission-ledger.js +1 -1
- package/dist/src/screen-recording-resource-recovery.js +1 -1
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot3.js +1 -1
- package/dist/src/script.js +1 -1
- package/dist/src/scroll-command.d.ts +377 -0
- package/dist/src/scroll-command.js +1 -1
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +9 -0
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-selectors.d.ts +23 -715
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/semantic-index.js +1 -1
- package/dist/src/server.js +1 -1
- package/dist/src/session-observation.js +1 -1
- package/dist/src/session-snapshot.js +1 -1
- package/dist/src/session2.js +2 -2
- package/dist/src/simctl-facade.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-facade.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-state.js +1 -1
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/src7.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/tree.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/web2.js +1 -1
- package/package.json +4 -2
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.11.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.11.apk.sha256 +0 -1
- package/apple/macos-helper/Sources/AgentDeviceMacOSDeviceHub/DeviceHubPose.swift +0 -47
- package/apple/macos-helper/Sources/AgentDeviceMacOSDeviceHub/DeviceHubWindowInventory.swift +0 -65
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubPose.swift +0 -225
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubSidebar.swift +0 -57
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubWindowDiscovery.swift +0 -108
- package/apple/macos-helper/Tests/AgentDeviceMacOSDeviceHubTests/DeviceHubPoseTests.swift +0 -30
- package/apple/macos-helper/Tests/AgentDeviceMacOSDeviceHubTests/DeviceHubWindowInventoryTests.swift +0 -65
- package/dist/src/app-inventory.d.ts +0 -4
- package/dist/src/apps-simctl.js +0 -1
- package/dist/src/cloud-artifacts.d.ts +0 -61
- package/dist/src/runner-contract.js +0 -3
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift
CHANGED
|
@@ -5,12 +5,12 @@ extension RunnerTests {
|
|
|
5
5
|
static let axSnapshotErrorCode = "IOS_AX_SNAPSHOT_FAILED"
|
|
6
6
|
static let axSnapshotFailureMessage =
|
|
7
7
|
"iOS XCTest snapshot failed while serializing the accessibility tree."
|
|
8
|
-
|
|
8
|
+
static let axSnapshotUnavailableReason = "ax_snapshot_unavailable"
|
|
9
9
|
static let axSnapshotHint =
|
|
10
10
|
"Snapshot state is unavailable because XCTest could not serialize this iOS accessibility tree. This can be specific to the current screen. Use plain screenshot, not screenshot --overlay-refs, as visual truth; navigate with coordinate commands if needed; then retry snapshot -i after reaching another screen. If you own the app and need full-tree inspection, simplify this screen's accessibility tree and expose stable ids on actionable controls."
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
static let rawSnapshotTooLargeCode = "IOS_RAW_SNAPSHOT_TOO_LARGE"
|
|
12
|
+
static let rawSnapshotMaxNodes = 5_000
|
|
13
|
+
static let rawSnapshotTooLargeHint =
|
|
14
14
|
"Raw iOS snapshot exceeded the runner payload guard. Use regular snapshot for visible UI, or scope/depth-limit raw snapshot when inspecting a large accessibility tree."
|
|
15
15
|
|
|
16
16
|
|
|
@@ -134,6 +134,20 @@ extension RunnerTests {
|
|
|
134
134
|
static let flatInteractiveFallbackBudget: TimeInterval = 1.0
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
static let flatInteractiveQueryBudget: TimeInterval = 0.1
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
static func querySweepSliceDeadline(startedAt: Date, planDeadline: Date) -> Date {
|
|
142
|
+
min(startedAt.addingTimeInterval(flatInteractiveFallbackBudget), planDeadline)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
static func querySweepCanStartQuery(deadline: Date, now: Date) -> Bool {
|
|
147
|
+
deadline.timeIntervalSince(now) >= flatInteractiveQueryBudget
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
137
151
|
|
|
138
152
|
|
|
139
153
|
|
|
@@ -145,14 +159,17 @@ extension RunnerTests {
|
|
|
145
159
|
|
|
146
160
|
|
|
147
161
|
|
|
148
|
-
func snapshotFast(
|
|
162
|
+
func snapshotFast(target: SnapshotCaptureTarget, options: PresentationOptions) throws -> DataPayload {
|
|
149
163
|
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
|
|
150
|
-
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
164
|
+
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
165
|
+
deadline: deadline,
|
|
166
|
+
penaltyTarget: .prepared(bundleId: target.bundleId)
|
|
167
|
+
) {
|
|
151
168
|
return blocking
|
|
152
169
|
}
|
|
153
170
|
return try runSnapshotCapturePlan(
|
|
154
171
|
Self.regularVisiblePlan,
|
|
155
|
-
|
|
172
|
+
target: target,
|
|
156
173
|
options: options,
|
|
157
174
|
terminal: .sparseWithFatalOnAXFailure,
|
|
158
175
|
deadline: deadline
|
|
@@ -267,14 +284,17 @@ extension RunnerTests {
|
|
|
267
284
|
}
|
|
268
285
|
|
|
269
286
|
|
|
270
|
-
func snapshotRaw(
|
|
287
|
+
func snapshotRaw(target: SnapshotCaptureTarget, options: PresentationOptions) throws -> DataPayload {
|
|
271
288
|
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
|
|
272
|
-
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
289
|
+
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
290
|
+
deadline: deadline,
|
|
291
|
+
penaltyTarget: .prepared(bundleId: target.bundleId)
|
|
292
|
+
) {
|
|
273
293
|
return blocking
|
|
274
294
|
}
|
|
275
295
|
return try runSnapshotCapturePlan(
|
|
276
296
|
Self.rawDiagnosticPlan,
|
|
277
|
-
|
|
297
|
+
target: target,
|
|
278
298
|
options: options,
|
|
279
299
|
terminal: .throwOnAXFailure,
|
|
280
300
|
deadline: deadline
|
|
@@ -283,8 +303,15 @@ extension RunnerTests {
|
|
|
283
303
|
|
|
284
304
|
|
|
285
305
|
|
|
286
|
-
|
|
287
|
-
|
|
306
|
+
|
|
307
|
+
func boundedBlockingSystemAlertSnapshot(
|
|
308
|
+
deadline: Date,
|
|
309
|
+
penaltyTarget: SnapshotProbePenaltyTarget
|
|
310
|
+
) -> DataPayload? {
|
|
311
|
+
boundedBlockingSystemAlertSnapshotBody(
|
|
312
|
+
deadline: deadline,
|
|
313
|
+
penaltyTarget: penaltyTarget
|
|
314
|
+
) { probeDeadline in
|
|
288
315
|
|
|
289
316
|
|
|
290
317
|
|
|
@@ -301,6 +328,7 @@ extension RunnerTests {
|
|
|
301
328
|
|
|
302
329
|
private func boundedBlockingSystemAlertSnapshotBody(
|
|
303
330
|
deadline: Date,
|
|
331
|
+
penaltyTarget: SnapshotProbePenaltyTarget,
|
|
304
332
|
probe: @escaping (Date) -> DataPayload?
|
|
305
333
|
) -> DataPayload? {
|
|
306
334
|
#if os(macOS)
|
|
@@ -316,6 +344,7 @@ extension RunnerTests {
|
|
|
316
344
|
}
|
|
317
345
|
let probeDeadline = Date().addingTimeInterval(slice)
|
|
318
346
|
let startedAt = Date()
|
|
347
|
+
let penaltyIdentity = SnapshotProbePenaltyIdentity(penaltyTarget)
|
|
319
348
|
do {
|
|
320
349
|
return try runMainThreadWork(
|
|
321
350
|
"system_modal_probe",
|
|
@@ -329,12 +358,13 @@ extension RunnerTests {
|
|
|
329
358
|
},
|
|
330
359
|
onAbandoned: {
|
|
331
360
|
self.penalizeSnapshotXCTestChannel(
|
|
332
|
-
bundleId:
|
|
361
|
+
bundleId: penaltyIdentity.penalizedBundleId,
|
|
333
362
|
reason: "system_modal_probe_timeout"
|
|
334
363
|
)
|
|
335
364
|
}
|
|
336
365
|
) {
|
|
337
|
-
|
|
366
|
+
penaltyIdentity.captureFromMain(bundleId: self.currentBundleId)
|
|
367
|
+
return probe(probeDeadline)
|
|
338
368
|
}
|
|
339
369
|
} catch {
|
|
340
370
|
NSLog(
|
|
@@ -413,37 +443,34 @@ extension RunnerTests {
|
|
|
413
443
|
func querySweepSnapshotAcquisition(
|
|
414
444
|
app: XCUIApplication,
|
|
415
445
|
hint: CaptureHint,
|
|
416
|
-
|
|
417
|
-
) -> SnapshotAcquisition {
|
|
446
|
+
sliceDeadline deadline: Date
|
|
447
|
+
) -> (acquisition: SnapshotAcquisition, outcome: SnapshotTierOutcome) {
|
|
418
448
|
var nodes: [RawAXNode] = [
|
|
419
449
|
interactiveRootNode(rect: .zero)
|
|
420
450
|
]
|
|
421
451
|
if hint.rawTraversalDepth == 0 || hint.regularPresentedDepth == 0 {
|
|
422
|
-
return
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
452
|
+
return (
|
|
453
|
+
SnapshotAcquisition(
|
|
454
|
+
hint: hint,
|
|
455
|
+
nodes: nodes,
|
|
456
|
+
truncated: false,
|
|
457
|
+
effectiveDepth: nil,
|
|
458
|
+
viewport: .infinite,
|
|
459
|
+
interfaceOrientation: RunnerInterfaceOrientation.unknown
|
|
460
|
+
),
|
|
461
|
+
.completed
|
|
429
462
|
)
|
|
430
463
|
}
|
|
431
464
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
let sweepDeadline = hint.interactiveOnly
|
|
435
|
-
? Date().addingTimeInterval(Self.flatInteractiveFallbackBudget)
|
|
436
|
-
: Date.distantFuture
|
|
437
|
-
let deadline = min(sweepDeadline, planDeadline)
|
|
438
465
|
let viewport = safeSnapshotViewport(app: app)
|
|
439
466
|
var seen = Set<String>()
|
|
440
467
|
var candidates: [RawAXNode] = []
|
|
441
468
|
let flatElements = flatInteractiveElements(app: app, deadline: deadline)
|
|
442
|
-
var
|
|
469
|
+
var outcome = flatElements.outcome
|
|
443
470
|
for element in flatElements.elements {
|
|
444
|
-
if Date()
|
|
471
|
+
if !Self.querySweepCanStartQuery(deadline: deadline, now: Date()) {
|
|
445
472
|
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_FLAT_FALLBACK_DEADLINE")
|
|
446
|
-
|
|
473
|
+
outcome = .deadlineExhausted
|
|
447
474
|
break
|
|
448
475
|
}
|
|
449
476
|
guard let node = flatSnapshotNode(element: element, index: 0, parentIndex: 0) else {
|
|
@@ -491,20 +518,25 @@ extension RunnerTests {
|
|
|
491
518
|
)
|
|
492
519
|
)
|
|
493
520
|
}
|
|
494
|
-
return
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
521
|
+
return (
|
|
522
|
+
SnapshotAcquisition(
|
|
523
|
+
hint: hint,
|
|
524
|
+
nodes: nodes,
|
|
525
|
+
truncated: outcome == .deadlineExhausted,
|
|
526
|
+
effectiveDepth: nil,
|
|
527
|
+
viewport: viewport,
|
|
528
|
+
interfaceOrientation: RunnerInterfaceOrientation.unknown
|
|
529
|
+
),
|
|
530
|
+
outcome
|
|
501
531
|
)
|
|
502
532
|
}
|
|
503
533
|
|
|
504
534
|
func snapshotAccessibilityUnavailable(failure: SnapshotCaptureFailure) -> DataPayload {
|
|
505
535
|
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_AX_UNAVAILABLE=%@", failure.message)
|
|
506
|
-
|
|
507
|
-
|
|
536
|
+
applyMainOwnedSnapshotState("ax_unavailable_invalidation") {
|
|
537
|
+
self.runnerAccessibilityHealth = .unavailable
|
|
538
|
+
self.invalidateCachedTarget(reason: Self.axSnapshotUnavailableReason)
|
|
539
|
+
}
|
|
508
540
|
|
|
509
541
|
|
|
510
542
|
return sparseTruncatedSnapshotPayload(
|
|
@@ -523,11 +555,11 @@ extension RunnerTests {
|
|
|
523
555
|
)
|
|
524
556
|
}
|
|
525
557
|
|
|
526
|
-
|
|
558
|
+
func recoveredSnapshotMessage(_ failure: SnapshotCaptureFailure) -> String {
|
|
527
559
|
return "\(failure.message) Hint: \(failure.hint)"
|
|
528
560
|
}
|
|
529
561
|
|
|
530
|
-
|
|
562
|
+
func rawSnapshotTooLargeFailure(nodeCount: Int) -> SnapshotCaptureFailure {
|
|
531
563
|
SnapshotCaptureFailure(
|
|
532
564
|
code: Self.rawSnapshotTooLargeCode,
|
|
533
565
|
message: "iOS raw snapshot exceeded \(Self.rawSnapshotMaxNodes) nodes while walking node \(nodeCount).",
|
|
@@ -558,246 +590,4 @@ extension RunnerTests {
|
|
|
558
590
|
runnerFatalReason: runnerFatalReason
|
|
559
591
|
)
|
|
560
592
|
}
|
|
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
593
|
}
|
|
@@ -464,7 +464,7 @@ extension RunnerTests {
|
|
|
464
464
|
func flatInteractiveElements(
|
|
465
465
|
app: XCUIApplication,
|
|
466
466
|
deadline: Date
|
|
467
|
-
) -> (elements: [XCUIElement],
|
|
467
|
+
) -> (elements: [XCUIElement], outcome: SnapshotTierOutcome) {
|
|
468
468
|
let queries: [XCUIElementQuery] = [
|
|
469
469
|
app.buttons,
|
|
470
470
|
app.links,
|
|
@@ -487,23 +487,36 @@ extension RunnerTests {
|
|
|
487
487
|
app.images
|
|
488
488
|
]
|
|
489
489
|
|
|
490
|
-
|
|
491
|
-
|
|
490
|
+
return Self.runFlatInteractiveQueries(queries, deadline: deadline) { query in
|
|
491
|
+
self.snapshotElementsQuery {
|
|
492
|
+
query.allElementsBoundByIndex
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
static func runFlatInteractiveQueries<Query, Element>(
|
|
502
|
+
_ queries: [Query],
|
|
503
|
+
deadline: Date,
|
|
504
|
+
now: () -> Date = { Date() },
|
|
505
|
+
run: (Query) -> (elements: [Element], axUnavailable: Bool)
|
|
506
|
+
) -> (elements: [Element], outcome: SnapshotTierOutcome) {
|
|
507
|
+
var elements: [Element] = []
|
|
492
508
|
for query in queries {
|
|
493
|
-
if
|
|
509
|
+
if !querySweepCanStartQuery(deadline: deadline, now: now()) {
|
|
494
510
|
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_FLAT_FALLBACK_DEADLINE")
|
|
495
|
-
|
|
496
|
-
break
|
|
497
|
-
}
|
|
498
|
-
let result = snapshotElementsQuery {
|
|
499
|
-
query.allElementsBoundByIndex
|
|
511
|
+
return (elements, .deadlineExhausted)
|
|
500
512
|
}
|
|
513
|
+
let result = run(query)
|
|
501
514
|
elements.append(contentsOf: result.elements)
|
|
502
515
|
if result.axUnavailable {
|
|
503
516
|
break
|
|
504
517
|
}
|
|
505
518
|
}
|
|
506
|
-
return (elements,
|
|
519
|
+
return (elements, .completed)
|
|
507
520
|
}
|
|
508
521
|
|
|
509
522
|
func snapshotElementsQuery(
|
|
@@ -86,81 +86,3 @@ enum SnapshotBackendKind: String, CaseIterable {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|