agent-device 0.21.13 → 0.21.15
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.13.apk → agent-device-android-ime-helper-0.21.15.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.15.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.13.manifest.json → agent-device-android-ime-helper-0.21.15.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.15.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.15.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.13.manifest.json → agent-device-android-snapshot-helper-0.21.15.manifest.json} +6 -6
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +11 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +110 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +4 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerMainOwnedState.swift +27 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedTextEntry.h +8 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedTextEntry.m +26 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +12 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +59 -20
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AlertObservation.swift +2 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +179 -91
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +21 -24
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+GestureExecution.swift +9 -13
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +36 -49
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+MainThreadWork.swift +11 -15
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +136 -29
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +20 -21
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +3 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +6 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollDragExecution.swift +12 -24
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +22 -42
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +15 -18
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +73 -31
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +20 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCaptureTarget.swift +9 -7
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotExecution.swift +5 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +2 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +51 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +5 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +78 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +32 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +7 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +23 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +17 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +8 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +9 -15
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +12 -11
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotCoordinateSpace.swift +16 -19
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotGeometry.swift +24 -9
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +66 -10
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationInvariant.swift +12 -10
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +1 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +27 -5
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFoldProjection.swift +1 -0
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb-executor.js +1 -1
- package/dist/src/adb-failure.js +1 -1
- package/dist/src/adb-transport.js +1 -1
- package/dist/src/agent-browser-provider.js +1 -1
- package/dist/src/agent-browser-tool.js +1 -1
- package/dist/src/agent-device-client.js +2 -2
- package/dist/src/ai-sdk.js +1 -1
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/android-adb.d.ts +1 -8
- package/dist/src/android-input-ownership.js +1 -1
- package/dist/src/android-snapshot-quality.js +1 -0
- package/dist/src/android-system-chrome.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-catalog.js +1 -1
- package/dist/src/app-deployment-resolution.js +1 -1
- package/dist/src/app-inventory.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +1 -1
- package/dist/src/app-lifecycle2.js +1 -1
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-runtime2.js +1 -1
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/apple-runner-platform.js +1 -1
- package/dist/src/application-lifecycle-interaction.js +1 -1
- package/dist/src/archive.js +1 -1
- package/dist/src/artifact-download.js +1 -1
- package/dist/src/auth-session.js +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/backend-snapshot-options.js +1 -1
- package/dist/src/boot-diagnostics.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 +2 -2
- package/dist/src/cli.js +4 -4
- package/dist/src/click-button.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +102 -95
- package/dist/src/clipboard-shell-response.js +1 -1
- package/dist/src/command-schema.js +1 -1
- package/dist/src/command-tools.js +3 -3
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +1 -1
- package/dist/src/contracts.d.ts +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/debug-symbols-facade.js +1 -1
- package/dist/src/device-claim-rule.js +2 -2
- package/dist/src/device-input-state.d.ts +15 -2
- package/dist/src/device-inventory-context.js +1 -1
- package/dist/src/device-rotation.js +1 -1
- package/dist/src/device-selection-resolver.js +1 -1
- package/dist/src/device-session.js +1 -1
- package/dist/src/device-shell.js +1 -1
- package/dist/src/device2.js +1 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/dispatch-resolve.js +1 -1
- package/dist/src/doctor2.js +1 -1
- package/dist/src/engine-eval-script.js +1 -1
- package/dist/src/error.js +1 -1
- package/dist/src/exec.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/format.js +1 -1
- package/dist/src/gesture-plan-types.d.ts +1 -1
- package/dist/src/gesture-plan.js +1 -1
- package/dist/src/gesture-runtime.js +1 -1
- package/dist/src/harmonyos.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/human-control-contract.js +1 -1
- package/dist/src/human-control.js +1 -1
- package/dist/src/index.d.ts +7 -3
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +1 -1
- package/dist/src/install-artifact-facade.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-positionals.js +1 -1
- package/dist/src/interaction-ref-policy.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-binding.js +1 -1
- package/dist/src/interactor.js +4 -4
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +2 -2
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/internal/run-script-http-child.js +1 -1
- package/dist/src/inventory.js +1 -1
- package/dist/src/inventory2.js +1 -1
- package/dist/src/inventory3.js +1 -1
- package/dist/src/inventory5.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-engine.js +1 -0
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun-download-file.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +16 -3
- package/dist/src/linux.js +1 -1
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/mechanics.js +17 -17
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/multitouch-support.js +1 -1
- package/dist/src/native-build-cache.js +1 -0
- package/dist/src/observation.js +1 -1
- package/dist/src/overlay.js +3 -0
- package/dist/src/parameterized-recorded-fill.js +1 -1
- package/dist/src/perf-facade.js +1 -1
- package/dist/src/perf-runtime-operation-builder.js +1 -1
- package/dist/src/perf-runtime-plan.js +1 -1
- package/dist/src/perf-target.js +2 -2
- package/dist/src/perf.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-managed-owner.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +4 -4
- package/dist/src/platform-runtime-runtime-hints.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/png-crop-bytes.js +1 -1
- package/dist/src/png-size.js +1 -1
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/png.js +1 -1
- package/dist/src/prepare-kind.js +1 -1
- package/dist/src/provider-session-ownership.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/recording.js +1 -1
- package/dist/src/rect-center.js +1 -1
- package/dist/src/register-builtins.js +1 -1
- package/dist/src/registry.js +36 -36
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay.js +1 -1
- package/dist/src/reporting.js +1 -1
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-cancel.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-metadata.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 +1 -1
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +1 -3
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime2.js +4 -4
- package/dist/src/runtime3.js +1 -1
- 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-completion.js +1 -1
- package/dist/src/screen-recording-options.js +1 -1
- package/dist/src/screen-recording-resource-recovery.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-image.js +1 -1
- package/dist/src/screenshot-overlay-draw.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot.js +1 -1
- package/dist/src/screenshot3.js +1 -1
- package/dist/src/script.js +1 -1
- package/dist/src/scroll-command.d.ts +13 -6
- package/dist/src/scroll-command.js +1 -1
- package/dist/src/scroll-gesture.js +1 -1
- package/dist/src/sdk-batch-runner.js +2 -2
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +59 -12
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.d.ts +1 -1
- package/dist/src/sdk-io.js +1 -1
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +1 -1
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/server.js +1 -1
- package/dist/src/session-allocation.js +1 -1
- package/dist/src/session-routing.js +1 -1
- package/dist/src/session-runtime-admission.js +1 -1
- package/dist/src/session-snapshot.js +1 -1
- package/dist/src/session-store.js +1 -1
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +4 -4
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -0
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-capture-annotations.js +1 -1
- package/dist/src/snapshot-desktop-projection.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/snapshot2.js +1 -1
- package/dist/src/snapshot3.js +1 -1
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src4.js +1 -1
- package/dist/src/src7.js +1 -1
- package/dist/src/src8.js +1 -1
- package/dist/src/string-enum.js +1 -1
- package/dist/src/surface-snapshot.js +1 -1
- package/dist/src/takeover.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider-facade.js +1 -1
- package/dist/src/tool-provider.js +2 -2
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/transport.js +1 -1
- package/dist/src/tree.js +1 -1
- package/dist/src/tv-remote.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/verified-file.js +1 -1
- package/dist/src/video.js +1 -1
- package/dist/src/viewport.js +1 -1
- package/dist/src/web.js +1 -1
- package/dist/src/web2.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.13.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/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 +0 -1
- package/dist/src/absence-observation-errors.js +0 -1
- package/dist/src/runner-presentation.js +0 -1
- package/dist/src/semantic-index.js +0 -1
- package/dist/src/snapshot-process.js +0 -1
- package/dist/src/snapshot-scope.js +0 -1
|
@@ -48,6 +48,39 @@ extension RunnerTests {
|
|
|
48
48
|
)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@MainActor
|
|
54
|
+
func executeAppState(command: Command) -> Response {
|
|
55
|
+
guard let bundleId = command.appBundleId?.trimmedNonEmpty else {
|
|
56
|
+
return Response(
|
|
57
|
+
ok: false,
|
|
58
|
+
error: ErrorPayload(
|
|
59
|
+
code: "INVALID_ARGS",
|
|
60
|
+
message: "appState requires appBundleId",
|
|
61
|
+
hint: "Set appBundleId to the session app's bundle identifier."
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
let state = XCUIApplication(bundleIdentifier: bundleId).state
|
|
66
|
+
return Response(ok: true, data: DataPayload(applicationState: Self.applicationStateName(state)))
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
static func applicationStateName(_ state: XCUIApplication.State) -> String {
|
|
72
|
+
switch state {
|
|
73
|
+
case .unknown: return "unknown"
|
|
74
|
+
case .notRunning: return "notRunning"
|
|
75
|
+
case .runningBackground: return "runningBackground"
|
|
76
|
+
case .runningForeground: return "runningForeground"
|
|
77
|
+
#if !os(macOS)
|
|
78
|
+
case .runningBackgroundSuspended: return "runningBackgroundSuspended"
|
|
79
|
+
#endif
|
|
80
|
+
@unknown default: return "unknown"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
51
84
|
struct ActiveCommandContext {
|
|
52
85
|
let app: XCUIApplication
|
|
53
86
|
|
|
@@ -133,7 +166,7 @@ extension RunnerTests {
|
|
|
133
166
|
return try runMainThreadWork(
|
|
134
167
|
"command_execution",
|
|
135
168
|
timeout: max(0.001, deadline.timeIntervalSinceNow),
|
|
136
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
169
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
137
170
|
) {
|
|
138
171
|
try self.executeOnMainSafely(
|
|
139
172
|
command: command,
|
|
@@ -144,8 +177,8 @@ extension RunnerTests {
|
|
|
144
177
|
}
|
|
145
178
|
return try runMainThreadWork(
|
|
146
179
|
"command_execution",
|
|
147
|
-
timeout: mainThreadExecutionTimeout,
|
|
148
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
180
|
+
timeout: Self.mainThreadExecutionTimeout,
|
|
181
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
149
182
|
) {
|
|
150
183
|
try self.executeOnMainSafely(command: command, routeToSpringboard: routeToSpringboard)
|
|
151
184
|
}
|
|
@@ -153,6 +186,7 @@ extension RunnerTests {
|
|
|
153
186
|
|
|
154
187
|
|
|
155
188
|
|
|
189
|
+
@MainActor
|
|
156
190
|
private func executeOnMainSafely(
|
|
157
191
|
command: Command,
|
|
158
192
|
alertDeadline: Date? = nil,
|
|
@@ -222,7 +256,7 @@ extension RunnerTests {
|
|
|
222
256
|
invalidateCachedTarget(reason: "xctest_recorded_failure")
|
|
223
257
|
return failureResponse
|
|
224
258
|
}
|
|
225
|
-
if !hasRetried,
|
|
259
|
+
if !hasRetried, command.traits.retryOnSessionLoss, shouldRetryResponse(response) {
|
|
226
260
|
NSLog(
|
|
227
261
|
"AGENT_DEVICE_RUNNER_RETRY command=%@ reason=response_unavailable",
|
|
228
262
|
command.command.rawValue
|
|
@@ -247,8 +281,8 @@ extension RunnerTests {
|
|
|
247
281
|
while true {
|
|
248
282
|
let failureCountBefore = try runMainThreadWork(
|
|
249
283
|
"recorded_failure_count",
|
|
250
|
-
timeout: mainThreadExecutionTimeout,
|
|
251
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
284
|
+
timeout: Self.mainThreadExecutionTimeout,
|
|
285
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
252
286
|
) {
|
|
253
287
|
self.currentXCTestFailureCount()
|
|
254
288
|
}
|
|
@@ -264,8 +298,8 @@ extension RunnerTests {
|
|
|
264
298
|
}
|
|
265
299
|
let recordedFailureResponse = try runMainThreadWork(
|
|
266
300
|
"recorded_failure_count",
|
|
267
|
-
timeout: mainThreadExecutionTimeout,
|
|
268
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
301
|
+
timeout: Self.mainThreadExecutionTimeout,
|
|
302
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
269
303
|
) {
|
|
270
304
|
self.didRecordXCTestFailure(since: failureCountBefore)
|
|
271
305
|
? self.xctestRecordedFailureResponse(command: command, response: response)
|
|
@@ -274,14 +308,14 @@ extension RunnerTests {
|
|
|
274
308
|
if let recordedFailureResponse {
|
|
275
309
|
try runMainThreadWork(
|
|
276
310
|
"target_invalidation",
|
|
277
|
-
timeout: mainThreadExecutionTimeout,
|
|
278
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
311
|
+
timeout: Self.mainThreadExecutionTimeout,
|
|
312
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
279
313
|
) {
|
|
280
314
|
self.invalidateCachedTarget(reason: "xctest_recorded_failure")
|
|
281
315
|
}
|
|
282
316
|
return recordedFailureResponse
|
|
283
317
|
}
|
|
284
|
-
if !hasRetried,
|
|
318
|
+
if !hasRetried, command.traits.retryOnSessionLoss, shouldRetryResponse(response) {
|
|
285
319
|
NSLog(
|
|
286
320
|
"AGENT_DEVICE_RUNNER_RETRY command=%@ reason=response_unavailable",
|
|
287
321
|
command.command.rawValue
|
|
@@ -289,8 +323,8 @@ extension RunnerTests {
|
|
|
289
323
|
hasRetried = true
|
|
290
324
|
try runMainThreadWork(
|
|
291
325
|
"target_invalidation",
|
|
292
|
-
timeout: mainThreadExecutionTimeout,
|
|
293
|
-
timeoutError: mainThreadExecutionTimeoutError
|
|
326
|
+
timeout: Self.mainThreadExecutionTimeout,
|
|
327
|
+
timeoutError: Self.mainThreadExecutionTimeoutError
|
|
294
328
|
) {
|
|
295
329
|
self.invalidateCachedTarget(reason: "response_unavailable")
|
|
296
330
|
self.sleepFor(self.retryCooldown)
|
|
@@ -301,6 +335,7 @@ extension RunnerTests {
|
|
|
301
335
|
}
|
|
302
336
|
}
|
|
303
337
|
|
|
338
|
+
@MainActor
|
|
304
339
|
private func executeOnMain(
|
|
305
340
|
command: Command,
|
|
306
341
|
alertDeadline: Date?,
|
|
@@ -386,6 +421,8 @@ extension RunnerTests {
|
|
|
386
421
|
}
|
|
387
422
|
case .uptime:
|
|
388
423
|
return executeUptime()
|
|
424
|
+
case .appState:
|
|
425
|
+
return executeAppState(command: command)
|
|
389
426
|
case .activate:
|
|
390
427
|
guard
|
|
391
428
|
let bundleId = command.appBundleId?.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
@@ -404,7 +441,7 @@ extension RunnerTests {
|
|
|
404
441
|
return Response(ok: false, error: ErrorPayload(message: "terminate requires appBundleId"))
|
|
405
442
|
}
|
|
406
443
|
XCUIApplication(bundleIdentifier: bundleId).terminate()
|
|
407
|
-
if
|
|
444
|
+
if mainOwned.bundleId == bundleId {
|
|
408
445
|
invalidateCachedTarget(reason: "target_terminated")
|
|
409
446
|
}
|
|
410
447
|
return Response(ok: true, data: DataPayload(message: "app terminated"))
|
|
@@ -418,88 +455,130 @@ extension RunnerTests {
|
|
|
418
455
|
)
|
|
419
456
|
}
|
|
420
457
|
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
@MainActor
|
|
421
462
|
func prepareActiveCommandContext(
|
|
422
463
|
command: Command,
|
|
423
464
|
routeToSpringboard: Bool = false
|
|
424
465
|
) -> ActiveCommandPreparation {
|
|
425
|
-
var activeApp = currentApp ?? app
|
|
426
|
-
var systemSurface: SystemSurfaceHost? = nil
|
|
427
466
|
if routeToSpringboard {
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
|
|
467
|
+
return .context(ActiveCommandContext(app: springboard))
|
|
468
|
+
}
|
|
469
|
+
switch command.traits.launchPolicy {
|
|
470
|
+
case .noApp:
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
if let presented = presentedSystemSurfaceHost() {
|
|
474
|
+
return .context(ActiveCommandContext(app: presented.app, systemSurface: presented.host))
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
return .context(ActiveCommandContext(app: mainOwned.app ?? app))
|
|
479
|
+
case .presentedSurface:
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
#if os(iOS)
|
|
483
|
+
return .context(ActiveCommandContext(app: resolveAppWithoutActivation(command: command)))
|
|
484
|
+
#else
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
return prepareActivatedTarget(command: command)
|
|
489
|
+
#endif
|
|
490
|
+
case .existingApp:
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
return prepareActivatedTarget(command: command)
|
|
494
|
+
case .mayLaunch:
|
|
495
|
+
if shouldSkipAppActivationPreflight(command) {
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
return .context(ActiveCommandContext(app: resolveAppWithoutActivation(command: command)))
|
|
499
|
+
}
|
|
500
|
+
return prepareActivatedTarget(command: command)
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
@MainActor
|
|
509
|
+
private func prepareActivatedTarget(command: Command) -> ActiveCommandPreparation {
|
|
510
|
+
if let presented = presentedSystemSurfaceHost() {
|
|
432
511
|
|
|
433
512
|
|
|
434
513
|
|
|
435
|
-
|
|
436
|
-
systemSurface = presented.host
|
|
437
|
-
if isInteractionCommand(command.command) {
|
|
514
|
+
if command.traits.isInteraction {
|
|
438
515
|
applyInteractionStabilizationIfNeeded()
|
|
439
516
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
517
|
+
return .context(ActiveCommandContext(app: presented.app, systemSurface: presented.host))
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
let normalizedBundleId = command.appBundleId?
|
|
521
|
+
.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
522
|
+
let requestedBundleId = (normalizedBundleId?.isEmpty == true) ? nil : normalizedBundleId
|
|
523
|
+
if let bundleId = requestedBundleId,
|
|
524
|
+
let notRunning = notRunningRefusal(command: command, bundleId: bundleId)
|
|
525
|
+
{
|
|
526
|
+
return .response(notRunning)
|
|
527
|
+
}
|
|
528
|
+
if let bundleId = requestedBundleId {
|
|
529
|
+
if mainOwned.bundleId != bundleId || mainOwned.app == nil {
|
|
530
|
+
_ = activateTarget(bundleId: bundleId, reason: "bundle_changed")
|
|
531
|
+
} else {
|
|
532
|
+
refreshCachedTargetIfProcessChanged(bundleId: bundleId)
|
|
448
533
|
}
|
|
534
|
+
} else {
|
|
535
|
+
|
|
536
|
+
invalidateCachedTarget(reason: "missing_app_bundle")
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
var activeApp = mainOwned.app ?? app
|
|
541
|
+
if let bundleId = requestedBundleId, targetNeedsActivation(activeApp) {
|
|
542
|
+
activeApp = activateTarget(bundleId: bundleId, reason: "stale_target")
|
|
543
|
+
} else if requestedBundleId == nil, targetNeedsActivation(activeApp) {
|
|
544
|
+
ensureRunnerHostAppActive(reason: "missing_app_bundle")
|
|
545
|
+
activeApp = app
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
let skipExistenceWait = canUseFastForegroundAppGuard(
|
|
549
|
+
activeApp: activeApp,
|
|
550
|
+
requestedBundleId: requestedBundleId
|
|
551
|
+
)
|
|
552
|
+
if !skipExistenceWait && !activeApp.waitForExistence(timeout: appExistenceTimeout) {
|
|
449
553
|
if let bundleId = requestedBundleId {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
refreshCachedTargetIfProcessChanged(bundleId: bundleId)
|
|
554
|
+
activeApp = activateTarget(bundleId: bundleId, reason: "missing_after_wait")
|
|
555
|
+
guard activeApp.waitForExistence(timeout: appExistenceTimeout) else {
|
|
556
|
+
return .response(Response(ok: false, error: .targetAppUnavailable(bundleId: bundleId)))
|
|
454
557
|
}
|
|
455
558
|
} else {
|
|
456
|
-
|
|
457
|
-
invalidateCachedTarget(reason: "missing_app_bundle")
|
|
559
|
+
return .response(Response(ok: false, error: .targetAppUnavailable(bundleId: nil)))
|
|
458
560
|
}
|
|
561
|
+
}
|
|
459
562
|
|
|
460
|
-
|
|
461
|
-
if let bundleId = requestedBundleId,
|
|
462
|
-
activeApp = activateTarget(bundleId: bundleId, reason: "
|
|
463
|
-
} else if requestedBundleId == nil,
|
|
464
|
-
ensureRunnerHostAppActive(reason: "
|
|
563
|
+
if command.traits.isInteraction {
|
|
564
|
+
if let bundleId = requestedBundleId, activeApp.state != .runningForeground {
|
|
565
|
+
activeApp = activateTarget(bundleId: bundleId, reason: "interaction_foreground_guard")
|
|
566
|
+
} else if requestedBundleId == nil, activeApp.state != .runningForeground {
|
|
567
|
+
ensureRunnerHostAppActive(reason: "interaction_missing_app_bundle")
|
|
465
568
|
activeApp = app
|
|
466
569
|
}
|
|
467
|
-
|
|
468
|
-
let skipExistenceWait = canUseFastForegroundAppGuard(
|
|
570
|
+
let skipInteractionExistenceWait = canUseFastForegroundAppGuard(
|
|
469
571
|
activeApp: activeApp,
|
|
470
572
|
requestedBundleId: requestedBundleId
|
|
471
573
|
)
|
|
472
|
-
if !
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
guard activeApp.waitForExistence(timeout: appExistenceTimeout) else {
|
|
476
|
-
return .response(Response(ok: false, error: .targetAppUnavailable(bundleId: bundleId)))
|
|
477
|
-
}
|
|
478
|
-
} else {
|
|
479
|
-
return .response(Response(ok: false, error: .targetAppUnavailable(bundleId: nil)))
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if isInteractionCommand(command.command) {
|
|
484
|
-
if let bundleId = requestedBundleId, activeApp.state != .runningForeground {
|
|
485
|
-
activeApp = activateTarget(bundleId: bundleId, reason: "interaction_foreground_guard")
|
|
486
|
-
} else if requestedBundleId == nil, activeApp.state != .runningForeground {
|
|
487
|
-
ensureRunnerHostAppActive(reason: "interaction_missing_app_bundle")
|
|
488
|
-
activeApp = app
|
|
489
|
-
}
|
|
490
|
-
let skipInteractionExistenceWait = canUseFastForegroundAppGuard(
|
|
491
|
-
activeApp: activeApp,
|
|
492
|
-
requestedBundleId: requestedBundleId
|
|
574
|
+
if !skipInteractionExistenceWait && !activeApp.waitForExistence(timeout: 2) {
|
|
575
|
+
return .response(
|
|
576
|
+
Response(ok: false, error: .targetAppUnavailable(bundleId: requestedBundleId))
|
|
493
577
|
)
|
|
494
|
-
if !skipInteractionExistenceWait && !activeApp.waitForExistence(timeout: 2) {
|
|
495
|
-
return .response(
|
|
496
|
-
Response(ok: false, error: .targetAppUnavailable(bundleId: requestedBundleId))
|
|
497
|
-
)
|
|
498
|
-
}
|
|
499
|
-
applyInteractionStabilizationIfNeeded()
|
|
500
578
|
}
|
|
579
|
+
applyInteractionStabilizationIfNeeded()
|
|
501
580
|
}
|
|
502
|
-
return .context(ActiveCommandContext(app: activeApp
|
|
581
|
+
return .context(ActiveCommandContext(app: activeApp))
|
|
503
582
|
}
|
|
504
583
|
|
|
505
584
|
|
|
@@ -509,9 +588,8 @@ extension RunnerTests {
|
|
|
509
588
|
private func presentedSystemSurfaceHost() -> (host: SystemSurfaceHost, app: XCUIApplication)? {
|
|
510
589
|
#if os(iOS)
|
|
511
590
|
for host in SystemSurfaceHostRegistry.hosts {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
return (host, candidate)
|
|
591
|
+
if systemSurfaceHostState(host) == .runningForeground {
|
|
592
|
+
return (host, XCUIApplication(bundleIdentifier: host.bundleId))
|
|
515
593
|
}
|
|
516
594
|
}
|
|
517
595
|
return nil
|
|
@@ -520,6 +598,21 @@ extension RunnerTests {
|
|
|
520
598
|
#endif
|
|
521
599
|
}
|
|
522
600
|
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
private func systemSurfaceHostState(_ host: SystemSurfaceHost) -> XCUIApplication.State {
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
return XCUIApplication(bundleIdentifier: host.bundleId).state
|
|
614
|
+
}
|
|
615
|
+
|
|
523
616
|
func currentXCTestFailureCount() -> Int {
|
|
524
617
|
return testRun?.failureCount ?? 0
|
|
525
618
|
}
|
|
@@ -533,7 +626,7 @@ extension RunnerTests {
|
|
|
533
626
|
if response.data?.runnerFatal == true {
|
|
534
627
|
return nil
|
|
535
628
|
}
|
|
536
|
-
guard
|
|
629
|
+
guard command.traits.convertsRecordedFailure else {
|
|
537
630
|
return nil
|
|
538
631
|
}
|
|
539
632
|
return Response(
|
|
@@ -546,19 +639,12 @@ extension RunnerTests {
|
|
|
546
639
|
)
|
|
547
640
|
}
|
|
548
641
|
|
|
549
|
-
func shouldSkipAppActivationPreflight(_ command: Command) -> Bool {
|
|
550
|
-
#if os(iOS)
|
|
551
|
-
if command.command == .alert {
|
|
552
|
-
return true
|
|
553
|
-
}
|
|
554
|
-
|
|
555
642
|
|
|
556
643
|
|
|
557
644
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
645
|
+
@MainActor
|
|
646
|
+
func shouldSkipAppActivationPreflight(_ command: Command) -> Bool {
|
|
647
|
+
#if os(iOS)
|
|
562
648
|
|
|
563
649
|
|
|
564
650
|
|
|
@@ -605,25 +691,27 @@ extension RunnerTests {
|
|
|
605
691
|
&& command.y != nil
|
|
606
692
|
}
|
|
607
693
|
|
|
694
|
+
@MainActor
|
|
608
695
|
private func hasCachedTargetForActivationSkip(command: Command) -> Bool {
|
|
609
|
-
guard let
|
|
696
|
+
guard let boundApp = mainOwned.app, boundApp.state == .runningForeground else { return false }
|
|
610
697
|
guard let bundleId = command.appBundleId?.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
611
698
|
!bundleId.isEmpty
|
|
612
699
|
else {
|
|
613
700
|
return true
|
|
614
701
|
}
|
|
615
|
-
return
|
|
702
|
+
return mainOwned.bundleId == bundleId
|
|
616
703
|
}
|
|
617
704
|
|
|
705
|
+
@MainActor
|
|
618
706
|
func resolveAppWithoutActivation(command: Command) -> XCUIApplication {
|
|
619
707
|
guard let bundleId = command.appBundleId?
|
|
620
708
|
.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
621
709
|
!bundleId.isEmpty
|
|
622
710
|
else {
|
|
623
|
-
return
|
|
711
|
+
return mainOwned.app ?? app
|
|
624
712
|
}
|
|
625
|
-
if
|
|
626
|
-
return
|
|
713
|
+
if mainOwned.bundleId == bundleId, let boundApp = mainOwned.app {
|
|
714
|
+
return boundApp
|
|
627
715
|
}
|
|
628
716
|
return XCUIApplication(bundleIdentifier: bundleId)
|
|
629
717
|
}
|
|
@@ -2,18 +2,19 @@ import XCTest
|
|
|
2
2
|
import AgentDeviceSnapshotPresentation
|
|
3
3
|
|
|
4
4
|
extension RunnerTests {
|
|
5
|
+
@MainActor
|
|
5
6
|
func executeOnMainPrepared(
|
|
6
7
|
command: Command,
|
|
7
8
|
activeApp: XCUIApplication,
|
|
8
9
|
alertDeadline: Date? = nil
|
|
9
10
|
) throws -> Response {
|
|
10
11
|
var activeApp = activeApp
|
|
11
|
-
if command.
|
|
12
|
+
if command.invalidatesRememberedTextEntryTap {
|
|
12
13
|
clearRememberedTextEntryTap()
|
|
13
14
|
}
|
|
14
15
|
switch command.command {
|
|
15
16
|
case .status, .activate, .terminate, .targetReset, .shutdown, .recordStart, .recordStop, .uptime,
|
|
16
|
-
.snapshot:
|
|
17
|
+
.appState, .snapshot:
|
|
17
18
|
return Response(
|
|
18
19
|
ok: false,
|
|
19
20
|
error: ErrorPayload(
|
|
@@ -78,20 +79,15 @@ extension RunnerTests {
|
|
|
78
79
|
app: activeApp,
|
|
79
80
|
policy: synthesizedGesturePolicy(policyKind)
|
|
80
81
|
)
|
|
81
|
-
|
|
82
|
+
switch performSynthesizedGesture(activeApp, kind: policyKind, context: context, synthesize: {
|
|
82
83
|
synthesizedTapAt(
|
|
83
84
|
app: activeApp,
|
|
84
85
|
x: touchPoint.x,
|
|
85
86
|
y: touchPoint.y,
|
|
86
87
|
context: context
|
|
87
88
|
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
logSynthesizedGesturePolicyDecision(
|
|
91
|
-
kind: policyKind,
|
|
92
|
-
context: context,
|
|
93
|
-
fallbackAttempted: false
|
|
94
|
-
)
|
|
89
|
+
}) {
|
|
90
|
+
case .performed(let timing):
|
|
95
91
|
if isTextEntry {
|
|
96
92
|
waitForTextEntryReadinessAfterTap(app: activeApp, element: element)
|
|
97
93
|
}
|
|
@@ -107,13 +103,12 @@ extension RunnerTests {
|
|
|
107
103
|
? match.usedNonHittableFallback
|
|
108
104
|
: nil
|
|
109
105
|
)
|
|
106
|
+
case .xctestFallback(let message, let hint):
|
|
107
|
+
fallback = GestureFallback(strategy: "xctest-coordinate-tap", message: message, hint: hint)
|
|
108
|
+
case .refused(_, let message, let hint):
|
|
109
|
+
clearRememberedTextEntryTap()
|
|
110
|
+
return unsupportedResponse(message: message, hint: hint)
|
|
110
111
|
}
|
|
111
|
-
logSynthesizedGesturePolicyDecision(
|
|
112
|
-
kind: policyKind,
|
|
113
|
-
context: context,
|
|
114
|
-
fallbackAttempted: true
|
|
115
|
-
)
|
|
116
|
-
fallback = gestureFallback(strategy: "xctest-coordinate-tap", from: outcome)
|
|
117
112
|
}
|
|
118
113
|
let (timing, outcome) = performGesture(activeApp) {
|
|
119
114
|
if expectedPoint != nil || match.usedNonHittableFallback {
|
|
@@ -149,7 +144,7 @@ extension RunnerTests {
|
|
|
149
144
|
}
|
|
150
145
|
if let x = command.x, let y = command.y {
|
|
151
146
|
let xCTestChannelPenalized = isSnapshotXCTestChannelPenalized(
|
|
152
|
-
bundleId:
|
|
147
|
+
bundleId: mainOwned.bundleId
|
|
153
148
|
)
|
|
154
149
|
let xCTestTextInputProbeSkipped = !shouldProbeCoordinateTapTextInput(
|
|
155
150
|
xCTestChannelPenalized: xCTestChannelPenalized
|
|
@@ -162,7 +157,7 @@ extension RunnerTests {
|
|
|
162
157
|
textInput = nil
|
|
163
158
|
NSLog(
|
|
164
159
|
"AGENT_DEVICE_RUNNER_COORDINATE_TAP_TEXT_INPUT_PROBE_SKIPPED bundle=%@",
|
|
165
|
-
|
|
160
|
+
mainOwned.bundleId ?? ""
|
|
166
161
|
)
|
|
167
162
|
}
|
|
168
163
|
var fallback: GestureFallback?
|
|
@@ -172,16 +167,18 @@ extension RunnerTests {
|
|
|
172
167
|
app: activeApp,
|
|
173
168
|
policy: synthesizedGesturePolicy(policyKind)
|
|
174
169
|
)
|
|
175
|
-
|
|
170
|
+
switch performSynthesizedGesture(activeApp, kind: policyKind, context: context, synthesize: {
|
|
176
171
|
synthesizedTapAt(app: activeApp, x: x, y: y, context: context)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
logSynthesizedGesturePolicyDecision(kind: policyKind, context: context, fallbackAttempted: false)
|
|
172
|
+
}) {
|
|
173
|
+
case .performed(let timing):
|
|
180
174
|
rememberTextEntryTap(textInput)
|
|
181
175
|
return gestureResponse(message: "tapped", timing: timing)
|
|
176
|
+
case .xctestFallback(let message, let hint):
|
|
177
|
+
fallback = GestureFallback(strategy: "xctest-coordinate-tap", message: message, hint: hint)
|
|
178
|
+
case .refused(_, let message, let hint):
|
|
179
|
+
clearRememberedTextEntryTap()
|
|
180
|
+
return unsupportedResponse(message: message, hint: hint)
|
|
182
181
|
}
|
|
183
|
-
logSynthesizedGesturePolicyDecision(kind: policyKind, context: context, fallbackAttempted: true)
|
|
184
|
-
fallback = gestureFallback(strategy: "xctest-coordinate-tap", from: outcome)
|
|
185
182
|
}
|
|
186
183
|
let touchFrame = resolvedTouchVisualizationFrame(app: activeApp, x: x, y: y)
|
|
187
184
|
let (timing, outcome) = performGesture(activeApp) { tapAt(app: activeApp, x: x, y: y) }
|
|
@@ -139,7 +139,7 @@ final class RunnerCommandJournal {
|
|
|
139
139
|
.remotePress, .type, .swipe, .scroll, .desktopScroll, .findText, .querySelector, .readText,
|
|
140
140
|
.backInApp, .backSystem, .home, .rotate, .appSwitcher, .actionButton, .keyboardDismiss, .keyboardReturn,
|
|
141
141
|
.alert, .sequence, .gesture, .gestureViewport, .recordStart, .recordStop,
|
|
142
|
-
.status, .uptime, .activate, .terminate, .targetReset, .shutdown:
|
|
142
|
+
.status, .uptime, .appState, .activate, .terminate, .targetReset, .shutdown:
|
|
143
143
|
return true
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -25,13 +25,17 @@ extension RunnerTests {
|
|
|
25
25
|
case .performed:
|
|
26
26
|
return nil
|
|
27
27
|
case .unsupported(let message, let hint):
|
|
28
|
-
return
|
|
29
|
-
ok: false,
|
|
30
|
-
error: ErrorPayload(code: "UNSUPPORTED_OPERATION", message: message, hint: hint)
|
|
31
|
-
)
|
|
28
|
+
return unsupportedResponse(message: message, hint: hint)
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
|
|
32
|
+
func unsupportedResponse(message: String, hint: String?) -> Response {
|
|
33
|
+
Response(
|
|
34
|
+
ok: false,
|
|
35
|
+
error: ErrorPayload(code: "UNSUPPORTED_OPERATION", message: message, hint: hint)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
|
|
36
40
|
enum GestureFrame {
|
|
37
41
|
case none
|
|
@@ -45,15 +49,6 @@ extension RunnerTests {
|
|
|
45
49
|
let hint: String?
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
func gestureFallback(strategy: String, from outcome: RunnerInteractionOutcome) -> GestureFallback? {
|
|
49
|
-
switch outcome {
|
|
50
|
-
case .performed:
|
|
51
|
-
return nil
|
|
52
|
-
case .unsupported(let message, let hint):
|
|
53
|
-
return GestureFallback(strategy: strategy, message: message, hint: hint)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
52
|
|
|
58
53
|
|
|
59
54
|
|
|
@@ -62,6 +57,7 @@ extension RunnerTests {
|
|
|
62
57
|
|
|
63
58
|
|
|
64
59
|
|
|
60
|
+
@MainActor
|
|
65
61
|
func performGesture(
|
|
66
62
|
_ app: XCUIApplication,
|
|
67
63
|
idleTimeout: Bool = true,
|