agent-device 0.21.30 → 0.21.31
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.30.apk → agent-device-android-ime-helper-0.21.31.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.31.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.30.manifest.json → agent-device-android-ime-helper-0.21.31.manifest.json} +4 -4
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.31.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.31.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.30.manifest.json → agent-device-android-snapshot-helper-0.21.31.manifest.json} +7 -7
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/BackgroundInteraction.swift +20 -6
- package/apple/snapshot-bridge/README.md +16 -3
- package/apple/snapshot-bridge/SnapshotBridgeRuntime.m +33 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunner/AgentDeviceRunnerApp.m +110 -8
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAppScreenCapture.swift +20 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +4 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+AXSnapshotFallback.swift +1 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +30 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +14 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +81 -41
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift +40 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +5 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +74 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotTiming.swift +33 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedCommitDeadline.swift +2 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +23 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +158 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +165 -70
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryConfirmation.swift +2 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryFocus.swift +49 -27
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntryReadiness.swift +17 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextInputProbe.swift +30 -28
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextTyping.swift +87 -87
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +4 -3
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +13 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +45 -0
- package/dist/src/absence-observation-errors.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/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 +1 -1
- package/dist/src/alert-tree-driver.js +1 -1
- package/dist/src/alert.js +1 -1
- package/dist/src/alert2.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-backend.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-lifecycle.js +4 -4
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/app-log-session-resource.js +1 -1
- 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/application-lifecycle-interaction.js +1 -1
- package/dist/src/artifact-tracking.js +1 -1
- package/dist/src/automation-helper-artifact.js +1 -1
- package/dist/src/automation-helper.js +1 -1
- package/dist/src/back-mode.js +1 -1
- package/dist/src/boot-diagnostics.js +1 -1
- package/dist/src/browser-launch.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +35 -29
- package/dist/src/cli-runner.js +1 -1
- package/dist/src/cli.js +3 -3
- package/dist/src/client-metro-companion.js +1 -1
- package/dist/src/client-metro.js +1 -1
- package/dist/src/client-types.d.ts +3 -3
- package/dist/src/cloud-artifacts.d.ts +5 -4
- package/dist/src/code-signature-cache.js +1 -1
- package/dist/src/command-metadata.js +10 -10
- package/dist/src/command-tools.js +2 -2
- package/dist/src/command.js +1 -1
- package/dist/src/composed-inventory-gateways.js +1 -1
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +5 -5
- package/dist/src/contracts.js +1 -1
- package/dist/src/daemon-client-ensure.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.js +1 -1
- package/dist/src/daemon-command-registry.js +1 -1
- package/dist/src/daemon-composition.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-resolution.js +1 -1
- package/dist/src/daemon-startup-diagnostics.js +1 -1
- package/dist/src/debug-symbols-facade.js +3 -3
- package/dist/src/device-claim-recovery.js +1 -1
- package/dist/src/device-claims.js +1 -1
- package/dist/src/device-inventory-context.js +1 -1
- package/dist/src/device-readiness-runtime.js +1 -1
- package/dist/src/device-selection-resolver.js +1 -1
- package/dist/src/device.js +1 -1
- package/dist/src/devicectl.js +1 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/display-inventory.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/explicit-session-resolution.js +1 -1
- package/dist/src/expo-dev-client-launch.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/gesture-admission.js +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.js +2 -2
- 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 -0
- 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.js +1 -1
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.js +1 -1
- package/dist/src/install-source-network-transport.js +1 -1
- package/dist/src/install-source2.js +1 -1
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction.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/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/daemon.js +1 -1
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/inventory.js +1 -1
- package/dist/src/inventory2.js +1 -1
- package/dist/src/inventory6.js +1 -1
- package/dist/src/ios-node-interpretation.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-engine.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/keyboard-occlusion.js +1 -1
- package/dist/src/keyed-lock.js +1 -1
- package/dist/src/launch-confirmation.js +1 -1
- package/dist/src/launch-services-registration.js +4 -4
- package/dist/src/lease.js +1 -1
- package/dist/src/legacy.js +1 -1
- package/dist/src/limrun-runtime-dependencies.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/mechanics.js +12 -12
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/observability.js +1 -1
- package/dist/src/output-path.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-target.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-claim-recovery.js +1 -1
- package/dist/src/platform-runtime-daemon-services.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 +5 -5
- package/dist/src/platform-runtime-runtime-hints.js +2 -2
- package/dist/src/platform-runtime-screen-recording-apple-simulator-host.js +1 -1
- package/dist/src/platform-runtime-screen-recording-finalizer-host.js +1 -1
- package/dist/src/platform-runtime-unavailable.js +1 -1
- package/dist/src/platform-runtime.js +1 -1
- package/dist/src/platform-runtime2.js +1 -1
- package/dist/src/png-resize.js +1 -1
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/process-exit.js +1 -1
- package/dist/src/provider-device-runtime.d.ts +28 -0
- package/dist/src/provider-plugin-catalog.js +2 -0
- package/dist/src/provider-plugin.d.ts +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/proxy.js +1 -1
- package/dist/src/react-native-overlay2.js +1 -1
- 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-scope.js +1 -1
- package/dist/src/recording.js +1 -1
- package/dist/src/registry.js +1 -1
- package/dist/src/remote-config-core.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 +3 -3
- package/dist/src/replay-script-selection.js +1 -1
- package/dist/src/replay2.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 +1 -1
- package/dist/src/retry.js +1 -1
- package/dist/src/runner-cache-retention.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 +2 -2
- 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 -1
- package/dist/src/runner-selector-query.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-probe.js +1 -1
- package/dist/src/runner.js +2 -2
- 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.js +4 -4
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime2.js +1 -1
- package/dist/src/runtime3.js +5 -5
- package/dist/src/runtime4.js +1 -1
- package/dist/src/runtime5.js +1 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +1 -1
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +2 -2
- package/dist/src/screen-recording-transport.js +1 -1
- package/dist/src/screenshot-density.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot3.js +1 -1
- package/dist/src/sdk-batch-runner.js +2 -2
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +9 -0
- package/dist/src/sdk-contracts.js +2 -2
- package/dist/src/sdk-device.js +1 -1
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-io.js +5 -5
- package/dist/src/sdk-remote-config.js +1 -1
- 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-startup.js +1 -1
- package/dist/src/session-paths.js +1 -1
- package/dist/src/session-replay-vars.js +1 -1
- package/dist/src/session-runtime.js +1 -1
- package/dist/src/session-store.js +3 -3
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settings-bluetooth.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-settings.js +1 -1
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-boot.js +1 -1
- package/dist/src/simulator-state.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-chrome.js +1 -1
- package/dist/src/snapshot-desktop-projection.js +1 -1
- package/dist/src/snapshot-helper-install.js +6 -6
- package/dist/src/snapshot-node-lookup.js +1 -1
- package/dist/src/snapshot-occlusion.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/snapshot3.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src3.js +1 -1
- package/dist/src/src4.js +1 -1
- package/dist/src/store.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/text-entry-focus.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-reference-frame.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-runtime.js +1 -1
- package/dist/src/tv-remote.js +2 -2
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/update-check.js +1 -1
- package/dist/src/vega-executable.js +1 -1
- package/dist/src/video.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +7 -6
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.30.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.30.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.30.apk.sha256 +0 -1
- package/dist/src/physical-device-apps.js +0 -1
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift
CHANGED
|
@@ -58,18 +58,25 @@ extension RunnerTests {
|
|
|
58
58
|
_ = pressTvRemote(.menu)
|
|
59
59
|
return .performed
|
|
60
60
|
#else
|
|
61
|
+
let rejectedQueriesBefore = navigationRejectedQueryCount()
|
|
61
62
|
let buttons = app.navigationBars.buttons.allElementsBoundByIndex
|
|
62
63
|
if let back = buttons.first(where: { $0.isHittable }) {
|
|
64
|
+
|
|
65
|
+
|
|
63
66
|
back.tap()
|
|
64
67
|
return .performed
|
|
65
68
|
}
|
|
66
|
-
if
|
|
69
|
+
if navigationRejectedQueryCount() != rejectedQueriesBefore
|
|
70
|
+
|| isSnapshotXCTestChannelPenalized(bundleId: mainOwned.bundleId)
|
|
71
|
+
{
|
|
67
72
|
NSLog("AGENT_DEVICE_RUNNER_IN_APP_BACK_SKIPPED_XCTEST_ENUMERATION bundle=%@", mainOwned.bundleId ?? "")
|
|
68
|
-
} else if let
|
|
69
|
-
|
|
70
|
-
return .performed
|
|
73
|
+
} else if let frame = topNavigationBackFrame(app: app) {
|
|
74
|
+
return tapResolvedNavigationBackControl(app: app, frame: frame)
|
|
71
75
|
}
|
|
72
|
-
return tapTopLeadingNavigationFallback(
|
|
76
|
+
return tapTopLeadingNavigationFallback(
|
|
77
|
+
app: app,
|
|
78
|
+
windowQueryRejected: navigationRejectedQueryCount() != rejectedQueriesBefore
|
|
79
|
+
)
|
|
73
80
|
#endif
|
|
74
81
|
}
|
|
75
82
|
|
|
@@ -84,32 +91,48 @@ extension RunnerTests {
|
|
|
84
91
|
#endif
|
|
85
92
|
}
|
|
86
93
|
|
|
87
|
-
|
|
94
|
+
@MainActor
|
|
95
|
+
private func tapResolvedNavigationBackControl(app: XCUIApplication, frame: CGRect) -> InAppBackOutcome {
|
|
96
|
+
guard SnapshotGeometry.isPositiveFinite(frame) else { return .unavailable }
|
|
97
|
+
let context = synthesizedCoordinateContext(
|
|
98
|
+
app: app,
|
|
99
|
+
policy: synthesizedGesturePolicy(.coordinateTap)
|
|
100
|
+
)
|
|
101
|
+
switch performSynthesizedGesture(app, kind: .coordinateTap, context: context, synthesize: {
|
|
102
|
+
synthesizedTapAt(app: app, x: frame.midX, y: frame.midY, context: context)
|
|
103
|
+
}) {
|
|
104
|
+
case .performed:
|
|
105
|
+
return .performed
|
|
106
|
+
case .refused:
|
|
107
|
+
return .unavailable
|
|
108
|
+
case .xctestFallback:
|
|
109
|
+
let fallback = performGesture(app) {
|
|
110
|
+
tapAt(app: app, x: frame.midX, y: frame.midY)
|
|
111
|
+
}
|
|
112
|
+
if case .performed = fallback.outcome { return .performed }
|
|
113
|
+
return .unavailable
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
private func topNavigationBackFrame(app: XCUIApplication) -> CGRect? {
|
|
88
118
|
#if os(iOS)
|
|
89
|
-
let
|
|
119
|
+
let window = onScreenWindowFrame(app: app)
|
|
90
120
|
let candidates = app.buttons.matching(Self.navigationBackPredicate()).allElementsBoundByIndex.compactMap {
|
|
91
|
-
element -> (
|
|
121
|
+
element -> (frame: CGRect, rank: Int)? in
|
|
92
122
|
guard element.exists, element.isHittable else { return nil }
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
identifier: element.identifier
|
|
101
|
-
) else {
|
|
102
|
-
return nil
|
|
103
|
-
}
|
|
104
|
-
return (element, rank)
|
|
123
|
+
let frame = element.frame
|
|
124
|
+
let identifier = element.identifier
|
|
125
|
+
guard Self.isTopNavigationBackCandidateFrame(frame, in: window, identifier: identifier)
|
|
126
|
+
else { return nil }
|
|
127
|
+
guard let rank = Self.navigationBackControlRank(label: element.label, identifier: identifier)
|
|
128
|
+
else { return nil }
|
|
129
|
+
return (frame, rank)
|
|
105
130
|
}
|
|
106
131
|
return candidates.sorted { lhs, rhs in
|
|
107
|
-
if lhs.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return leftFrame.minX < rightFrame.minX
|
|
112
|
-
}.first?.0
|
|
132
|
+
if lhs.rank != rhs.rank { return lhs.rank < rhs.rank }
|
|
133
|
+
if lhs.frame.minY != rhs.frame.minY { return lhs.frame.minY < rhs.frame.minY }
|
|
134
|
+
return lhs.frame.minX < rhs.frame.minX
|
|
135
|
+
}.first?.frame
|
|
113
136
|
#else
|
|
114
137
|
return nil
|
|
115
138
|
#endif
|
|
@@ -163,27 +186,30 @@ extension RunnerTests {
|
|
|
163
186
|
|
|
164
187
|
let xOffset = min(max(frame.width * 0.08, 28), 44)
|
|
165
188
|
|
|
166
|
-
|
|
189
|
+
|
|
190
|
+
let yOffset = min(max(frame.height * 0.1, 56), 96)
|
|
167
191
|
return CGPoint(x: frame.minX + xOffset, y: frame.minY + yOffset)
|
|
168
192
|
}
|
|
169
193
|
|
|
170
194
|
@MainActor
|
|
171
|
-
private func tapTopLeadingNavigationFallback(
|
|
195
|
+
private func tapTopLeadingNavigationFallback(
|
|
196
|
+
app: XCUIApplication,
|
|
197
|
+
windowQueryRejected: Bool
|
|
198
|
+
) -> InAppBackOutcome {
|
|
172
199
|
#if os(iOS)
|
|
173
|
-
let
|
|
174
|
-
|
|
200
|
+
guard let context = synthesizedCoordinateContext(
|
|
201
|
+
app: app,
|
|
202
|
+
policy: synthesizedGesturePolicy(.coordinateTap),
|
|
203
|
+
windowQueryRejected: windowQueryRejected
|
|
204
|
+
), let point = Self.topLeadingNavigationFallbackPoint(in: context.referenceFrame) else {
|
|
175
205
|
return .unavailable
|
|
176
206
|
}
|
|
177
|
-
let before = captureNavigationFallbackVisualState(app: app)
|
|
178
|
-
let context = synthesizedCoordinateContext(
|
|
179
|
-
app: app,
|
|
180
|
-
policy: synthesizedGesturePolicy(.coordinateTap)
|
|
181
|
-
)?.withReferenceFrame(frame)
|
|
207
|
+
let before = captureNavigationFallbackVisualState(app: app, context: context)
|
|
182
208
|
switch performSynthesizedGesture(app, kind: .coordinateTap, context: context, synthesize: {
|
|
183
209
|
synthesizedTapAt(app: app, x: point.x, y: point.y, context: context)
|
|
184
210
|
}) {
|
|
185
211
|
case .performed:
|
|
186
|
-
return verifyNavigationFallbackOutcome(app: app, before: before)
|
|
212
|
+
return verifyNavigationFallbackOutcome(app: app, before: before, context: context)
|
|
187
213
|
case .refused:
|
|
188
214
|
return .unavailable
|
|
189
215
|
case .xctestFallback:
|
|
@@ -191,17 +217,30 @@ extension RunnerTests {
|
|
|
191
217
|
tapAt(app: app, x: point.x, y: point.y)
|
|
192
218
|
}
|
|
193
219
|
if case .performed = fallback.outcome {
|
|
194
|
-
return verifyNavigationFallbackOutcome(app: app, before: before)
|
|
220
|
+
return verifyNavigationFallbackOutcome(app: app, before: before, context: context)
|
|
195
221
|
}
|
|
196
222
|
}
|
|
197
223
|
#endif
|
|
198
224
|
return .unavailable
|
|
199
225
|
}
|
|
200
226
|
|
|
201
|
-
private func
|
|
227
|
+
private func navigationRejectedQueryCount() -> Int {
|
|
228
|
+
suppressedIssueLock.lock()
|
|
229
|
+
defer { suppressedIssueLock.unlock() }
|
|
230
|
+
return suppressedAxSnapshotIssueCount
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
private func captureNavigationFallbackVisualState(
|
|
234
|
+
app: XCUIApplication,
|
|
235
|
+
context: SynthesizedCoordinateContext
|
|
236
|
+
) -> NavigationVisualSample {
|
|
202
237
|
#if os(iOS)
|
|
203
238
|
return Self.navigationFallbackSample(
|
|
204
|
-
resolvingApp: {
|
|
239
|
+
resolvingApp: {
|
|
240
|
+
context.resolvedWindow == nil
|
|
241
|
+
? self.captureSoleAppScreen()
|
|
242
|
+
: self.captureResolvedAppScreen(app: app)
|
|
243
|
+
},
|
|
205
244
|
systemSurface: { self.captureResolvedAppScreen(app: self.springboard) },
|
|
206
245
|
encoding: { runnerPngData(for: $0.image) }
|
|
207
246
|
)
|
|
@@ -256,10 +295,11 @@ extension RunnerTests {
|
|
|
256
295
|
|
|
257
296
|
private func verifyNavigationFallbackOutcome(
|
|
258
297
|
app: XCUIApplication,
|
|
259
|
-
before: NavigationVisualSample
|
|
298
|
+
before: NavigationVisualSample,
|
|
299
|
+
context: SynthesizedCoordinateContext
|
|
260
300
|
) -> InAppBackOutcome {
|
|
261
301
|
sleepFor(Self.navigationFallbackVerificationDelay)
|
|
262
|
-
let after = captureNavigationFallbackVisualState(app: app)
|
|
302
|
+
let after = captureNavigationFallbackVisualState(app: app, context: context)
|
|
263
303
|
let observation = Self.navigationVisualObservation(before: before.data, after: after.data)
|
|
264
304
|
|
|
265
305
|
|
|
@@ -35,14 +35,16 @@ extension RunnerTests {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
let synthesizedContext = synthesizedSequenceCoordinateContext(steps: steps, app: activeApp)
|
|
39
|
+
|
|
40
|
+
|
|
38
41
|
|
|
39
42
|
let firstStep = steps[0]
|
|
40
43
|
let firstFrame = (firstStep.x != nil && firstStep.y != nil)
|
|
41
|
-
?
|
|
44
|
+
? synthesizedContext.map { touchVisualizationFrame(x: firstStep.x!, y: firstStep.y!, context: $0) }
|
|
45
|
+
?? resolvedTouchVisualizationFrame(app: activeApp, x: firstStep.x!, y: firstStep.y!)
|
|
42
46
|
: nil
|
|
43
47
|
|
|
44
|
-
let synthesizedContext = synthesizedSequenceCoordinateContext(steps: steps, app: activeApp)
|
|
45
|
-
|
|
46
48
|
let execution = assembleSequenceExecution(steps: steps) { _, step in
|
|
47
49
|
performSequenceStep(step, activeApp: activeApp, synthesizedContext: synthesizedContext)
|
|
48
50
|
}
|
|
@@ -145,9 +147,17 @@ extension RunnerTests {
|
|
|
145
147
|
) -> SequenceStepOutcome {
|
|
146
148
|
let x = step.x ?? 0
|
|
147
149
|
let y = step.y ?? 0
|
|
150
|
+
let longPressDurationMs = min(max(step.durationMs ?? 800, 16), 10000)
|
|
148
151
|
if let policyKind = synthesizedPolicyKind(forSequenceStep: step) {
|
|
149
152
|
switch performSynthesizedGesture(activeApp, kind: policyKind, context: synthesizedContext, synthesize: {
|
|
150
|
-
|
|
153
|
+
synthesizedSequenceStep(
|
|
154
|
+
policyKind,
|
|
155
|
+
app: activeApp,
|
|
156
|
+
x: x,
|
|
157
|
+
y: y,
|
|
158
|
+
longPressDurationMs: longPressDurationMs,
|
|
159
|
+
context: synthesizedContext
|
|
160
|
+
)
|
|
151
161
|
}) {
|
|
152
162
|
case .performed(let timing):
|
|
153
163
|
return finishedSequenceStep(step, timing: timing, outcome: .performed)
|
|
@@ -167,8 +177,7 @@ extension RunnerTests {
|
|
|
167
177
|
|
|
168
178
|
return doubleTapAt(app: activeApp, x: x, y: y)
|
|
169
179
|
case "longPress":
|
|
170
|
-
|
|
171
|
-
return longPressAt(app: activeApp, x: x, y: y, duration: duration)
|
|
180
|
+
return longPressAt(app: activeApp, x: x, y: y, duration: longPressDurationMs / 1000.0)
|
|
172
181
|
default:
|
|
173
182
|
return tapAt(app: activeApp, x: x, y: y)
|
|
174
183
|
}
|
|
@@ -176,6 +185,31 @@ extension RunnerTests {
|
|
|
176
185
|
return finishedSequenceStep(step, timing: timing, outcome: outcome)
|
|
177
186
|
}
|
|
178
187
|
|
|
188
|
+
@MainActor
|
|
189
|
+
private func synthesizedSequenceStep(
|
|
190
|
+
_ policyKind: SynthesizedGesturePolicyKind,
|
|
191
|
+
app: XCUIApplication,
|
|
192
|
+
x: Double,
|
|
193
|
+
y: Double,
|
|
194
|
+
longPressDurationMs: Double,
|
|
195
|
+
context: SynthesizedCoordinateContext?
|
|
196
|
+
) -> RunnerInteractionOutcome? {
|
|
197
|
+
switch policyKind {
|
|
198
|
+
#if os(iOS)
|
|
199
|
+
case .coordinateLongPress:
|
|
200
|
+
return synthesizedLongPressAt(
|
|
201
|
+
app: app,
|
|
202
|
+
x: x,
|
|
203
|
+
y: y,
|
|
204
|
+
durationMs: longPressDurationMs,
|
|
205
|
+
context: context
|
|
206
|
+
)
|
|
207
|
+
#endif
|
|
208
|
+
default:
|
|
209
|
+
return synthesizedTapAt(app: app, x: x, y: y, context: context)
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
179
213
|
private func finishedSequenceStep(
|
|
180
214
|
_ step: SequenceStep,
|
|
181
215
|
timing: (gestureStartUptimeMs: Double, gestureEndUptimeMs: Double),
|
|
@@ -51,6 +51,45 @@ enum SnapshotXCTestChannelPlanState: Equatable {
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
struct SnapshotXCTestChannelPenalty: Equatable {
|
|
55
|
+
static let duration: TimeInterval = 120
|
|
56
|
+
static let recoveryProbeInterval: TimeInterval = 30
|
|
57
|
+
|
|
58
|
+
private(set) var bundleId: String?
|
|
59
|
+
private(set) var until = Date.distantPast
|
|
60
|
+
private(set) var probeDueAt = Date.distantFuture
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
func isActive(for bundleId: String?, at now: Date) -> Bool {
|
|
64
|
+
guard now < until else { return false }
|
|
65
|
+
guard let penalized = self.bundleId else { return true }
|
|
66
|
+
return penalized == bundleId
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
func isProbeDue(for bundleId: String?, at now: Date) -> Bool {
|
|
70
|
+
isActive(for: bundleId, at: now) && now >= probeDueAt
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
mutating func arm(bundleId: String?, at now: Date) {
|
|
74
|
+
self.bundleId = bundleId
|
|
75
|
+
until = now.addingTimeInterval(Self.duration)
|
|
76
|
+
probeDueAt = now.addingTimeInterval(Self.recoveryProbeInterval)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
mutating func claimProbe(at now: Date) {
|
|
81
|
+
probeDueAt = now.addingTimeInterval(Self.recoveryProbeInterval)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
mutating func clear() {
|
|
85
|
+
self = SnapshotXCTestChannelPenalty()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
54
93
|
|
|
55
94
|
enum SnapshotTierOutcome: Equatable {
|
|
56
95
|
case completed
|
|
@@ -64,6 +103,12 @@ struct EffectiveSnapshotCapturePlan {
|
|
|
64
103
|
|
|
65
104
|
|
|
66
105
|
let preferredBackend: SnapshotBackendKind?
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
var leadsWithXCTestRecoveryProbe: Bool {
|
|
109
|
+
xCTestChannelState == .deferredToIndependentBackend
|
|
110
|
+
&& plan.first?.usesXCTestAccessibilityChannel == true
|
|
111
|
+
}
|
|
67
112
|
}
|
|
68
113
|
|
|
69
114
|
|
|
@@ -144,8 +189,7 @@ extension RunnerTests {
|
|
|
144
189
|
|
|
145
190
|
func penalizeSnapshotXCTestChannel(bundleId: String?, reason: String) {
|
|
146
191
|
snapshotXCTestChannelPenaltyLock.lock()
|
|
147
|
-
|
|
148
|
-
snapshotXCTestChannelPenaltyUntil = Date().addingTimeInterval(snapshotXCTestChannelPenaltyDuration)
|
|
192
|
+
snapshotXCTestChannelPenalty.arm(bundleId: bundleId, at: Date())
|
|
149
193
|
snapshotXCTestChannelPenaltyLock.unlock()
|
|
150
194
|
NSLog(
|
|
151
195
|
"AGENT_DEVICE_RUNNER_SNAPSHOT_XCTEST_CHANNEL_PENALIZED bundle=%@ reason=%@",
|
|
@@ -156,9 +200,8 @@ extension RunnerTests {
|
|
|
156
200
|
|
|
157
201
|
func clearSnapshotXCTestChannelPenalty(reason: String) {
|
|
158
202
|
snapshotXCTestChannelPenaltyLock.lock()
|
|
159
|
-
let hadActivePenalty = Date() <
|
|
160
|
-
|
|
161
|
-
snapshotXCTestChannelPenaltyUntil = Date.distantPast
|
|
203
|
+
let hadActivePenalty = Date() < snapshotXCTestChannelPenalty.until
|
|
204
|
+
snapshotXCTestChannelPenalty.clear()
|
|
162
205
|
snapshotXCTestChannelPenaltyLock.unlock()
|
|
163
206
|
if hadActivePenalty {
|
|
164
207
|
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_XCTEST_CHANNEL_PENALTY_CLEARED reason=%@", reason)
|
|
@@ -168,10 +211,20 @@ extension RunnerTests {
|
|
|
168
211
|
func isSnapshotXCTestChannelPenalized(bundleId: String?) -> Bool {
|
|
169
212
|
snapshotXCTestChannelPenaltyLock.lock()
|
|
170
213
|
defer { snapshotXCTestChannelPenaltyLock.unlock() }
|
|
171
|
-
|
|
214
|
+
return snapshotXCTestChannelPenalty.isActive(for: bundleId, at: Date())
|
|
215
|
+
}
|
|
172
216
|
|
|
173
|
-
|
|
174
|
-
|
|
217
|
+
func isSnapshotXCTestRecoveryProbeDue(bundleId: String?) -> Bool {
|
|
218
|
+
snapshotXCTestChannelPenaltyLock.lock()
|
|
219
|
+
defer { snapshotXCTestChannelPenaltyLock.unlock() }
|
|
220
|
+
return snapshotXCTestChannelPenalty.isProbeDue(for: bundleId, at: Date())
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
func claimSnapshotXCTestRecoveryProbe(bundleId: String?) {
|
|
224
|
+
snapshotXCTestChannelPenaltyLock.lock()
|
|
225
|
+
snapshotXCTestChannelPenalty.claimProbe(at: Date())
|
|
226
|
+
snapshotXCTestChannelPenaltyLock.unlock()
|
|
227
|
+
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_XCTEST_RECOVERY_PROBE bundle=%@", bundleId ?? "")
|
|
175
228
|
}
|
|
176
229
|
|
|
177
230
|
|
|
@@ -246,9 +299,11 @@ extension RunnerTests {
|
|
|
246
299
|
|
|
247
300
|
|
|
248
301
|
|
|
302
|
+
|
|
249
303
|
static func effectiveSnapshotCapturePlan(
|
|
250
304
|
_ plan: [SnapshotBackendKind],
|
|
251
305
|
xCTestChannelPenalized: Bool,
|
|
306
|
+
xCTestRecoveryProbeDue: Bool = false,
|
|
252
307
|
availableBackends: Set<SnapshotBackendKind> = Set(SnapshotBackendKind.allCases),
|
|
253
308
|
preferredBackend: String? = nil
|
|
254
309
|
) -> EffectiveSnapshotCapturePlan {
|
|
@@ -280,8 +335,10 @@ extension RunnerTests {
|
|
|
280
335
|
|
|
281
336
|
|
|
282
337
|
|
|
338
|
+
|
|
339
|
+
let boundedTree = availablePlan.filter { $0 == .recursiveTree }
|
|
283
340
|
return EffectiveSnapshotCapturePlan(
|
|
284
|
-
plan:
|
|
341
|
+
plan: xCTestRecoveryProbeDue ? boundedTree + recoveryPlan : recoveryPlan + boundedTree,
|
|
285
342
|
xCTestChannelState: .deferredToIndependentBackend,
|
|
286
343
|
treeCaptureSliceBudgetOverride: Self.penalizedXCTestProbeTreeSliceBudget,
|
|
287
344
|
preferredBackend: nil
|
|
@@ -324,8 +381,10 @@ extension RunnerTests {
|
|
|
324
381
|
|
|
325
382
|
var xCTestChannelPenalized = false
|
|
326
383
|
var xCTestChannelPenalizedByBreaker = false
|
|
384
|
+
var xCTestRecoveryProbeDue = false
|
|
327
385
|
#if os(iOS)
|
|
328
386
|
xCTestChannelPenalizedByBreaker = isSnapshotXCTestChannelPenalized(bundleId: target.bundleId)
|
|
387
|
+
xCTestRecoveryProbeDue = isSnapshotXCTestRecoveryProbeDue(bundleId: target.bundleId)
|
|
329
388
|
xCTestChannelPenalized = Self.snapshotXCTestChannelTreatedAsPenalized(
|
|
330
389
|
penalized: xCTestChannelPenalizedByBreaker,
|
|
331
390
|
preferredBackend: options.preferredBackend
|
|
@@ -334,6 +393,7 @@ extension RunnerTests {
|
|
|
334
393
|
let effective = Self.effectiveSnapshotCapturePlan(
|
|
335
394
|
plan,
|
|
336
395
|
xCTestChannelPenalized: xCTestChannelPenalized,
|
|
396
|
+
xCTestRecoveryProbeDue: xCTestRecoveryProbeDue,
|
|
337
397
|
availableBackends: Set(SnapshotBackendKind.allCases.filter(\.isAvailableOnCurrentPlatform)),
|
|
338
398
|
preferredBackend: options.preferredBackend
|
|
339
399
|
)
|
|
@@ -374,6 +434,9 @@ extension RunnerTests {
|
|
|
374
434
|
}
|
|
375
435
|
continue
|
|
376
436
|
}
|
|
437
|
+
if kind == effectivePlan.first && effective.leadsWithXCTestRecoveryProbe {
|
|
438
|
+
claimSnapshotXCTestRecoveryProbe(bundleId: target.bundleId)
|
|
439
|
+
}
|
|
377
440
|
if kind.usesXCTestAccessibilityChannel { xCTestTierRan = true }
|
|
378
441
|
let attempt = try captureWithBackend(
|
|
379
442
|
kind,
|
|
@@ -386,7 +449,8 @@ extension RunnerTests {
|
|
|
386
449
|
kind,
|
|
387
450
|
attempt: attempt,
|
|
388
451
|
bundleId: target.bundleId,
|
|
389
|
-
penaltySuppressed: suppressXCTestPenalty
|
|
452
|
+
penaltySuppressed: suppressXCTestPenalty,
|
|
453
|
+
channelState: effective.xCTestChannelState
|
|
390
454
|
)
|
|
391
455
|
if case let .failed(failure, phase: _) = attempt.outcome {
|
|
392
456
|
if Self.isAxSnapshotFailure(failure) { axFailure = failure }
|
|
@@ -119,9 +119,10 @@ extension RunnerTests {
|
|
|
119
119
|
static func snapshotXCTestPenaltyReason(
|
|
120
120
|
kind: SnapshotBackendKind,
|
|
121
121
|
attempt: SnapshotBackendAttempt,
|
|
122
|
-
slowThresholdMs: Double
|
|
122
|
+
slowThresholdMs: Double,
|
|
123
|
+
channelState: SnapshotXCTestChannelPlanState = .normal
|
|
123
124
|
) -> String? {
|
|
124
|
-
guard kind.usesXCTestAccessibilityChannel else { return nil }
|
|
125
|
+
guard channelState == .normal, kind.usesXCTestAccessibilityChannel else { return nil }
|
|
125
126
|
if case let .failed(failure, phase: .acquisition) = attempt.outcome,
|
|
126
127
|
failure.code == Self.xCTestSnapshotTimeoutCode
|
|
127
128
|
{
|
|
@@ -134,18 +135,46 @@ extension RunnerTests {
|
|
|
134
135
|
return "slow_\(kind.rawValue)_capture_\(Int(attempt.timing.acquisitionMs))ms"
|
|
135
136
|
}
|
|
136
137
|
|
|
138
|
+
|
|
139
|
+
static func snapshotXCTestRecoveryProbeSucceeded(
|
|
140
|
+
kind: SnapshotBackendKind,
|
|
141
|
+
attempt: SnapshotBackendAttempt,
|
|
142
|
+
channelState: SnapshotXCTestChannelPlanState
|
|
143
|
+
) -> Bool {
|
|
144
|
+
guard channelState != .normal,
|
|
145
|
+
kind == .recursiveTree,
|
|
146
|
+
attempt.timing.acquisitionMs <= Self.penalizedXCTestProbeTreeSliceBudget * 1_000,
|
|
147
|
+
case let .captured(capture) = attempt.outcome
|
|
148
|
+
else { return false }
|
|
149
|
+
return Self.snapshotTierRejectionReason(
|
|
150
|
+
outcome: attempt.tierOutcome,
|
|
151
|
+
kind: kind,
|
|
152
|
+
payload: capture.qualityPayload ?? capture.payload
|
|
153
|
+
) == nil
|
|
154
|
+
}
|
|
155
|
+
|
|
137
156
|
func recordXCTestSnapshotBackendAttemptIfNeeded(
|
|
138
157
|
_ kind: SnapshotBackendKind,
|
|
139
158
|
attempt: SnapshotBackendAttempt,
|
|
140
159
|
bundleId: String?,
|
|
141
|
-
penaltySuppressed: Bool
|
|
160
|
+
penaltySuppressed: Bool,
|
|
161
|
+
channelState: SnapshotXCTestChannelPlanState
|
|
142
162
|
) {
|
|
143
163
|
guard !penaltySuppressed else { return }
|
|
164
|
+
if Self.snapshotXCTestRecoveryProbeSucceeded(
|
|
165
|
+
kind: kind,
|
|
166
|
+
attempt: attempt,
|
|
167
|
+
channelState: channelState
|
|
168
|
+
) {
|
|
169
|
+
clearSnapshotXCTestChannelPenalty(reason: "healthy_tree_recovery_probe")
|
|
170
|
+
return
|
|
171
|
+
}
|
|
144
172
|
guard
|
|
145
173
|
let reason = Self.snapshotXCTestPenaltyReason(
|
|
146
174
|
kind: kind,
|
|
147
175
|
attempt: attempt,
|
|
148
|
-
slowThresholdMs: snapshotXCTestSlowCaptureThreshold * 1_000
|
|
176
|
+
slowThresholdMs: snapshotXCTestSlowCaptureThreshold * 1_000,
|
|
177
|
+
channelState: channelState
|
|
149
178
|
)
|
|
150
179
|
else { return }
|
|
151
180
|
penalizeSnapshotXCTestChannel(
|
|
@@ -138,7 +138,7 @@ extension RunnerTests {
|
|
|
138
138
|
observe: () -> TextValueRead,
|
|
139
139
|
waitForNextObservation: () -> Void
|
|
140
140
|
) {
|
|
141
|
-
let field =
|
|
141
|
+
let field = resolveTextEntryInput(app: app, target: target)?.attributes
|
|
142
142
|
let placeholder = field?.placeholderValue
|
|
143
143
|
let waitStartedAt = Date()
|
|
144
144
|
return (
|
|
@@ -146,7 +146,7 @@ extension RunnerTests {
|
|
|
146
146
|
fieldIsUnreadable: textValueRead(for: field) == .unreadable,
|
|
147
147
|
observe: {
|
|
148
148
|
let observed = self.textValueRead(
|
|
149
|
-
for: self.
|
|
149
|
+
for: self.resolveTextEntryInput(app: app, target: target)?.attributes,
|
|
150
150
|
treatingPlaceholderAsEmpty: true
|
|
151
151
|
)
|
|
152
152
|
var observedText: String?
|
|
@@ -45,6 +45,7 @@ enum SynthesizedFallbackPolicy: String, Equatable, Hashable {
|
|
|
45
45
|
|
|
46
46
|
enum SynthesizedGesturePolicyKind: String, Equatable, Hashable {
|
|
47
47
|
case coordinateTap
|
|
48
|
+
case coordinateLongPress
|
|
48
49
|
case scroll
|
|
49
50
|
case synthesizedDrag
|
|
50
51
|
}
|
|
@@ -58,7 +59,9 @@ struct SynthesizedCoordinateContext {
|
|
|
58
59
|
let referenceFrame: CGRect
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
let resolvedWindow: XCUIElement?
|
|
62
65
|
let keyboardPolicy: SynthesizedKeyboardPolicy
|
|
63
66
|
let accessibilityHealth: RunnerAccessibilityHealth
|
|
64
67
|
|
|
@@ -83,6 +86,14 @@ func synthesizedGesturePolicy(_ kind: SynthesizedGesturePolicyKind) -> Synthesiz
|
|
|
83
86
|
keyboardPolicy: .never,
|
|
84
87
|
fallbackPolicy: .xctestCoordinateAllowed
|
|
85
88
|
)
|
|
89
|
+
case .coordinateLongPress:
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return SynthesizedGesturePolicy(
|
|
94
|
+
keyboardPolicy: .never,
|
|
95
|
+
fallbackPolicy: .xctestCoordinateWhenAccessibilityAvailable
|
|
96
|
+
)
|
|
86
97
|
case .scroll:
|
|
87
98
|
|
|
88
99
|
|
|
@@ -107,8 +118,18 @@ func shouldProbeCoordinateTapTextInput(xCTestChannelPenalized: Bool) -> Bool {
|
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
|
|
121
|
+
|
|
110
122
|
func synthesizedPolicyKind(forSequenceStep step: SequenceStep) -> SynthesizedGesturePolicyKind? {
|
|
111
|
-
|
|
123
|
+
switch step.kind {
|
|
124
|
+
case "tap":
|
|
125
|
+
return step.synthesized == true ? .coordinateTap : nil
|
|
126
|
+
#if os(iOS)
|
|
127
|
+
case "longPress":
|
|
128
|
+
return .coordinateLongPress
|
|
129
|
+
#endif
|
|
130
|
+
default:
|
|
131
|
+
return nil
|
|
132
|
+
}
|
|
112
133
|
}
|
|
113
134
|
|
|
114
135
|
|