agent-device 0.21.37 → 0.21.38
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.37.apk → agent-device-android-ime-helper-0.21.38.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.38.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.37.manifest.json → agent-device-android-ime-helper-0.21.38.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.37.apk → agent-device-android-snapshot-helper-0.21.38.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.38.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.37.manifest.json → agent-device-android-snapshot-helper-0.21.38.manifest.json} +7 -7
- package/apple/fold-helper/Fold.m +8 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerKeyboardReturnKey.swift +53 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +42 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +26 -18
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +42 -11
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +123 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +7 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +570 -53
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +41 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +7 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +17 -1
- package/dist/src/THIRD_PARTY_NOTICES.txt +2 -2
- package/dist/src/absence-observation-errors.js +1 -1
- package/dist/src/absence-observation.js +1 -1
- package/dist/src/adapter.js +1 -1
- package/dist/src/adb-executor.js +1 -1
- package/dist/src/adb-failure.js +2 -2
- package/dist/src/adb-transport.js +1 -1
- 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/ai-sdk.d.ts +1 -1
- package/dist/src/ai-sdk.js +1 -1
- package/dist/src/alert-contract.js +1 -1
- package/dist/src/alert-tree-driver.js +1 -1
- package/dist/src/alert.js +1 -1
- package/dist/src/android-adb.d.ts +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/android2.js +1 -1
- package/dist/src/app-backend.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 +4 -4
- package/dist/src/app-lifecycle2.js +2 -2
- package/dist/src/app-log-files.js +1 -1
- package/dist/src/app-log-runtime2.js +2 -2
- package/dist/src/app-log-session-resource.js +1 -1
- package/dist/src/app-resolution.js +1 -1
- package/dist/src/app-state-read.js +1 -1
- package/dist/src/app-state-runtime.d.ts +1 -1
- package/dist/src/application-lifecycle-interaction.js +1 -1
- package/dist/src/archive.js +1 -1
- package/dist/src/args.js +1 -1
- package/dist/src/artifact-download.js +1 -1
- package/dist/src/artifact-tracking.js +1 -1
- package/dist/src/auth-session.js +1 -1
- package/dist/src/auth.js +1 -1
- package/dist/src/automation-helper-artifact.js +1 -1
- package/dist/src/automation-helper.js +1 -1
- package/dist/src/await-with-signal.js +1 -1
- package/dist/src/backend-snapshot-options.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/bridge-source.js +1 -1
- package/dist/src/browser-launch.js +1 -1
- package/dist/src/browserstack-device-features.js +1 -1
- package/dist/src/browserstack.js +1 -1
- package/dist/src/cache.js +1 -1
- package/dist/src/capture-disclosure.js +1 -1
- package/dist/src/capture-lifecycle.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +19 -16
- package/dist/src/cli-output.js +11 -11
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +2 -2
- 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-options.js +1 -1
- package/dist/src/client-port.d.ts +246 -208
- package/dist/src/clipboard-shell-response.js +1 -1
- package/dist/src/cloud-artifacts.d.ts +7 -2
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/command-schema.js +6 -4
- package/dist/src/command-tools.js +3 -3
- package/dist/src/command.js +1 -1
- package/dist/src/composed-inventory-gateways.js +1 -1
- package/dist/src/composite-resource-admission.js +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/connection-lease-transaction.js +1 -1
- package/dist/src/connection-metro-runtime.js +1 -1
- 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/context.js +1 -1
- package/dist/src/contract.d.ts +2 -1
- package/dist/src/contracts.d.ts +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-attach.js +1 -1
- package/dist/src/daemon-client-dispatch-disclosure.js +1 -1
- package/dist/src/daemon-client-ensure.js +1 -1
- package/dist/src/daemon-client-ensuring.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-client-remote-health-cache.js +1 -0
- package/dist/src/daemon-client-remote-health-recovery.js +1 -0
- package/dist/src/daemon-client-transport.js +1 -1
- package/dist/src/daemon-command-registry.js +1 -1
- package/dist/src/daemon-composition.js +1 -1
- package/dist/src/daemon-diagnostics-scope.js +1 -1
- package/dist/src/daemon-http.js +1 -1
- package/dist/src/daemon-launch-spec.js +1 -1
- package/dist/src/daemon-lifecycle-errors.js +1 -1
- package/dist/src/daemon-policy-file.js +1 -1
- package/dist/src/daemon-registration-owner.js +3 -3
- package/dist/src/daemon-registration.js +1 -1
- package/dist/src/daemon-resolution.js +1 -1
- package/dist/src/daemon-startup-diagnostics.js +1 -1
- package/dist/src/daemon-stop.js +1 -1
- package/dist/src/daemon.js +1 -1
- package/dist/src/debug-symbols-facade.js +3 -3
- package/dist/src/device-claim-admission.js +1 -0
- package/dist/src/device-claim-reconciliation.js +1 -0
- package/dist/src/device-claim-recovery.js +1 -1
- package/dist/src/device-claim-rule.js +1 -1
- package/dist/src/device-claims.js +1 -1
- package/dist/src/device-input-state.d.ts +1 -1
- package/dist/src/device-inventory-context.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/device.js +1 -1
- package/dist/src/device3.js +3 -3
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/discovery.js +1 -1
- package/dist/src/dispatch-resolve.js +1 -1
- package/dist/src/display-inventory.js +1 -1
- package/dist/src/doctor-facade.js +1 -1
- package/dist/src/doctor2.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -1
- package/dist/src/durable-capture.js +1 -1
- package/dist/src/durable-resource.js +1 -1
- package/dist/src/ended-lease.js +1 -1
- package/dist/src/engine-eval-script.js +1 -1
- package/dist/src/error.js +2 -2
- package/dist/src/errors.js +1 -1
- package/dist/src/explicit-session-resolution.js +1 -1
- package/dist/src/expo-dev-client-launch.js +1 -1
- package/dist/src/failure-output.js +1 -1
- package/dist/src/file.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/flag-registry.js +1 -1
- package/dist/src/focus-runtime.js +1 -1
- package/dist/src/fold-helper.js +1 -1
- package/dist/src/generic-settle.js +1 -1
- package/dist/src/generic.js +1 -1
- package/dist/src/gesture-admission.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/hdc.js +1 -1
- package/dist/src/helper-artifacts.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/host-file.js +1 -1
- package/dist/src/host.js +1 -1
- package/dist/src/host2.js +1 -1
- package/dist/src/host3.js +1 -1
- package/dist/src/host4.js +1 -1
- package/dist/src/host5.js +1 -1
- package/dist/src/host6.js +1 -1
- package/dist/src/human-control-contract.js +1 -1
- package/dist/src/human-control.js +1 -1
- package/dist/src/ime-rebind.js +1 -1
- package/dist/src/ime-settings-record.js +1 -1
- package/dist/src/ime-state.js +1 -1
- package/dist/src/index.d.ts +3 -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-error.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 +5 -5
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactor3.js +1 -1
- package/dist/src/interactor4.js +1 -1
- package/dist/src/interactor5.js +1 -1
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/companion-tunnel.js +1 -1
- package/dist/src/internal/daemon.js +1 -1
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/internal/run-script-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-node-interpretation.js +1 -1
- package/dist/src/ios-simulator-accessibility.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/launch-confirmation.js +1 -1
- package/dist/src/launch-services-registration.js +1 -1
- package/dist/src/lease-context.js +1 -1
- package/dist/src/lease-registry-scope.js +1 -1
- package/dist/src/lease-release2.js +1 -1
- package/dist/src/lease-scope.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/leased-recording-retention.js +1 -1
- package/dist/src/legacy.js +1 -1
- package/dist/src/limrun-download-file.js +1 -1
- package/dist/src/limrun-ios-files.js +1 -1
- package/dist/src/limrun-ios-runner.js +2 -2
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/limrun.d.ts +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/local-simulator-apps.js +1 -1
- package/dist/src/local-simulator-files.js +1 -1
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/manifest.js +1 -1
- package/dist/src/mechanics.js +12 -12
- package/dist/src/merge-flags.js +1 -1
- package/dist/src/metro-reload-endpoints.js +1 -1
- package/dist/src/metro-session-hints.js +1 -1
- package/dist/src/metro.d.ts +1 -1
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/network-traffic.js +1 -1
- package/dist/src/node-http.js +1 -1
- package/dist/src/node-touch-point.js +1 -1
- package/dist/src/observation.js +1 -1
- package/dist/src/open-script.js +1 -1
- package/dist/src/open-target-device-resolution.js +1 -1
- package/dist/src/orientation.js +1 -1
- 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-android-adb-host.js +1 -1
- package/dist/src/platform-runtime-app-log-process.js +1 -1
- package/dist/src/platform-runtime-apple-application-tools.js +1 -1
- package/dist/src/platform-runtime-claim-recovery.js +1 -1
- package/dist/src/platform-runtime-host.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +3 -3
- package/dist/src/platform-runtime-runtime-hints.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-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-process-host.js +1 -1
- package/dist/src/platform-runtime-shutdown-error.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/plist.js +1 -1
- package/dist/src/plugins2.js +1 -1
- package/dist/src/png-crop-bytes.js +1 -1
- package/dist/src/png-resize.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/post-gesture-stability.js +1 -1
- package/dist/src/process-executable-path.js +1 -0
- package/dist/src/process-exit.js +1 -1
- package/dist/src/provider-device-runtime.d.ts +2 -2
- package/dist/src/provider-limrun-credentials.js +1 -1
- package/dist/src/provider-plugin.d.ts +1 -1
- package/dist/src/provider-profile-fields.js +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/provider.js +1 -1
- package/dist/src/proxy.js +2 -2
- package/dist/src/react-devtools-connection.js +1 -1
- package/dist/src/react-devtools-inspect-command.js +1 -1
- package/dist/src/react-native-overlay2.js +2 -2
- package/dist/src/react-native.js +1 -1
- package/dist/src/react-profile-command.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/record-trace.js +1 -1
- package/dist/src/recording-gestures.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 +1 -1
- package/dist/src/remote-config-core.js +1 -1
- package/dist/src/remote-config-flags.js +1 -1
- package/dist/src/remote-connection-state.js +1 -1
- package/dist/src/replay-backend-host.js +1 -1
- package/dist/src/replay-divergence.js +1 -1
- package/dist/src/replay-maestro-backend.js +2 -2
- package/dist/src/replay.d.ts +1 -1
- package/dist/src/replay2.js +1 -1
- package/dist/src/reporting.js +1 -1
- package/dist/src/request-dispatch-disclosure.js +1 -1
- package/dist/src/request-ended-leases.js +1 -1
- package/dist/src/request-providers.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/request.js +1 -1
- package/dist/src/result-serialization.js +2 -2
- package/dist/src/retry.js +1 -1
- package/dist/src/run-script-execution.js +6 -8
- package/dist/src/run-script-http.js +1 -1
- package/dist/src/runner-cache-metadata.js +1 -1
- package/dist/src/runner-cache-retention.js +1 -1
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-contract.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-disposal.js +1 -1
- package/dist/src/runner-error-classification.js +2 -2
- package/dist/src/runner-exchange.js +1 -1
- package/dist/src/runner-io.js +1 -1
- package/dist/src/runner-launched-session.js +1 -1
- package/dist/src/runner-lease.js +1 -1
- package/dist/src/runner-lifecycle.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-panel.js +1 -1
- package/dist/src/runner-retention.js +1 -1
- package/dist/src/runner-runtime.js +1 -1
- package/dist/src/runner-selector-query.js +1 -1
- package/dist/src/runner-sequence.js +1 -1
- package/dist/src/runner-start-budget.js +1 -1
- package/dist/src/runner-startup-transport.js +1 -1
- package/dist/src/runner-toolchain-identity.js +1 -1
- package/dist/src/runtime-admission.js +1 -1
- package/dist/src/runtime-deployment.js +1 -1
- package/dist/src/runtime-factory.js +1 -1
- package/dist/src/runtime-session.js +1 -1
- package/dist/src/runtime-transport-hints.js +1 -1
- package/dist/src/runtime.js +2 -2
- package/dist/src/runtime10.js +1 -1
- package/dist/src/runtime11.js +1 -1
- package/dist/src/runtime12.js +1 -1
- package/dist/src/runtime13.js +2 -2
- package/dist/src/runtime2.js +2 -2
- package/dist/src/runtime4.js +3 -3
- package/dist/src/runtime5.js +1 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +2 -2
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +1 -1
- package/dist/src/screen-recording-admission-ledger.js +1 -0
- 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/screen-recording-stop-recovery.js +1 -1
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-image-size.js +1 -1
- package/dist/src/screenshot-image.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot-runtime2.js +1 -1
- package/dist/src/screenshot.js +1 -1
- package/dist/src/screenshot2.js +1 -1
- package/dist/src/screenshot4.js +1 -1
- package/dist/src/script-source.js +1 -1
- 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.d.ts +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 +26 -2
- 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-finders.js +1 -1
- package/dist/src/sdk-io.js +5 -5
- 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 +9 -6
- 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-shutdown.js +1 -1
- package/dist/src/server-startup.js +2 -2
- package/dist/src/server.js +4 -4
- package/dist/src/session-allocation.js +1 -1
- package/dist/src/session-artifact-paths.js +1 -1
- package/dist/src/session-capture-binding.js +1 -1
- package/dist/src/session-device-resolution.js +1 -1
- package/dist/src/session-event-action.js +1 -1
- package/dist/src/session-open.js +1 -1
- package/dist/src/session-repair-tombstone.js +1 -1
- package/dist/src/session-replay-vars.js +1 -1
- package/dist/src/session-routing.js +1 -1
- package/dist/src/session-runtime-admission.js +1 -1
- package/dist/src/session-runtime.js +1 -1
- package/dist/src/session-script-destination.js +1 -0
- package/dist/src/session-selector.js +1 -1
- package/dist/src/session-store.js +3 -3
- package/dist/src/session-teardown.js +1 -1
- package/dist/src/session-tenant-scope.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings-bluetooth.js +1 -1
- package/dist/src/settings-global-toggle.js +1 -1
- package/dist/src/settings.js +1 -1
- package/dist/src/settings2.js +1 -1
- package/dist/src/settle-observation-capture.js +1 -1
- package/dist/src/simctl-execution.js +1 -1
- package/dist/src/simctl-facade.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-app-budget.js +1 -1
- package/dist/src/simulator-boot.js +1 -1
- package/dist/src/simulator-facade.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-baseline.js +1 -1
- package/dist/src/snapshot-chrome.js +1 -1
- package/dist/src/snapshot-desktop-projection.js +1 -1
- package/dist/src/snapshot-diagnostics.js +1 -1
- package/dist/src/snapshot-helper-install.js +3 -3
- package/dist/src/snapshot-helper-session.js +1 -1
- package/dist/src/snapshot-lines.js +1 -1
- package/dist/src/snapshot-node-lookup.js +1 -1
- package/dist/src/snapshot-occlusion.js +1 -1
- package/dist/src/snapshot-private-evidence.js +1 -1
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime-capture-input.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 +2 -2
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/source-channel.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src10.js +1 -1
- package/dist/src/src11.js +1 -1
- package/dist/src/src2.js +1 -1
- package/dist/src/src3.js +5 -5
- package/dist/src/src4.js +2 -2
- package/dist/src/src5.js +1 -1
- package/dist/src/src6.js +1 -1
- package/dist/src/src8.js +1 -1
- package/dist/src/store-legacy.js +1 -1
- package/dist/src/store.js +1 -1
- package/dist/src/string-enum.js +1 -1
- package/dist/src/surface-snapshot.js +1 -1
- package/dist/src/surface-snapshot2.js +1 -1
- package/dist/src/sync-cache.js +1 -1
- package/dist/src/system-surface-foreground.js +2 -2
- package/dist/src/takeover.js +1 -1
- package/dist/src/tap-keyboard-occlusion.js +1 -1
- package/dist/src/target-evidence-tree.js +1 -1
- package/dist/src/target-evidence.js +1 -1
- package/dist/src/telephony-runtime.js +1 -1
- package/dist/src/tool-provider-facade.js +1 -1
- package/dist/src/tool-provider.js +3 -3
- 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-runtime.js +1 -1
- package/dist/src/touch-runtime2.js +1 -1
- package/dist/src/transport.js +2 -2
- package/dist/src/tree.js +1 -1
- package/dist/src/tv-remote-runtime.js +1 -1
- package/dist/src/tv-remote.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/unsupported-interactor.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/validation.js +1 -1
- package/dist/src/vars.js +1 -1
- package/dist/src/vega-executable.js +1 -1
- package/dist/src/verified-file.js +1 -1
- package/dist/src/video.js +2 -2
- package/dist/src/viewport.js +1 -1
- package/dist/src/web.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +2 -2
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.37.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.37.apk.sha256 +0 -1
- package/dist/src/capture-output-ownership.js +0 -1
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift
CHANGED
|
@@ -2,7 +2,16 @@ import AgentDeviceSnapshotPresentation
|
|
|
2
2
|
import XCTest
|
|
3
3
|
|
|
4
4
|
extension RunnerTests {
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
static let navigationBarBackButtonIdentifier = "BackButton"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
static let backSwipeVerificationDelay: TimeInterval = 0.1
|
|
13
|
+
|
|
14
|
+
static let backSwipeSettleSampleInterval: TimeInterval = 0.05
|
|
6
15
|
|
|
7
16
|
|
|
8
17
|
|
|
@@ -11,14 +20,35 @@ extension RunnerTests {
|
|
|
11
20
|
#else
|
|
12
21
|
static let backGestureAllowanceMs = 400.0
|
|
13
22
|
#endif
|
|
14
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
static let backSwipeSettleBaseBudgetMs = 2000.0
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
static let backSwipeStillMarginMs = 250.0
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
static func backSwipeSettleBudgetMs(maxCaptureMs: Double) -> Double {
|
|
38
|
+
let sampleIntervalMs = backSwipeSettleSampleInterval * 1000 + maxCaptureMs
|
|
39
|
+
return max(
|
|
40
|
+
backSwipeSettleBaseBudgetMs,
|
|
41
|
+
maxCaptureMs + backSwipeRequiredStillMs(maxCaptureMs: maxCaptureMs) + sampleIntervalMs
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
15
45
|
|
|
16
46
|
|
|
17
47
|
|
|
18
48
|
|
|
19
49
|
|
|
20
50
|
static func backSwipeRequiredStillMs(maxCaptureMs: Double) -> Double {
|
|
21
|
-
backGestureAllowanceMs +
|
|
51
|
+
backGestureAllowanceMs + backSwipeStillMarginMs + maxCaptureMs
|
|
22
52
|
}
|
|
23
53
|
|
|
24
54
|
|
|
@@ -68,11 +98,13 @@ extension RunnerTests {
|
|
|
68
98
|
|
|
69
99
|
|
|
70
100
|
|
|
101
|
+
|
|
102
|
+
|
|
71
103
|
@MainActor
|
|
72
104
|
func performInAppBack(app: XCUIApplication) throws -> InAppBackOutcome {
|
|
73
105
|
#if os(macOS)
|
|
74
106
|
guard let back = macOSNavigationBackElement(app: app) else {
|
|
75
|
-
return .refused(
|
|
107
|
+
return .refused(Self.macOSInAppBackControlRefusal)
|
|
76
108
|
}
|
|
77
109
|
let frame = back.frame
|
|
78
110
|
if frame.isEmpty {
|
|
@@ -86,13 +118,30 @@ extension RunnerTests {
|
|
|
86
118
|
return .performed
|
|
87
119
|
#elseif os(iOS)
|
|
88
120
|
|
|
121
|
+
|
|
89
122
|
var trace = BackSwipeTrace()
|
|
123
|
+
func logSwipe(_ line: String) { NSLog("AGENT_DEVICE_RUNNER_BACK_SWIPE_VERIFICATION %@", line) }
|
|
124
|
+
let resolved: SynthesizedCoordinateContext?
|
|
90
125
|
do {
|
|
91
|
-
|
|
92
|
-
|
|
126
|
+
resolved = try synthesizedCoordinateContext(app: app)
|
|
127
|
+
} catch {
|
|
128
|
+
logSwipe(trace.logLine(name: "error", code: String(describing: type(of: error))))
|
|
129
|
+
throw error
|
|
130
|
+
}
|
|
131
|
+
guard let context = resolved else {
|
|
132
|
+
let outcome = InAppBackOutcome.refused(Self.backScreenRefusal(.unresolvedWindow))
|
|
133
|
+
logSwipe(trace.logLine(outcome: outcome))
|
|
134
|
+
return outcome
|
|
135
|
+
}
|
|
136
|
+
if let pressed = try pressNavigationBarBackButton(app: app, context: context) {
|
|
137
|
+
return pressed
|
|
138
|
+
}
|
|
139
|
+
do {
|
|
140
|
+
let outcome = try verifiedBackSwipe(app: app, context: context, trace: &trace)
|
|
141
|
+
logSwipe(trace.logLine(outcome: outcome))
|
|
93
142
|
return outcome
|
|
94
143
|
} catch {
|
|
95
|
-
|
|
144
|
+
logSwipe(trace.logLine(name: "error", code: String(describing: type(of: error))))
|
|
96
145
|
throw error
|
|
97
146
|
}
|
|
98
147
|
#else
|
|
@@ -101,8 +150,8 @@ extension RunnerTests {
|
|
|
101
150
|
return .refused(
|
|
102
151
|
ErrorPayload(
|
|
103
152
|
code: RunnerWireErrorCode.backSwipeNotDispatched,
|
|
104
|
-
message: "visionOS has no back
|
|
105
|
-
hint: "
|
|
153
|
+
message: "visionOS has no back command",
|
|
154
|
+
hint: "Press the visible back control by its ref."
|
|
106
155
|
)
|
|
107
156
|
)
|
|
108
157
|
#endif
|
|
@@ -144,16 +193,479 @@ extension RunnerTests {
|
|
|
144
193
|
}
|
|
145
194
|
}
|
|
146
195
|
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
147
204
|
@MainActor
|
|
148
|
-
private func
|
|
149
|
-
|
|
150
|
-
|
|
205
|
+
private func pressNavigationBarBackButton(
|
|
206
|
+
app: XCUIApplication,
|
|
207
|
+
context: SynthesizedCoordinateContext
|
|
208
|
+
) throws -> InAppBackOutcome? {
|
|
209
|
+
var trace = NavigationBarBackTrace()
|
|
210
|
+
|
|
211
|
+
defer {
|
|
212
|
+
NSLog("AGENT_DEVICE_RUNNER_BACK_NAVIGATION_BAR_BUTTON %@", trace.logLine)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
151
216
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
217
|
+
guard navigationBarBackButtonIsReadable(context: context) else { return nil }
|
|
218
|
+
let started = currentUptimeMs()
|
|
219
|
+
let lookup = stillNavigationBarBackButton(
|
|
220
|
+
app: app,
|
|
221
|
+
geometry: context.geometry,
|
|
222
|
+
deadlineMs: started + Self.navigationBarBackReadBudgetMs
|
|
223
|
+
)
|
|
224
|
+
trace.lookupMs = currentUptimeMs() - started
|
|
225
|
+
let before: NavigationBarBackState
|
|
226
|
+
let frame: CGRect
|
|
227
|
+
switch lookup {
|
|
228
|
+
case .still(let state, let button):
|
|
229
|
+
before = state
|
|
230
|
+
frame = button
|
|
231
|
+
case .notFound(let found):
|
|
232
|
+
trace.found = found
|
|
233
|
+
return nil
|
|
234
|
+
case .hung:
|
|
235
|
+
trace.found = "hung"
|
|
236
|
+
return .refused(Self.navigationBarBackHungLookup)
|
|
237
|
+
}
|
|
238
|
+
trace.found = "yes"
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
switch try performSynthesizedTapGesture(app: app, x: frame.midX, y: frame.midY, context: context) {
|
|
243
|
+
case .performed:
|
|
244
|
+
break
|
|
245
|
+
case .xctestFallback:
|
|
246
|
+
_ = try performGesture(app) { try tapAt(app: app, x: frame.midX, y: frame.midY, context: context) }
|
|
247
|
+
case .refused:
|
|
248
|
+
return nil
|
|
249
|
+
}
|
|
250
|
+
trace.pressed = true
|
|
251
|
+
let tapped = currentUptimeMs()
|
|
252
|
+
let confirmation = navigationBarBackConfirmation(
|
|
253
|
+
app: app,
|
|
254
|
+
from: before,
|
|
255
|
+
windowHeight: context.geometry.windowOnScreen.rect.height,
|
|
256
|
+
deadlineMs: tapped + Self.navigationBarBackReadBudgetMs
|
|
257
|
+
)
|
|
258
|
+
trace.confirmMs = currentUptimeMs() - tapped
|
|
259
|
+
trace.confirmed = confirmation.logToken
|
|
260
|
+
switch confirmation {
|
|
261
|
+
case .changed: return .performed
|
|
262
|
+
case .unchanged: return .unconfirmed(Self.navigationBarBackUnverified)
|
|
263
|
+
case .hung: return .unconfirmed(Self.navigationBarBackHungConfirmation)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
struct NavigationBarBackTrace {
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
var found = "skipped"
|
|
273
|
+
var pressed = false
|
|
274
|
+
|
|
275
|
+
var confirmed: String?
|
|
276
|
+
var lookupMs = 0.0
|
|
277
|
+
var confirmMs: Double?
|
|
278
|
+
|
|
279
|
+
var logLine: String {
|
|
280
|
+
func ms(_ value: Double?) -> String { value.map { String(Int($0.rounded())) } ?? "-" }
|
|
281
|
+
return [
|
|
282
|
+
"found=\(found)",
|
|
283
|
+
"pressed=\(pressed ? "yes" : "no")",
|
|
284
|
+
"confirmed=\(confirmed ?? "-")",
|
|
285
|
+
"lookupMs=\(ms(lookupMs))",
|
|
286
|
+
"confirmMs=\(ms(confirmMs))",
|
|
287
|
+
].joined(separator: " ")
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
struct NavigationBarBackState: Equatable {
|
|
304
|
+
var barCount: Int
|
|
305
|
+
let backButtonLabels: [String]
|
|
306
|
+
let backButtonFrames: [CGRect]
|
|
307
|
+
var barTitles: [String] = []
|
|
308
|
+
|
|
309
|
+
var hasUnlabeledBackButton: Bool { backButtonLabels.contains(where: \.isEmpty) }
|
|
310
|
+
|
|
311
|
+
func hasSameButtons(as other: NavigationBarBackState) -> Bool {
|
|
312
|
+
backButtonLabels == other.backButtonLabels && backButtonFrames == other.backButtonFrames
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
var canShowAPop: Bool { !hasUnlabeledBackButton || barTitles.contains { !$0.isEmpty } }
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
static func navigationBarBackPopped(from before: NavigationBarBackState, to after: NavigationBarBackState) -> Bool {
|
|
326
|
+
after.barCount != before.barCount || after.backButtonLabels != before.backButtonLabels
|
|
327
|
+
|| after.barTitles != before.barTitles
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
static let navigationBarBackReadInterval: TimeInterval = 0.05
|
|
334
|
+
static let navigationBarBackReadBudgetMs = 1000.0
|
|
335
|
+
|
|
336
|
+
static let navigationBarBackUnverified = ErrorPayload(
|
|
337
|
+
code: RunnerWireErrorCode.backSwipeUnverified,
|
|
338
|
+
message: "back pressed the navigation bar back button, but the navigation bar's back buttons did not change within 1 s or on one more read after it. This is an unknown outcome.",
|
|
339
|
+
hint: "Take a snapshot to see where the app is."
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
static let navigationBarBackHungConfirmation = ErrorPayload(
|
|
343
|
+
code: RunnerWireErrorCode.backSwipeUnverified,
|
|
344
|
+
message: "back pressed the navigation bar back button, but an XCTest query on the navigation bar hung afterwards. This is an unknown outcome.",
|
|
345
|
+
hint: "Take a snapshot to see where the app is."
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
static let navigationBarBackHungLookup = ErrorPayload(
|
|
349
|
+
code: RunnerWireErrorCode.backSwipeNotDispatched,
|
|
350
|
+
message: "back sent nothing: an XCTest query on the navigation bar hung before the back button or the swipe.",
|
|
351
|
+
hint: "Take a snapshot to check that the app responds, then retry back."
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
enum NavigationBarBackLookup {
|
|
357
|
+
case still(NavigationBarBackState, button: CGRect)
|
|
358
|
+
case notFound(String)
|
|
359
|
+
case hung
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
@MainActor
|
|
370
|
+
private func stillNavigationBarBackButton(
|
|
371
|
+
app: XCUIApplication,
|
|
372
|
+
geometry: SurfaceGeometry,
|
|
373
|
+
deadlineMs: Double
|
|
374
|
+
) -> NavigationBarBackLookup {
|
|
375
|
+
let windowHeight = geometry.windowOnScreen.rect.height
|
|
376
|
+
var previous: NavigationBarBackState?
|
|
377
|
+
var barsRead: (state: NavigationBarBackState, bars: [NavigationBarSnapshot])?
|
|
378
|
+
while true {
|
|
379
|
+
let sample: NavigationBarBackSample
|
|
380
|
+
switch readNavigationBarBack(
|
|
381
|
+
app: app, phase: .lookup, deadlineMs: deadlineMs, windowHeight: windowHeight, knownBars: barsRead?.bars
|
|
382
|
+
) {
|
|
383
|
+
case .hung: return .hung
|
|
384
|
+
case .unreadable: return .notFound("unreadable")
|
|
385
|
+
case .read(let read): sample = read
|
|
386
|
+
}
|
|
387
|
+
let candidates = sample.candidates(by: sample.bars)
|
|
388
|
+
if candidates.isEmpty { return .notFound("no") }
|
|
389
|
+
let current = sample.state(of: candidates, bars: nil)
|
|
390
|
+
let buttonsStill = previous.map { current.hasSameButtons(as: $0) } ?? false
|
|
391
|
+
if sample.barsWereRead {
|
|
392
|
+
barsRead = (sample.state(of: candidates, bars: sample.bars), sample.bars)
|
|
393
|
+
} else if !buttonsStill {
|
|
394
|
+
barsRead = nil
|
|
395
|
+
}
|
|
396
|
+
if buttonsStill, let barsBefore = barsRead?.state {
|
|
397
|
+
|
|
398
|
+
let liveDeadlineMs = currentUptimeMs() + Self.navigationBarBackReadBudgetMs
|
|
399
|
+
switch liveNavigationBarBackButton(of: sample, geometry: geometry, deadlineMs: liveDeadlineMs) {
|
|
400
|
+
case .hung: return .hung
|
|
401
|
+
case .unreadable: return .notFound("unreadable")
|
|
402
|
+
case .read(.absent(let found)): return .notFound(found)
|
|
403
|
+
case .read(.found(let state, let button, let bars)):
|
|
404
|
+
if state == barsBefore { return .still(state, button: button) }
|
|
405
|
+
barsRead = (state, bars)
|
|
406
|
+
case .read(.moving): break
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if currentUptimeMs() >= deadlineMs { return .notFound("moving") }
|
|
410
|
+
previous = current
|
|
411
|
+
sleepFor(Self.navigationBarBackReadInterval)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
enum NavigationBarBackLive {
|
|
417
|
+
case found(NavigationBarBackState, CGRect, [NavigationBarSnapshot])
|
|
418
|
+
case absent(String)
|
|
419
|
+
case moving
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
@MainActor
|
|
425
|
+
private func liveNavigationBarBackButton(
|
|
426
|
+
of sample: NavigationBarBackSample,
|
|
427
|
+
geometry: SurfaceGeometry,
|
|
428
|
+
deadlineMs: Double
|
|
429
|
+
) -> NavigationBarBackRead<NavigationBarBackLive> {
|
|
430
|
+
heldNavigationBarRead(.lookup) {
|
|
431
|
+
let bars = sample.roots.flatMap { $0.descendants(matching: .navigationBar).allElementsBoundByIndex }
|
|
432
|
+
guard let snapshots = barSnapshots(bars, deadlineMs: deadlineMs) else { return nil }
|
|
433
|
+
let candidates = sample.candidates(by: snapshots)
|
|
434
|
+
let hittable = candidates.filter { sample.buttons[$0].isHittable }
|
|
435
|
+
if hittable.isEmpty { return .absent("no") }
|
|
436
|
+
if hittable.count > 1 { return .absent("ambiguous") }
|
|
437
|
+
let button = sample.buttons[hittable[0]].frame
|
|
438
|
+
guard SnapshotGeometry.isPositiveFinite(button) else { return nil }
|
|
439
|
+
let state = sample.state(of: candidates, bars: snapshots)
|
|
440
|
+
if !state.canShowAPop { return .absent("unprovable") }
|
|
441
|
+
return Self.navigationBarBackState(state, holdsButton: button, geometry: geometry)
|
|
442
|
+
? .found(state, button, snapshots) : .moving
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
static func navigationBarBackState(
|
|
449
|
+
_ state: NavigationBarBackState,
|
|
450
|
+
holdsButton button: CGRect,
|
|
451
|
+
geometry: SurfaceGeometry
|
|
452
|
+
) -> Bool {
|
|
453
|
+
state.backButtonFrames.contains { frame in
|
|
454
|
+
let origin = geometry.screenPoint(from: SurfacePoint<WindowContentSpace>(frame.origin)).point
|
|
455
|
+
return CGRect(origin: origin, size: frame.size) == button
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
enum NavigationBarBackConfirmation {
|
|
460
|
+
case changed
|
|
461
|
+
case unchanged
|
|
462
|
+
case hung
|
|
463
|
+
|
|
464
|
+
var logToken: String {
|
|
465
|
+
switch self {
|
|
466
|
+
case .changed: return "yes"
|
|
467
|
+
case .unchanged: return "no"
|
|
468
|
+
case .hung: return "hung"
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
@MainActor
|
|
479
|
+
private func navigationBarBackConfirmation(
|
|
480
|
+
app: XCUIApplication,
|
|
481
|
+
from before: NavigationBarBackState,
|
|
482
|
+
windowHeight: CGFloat,
|
|
483
|
+
deadlineMs: Double
|
|
484
|
+
) -> NavigationBarBackConfirmation {
|
|
485
|
+
while true {
|
|
486
|
+
let isFinalRead = currentUptimeMs() >= deadlineMs
|
|
487
|
+
let readDeadlineMs = isFinalRead ? Double.infinity : deadlineMs
|
|
488
|
+
let phase: NavigationBarBackReadPhase = isFinalRead ? .finalConfirmation : .confirmation
|
|
489
|
+
switch readNavigationBarBack(
|
|
490
|
+
app: app, phase: phase, deadlineMs: readDeadlineMs, windowHeight: windowHeight, knownBars: nil
|
|
491
|
+
) {
|
|
492
|
+
case .read(let after)
|
|
493
|
+
where Self.navigationBarBackPopped(
|
|
494
|
+
from: before, to: after.state(of: after.candidates(by: after.bars), bars: after.bars)
|
|
495
|
+
):
|
|
496
|
+
return .changed
|
|
497
|
+
case .hung: return .hung
|
|
498
|
+
case .read, .unreadable: break
|
|
499
|
+
}
|
|
500
|
+
if isFinalRead { return .unchanged }
|
|
501
|
+
sleepFor(min(Self.navigationBarBackReadInterval, max(0, deadlineMs - currentUptimeMs()) / 1000))
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
@MainActor
|
|
506
|
+
private func navigationBarBackButtonIsReadable(context: SynthesizedCoordinateContext) -> Bool {
|
|
507
|
+
guard !context.treeUnreadable, context.accessibilityHealth != .unavailable else { return false }
|
|
508
|
+
return !isSnapshotXCTestChannelPenalized(bundleId: mainOwned.bundleId)
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
enum NavigationBarBackReadPhase {
|
|
514
|
+
case lookup
|
|
515
|
+
case confirmation
|
|
516
|
+
case finalConfirmation
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
enum NavigationBarBackRead<Value> {
|
|
521
|
+
case read(Value)
|
|
522
|
+
case unreadable
|
|
523
|
+
case hung
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
@MainActor
|
|
530
|
+
private func heldNavigationBarRead<T>(_ phase: NavigationBarBackReadPhase, _ read: () -> T?) -> NavigationBarBackRead<T> {
|
|
531
|
+
var value: T?
|
|
532
|
+
let held = holdingRecordedIssues {
|
|
533
|
+
value = read()
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
}
|
|
540
|
+
let hung = held.issues.filter { Self.isHungQueryIssueDescription($0.compactDescription) }
|
|
541
|
+
hung.forEach { record($0) }
|
|
542
|
+
if !hung.isEmpty { return .hung }
|
|
543
|
+
guard held.issues.isEmpty, held.exceptionMessage == nil, let value else { return .unreadable }
|
|
544
|
+
return .read(value)
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
struct NavigationBarBackSample {
|
|
551
|
+
let buttons: [XCUIElement]
|
|
552
|
+
let labels: [String]
|
|
553
|
+
|
|
554
|
+
let frames: [CGRect]
|
|
555
|
+
let roots: [XCUIElement]
|
|
556
|
+
let bars: [NavigationBarSnapshot]
|
|
557
|
+
let barsWereRead: Bool
|
|
558
|
+
let windowHeight: CGFloat
|
|
559
|
+
|
|
560
|
+
func candidates(by bars: [NavigationBarSnapshot]) -> [Int] {
|
|
561
|
+
RunnerTests.backButtonCandidates(frames, barFrames: bars.map(\.frame), windowHeight: windowHeight)
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
func state(of candidates: [Int], bars: [NavigationBarSnapshot]?) -> NavigationBarBackState {
|
|
566
|
+
let state = NavigationBarBackState(
|
|
567
|
+
barCount: 0, backButtonLabels: candidates.map { labels[$0] }, backButtonFrames: candidates.map { frames[$0] })
|
|
568
|
+
return bars.map { RunnerTests.addingBars($0, to: state) } ?? state
|
|
156
569
|
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
@MainActor
|
|
577
|
+
private func readNavigationBarBack(
|
|
578
|
+
app: XCUIApplication,
|
|
579
|
+
phase: NavigationBarBackReadPhase,
|
|
580
|
+
deadlineMs: Double,
|
|
581
|
+
windowHeight: CGFloat,
|
|
582
|
+
knownBars: [NavigationBarSnapshot]?
|
|
583
|
+
) -> NavigationBarBackRead<NavigationBarBackSample> {
|
|
584
|
+
guard currentUptimeMs() < deadlineMs else { return .unreadable }
|
|
585
|
+
return heldNavigationBarRead(phase) {
|
|
586
|
+
guard let roots = try? elementSearchRoots(root: app, litDisplayID: requestLitPanel?.displayID) else { return nil }
|
|
587
|
+
let buttons = roots.flatMap {
|
|
588
|
+
$0.descendants(matching: .button).matching(identifier: Self.navigationBarBackButtonIdentifier).allElementsBoundByIndex
|
|
589
|
+
}
|
|
590
|
+
var labels: [String] = []
|
|
591
|
+
var frames: [CGRect] = []
|
|
592
|
+
for button in buttons {
|
|
593
|
+
guard currentUptimeMs() < deadlineMs, let snapshot = try? button.snapshot() else { return nil }
|
|
594
|
+
labels.append(snapshot.label)
|
|
595
|
+
frames.append(snapshot.frame)
|
|
596
|
+
}
|
|
597
|
+
var bars = knownBars
|
|
598
|
+
if bars == nil {
|
|
599
|
+
let elements = roots.flatMap { $0.descendants(matching: .navigationBar).allElementsBoundByIndex }
|
|
600
|
+
bars = barSnapshots(elements, deadlineMs: deadlineMs)
|
|
601
|
+
}
|
|
602
|
+
guard let bars else { return nil }
|
|
603
|
+
return NavigationBarBackSample(
|
|
604
|
+
buttons: buttons, labels: labels, frames: frames, roots: roots, bars: bars,
|
|
605
|
+
barsWereRead: knownBars == nil, windowHeight: windowHeight
|
|
606
|
+
)
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
static func backButtonBelongsToABar(_ button: CGRect, barFrames: [CGRect], windowHeight: CGFloat) -> Bool {
|
|
616
|
+
barFrames.contains { bar in
|
|
617
|
+
button.midX >= bar.minX && button.midX <= bar.maxX
|
|
618
|
+
&& button.minY >= bar.minY && button.minY <= bar.minY + windowHeight / 3
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
static func backButtonCandidates(_ frames: [CGRect], barFrames: [CGRect], windowHeight: CGFloat) -> [Int] {
|
|
628
|
+
let inside = frames.indices.filter { index in
|
|
629
|
+
barFrames.contains { $0.contains(CGPoint(x: frames[index].midX, y: frames[index].midY)) }
|
|
630
|
+
}
|
|
631
|
+
if !inside.isEmpty { return inside }
|
|
632
|
+
return frames.indices.filter {
|
|
633
|
+
backButtonBelongsToABar(frames[$0], barFrames: barFrames, windowHeight: windowHeight)
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
struct NavigationBarSnapshot {
|
|
638
|
+
let frame: CGRect
|
|
639
|
+
|
|
640
|
+
let title: String
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
func barSnapshots(_ bars: [XCUIElement], deadlineMs: Double) -> [NavigationBarSnapshot]? {
|
|
645
|
+
var snapshots: [NavigationBarSnapshot] = []
|
|
646
|
+
for bar in bars {
|
|
647
|
+
guard currentUptimeMs() < deadlineMs, let snapshot = try? bar.snapshot() else { return nil }
|
|
648
|
+
snapshots.append(
|
|
649
|
+
NavigationBarSnapshot(frame: snapshot.frame, title: snapshot.identifier.isEmpty ? snapshot.label : snapshot.identifier))
|
|
650
|
+
}
|
|
651
|
+
return snapshots
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
static func addingBars(_ bars: [NavigationBarSnapshot], to state: NavigationBarBackState) -> NavigationBarBackState {
|
|
656
|
+
var state = state
|
|
657
|
+
state.barCount = bars.count
|
|
658
|
+
if state.hasUnlabeledBackButton { state.barTitles = bars.map(\.title) }
|
|
659
|
+
return state
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
@MainActor
|
|
663
|
+
private func verifiedBackSwipe(
|
|
664
|
+
app: XCUIApplication,
|
|
665
|
+
context: SynthesizedCoordinateContext,
|
|
666
|
+
trace: inout BackSwipeTrace
|
|
667
|
+
) throws -> InAppBackOutcome {
|
|
668
|
+
|
|
157
669
|
|
|
158
670
|
let dispatchGesture: @MainActor () throws -> TouchDispatch
|
|
159
671
|
switch try prepareBackGesture(app: app, context: context) {
|
|
@@ -161,25 +673,19 @@ extension RunnerTests {
|
|
|
161
673
|
case .notSent(let message, let hint):
|
|
162
674
|
return .refused(ErrorPayload(code: RunnerWireErrorCode.backSwipeNotDispatched, message: message, hint: hint))
|
|
163
675
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
case .success(let sample): justBefore = sample
|
|
676
|
+
let before: SettledBackSample
|
|
677
|
+
switch settledBackVisualState(app: app, context: context, trace: &trace) {
|
|
678
|
+
case .success(let settled): before = settled
|
|
168
679
|
case .failure(let refusal): return .refused(Self.backScreenRefusal(refusal))
|
|
169
680
|
}
|
|
170
|
-
let justBeforeMs =
|
|
681
|
+
let justBeforeMs = before.sampledMs
|
|
171
682
|
trace.stableMs = justBeforeMs - before.stableSinceMs
|
|
172
|
-
let stillSettled = Self.backSwipeBaselineHolds(
|
|
173
|
-
settled: before.settled,
|
|
174
|
-
baseline: before.sample,
|
|
175
|
-
justBefore: justBefore
|
|
176
|
-
)
|
|
177
683
|
let dispatch = try dispatchGesture()
|
|
178
684
|
trace.gestureMs = currentUptimeMs() - justBeforeMs
|
|
179
685
|
if let refusal = Self.backGestureRefusal(dispatch) {
|
|
180
686
|
return refusal
|
|
181
687
|
}
|
|
182
|
-
guard
|
|
688
|
+
guard before.settled else {
|
|
183
689
|
return .unconfirmed(
|
|
184
690
|
Self.backSwipeUnverified(
|
|
185
691
|
because: "the app's screen was already changing on its own",
|
|
@@ -191,7 +697,7 @@ extension RunnerTests {
|
|
|
191
697
|
let after = timedBackCapture(app: app, context: context, trace: &trace)
|
|
192
698
|
let afterMs = currentUptimeMs()
|
|
193
699
|
trace.justBeforeToAfterMs = afterMs - justBeforeMs
|
|
194
|
-
let observation = Self.navigationVisualObservation(before: .success(
|
|
700
|
+
let observation = Self.navigationVisualObservation(before: .success(before.sample), after: after)
|
|
195
701
|
trace.changed = observation
|
|
196
702
|
guard Self.backSwipeGapIsCovered(
|
|
197
703
|
stableSinceMs: before.stableSinceMs,
|
|
@@ -247,38 +753,55 @@ extension RunnerTests {
|
|
|
247
753
|
)
|
|
248
754
|
}
|
|
249
755
|
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
static let macOSInAppBackControlRefusal = ErrorPayload(
|
|
760
|
+
code: RunnerWireErrorCode.inAppBackControlUnavailable,
|
|
761
|
+
message: "in-app back control is not available",
|
|
762
|
+
hint: "Press the app's visible back control by its ref."
|
|
763
|
+
)
|
|
764
|
+
|
|
250
765
|
#if os(iOS)
|
|
251
766
|
|
|
252
767
|
|
|
768
|
+
struct SettledBackSample {
|
|
769
|
+
let sample: Data
|
|
770
|
+
let stableSinceMs: Double
|
|
771
|
+
let sampledMs: Double
|
|
772
|
+
let settled: Bool
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|
|
253
777
|
|
|
254
778
|
@MainActor
|
|
255
779
|
private func settledBackVisualState(
|
|
256
780
|
app: XCUIApplication,
|
|
257
781
|
context: SynthesizedCoordinateContext,
|
|
258
782
|
trace: inout BackSwipeTrace
|
|
259
|
-
) -> Result<
|
|
783
|
+
) -> Result<SettledBackSample, RunnerAppScreenCaptureFailure> {
|
|
784
|
+
let started = currentUptimeMs()
|
|
260
785
|
var runStart: (sample: Data, ms: Double)?
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
786
|
+
while true {
|
|
787
|
+
if trace.settleSamples > 0 { sleepFor(Self.backSwipeSettleSampleInterval) }
|
|
788
|
+
trace.settleSamples += 1
|
|
789
|
+
let sample: Data
|
|
265
790
|
switch timedBackCapture(app: app, context: context, trace: &trace) {
|
|
266
|
-
case .failure(let refusal):
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
791
|
+
case .failure(let refusal): return .failure(refusal)
|
|
792
|
+
case .success(let captured): sample = captured
|
|
793
|
+
}
|
|
794
|
+
let now = currentUptimeMs()
|
|
795
|
+
let start = runStart.flatMap { Self.visualSamplesDiffer($0.sample, sample) ? nil : $0 } ?? (sample: sample, ms: now)
|
|
796
|
+
runStart = start
|
|
797
|
+
if now - start.ms >= Self.backSwipeRequiredStillMs(maxCaptureMs: trace.maxCaptureMs) {
|
|
798
|
+
trace.settled = true
|
|
799
|
+
return .success(SettledBackSample(sample: sample, stableSinceMs: start.ms, sampledMs: now, settled: true))
|
|
800
|
+
}
|
|
801
|
+
if now - started >= Self.backSwipeSettleBudgetMs(maxCaptureMs: trace.maxCaptureMs) {
|
|
802
|
+
return .success(SettledBackSample(sample: sample, stableSinceMs: start.ms, sampledMs: now, settled: false))
|
|
279
803
|
}
|
|
280
804
|
}
|
|
281
|
-
return .success((last, runStart?.ms ?? currentUptimeMs(), false))
|
|
282
805
|
}
|
|
283
806
|
#endif
|
|
284
807
|
|
|
@@ -370,12 +893,6 @@ extension RunnerTests {
|
|
|
370
893
|
|
|
371
894
|
|
|
372
895
|
|
|
373
|
-
static func backSwipeBaselineHolds(settled: Bool, baseline: Data, justBefore: Data) -> Bool {
|
|
374
|
-
settled && !visualSamplesDiffer(baseline, justBefore)
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
896
|
static func backSwipeOutcome(observation: NavigationVisualObservation) -> InAppBackOutcome {
|
|
380
897
|
switch observation {
|
|
381
898
|
case .changed:
|