agent-device 0.21.24 → 0.21.25
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.25.apk +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.25.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.24.manifest.json → agent-device-android-ime-helper-0.21.25.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.25.manifest.json +16 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +159 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerHttpRequestFraming.swift +139 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerListenerPeer.swift +41 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerListenerToken.swift +25 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Environment.swift +18 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +25 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedTextEntry.swift +0 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +1 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +59 -26
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +47 -103
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +142 -54
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift +4 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +21 -19
- package/dist/src/absence-observation-errors.js +1 -0
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb-executor.js +2 -2
- package/dist/src/adb-failure.js +2 -2
- package/dist/src/agent-browser-lifecycle.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/android-adb.js +1 -1
- package/dist/src/android-input-ownership.js +1 -1
- package/dist/src/android-system-surface-disclosure.js +1 -0
- package/dist/src/android-text-entry.js +1 -0
- package/dist/src/android.js +1 -1
- package/dist/src/app-backend.js +1 -1
- package/dist/src/app-helpers.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +4 -3
- package/dist/src/app-lifecycle2.js +2 -2
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-reconnect.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-resolution-facade.js +1 -1
- package/dist/src/app-resolution.js +2 -2
- package/dist/src/apple-runner-platform.js +1 -1
- package/dist/src/artifact-download.js +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/aws-device-farm-connection.js +1 -1
- package/dist/src/back-mode.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/browserstack-connection.js +1 -1
- package/dist/src/capture-disclosure.js +1 -0
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +17 -14
- package/dist/src/cli-output.js +1 -1
- package/dist/src/cli-runner.js +3 -1
- package/dist/src/cli.js +3 -3
- package/dist/src/client-companion-tunnel.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +8 -2
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/code-signature.js +1 -1
- package/dist/src/command-metadata.js +73 -1
- package/dist/src/command-policy.js +1 -0
- package/dist/src/command-schema.js +3 -3
- package/dist/src/command-surface.js +1 -1
- package/dist/src/command-tools.js +2 -2
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection-verification.js +1 -1
- package/dist/src/connection.js +3 -3
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-lease-beat.js +1 -1
- package/dist/src/daemon-client-lifecycle.js +1 -1
- package/dist/src/daemon-client-liveness-probe.js +1 -1
- package/dist/src/daemon-policy-file.js +1 -1
- package/dist/src/daemon-registration-owner.js +1 -1
- package/dist/src/daemon-registration.js +1 -1
- package/dist/src/daemon-resolution.js +3 -1
- package/dist/src/debug-symbols-facade.js +1 -1
- package/dist/src/device-claim-inspection.js +1 -1
- package/dist/src/device-input-state.d.ts +5 -3
- package/dist/src/device-inventory-context.js +1 -1
- package/dist/src/device-readiness-runtime.js +1 -1
- package/dist/src/device-release.js +1 -1
- package/dist/src/device-shell.js +1 -1
- package/dist/src/device.js +3 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -1
- package/dist/src/durable-resource.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/expo-dev-client-launch.js +1 -0
- package/dist/src/file.js +3 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/generic-settle.js +1 -1
- package/dist/src/generic.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.js +1 -1
- package/dist/src/ime-rebind.js +1 -1
- package/dist/src/ime-state.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-source-network-transport.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-error.js +1 -0
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-catalog.js +1 -1
- package/dist/src/interactor.js +5 -5
- package/dist/src/interactor2.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +5 -1
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/inventory.js +2 -2
- package/dist/src/inventory6.js +1 -1
- package/dist/src/io.d.ts +2 -2
- package/dist/src/ios-client.js +1 -1
- package/dist/src/ios-settings.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-adapter.js +1 -1
- package/dist/src/ios-snapshot-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/keyed-lock.js +1 -1
- package/dist/src/launch-confirmation.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 +2 -10
- package/dist/src/limrun.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/load.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/log-stream.js +9 -9
- package/dist/src/mechanics.js +16 -16
- package/dist/src/metro.js +1 -1
- package/dist/src/metro2.js +1 -1
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/observability.js +1 -1
- package/dist/src/open-target-resolution.js +1 -1
- package/dist/src/output-path.js +1 -1
- package/dist/src/overlay.js +1 -3
- package/dist/src/perf-facade.js +1 -1
- package/dist/src/perf-runtime-operation-builder.js +1 -1
- package/dist/src/perf-runtime.js +1 -1
- package/dist/src/physical-device-control.js +1 -1
- package/dist/src/platform-request-scope.js +1 -1
- package/dist/src/platform-runtime-android-adb-host.js +1 -1
- package/dist/src/platform-runtime-app-log-android-transport.js +1 -1
- package/dist/src/platform-runtime-apple-resources.js +1 -0
- package/dist/src/platform-runtime-claim-recovery.js +1 -0
- package/dist/src/platform-runtime-daemon-services.js +1 -0
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-network-web-transport.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 +2 -2
- package/dist/src/platform-runtime-screen-recording-android-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-runner-transport.js +1 -1
- package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-harmony-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-web-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/plugin.js +1 -1
- package/dist/src/png-crop-bytes.js +1 -1
- package/dist/src/png-resize.js +1 -0
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/png-worker-contract.js +1 -1
- package/dist/src/process-entry.js +1 -1
- package/dist/src/process.js +1 -1
- package/dist/src/provider-credential-fingerprint.js +1 -1
- package/dist/src/provider-device-admission.js +1 -1
- package/dist/src/provider-policy.js +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/proxy.js +2 -2
- package/dist/src/quality-warnings.js +1 -1
- package/dist/src/react-native-overlay2.js +3 -0
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/recording.js +2 -2
- package/dist/src/register-builtins.js +1 -1
- package/dist/src/remote-config-core.js +1 -1
- package/dist/src/replay-backend-registry.js +1 -0
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay-maestro-backend.js +117 -0
- package/dist/src/replay-script-selection.js +1 -0
- package/dist/src/replay.js +1 -3
- package/dist/src/replay2.js +1 -0
- package/dist/src/reporting.js +3 -3
- package/dist/src/request-cancel.js +1 -1
- package/dist/src/request-providers.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-retention.js +1 -1
- package/dist/src/runner-cache-trim.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-device-set.js +1 -1
- package/dist/src/runner-error-classification.js +3 -3
- package/dist/src/runner-exchange.js +1 -1
- package/dist/src/runner-lease.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-retention.js +1 -0
- package/dist/src/runner-start-budget.js +1 -1
- package/dist/src/runner-startup-transport.js +1 -0
- package/dist/src/runner-toolchain-probe.js +1 -1
- package/dist/src/runner.js +2 -1
- package/dist/src/runtime-command-surface.js +1 -0
- package/dist/src/runtime-deployment.js +1 -1
- package/dist/src/runtime-factory.js +1 -0
- package/dist/src/runtime-session.js +1 -0
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +2 -1
- package/dist/src/runtime10.js +2 -1
- package/dist/src/runtime2.js +5 -2
- package/dist/src/runtime3.js +1 -5
- package/dist/src/runtime4.js +5 -1
- package/dist/src/runtime5.js +1 -5
- 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/screenshot-image.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -0
- package/dist/src/screenshot3.js +5 -5
- package/dist/src/sdk-batch-runner.js +2 -2
- package/dist/src/sdk-batch.js +1 -1
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-io.d.ts +4 -2
- package/dist/src/sdk-selectors.d.ts +4 -5
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-pipeline-policy.js +1 -1
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/server.js +2 -2
- package/dist/src/session-allocation.js +1 -1
- package/dist/src/session-replay-runtime-failure-response.js +1 -0
- package/dist/src/session-runtime-admission.js +1 -0
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -1
- package/dist/src/simctl-settings.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-chrome.js +1 -0
- package/dist/src/snapshot-desktop-projection.js +1 -1
- package/dist/src/snapshot-evidence.js +1 -0
- package/dist/src/snapshot-node-lookup.js +1 -0
- package/dist/src/snapshot-occlusion.js +1 -0
- package/dist/src/snapshot-quality-verdict.js +1 -0
- 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/snapshot.js +1 -1
- package/dist/src/snapshot2.js +1 -1
- package/dist/src/snapshot3.js +1 -1
- package/dist/src/src.js +5 -1
- package/dist/src/src2.js +1 -1
- package/dist/src/src3.js +2 -1
- package/dist/src/store.js +1 -1
- package/dist/src/surface-snapshot2.js +1 -1
- package/dist/src/target-evidence-tree.js +1 -0
- package/dist/src/target-evidence.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/tool-provider2.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/touch-runtime2.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/undici.js +8 -8
- package/dist/src/update-check.js +1 -1
- package/dist/src/vars.js +2 -0
- package/dist/src/version.js +1 -1
- package/dist/src/video.js +2 -2
- package/dist/src/wait.js +1 -0
- package/dist/src/web.js +1 -1
- package/dist/src/web2.js +1 -1
- package/package.json +9 -11
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.24.apk +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.24.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.24.manifest.json +0 -16
- package/dist/src/adb-transport.js +0 -1
- package/dist/src/alert-runtime.js +0 -1
- package/dist/src/app-deployment-resolution.js +0 -2
- package/dist/src/app-inventory-contract.js +0 -1
- package/dist/src/app-log-session-resource.js +0 -1
- package/dist/src/application-lifecycle-runtime.js +0 -1
- package/dist/src/auth-session.js +0 -1
- package/dist/src/browserstack-device-features.js +0 -1
- package/dist/src/browserstack.js +0 -1
- package/dist/src/cache.js +0 -1
- package/dist/src/capture.js +0 -1
- package/dist/src/catalog.js +0 -1
- package/dist/src/click-button.js +0 -1
- package/dist/src/client-metro-companion.js +0 -1
- package/dist/src/client-options.js +0 -3
- package/dist/src/daemon-client-transport.js +0 -1
- package/dist/src/daemon-http.js +0 -1
- package/dist/src/device-rotation.js +0 -1
- package/dist/src/device-session.js +0 -3
- package/dist/src/device2.js +0 -1
- package/dist/src/device3.js +0 -3
- package/dist/src/dispatch-resolve.js +0 -4
- package/dist/src/format.js +0 -2
- package/dist/src/gesture-plan-types.js +0 -1
- package/dist/src/host.js +0 -1
- package/dist/src/ime-settings-record.js +0 -1
- package/dist/src/interaction-ref-policy.js +0 -1
- package/dist/src/interactor-operation-binding.js +0 -1
- package/dist/src/keyboard-actions.js +0 -1
- package/dist/src/lease-context.js +0 -1
- package/dist/src/lease-registry-scope.js +0 -1
- package/dist/src/lease-scope.js +0 -1
- package/dist/src/managed-device-scope.js +0 -1
- package/dist/src/manifest.js +0 -1
- package/dist/src/observe-until.js +0 -1
- package/dist/src/output-common.js +0 -5
- package/dist/src/owner-identity.js +0 -3
- package/dist/src/path-resolution.js +0 -1
- package/dist/src/perf-runtime-plan.js +0 -1
- package/dist/src/platform-runtime-app-log-process.js +0 -1
- package/dist/src/platform-runtime-managed-owner.js +0 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +0 -1
- package/dist/src/png.js +0 -1
- package/dist/src/provider-session-ownership.js +0 -2
- package/dist/src/providers.js +0 -1
- package/dist/src/registry.js +0 -68
- package/dist/src/remote-connection-state.js +0 -1
- package/dist/src/request-admission.js +0 -1
- package/dist/src/request-cancellation.js +0 -1
- package/dist/src/request-progress-protocol.js +0 -1
- package/dist/src/runner-cache-metadata.js +0 -2
- package/dist/src/runner-disposal.js +0 -1
- package/dist/src/runner-session-types.js +0 -1
- package/dist/src/runtime-admission.js +0 -1
- package/dist/src/runtime11.js +0 -2
- package/dist/src/screen-recording-resource-recovery.js +0 -1
- package/dist/src/screenshot-result.js +0 -1
- package/dist/src/script.js +0 -1
- package/dist/src/scroll-command.js +0 -1
- package/dist/src/scroll-gesture.js +0 -1
- package/dist/src/scroll-indicator.js +0 -1
- package/dist/src/session-artifact-paths.js +0 -1
- package/dist/src/session-paths.js +0 -1
- package/dist/src/session-repair-tombstone.js +0 -1
- package/dist/src/session-snapshot.js +0 -1
- package/dist/src/snapshot-private-evidence.js +0 -1
- package/dist/src/snapshot4.js +0 -1
- package/dist/src/src4.js +0 -1
- package/dist/src/src5.js +0 -1
- package/dist/src/src6.js +0 -1
- package/dist/src/src7.js +0 -2
- package/dist/src/src8.js +0 -115
- package/dist/src/string-enum.js +0 -1
- package/dist/src/success-text.js +0 -1
- package/dist/src/transport.js +0 -3
- package/dist/src/ttl-memo.js +0 -1
- package/dist/src/verified-file.js +0 -1
- package/dist/src/window-state.js +0 -1
- /package/dist/src/{doctor-output.js → doctor-lines.js} +0 -0
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift
CHANGED
|
@@ -342,13 +342,12 @@ extension RunnerTests {
|
|
|
342
342
|
)
|
|
343
343
|
}
|
|
344
344
|
let verifyStartedAt = Date()
|
|
345
|
-
var result
|
|
346
|
-
|
|
347
|
-
target: activeTarget,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
)
|
|
345
|
+
var result: TextEntryResult
|
|
346
|
+
if repairMode == .replacement {
|
|
347
|
+
result = observeReplacementTextEntry(app: app, target: activeTarget, requested: text, baseline: entryBaseline)
|
|
348
|
+
} else {
|
|
349
|
+
result = verifyAppendTextEntryWithRepairIfNeeded(app: app, target: activeTarget, expectedText: expectedText)
|
|
350
|
+
}
|
|
352
351
|
logTextEntryPhase(
|
|
353
352
|
commandId: commandId,
|
|
354
353
|
phase: "verify",
|
|
@@ -389,12 +388,39 @@ extension RunnerTests {
|
|
|
389
388
|
}
|
|
390
389
|
}
|
|
391
390
|
|
|
392
|
-
private func
|
|
391
|
+
private func observeReplacementTextEntry(
|
|
393
392
|
app: XCUIApplication,
|
|
394
393
|
target: TextEntryTarget,
|
|
395
|
-
|
|
396
|
-
repairMode: TextTypingRepairMode,
|
|
394
|
+
requested: String,
|
|
397
395
|
baseline: TextEntryObservation?
|
|
396
|
+
) -> TextEntryResult {
|
|
397
|
+
var confirmation = ReplacementTextEntryConfirmation(requested: requested, baseline: baseline, startedAt: Date())
|
|
398
|
+
while true {
|
|
399
|
+
guard let element = resolveTextEntryElement(app: app, target: target) else {
|
|
400
|
+
let failure: TextEntryFailure? = target.boundIdentity != nil && !boundTextEntryInputIsGone(app: app, target: target)
|
|
401
|
+
? .commitNotObserved : nil
|
|
402
|
+
if target.boundIdentity != nil && failure == nil {
|
|
403
|
+
NSLog("AGENT_DEVICE_RUNNER_TEXT_ENTRY_INPUT_REMOVED_AFTER_DELIVERY")
|
|
404
|
+
}
|
|
405
|
+
return TextEntryResult(verified: nil, repaired: false, expectedText: requested, observedText: nil, failure: failure)
|
|
406
|
+
}
|
|
407
|
+
guard let observed = textEntryObservation(for: element) else {
|
|
408
|
+
return TextEntryResult(verified: nil, repaired: false, expectedText: requested, observedText: nil)
|
|
409
|
+
}
|
|
410
|
+
if let result = confirmation.observe(observed, at: Date()) {
|
|
411
|
+
if result.unconfirmed != nil {
|
|
412
|
+
NSLog("AGENT_DEVICE_RUNNER_TEXT_ENTRY_UNCONFIRMED expectedLength=%d observedLength=%d repaired=0", requested.count, observed.value.count)
|
|
413
|
+
}
|
|
414
|
+
return result
|
|
415
|
+
}
|
|
416
|
+
sleepFor(TextEntryTiming.pollInterval)
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
private func verifyAppendTextEntryWithRepairIfNeeded(
|
|
421
|
+
app: XCUIApplication,
|
|
422
|
+
target: TextEntryTarget,
|
|
423
|
+
expectedText: String?
|
|
398
424
|
) -> TextEntryResult {
|
|
399
425
|
if target.boundIdentity != nil, resolveTextEntryElement(app: app, target: target) == nil {
|
|
400
426
|
guard boundTextEntryInputIsGone(app: app, target: target) else {
|
|
@@ -417,27 +443,16 @@ extension RunnerTests {
|
|
|
417
443
|
expectedText: expectedText,
|
|
418
444
|
repaired: false
|
|
419
445
|
)
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
if let unconfirmed = settledUnconfirmedTextEntry(
|
|
423
|
-
app: app,
|
|
424
|
-
target: target,
|
|
425
|
-
result: initialResult,
|
|
426
|
-
baseline: baseline
|
|
427
|
-
) {
|
|
428
|
-
return unconfirmed
|
|
429
|
-
}
|
|
430
446
|
#if os(iOS)
|
|
431
447
|
guard initialResult.verified == false,
|
|
432
448
|
let expectedText = initialResult.expectedText
|
|
433
449
|
else {
|
|
434
450
|
return initialResult
|
|
435
451
|
}
|
|
436
|
-
guard
|
|
452
|
+
guard shouldRepairAppendTextEntry(
|
|
437
453
|
app: app,
|
|
438
454
|
target: target,
|
|
439
|
-
expectedText: expectedText
|
|
440
|
-
repairMode: repairMode
|
|
455
|
+
expectedText: expectedText
|
|
441
456
|
) else {
|
|
442
457
|
return verifyTextEntry(
|
|
443
458
|
app: app,
|
|
@@ -474,76 +489,12 @@ extension RunnerTests {
|
|
|
474
489
|
expectedText: expectedText,
|
|
475
490
|
repaired: true
|
|
476
491
|
)
|
|
477
|
-
return
|
|
478
|
-
app: app,
|
|
479
|
-
target: repairedTarget,
|
|
480
|
-
result: repairedResult,
|
|
481
|
-
baseline: baseline
|
|
482
|
-
) ?? repairedResult
|
|
492
|
+
return repairedResult
|
|
483
493
|
#else
|
|
484
494
|
return initialResult
|
|
485
495
|
#endif
|
|
486
496
|
}
|
|
487
497
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
private func settledUnconfirmedTextEntry(
|
|
491
|
-
app: XCUIApplication,
|
|
492
|
-
target: TextEntryTarget,
|
|
493
|
-
result: TextEntryResult,
|
|
494
|
-
baseline: TextEntryObservation?
|
|
495
|
-
) -> TextEntryResult? {
|
|
496
|
-
guard result.verified == false, let requested = result.expectedText, let baseline else {
|
|
497
|
-
return nil
|
|
498
|
-
}
|
|
499
|
-
func observe() -> TextEntryObservation? {
|
|
500
|
-
textEntryObservation(for: resolveTextEntryElement(app: app, target: target))
|
|
501
|
-
}
|
|
502
|
-
func evidence(_ observed: TextEntryObservation?) -> TextEntryUnconfirmedEvidence? {
|
|
503
|
-
Self.unconfirmedTextEntryEvidence(requested: requested, baseline: baseline, observed: observed)
|
|
504
|
-
}
|
|
505
|
-
let moveDeadline = Date().addingTimeInterval(TextEntryTiming.unconfirmedSettleCeiling)
|
|
506
|
-
var latest = observe()
|
|
507
|
-
while let unmoved = latest, unmoved.isSettled(with: baseline), Date() < moveDeadline {
|
|
508
|
-
sleepFor(TextEntryTiming.pollInterval)
|
|
509
|
-
latest = observe()
|
|
510
|
-
}
|
|
511
|
-
guard evidence(latest) != nil else {
|
|
512
|
-
return nil
|
|
513
|
-
}
|
|
514
|
-
let ceiling = Date().addingTimeInterval(TextEntryTiming.unconfirmedSettleCeiling)
|
|
515
|
-
var stableSince = Date()
|
|
516
|
-
while Date().timeIntervalSince(stableSince) < TextEntryTiming.verificationStabilityWindow {
|
|
517
|
-
guard Date() < ceiling else {
|
|
518
|
-
return nil
|
|
519
|
-
}
|
|
520
|
-
sleepFor(TextEntryTiming.pollInterval)
|
|
521
|
-
let next = observe()
|
|
522
|
-
if let next, let settled = latest, next.isSettled(with: settled) {
|
|
523
|
-
latest = next
|
|
524
|
-
continue
|
|
525
|
-
}
|
|
526
|
-
latest = next
|
|
527
|
-
stableSince = Date()
|
|
528
|
-
}
|
|
529
|
-
guard let unconfirmed = evidence(latest) else {
|
|
530
|
-
return nil
|
|
531
|
-
}
|
|
532
|
-
NSLog(
|
|
533
|
-
"AGENT_DEVICE_RUNNER_TEXT_ENTRY_UNCONFIRMED expectedLength=%d observedLength=%d repaired=%d",
|
|
534
|
-
requested.count,
|
|
535
|
-
unconfirmed.after.count,
|
|
536
|
-
result.repaired ? 1 : 0
|
|
537
|
-
)
|
|
538
|
-
return TextEntryResult(
|
|
539
|
-
verified: nil,
|
|
540
|
-
repaired: result.repaired,
|
|
541
|
-
expectedText: requested,
|
|
542
|
-
observedText: unconfirmed.after,
|
|
543
|
-
unconfirmed: unconfirmed
|
|
544
|
-
)
|
|
545
|
-
}
|
|
546
|
-
|
|
547
498
|
private func verifyTextEntry(
|
|
548
499
|
app: XCUIApplication,
|
|
549
500
|
target: TextEntryTarget,
|
|
@@ -631,11 +582,10 @@ extension RunnerTests {
|
|
|
631
582
|
}
|
|
632
583
|
}
|
|
633
584
|
|
|
634
|
-
private func
|
|
585
|
+
private func shouldRepairAppendTextEntry(
|
|
635
586
|
app: XCUIApplication,
|
|
636
587
|
target: TextEntryTarget,
|
|
637
|
-
expectedText: String
|
|
638
|
-
repairMode: TextTypingRepairMode
|
|
588
|
+
expectedText: String
|
|
639
589
|
) -> Bool {
|
|
640
590
|
#if os(iOS)
|
|
641
591
|
var latestObservedText: String?
|
|
@@ -652,10 +602,9 @@ extension RunnerTests {
|
|
|
652
602
|
return false
|
|
653
603
|
}
|
|
654
604
|
latestObservedText = observedText
|
|
655
|
-
if !
|
|
605
|
+
if !isRepairableAppendTextEntryMismatch(
|
|
656
606
|
observedText: observedText,
|
|
657
|
-
expectedText: expectedText
|
|
658
|
-
repairMode: repairMode
|
|
607
|
+
expectedText: expectedText
|
|
659
608
|
) {
|
|
660
609
|
return false
|
|
661
610
|
}
|
|
@@ -672,27 +621,22 @@ extension RunnerTests {
|
|
|
672
621
|
) else {
|
|
673
622
|
return false
|
|
674
623
|
}
|
|
675
|
-
return
|
|
624
|
+
return isRepairableAppendTextEntryMismatch(
|
|
676
625
|
observedText: latestObservedText,
|
|
677
|
-
expectedText: expectedText
|
|
678
|
-
repairMode: repairMode
|
|
626
|
+
expectedText: expectedText
|
|
679
627
|
)
|
|
680
628
|
#else
|
|
681
629
|
return false
|
|
682
630
|
#endif
|
|
683
631
|
}
|
|
684
632
|
|
|
685
|
-
private func
|
|
633
|
+
private func isRepairableAppendTextEntryMismatch(
|
|
686
634
|
observedText: String,
|
|
687
|
-
expectedText: String
|
|
688
|
-
repairMode: TextTypingRepairMode
|
|
635
|
+
expectedText: String
|
|
689
636
|
) -> Bool {
|
|
690
637
|
guard observedText != expectedText else {
|
|
691
638
|
return false
|
|
692
639
|
}
|
|
693
|
-
if repairMode == .replacement {
|
|
694
|
-
return true
|
|
695
|
-
}
|
|
696
640
|
return observedText.isEmpty || isLikelyDroppedCharacterTextEntryMismatch(
|
|
697
641
|
observedText: observedText,
|
|
698
642
|
expectedText: expectedText
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift
CHANGED
|
@@ -4,43 +4,119 @@ import Network
|
|
|
4
4
|
extension RunnerTests {
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
static let requestTimeout: TimeInterval = 30
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
7
13
|
func handle(connection: NWConnection) {
|
|
8
|
-
|
|
14
|
+
guard let token = listenerToken else {
|
|
15
|
+
connection.cancel()
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
connection.stateUpdateHandler = { [weak self] state in
|
|
19
|
+
switch state {
|
|
20
|
+
case .ready:
|
|
21
|
+
connection.stateUpdateHandler = nil
|
|
22
|
+
self?.admit(connection, token: token)
|
|
23
|
+
case .failed:
|
|
24
|
+
connection.cancel()
|
|
25
|
+
default:
|
|
26
|
+
break
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
connection.start(queue: transportQueue)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private func admit(_ connection: NWConnection, token: RunnerListenerToken) {
|
|
33
|
+
let peer = RunnerListenerPeer.of(connection)
|
|
34
|
+
guard peer != .directNetwork else {
|
|
35
|
+
connection.cancel()
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
let inbound = RunnerInboundRequest(token: token)
|
|
39
|
+
if peer == .tunnel {
|
|
40
|
+
armDeadline(for: inbound, over: connection)
|
|
41
|
+
}
|
|
42
|
+
receiveRequest(inbound, over: connection)
|
|
9
43
|
}
|
|
10
44
|
|
|
11
45
|
|
|
12
46
|
|
|
13
|
-
private func receiveRequest(
|
|
14
|
-
connection.receive(minimumIncompleteLength: 1, maximumLength:
|
|
15
|
-
|
|
47
|
+
private func receiveRequest(_ inbound: RunnerInboundRequest, over connection: NWConnection) {
|
|
48
|
+
connection.receive(minimumIncompleteLength: 1, maximumLength: 64 * 1024) {
|
|
49
|
+
[weak self] data, _, isComplete, error in
|
|
50
|
+
guard let self, !inbound.closed else { return }
|
|
51
|
+
if let data, !data.isEmpty {
|
|
52
|
+
self.consume(data, for: inbound, over: connection)
|
|
53
|
+
} else if error != nil || isComplete {
|
|
54
|
+
inbound.close()
|
|
16
55
|
connection.cancel()
|
|
17
|
-
|
|
56
|
+
} else {
|
|
57
|
+
self.receiveRequest(inbound, over: connection)
|
|
18
58
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private func consume(_ data: Data, for inbound: RunnerInboundRequest, over connection: NWConnection) {
|
|
63
|
+
if inbound.deadline == nil {
|
|
64
|
+
armDeadline(for: inbound, over: connection)
|
|
65
|
+
}
|
|
66
|
+
let alreadyScanned = inbound.buffer.count
|
|
67
|
+
inbound.buffer.append(data)
|
|
68
|
+
if inbound.head == nil {
|
|
69
|
+
switch RunnerHttpRequestFraming.admitHead(
|
|
70
|
+
inbound.buffer,
|
|
71
|
+
token: inbound.token,
|
|
72
|
+
alreadyScanned: alreadyScanned
|
|
73
|
+
) {
|
|
74
|
+
case .incomplete:
|
|
75
|
+
receiveRequest(inbound, over: connection)
|
|
31
76
|
return
|
|
77
|
+
case .rejected(let rejection):
|
|
78
|
+
reject(inbound, with: rejection, over: connection)
|
|
79
|
+
return
|
|
80
|
+
case .admitted(let head):
|
|
81
|
+
inbound.head = head
|
|
32
82
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
83
|
+
}
|
|
84
|
+
guard let head = inbound.head else { return }
|
|
85
|
+
let bodyEnd = head.bodyOffset + head.contentLength
|
|
86
|
+
guard inbound.buffer.count >= bodyEnd else {
|
|
87
|
+
receiveRequest(inbound, over: connection)
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
inbound.close()
|
|
91
|
+
let body = inbound.buffer.subdata(in: head.bodyOffset..<bodyEnd)
|
|
92
|
+
handleRequestBody(body) { [weak self] result in
|
|
93
|
+
self?.sendResult(result, over: connection)
|
|
41
94
|
}
|
|
42
95
|
}
|
|
43
96
|
|
|
97
|
+
private func armDeadline(for inbound: RunnerInboundRequest, over connection: NWConnection) {
|
|
98
|
+
let deadline = DispatchWorkItem { [weak self, inbound] in
|
|
99
|
+
guard let self, !inbound.closed else { return }
|
|
100
|
+
self.reject(inbound, with: .timedOut, over: connection)
|
|
101
|
+
}
|
|
102
|
+
inbound.deadline = deadline
|
|
103
|
+
transportQueue.asyncAfter(deadline: .now() + Self.requestTimeout, execute: deadline)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
private func reject(
|
|
107
|
+
_ inbound: RunnerInboundRequest,
|
|
108
|
+
with rejection: RunnerHttpRequestRejection,
|
|
109
|
+
over connection: NWConnection
|
|
110
|
+
) {
|
|
111
|
+
inbound.close()
|
|
112
|
+
NSLog("AGENT_DEVICE_RUNNER_REQUEST_REJECTED status=%d", rejection.status)
|
|
113
|
+
let response = jsonResponse(
|
|
114
|
+
status: rejection.status,
|
|
115
|
+
response: errorResponse(code: rejection.code, message: rejection.message)
|
|
116
|
+
)
|
|
117
|
+
sendResponse(response, over: connection)
|
|
118
|
+
}
|
|
119
|
+
|
|
44
120
|
private func sendResult(
|
|
45
121
|
_ result: (data: Data, shouldFinish: Bool),
|
|
46
122
|
over connection: NWConnection
|
|
@@ -66,34 +142,6 @@ extension RunnerTests {
|
|
|
66
142
|
})
|
|
67
143
|
}
|
|
68
144
|
|
|
69
|
-
private func parseRequest(data: Data) -> Data? {
|
|
70
|
-
guard let headerEnd = data.range(of: Data("\r\n\r\n".utf8)) else {
|
|
71
|
-
return nil
|
|
72
|
-
}
|
|
73
|
-
let headerData = data.subdata(in: 0..<headerEnd.lowerBound)
|
|
74
|
-
let bodyStart = headerEnd.upperBound
|
|
75
|
-
let headers = String(decoding: headerData, as: UTF8.self)
|
|
76
|
-
let contentLength = extractContentLength(headers: headers)
|
|
77
|
-
guard let contentLength = contentLength else {
|
|
78
|
-
return nil
|
|
79
|
-
}
|
|
80
|
-
if data.count < bodyStart + contentLength {
|
|
81
|
-
return nil
|
|
82
|
-
}
|
|
83
|
-
let body = data.subdata(in: bodyStart..<(bodyStart + contentLength))
|
|
84
|
-
return body
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
private func extractContentLength(headers: String) -> Int? {
|
|
88
|
-
for line in headers.split(separator: "\r\n") {
|
|
89
|
-
let parts = line.split(separator: ":", maxSplits: 1).map { $0.trimmingCharacters(in: .whitespaces) }
|
|
90
|
-
if parts.count == 2 && parts[0].lowercased() == "content-length" {
|
|
91
|
-
return Int(parts[1])
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return nil
|
|
95
|
-
}
|
|
96
|
-
|
|
97
145
|
private func handleRequestBody(
|
|
98
146
|
_ body: Data,
|
|
99
147
|
completion: @escaping @Sendable ((data: Data, shouldFinish: Bool)) -> Void
|
|
@@ -297,9 +345,10 @@ extension RunnerTests {
|
|
|
297
345
|
|
|
298
346
|
private func httpResponse(status: Int, body: String) -> Data {
|
|
299
347
|
let headers = [
|
|
300
|
-
"HTTP/1.1 \(status)
|
|
348
|
+
"HTTP/1.1 \(status) \(Self.reasonPhrase(status))",
|
|
301
349
|
"Content-Type: application/json",
|
|
302
350
|
"Content-Length: \(body.utf8.count)",
|
|
351
|
+
"\(Self.authEnforcedResponseHeader): required",
|
|
303
352
|
"Connection: close",
|
|
304
353
|
"",
|
|
305
354
|
body
|
|
@@ -307,6 +356,24 @@ extension RunnerTests {
|
|
|
307
356
|
return Data(headers.utf8)
|
|
308
357
|
}
|
|
309
358
|
|
|
359
|
+
|
|
360
|
+
static let authEnforcedResponseHeader = "X-Agent-Device-Runner-Auth"
|
|
361
|
+
|
|
362
|
+
private static func reasonPhrase(_ status: Int) -> String {
|
|
363
|
+
switch status {
|
|
364
|
+
case 200: return "OK"
|
|
365
|
+
case 400: return "Bad Request"
|
|
366
|
+
case 401: return "Unauthorized"
|
|
367
|
+
case 404: return "Not Found"
|
|
368
|
+
case 405: return "Method Not Allowed"
|
|
369
|
+
case 408: return "Request Timeout"
|
|
370
|
+
case 411: return "Length Required"
|
|
371
|
+
case 413: return "Content Too Large"
|
|
372
|
+
case 431: return "Request Header Fields Too Large"
|
|
373
|
+
default: return "Internal Server Error"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
310
377
|
private func finish() {
|
|
311
378
|
listener?.cancel()
|
|
312
379
|
listener = nil
|
|
@@ -316,3 +383,24 @@ extension RunnerTests {
|
|
|
316
383
|
doneExpectation = nil
|
|
317
384
|
}
|
|
318
385
|
}
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
final class RunnerInboundRequest {
|
|
389
|
+
let token: RunnerListenerToken
|
|
390
|
+
var buffer = Data()
|
|
391
|
+
var head: RunnerHttpAdmittedHead?
|
|
392
|
+
var deadline: DispatchWorkItem?
|
|
393
|
+
private(set) var closed = false
|
|
394
|
+
|
|
395
|
+
init(token: RunnerListenerToken) {
|
|
396
|
+
self.token = token
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
func close() {
|
|
402
|
+
closed = true
|
|
403
|
+
deadline?.cancel()
|
|
404
|
+
deadline = nil
|
|
405
|
+
}
|
|
406
|
+
}
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TypeExecution.swift
CHANGED
|
@@ -108,7 +108,10 @@ extension RunnerTests {
|
|
|
108
108
|
ok: false,
|
|
109
109
|
error: ErrorPayload(
|
|
110
110
|
code: "TEXT_ENTRY_MISMATCH",
|
|
111
|
-
message: "text entry
|
|
111
|
+
message: "text entry read-back did not match: expected \"\(expected)\", observed \"\(observed)\"",
|
|
112
|
+
hint: textEntryMode == .replacement
|
|
113
|
+
? "The app may have formatted, filtered, or consumed the entry. Inspect the field or resulting screen before retrying. If it needs correction, retry fill with the full text and --delay-ms \(TextEntryTiming.recoveryDelayMilliseconds)."
|
|
114
|
+
: nil
|
|
112
115
|
)
|
|
113
116
|
)
|
|
114
117
|
}
|
|
@@ -50,6 +50,7 @@ final class RunnerTests: XCTestCase {
|
|
|
50
50
|
}()
|
|
51
51
|
static let defaultRecordingFps: Int32 = 15
|
|
52
52
|
var listener: NWListener?
|
|
53
|
+
var listenerToken: RunnerListenerToken?
|
|
53
54
|
var doneExpectation: XCTestExpectation?
|
|
54
55
|
let transportQueue = DispatchQueue(label: "agent-device.runner.transport")
|
|
55
56
|
let commandExecutionQueue = DispatchQueue(label: "agent-device.runner.commands")
|
|
@@ -64,7 +65,6 @@ final class RunnerTests: XCTestCase {
|
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
var textEntryTapWitness: TextEntryTapWitness?
|
|
67
|
-
let maxRequestBytes = 2 * 1024 * 1024
|
|
68
68
|
static let mainThreadExecutionTimeout: TimeInterval = 30
|
|
69
69
|
let appExistenceTimeout: TimeInterval = 30
|
|
70
70
|
let retryCooldown: TimeInterval = 0.2
|
|
@@ -291,9 +291,15 @@ final class RunnerTests: XCTestCase {
|
|
|
291
291
|
func testCommand() throws {
|
|
292
292
|
doneExpectation = expectation(description: "agent-device command handled")
|
|
293
293
|
NSLog("AGENT_DEVICE_RUNNER_HEADLESS_STARTUP=1")
|
|
294
|
-
let
|
|
295
|
-
|
|
296
|
-
|
|
294
|
+
guard let configuration = RunnerListenerConfiguration.fromEnvironment() else {
|
|
295
|
+
NSLog("AGENT_DEVICE_RUNNER_LISTENER_CONFIGURATION_MISSING")
|
|
296
|
+
XCTFail("runner listener port or token is missing; refusing to listen")
|
|
297
|
+
return
|
|
298
|
+
}
|
|
299
|
+
listenerToken = configuration.token
|
|
300
|
+
NSLog("AGENT_DEVICE_RUNNER_AUTH=required")
|
|
301
|
+
NSLog("AGENT_DEVICE_RUNNER_DESIRED_PORT=%d", configuration.port.rawValue)
|
|
302
|
+
listener = try Self.makeRunnerListener(port: configuration.port)
|
|
297
303
|
listener?.stateUpdateHandler = { [weak self] state in
|
|
298
304
|
switch state {
|
|
299
305
|
case .ready:
|
|
@@ -311,9 +317,7 @@ final class RunnerTests: XCTestCase {
|
|
|
311
317
|
}
|
|
312
318
|
}
|
|
313
319
|
listener?.newConnectionHandler = { [weak self] conn in
|
|
314
|
-
|
|
315
|
-
conn.start(queue: self.transportQueue)
|
|
316
|
-
self.handle(connection: conn)
|
|
320
|
+
self?.handle(connection: conn)
|
|
317
321
|
}
|
|
318
322
|
listener?.start(queue: transportQueue)
|
|
319
323
|
let idleKeepaliveTimer = DispatchSource.makeTimerSource(queue: transportQueue)
|
|
@@ -341,17 +345,15 @@ final class RunnerTests: XCTestCase {
|
|
|
341
345
|
}
|
|
342
346
|
}
|
|
343
347
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
return try NWListener(using: .tcp)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
static func makeRunnerListener(port: NWEndpoint.Port) throws -> NWListener {
|
|
351
|
+
#if targetEnvironment(simulator) || os(macOS)
|
|
352
|
+
let parameters = NWParameters.tcp
|
|
353
|
+
parameters.requiredLocalEndpoint = .hostPort(host: .ipv4(.loopback), port: port)
|
|
354
|
+
return try NWListener(using: parameters)
|
|
355
|
+
#else
|
|
356
|
+
return try NWListener(using: .tcp, on: port)
|
|
357
|
+
#endif
|
|
356
358
|
}
|
|
357
359
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e,P as t}from"./sdk-contracts.js";import{o as n,s as r}from"./back-mode.js";import{t as i}from"./interaction-error.js";function a(e,n=`is`){return new t(`INVALID_ARGS`,r(e,n),{command:n,predicate:`absent`,rejectedOption:e})}function o(e,r,a=`is`){let o=`firstMatch`in r?r.firstMatch:void 0,s={command:a,reason:i.predicateFailed,predicate:`absent`,selector:e,matches:r.matches,observation:r.kind,...o?{firstMatch:o}:{},...r.kind===`sparse`?{snapshotQuality:r.quality}:{},...r.kind===`truncated`?{truncated:!0}:{}};if(r.kind===`present`){let n=r.matches>1;return new t(`COMMAND_FAILED`,`${a} absent failed for selector ${e}: ${r.matches} match${n?`es`:``} found`,{...s,...n?{hint:`Refine the selector to match no elements.`}:{}})}return new t(`COMMAND_FAILED`,`${a} absent could not prove absence for selector ${e}: ${n[r.kind]}`,{...s,hint:`Retry after the accessibility capture is complete.`})}function s(n,r,a=`is`){let o=e(r),s=typeof o.details?.reason==`string`?o.details.reason:typeof o.details?.androidSnapshotHelperFailureReason==`string`?o.details.androidSnapshotHelperFailureReason:void 0;return new t(`COMMAND_FAILED`,`${a} absent could not prove absence for selector ${n}: capture was unreadable`,{command:a,reason:i.predicateFailed,predicate:`absent`,selector:n,matches:0,observation:`unreadable`,captureErrorCode:o.code,...s?{captureErrorReason:s}:{},hint:`Retry after the accessibility capture is readable.`},o)}export{o as n,s as r,a as t};
|