agent-device 0.21.0 → 0.21.1
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.0.apk → agent-device-android-ime-helper-0.21.1.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.1.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.0.manifest.json → agent-device-android-ime-helper-0.21.1.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.0.apk → agent-device-android-snapshot-helper-0.21.1.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.1.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.0.manifest.json → agent-device-android-snapshot-helper-0.21.1.manifest.json} +6 -6
- package/apple/snapshot-bridge/README.md +58 -1
- package/apple/snapshot-bridge/SnapshotBridge.m +6 -0
- package/apple/snapshot-bridge/SnapshotBridgeCapture.h +25 -0
- package/apple/snapshot-bridge/SnapshotBridgeCapture.m +138 -0
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.h +1 -0
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +32 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.h +12 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAXSnapshotBridge.m +20 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSelectorMatchPolicy.swift +15 -15
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSystemSurfaceHostPolicy.swift +72 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTapPointPolicy.swift +63 -14
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +668 -82
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +14 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+BlockingSystemModalResolution.swift +39 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +1065 -223
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +290 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +10 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +249 -61
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +101 -42
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +13 -13
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +51 -43
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +71 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+PrivateAXPresentation.swift +144 -7
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScreenRecorder.swift +13 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+ScrollGesture.swift +216 -17
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +206 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +289 -42
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotBackendCapabilities.swift +92 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +617 -122
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +79 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +71 -71
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +83 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +67 -67
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +4 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +17 -17
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +30 -30
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +31 -31
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputCandidatePolicy.swift +28 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +101 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +19 -19
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +55 -17
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +26 -5
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +125 -75
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +9 -9
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-overlay.swift +9 -9
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-trim.swift +4 -4
- 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/agent-browser-process-record.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.d.ts +1 -1
- package/dist/src/ai-sdk.js +1 -1
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/android-input-ownership.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-contract.js +1 -1
- package/dist/src/app-inventory.js +1 -1
- package/dist/src/app-launch.js +2 -2
- package/dist/src/app-lifecycle.js +3 -3
- package/dist/src/app-lifecycle2.js +1 -1
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-resolution.js +1 -1
- package/dist/src/apple-runner-platform.js +1 -0
- 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.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +25 -21
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +4 -4
- package/dist/src/click-button.js +1 -1
- package/dist/src/client-metro-companion.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +27 -13
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/code-signature.js +1 -1
- package/dist/src/command-schema.js +3 -3
- package/dist/src/command-tools.js +2 -2
- package/dist/src/command.js +1 -1
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +3 -3
- 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 +1 -1
- 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/device2.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/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/generic-settle.js +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/hdc.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 +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +2 -2
- 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.js +5 -5
- 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 +2 -2
- 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-runtime.js +1 -1
- package/dist/src/ios-system-surface.js +1 -0
- package/dist/src/lease-scope.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +1 -1
- 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 +16 -16
- package/dist/src/multitouch-support.js +1 -1
- package/dist/src/observation.js +1 -1
- package/dist/src/open-target-resolution.js +1 -0
- package/dist/src/owner-identity.js +3 -3
- package/dist/src/parameterized-recorded-fill.js +1 -1
- package/dist/src/perf-facade.js +2 -2
- package/dist/src/perf-process-identity.js +1 -0
- package/dist/src/perf-runtime-operation-builder.js +1 -1
- package/dist/src/perf-runtime-plan.js +1 -1
- package/dist/src/perf.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-runtime-android-adb-host.js +1 -1
- package/dist/src/platform-runtime-app-log-process.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 +2 -2
- package/dist/src/platform-runtime-runtime-hints.js +2 -2
- package/dist/src/platform-runtime-screen-recording-android-host.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-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/png-worker-contract.js +1 -1
- package/dist/src/prepare-kind.js +1 -1
- package/dist/src/provider-device-runtime.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/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/rect-center.js +1 -1
- package/dist/src/register-builtins.js +1 -1
- package/dist/src/registry.js +37 -36
- package/dist/src/remote-config2.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay.js +2 -2
- package/dist/src/reporting.js +9 -8
- 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 +2 -2
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +3 -3
- package/dist/src/runtime2.js +4 -4
- package/dist/src/runtime3.js +1 -1
- package/dist/src/runtime4.js +5 -4
- 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-live-handle.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-runtime.js +1 -1
- package/dist/src/screenshot.js +1 -1
- package/dist/src/screenshot3.js +3 -3
- package/dist/src/script.js +1 -1
- 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 +44 -1
- 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.d.ts +1 -1
- package/dist/src/sdk-remote-config.js +1 -1
- package/dist/src/sdk-selectors.d.ts +69 -13
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/server.js +3 -3
- package/dist/src/session-allocation.js +1 -1
- package/dist/src/session-observation.js +1 -0
- 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 +3 -3
- package/dist/src/session-target-evidence.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-quality-backend-capabilities.js +1 -1
- package/dist/src/snapshot-quality-verdict.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/src7.js +2 -2
- package/dist/src/src8.js +2 -2
- package/dist/src/string-enum.js +1 -1
- package/dist/src/takeover.js +1 -1
- package/dist/src/tool-provider.js +2 -2
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/tool-provider3.js +1 -1
- package/dist/src/toolchain-probe.js +1 -1
- package/dist/src/touch-reference-frame.js +1 -0
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/transport.js +1 -1
- package/dist/src/tv-remote.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/verified-file.js +1 -1
- package/dist/src/video.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/dist/src/window-state.js +1 -0
- package/package.json +3 -2
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.0.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.0.apk.sha256 +0 -1
- package/dist/src/back-mode.js +0 -1
- package/dist/src/format.js +0 -2
- package/dist/src/platform-runtime-apple-resources.js +0 -1
- package/dist/src/runner-selector-query.js +0 -1
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import XCTest
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
6
|
extension RunnerTests {
|
|
7
7
|
enum TextEntryFailure: String {
|
|
8
8
|
case notFocused = "TEXT_INPUT_NOT_FOCUSED"
|
|
@@ -45,13 +45,13 @@ extension RunnerTests {
|
|
|
45
45
|
static let pollInterval: TimeInterval = 0.02
|
|
46
46
|
static let warmupValueTimeout: TimeInterval = 0.4
|
|
47
47
|
static let verificationStabilityWindow: TimeInterval = 0.2
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
51
|
static let synthesizedCommitStallTimeout: TimeInterval = 3.0
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
55
|
static let synthesizedCommitCeiling: TimeInterval = 10.0
|
|
56
56
|
static let synthesizedCommitPollInterval: TimeInterval = 0.2
|
|
57
57
|
}
|
|
@@ -114,14 +114,14 @@ extension RunnerTests {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
func clearTextInput(_ element: XCUIElement) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
125
|
if let existing = editableTextValue(for: element, treatingPlaceholderAsEmpty: true),
|
|
126
126
|
existing.isEmpty {
|
|
127
127
|
return
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import XCTest
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
8
|
extension RunnerTests {
|
|
9
9
|
func rememberTextEntryTap(_ element: XCUIElement?) {
|
|
10
10
|
guard let element, isTextEntryElement(element) else {
|
|
@@ -26,8 +26,8 @@ extension RunnerTests {
|
|
|
26
26
|
guard let witness = textEntryTapWitness else {
|
|
27
27
|
return nil
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
|
|
31
31
|
clearRememberedTextEntryTap()
|
|
32
32
|
guard witness.matches(
|
|
33
33
|
bundleId: currentBundleId,
|
|
@@ -36,16 +36,16 @@ extension RunnerTests {
|
|
|
36
36
|
return nil
|
|
37
37
|
}
|
|
38
38
|
let element = witness.element
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
43
|
guard safely("LAST_TAPPED_TEXT_INPUT_EXISTS", false, { element.exists }) else {
|
|
44
44
|
return nil
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
49
|
return TextEntryTarget(
|
|
50
50
|
element: element,
|
|
51
51
|
refreshPoint: nil,
|
|
@@ -69,8 +69,8 @@ extension RunnerTests {
|
|
|
69
69
|
if let focused = focusedTextInput(app: app) {
|
|
70
70
|
return TextEntryStabilization(element: focused, focusConfirmed: true)
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
|
|
73
|
+
|
|
74
74
|
if keyboardBecameVisible(app: app, wasVisibleAtEntry: keyboardVisibleAtEntry) {
|
|
75
75
|
return TextEntryStabilization(element: latest, focusConfirmed: true)
|
|
76
76
|
}
|
|
@@ -86,10 +86,10 @@ extension RunnerTests {
|
|
|
86
86
|
if !softwareKeyboardVisible, let rememberedTarget = rememberedTextEntryTarget() {
|
|
87
87
|
return rememberedTarget
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
93
|
if softwareKeyboardVisible {
|
|
94
94
|
return TextEntryTarget(
|
|
95
95
|
element: focusedTextInput(app: app),
|
|
@@ -121,9 +121,9 @@ extension RunnerTests {
|
|
|
121
121
|
} else {
|
|
122
122
|
_ = tapAt(app: app, x: x, y: y)
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
127
|
if keyboardVisibleBeforeTap, let target {
|
|
128
128
|
return TextEntryTarget(
|
|
129
129
|
element: target,
|
|
@@ -158,8 +158,8 @@ extension RunnerTests {
|
|
|
158
158
|
if let point {
|
|
159
159
|
_ = tapAt(app: app, x: point.x, y: point.y)
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
|
|
162
|
+
|
|
163
163
|
if keyboardVisibleBeforeTap {
|
|
164
164
|
return TextEntryTarget(
|
|
165
165
|
element: element,
|
|
@@ -198,9 +198,9 @@ extension RunnerTests {
|
|
|
198
198
|
return CGPoint(x: frame.midX, y: frame.midY)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
206
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import XCTest
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
7
|
extension RunnerTests {
|
|
8
8
|
func focusedTextInput(app: XCUIApplication) -> XCUIElement? {
|
|
9
9
|
#if os(iOS)
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
return nil
|
|
13
13
|
#else
|
|
14
14
|
return safely("FOCUSED_INPUT_QUERY") {
|
|
@@ -49,21 +49,21 @@ extension RunnerTests {
|
|
|
49
49
|
return focused
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
57
|
if keyboardBecameVisible(app: app, wasVisibleAtEntry: keyboardVisibleAtEntry) {
|
|
58
58
|
return latest
|
|
59
59
|
}
|
|
60
60
|
sawSoftwareKeyboard = sawSoftwareKeyboard || keyboardElementExists(app: app)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
67
|
if !sawSoftwareKeyboard, Date() >= hardwareKeyboardFallback, let candidate = latest {
|
|
68
68
|
if keyboardFocusConfirmed(app: app, element: candidate) {
|
|
69
69
|
return candidate
|
|
@@ -113,23 +113,23 @@ extension RunnerTests {
|
|
|
113
113
|
return !wasVisibleAtEntry && isKeyboardVisible(app: app)
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
127
|
func keyboardFocusConfirmed(app: XCUIApplication, element: XCUIElement) -> Bool {
|
|
128
128
|
#if os(iOS)
|
|
129
129
|
return safely("TEXT_ENTRY_FOCUS_CONFIRMED", false) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
133
|
let frame = element.frame
|
|
134
134
|
guard !frame.isEmpty else {
|
|
135
135
|
return false
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import XCTest
|
|
2
|
+
|
|
3
|
+
final class TextInputProbeIssues {
|
|
4
|
+
let thread = Thread.current
|
|
5
|
+
var count = 0
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
enum TextInputProbeFailure: String {
|
|
9
|
+
case recordedIssue = "text_input_probe_recorded_issue"
|
|
10
|
+
case exception = "text_input_probe_exception"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
enum TextInputProbeOutcome {
|
|
14
|
+
case matches([XCUIElement])
|
|
15
|
+
case absent
|
|
16
|
+
case unavailable(TextInputProbeFailure)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
extension RunnerTests {
|
|
20
|
+
func textInputAt(app: XCUIApplication, x: Double, y: Double) -> XCUIElement? {
|
|
21
|
+
textInputCandidatesAt(app: app, point: CGPoint(x: x, y: y)).first
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
func textInputCandidatesAt(app: XCUIApplication, point: CGPoint) -> [XCUIElement] {
|
|
25
|
+
safely("TEXT_INPUT_AT_POINT", []) {
|
|
26
|
+
queryTextInputs(app: app, point: point, shouldStop: { false })
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func coordinateTapTextInputAt(app: XCUIApplication, x: Double, y: Double) -> XCUIElement? {
|
|
31
|
+
switch probeTextInputs(app: app, point: CGPoint(x: x, y: y)) {
|
|
32
|
+
case .matches(let elements):
|
|
33
|
+
return elements.first
|
|
34
|
+
case .absent:
|
|
35
|
+
return nil
|
|
36
|
+
case .unavailable:
|
|
37
|
+
return nil
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
func probeTextInputs(app: XCUIApplication, point: CGPoint) -> TextInputProbeOutcome {
|
|
42
|
+
precondition(Thread.isMainThread)
|
|
43
|
+
let issues = TextInputProbeIssues()
|
|
44
|
+
suppressedIssueLock.lock()
|
|
45
|
+
let previous = textInputProbeIssues
|
|
46
|
+
textInputProbeIssues = issues
|
|
47
|
+
suppressedIssueLock.unlock()
|
|
48
|
+
defer {
|
|
49
|
+
suppressedIssueLock.lock()
|
|
50
|
+
textInputProbeIssues = previous
|
|
51
|
+
suppressedIssueLock.unlock()
|
|
52
|
+
}
|
|
53
|
+
let (elements, exception) = catchingObjCException(fallback: []) {
|
|
54
|
+
queryTextInputs(app: app, point: point, shouldStop: { self.hasTextInputProbeIssues(issues) })
|
|
55
|
+
}
|
|
56
|
+
if hasTextInputProbeIssues(issues) { return .unavailable(.recordedIssue) }
|
|
57
|
+
if exception != nil { return .unavailable(.exception) }
|
|
58
|
+
return elements.isEmpty ? .absent : .matches(elements)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private func hasTextInputProbeIssues(_ scope: TextInputProbeIssues) -> Bool {
|
|
62
|
+
suppressedIssueLock.lock()
|
|
63
|
+
defer { suppressedIssueLock.unlock() }
|
|
64
|
+
return scope.count > 0
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
func containTextInputProbeIssue(_ issue: XCTIssue) -> Bool {
|
|
68
|
+
suppressedIssueLock.lock()
|
|
69
|
+
guard let scope = textInputProbeIssues, scope.thread === Thread.current else {
|
|
70
|
+
suppressedIssueLock.unlock()
|
|
71
|
+
return false
|
|
72
|
+
}
|
|
73
|
+
scope.count += 1
|
|
74
|
+
suppressedIssueLock.unlock()
|
|
75
|
+
NSLog("AGENT_DEVICE_RUNNER_TEXT_INPUT_PROBE_UNAVAILABLE issue=%@", issue.compactDescription)
|
|
76
|
+
return true
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private func queryTextInputs(
|
|
80
|
+
app: XCUIApplication,
|
|
81
|
+
point: CGPoint,
|
|
82
|
+
shouldStop: () -> Bool
|
|
83
|
+
) -> [XCUIElement] {
|
|
84
|
+
var candidates: [XCUIElement] = []
|
|
85
|
+
for query in [app.textFields, app.secureTextFields, app.searchFields, app.textViews] {
|
|
86
|
+
if shouldStop() { break }
|
|
87
|
+
candidates.append(contentsOf: query.allElementsBoundByIndex)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
}
|
|
95
|
+
guard !shouldStop() else { return [] }
|
|
96
|
+
return candidates.filter { element in
|
|
97
|
+
guard !shouldStop(), element.exists else { return false }
|
|
98
|
+
return isCoordinateTextInputCandidate(enabled: element.isEnabled, frame: element.frame, point: point)
|
|
99
|
+
}.sorted(by: smallestElementFirst)
|
|
100
|
+
}
|
|
101
|
+
}
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XCTest
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
|
|
5
5
|
extension RunnerTests {
|
|
6
6
|
func typeTextReliably(
|
|
7
7
|
app: XCUIApplication,
|
|
@@ -15,15 +15,15 @@ extension RunnerTests {
|
|
|
15
15
|
) -> TextEntryResult {
|
|
16
16
|
let totalStartedAt = Date()
|
|
17
17
|
guard !text.isEmpty else {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
22
|
if repairMode == .replacement {
|
|
23
23
|
guard let clearTarget = resolveTextEntryElement(app: app, target: target) else {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
27
|
logTextEntryPhase(commandId: commandId, phase: "total", startedAt: totalStartedAt, chars: 0, mode: repairMode)
|
|
28
28
|
return TextEntryResult(
|
|
29
29
|
verified: nil,
|
|
@@ -34,8 +34,8 @@ extension RunnerTests {
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
clearTextInput(clearTarget)
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
|
|
38
|
+
|
|
39
39
|
let observed = editableTextValue(for: clearTarget, treatingPlaceholderAsEmpty: true)
|
|
40
40
|
logTextEntryPhase(commandId: commandId, phase: "total", startedAt: totalStartedAt, chars: 0, mode: repairMode)
|
|
41
41
|
return TextEntryResult(
|
|
@@ -95,9 +95,9 @@ extension RunnerTests {
|
|
|
95
95
|
mode: repairMode
|
|
96
96
|
)
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
101
|
guard initialTarget != nil || (activeTarget.prefersFocusedElement && isKeyboardVisible(app: app)) else {
|
|
102
102
|
logTextEntryPhase(
|
|
103
103
|
commandId: commandId,
|
|
@@ -145,8 +145,8 @@ extension RunnerTests {
|
|
|
145
145
|
let textBefore = editableTextValue(for: currentTarget, treatingPlaceholderAsEmpty: true)
|
|
146
146
|
switch synthesizer.enterText(app: app, text: value, replacingExistingText: false) {
|
|
147
147
|
case .continueTyping:
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
|
|
149
|
+
|
|
150
150
|
let commit = awaitSynthesizedFirstResponderCommit(
|
|
151
151
|
app: app,
|
|
152
152
|
target: TextEntryTarget(
|
|
@@ -158,9 +158,9 @@ extension RunnerTests {
|
|
|
158
158
|
textBefore: textBefore,
|
|
159
159
|
typedText: value
|
|
160
160
|
)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
164
|
return (currentTarget, Self.textEntryFailure(forCommitOutcome: commit))
|
|
165
165
|
case .fallback:
|
|
166
166
|
return (nil, .synthesisUnavailable)
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift
CHANGED
|
@@ -2,13 +2,13 @@ import XCTest
|
|
|
2
2
|
import Network
|
|
3
3
|
|
|
4
4
|
extension RunnerTests {
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
|
|
7
7
|
func handle(connection: NWConnection) {
|
|
8
8
|
receiveRequest(connection: connection, buffer: Data())
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
|
|
13
13
|
private func receiveRequest(connection: NWConnection, buffer: Data) {
|
|
14
14
|
connection.receive(minimumIncompleteLength: 1, maximumLength: 1024 * 1024) { [weak self] data, _, _, _ in
|
|
@@ -116,9 +116,9 @@ extension RunnerTests {
|
|
|
116
116
|
completion((jsonResponse(status: 200, response: executeUptime()), false))
|
|
117
117
|
return
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
122
|
if attachToInFlightCommandIfNeeded(command: command, completion: completion) {
|
|
123
123
|
return
|
|
124
124
|
}
|
|
@@ -181,11 +181,11 @@ extension RunnerTests {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
// MARK: - In-Flight Command Coalescing
|
|
185
184
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
189
|
private func attachToInFlightCommandIfNeeded(
|
|
190
190
|
command: Command,
|
|
191
191
|
completion: @escaping ((data: Data, shouldFinish: Bool)) -> Void
|
|
@@ -226,14 +226,52 @@ extension RunnerTests {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
230
268
|
|
|
231
269
|
private func jsonResponse(status: Int, response: Response) -> Data {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
237
275
|
let stamped =
|
|
238
276
|
response.ok
|
|
239
277
|
? response.stampingCurrentUptimeMs(ProcessInfo.processInfo.systemUptime * 1000)
|
|
@@ -262,8 +300,8 @@ extension RunnerTests {
|
|
|
262
300
|
private func finish() {
|
|
263
301
|
listener?.cancel()
|
|
264
302
|
listener = nil
|
|
265
|
-
|
|
266
|
-
|
|
303
|
+
|
|
304
|
+
|
|
267
305
|
doneExpectation?.fulfill()
|
|
268
306
|
doneExpectation = nil
|
|
269
307
|
}
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift
CHANGED
|
@@ -2,8 +2,8 @@ import XCTest
|
|
|
2
2
|
|
|
3
3
|
enum RunnerInteractionOutcome {
|
|
4
4
|
case performed
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
7
|
case unsupported(message: String, hint: String?)
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -19,6 +19,27 @@ enum TvRemoteButton: String {
|
|
|
19
19
|
|
|
20
20
|
extension RunnerTests {
|
|
21
21
|
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
22
43
|
func resolveTvRemoteDoublePressDelay() -> TimeInterval {
|
|
23
44
|
guard
|
|
24
45
|
let raw = ProcessInfo.processInfo.environment["AGENT_DEVICE_TV_REMOTE_DOUBLE_PRESS_DELAY_MS"],
|
|
@@ -71,9 +92,9 @@ extension RunnerTests {
|
|
|
71
92
|
#else
|
|
72
93
|
let frame = element.frame
|
|
73
94
|
if !frame.isEmpty {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
77
98
|
return tapAt(app: app, x: frame.midX, y: frame.midY)
|
|
78
99
|
}
|
|
79
100
|
return performElementTap(element)
|