agent-device 0.21.7 → 0.21.9
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.7.apk → agent-device-android-ime-helper-0.21.9.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.9.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.7.manifest.json → agent-device-android-ime-helper-0.21.9.manifest.json} +4 -4
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.7.apk → agent-device-android-snapshot-helper-0.21.9.apk} +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.9.apk.sha256 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.7.manifest.json → agent-device-android-snapshot-helper-0.21.9.manifest.json} +6 -6
- package/apple/macos-helper/Package.swift +16 -1
- package/apple/macos-helper/Sources/AgentDeviceMacOSDeviceHub/DeviceHubPose.swift +47 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSDeviceHub/DeviceHubWindowInventory.swift +65 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubPose.swift +225 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubSidebar.swift +57 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/DeviceHubWindowDiscovery.swift +108 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/main.swift +66 -13
- package/apple/macos-helper/Sources/AgentDeviceMacOSInput/MouseClickDelivery.swift +116 -0
- package/apple/macos-helper/Sources/AgentDeviceMacOSInput/MouseClickSchedule.swift +61 -0
- package/apple/macos-helper/Tests/AgentDeviceMacOSDeviceHubTests/DeviceHubPoseTests.swift +30 -0
- package/apple/macos-helper/Tests/AgentDeviceMacOSDeviceHubTests/DeviceHubWindowInventoryTests.swift +65 -0
- package/apple/macos-helper/Tests/AgentDeviceMacOSInputTests/MouseClickScheduleTests.swift +58 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/AgentDeviceRunnerUITests-Bridging-Header.h +1 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerAppScreenCapture.swift +175 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +10 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +42 -15
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +8 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +45 -22
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +39 -734
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift +20 -4
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +63 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +13 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift +25 -10
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +5 -562
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotAcquisition.swift +566 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedGesturePolicy.swift +5 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +594 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.h +35 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerXCTestEventBridge.m +160 -0
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/RecordingExportSupport.swift +3 -0
- package/dist/apple/runner/AgentDeviceRunner/RecordingScripts/recording-frames.swift +203 -0
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotCoordinateSpace.swift +5 -0
- package/dist/src/absence-observation-errors.js +1 -1
- package/dist/src/adapter.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-device-client.js +2 -2
- package/dist/src/alert-runtime.js +1 -1
- package/dist/src/android-adb.js +1 -1
- package/dist/src/android-input-ownership.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-launch.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- 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-paths.js +1 -0
- package/dist/src/back-mode.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +15 -11
- package/dist/src/cli.js +4 -4
- package/dist/src/client-types.d.ts +51 -1
- package/dist/src/command-tools.js +3 -3
- package/dist/src/config.js +1 -1
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/device-claim-inspection.js +1 -1
- package/dist/src/device-claim-rule.js +2 -2
- package/dist/src/device-input-state.d.ts +1 -1
- package/dist/src/device-rotation.js +1 -1
- package/dist/src/device-selection-resolver.js +1 -1
- package/dist/src/device-session.js +1 -1
- package/dist/src/device.js +1 -1
- package/dist/src/device2.js +1 -1
- package/dist/src/devicectl.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/durable-resource.js +1 -1
- package/dist/src/exec.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/fold-runtime.js +1 -0
- package/dist/src/gesture-admission.js +1 -1
- package/dist/src/gesture-runtime.js +1 -1
- package/dist/src/harmonyos.js +1 -1
- package/dist/src/helper.js +2 -2
- package/dist/src/host.js +1 -0
- package/dist/src/interaction-positionals.js +1 -1
- package/dist/src/interaction-ref-policy.js +1 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/interaction2.js +1 -1
- package/dist/src/interactor-operation-binding.js +1 -0
- package/dist/src/interactor-operation-catalog.js +1 -1
- package/dist/src/interactor.js +4 -5
- package/dist/src/interactor2.js +1 -1
- package/dist/src/interactors.js +1 -1
- package/dist/src/internal/bin.js +1 -1
- package/dist/src/internal/daemon.js +2 -2
- package/dist/src/internal/png-worker.d.ts +5 -0
- package/dist/src/internal/png-worker.js +1 -1
- package/dist/src/inventory2.js +1 -1
- package/dist/src/ios-snapshot-acquisition.js +1 -1
- package/dist/src/ios-snapshot-runtime.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/linux.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/location-coordinates.js +1 -1
- package/dist/src/macos-facade.js +1 -1
- package/dist/src/managed-device-scope.js +1 -1
- package/dist/src/mechanics.js +17 -16
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/mp4-duration.js +1 -0
- package/dist/src/multitouch-support.js +1 -1
- package/dist/src/owner-identity.js +1 -1
- package/dist/src/parameterized-recorded-fill.js +1 -1
- package/dist/src/perf-facade.js +2 -2
- package/dist/src/perf-runtime-plan.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-managed-owner.js +1 -1
- package/dist/src/platform-runtime-open-target.js +1 -1
- package/dist/src/platform-runtime-operation-host.js +2 -2
- package/dist/src/platform-runtime-runtime-hints.js +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-crop-bytes.js +1 -1
- package/dist/src/png-encode.js +1 -0
- package/dist/src/png-size.js +1 -0
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/provider-webdriver.js +1 -1
- package/dist/src/quality-warnings.js +1 -1
- package/dist/src/react-native.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/recording-export-quality.js +1 -1
- package/dist/src/recording-scope.js +1 -0
- package/dist/src/recording.js +3 -0
- package/dist/src/registry.js +35 -35
- package/dist/src/replay.js +1 -1
- package/dist/src/request-admission.js +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/runner-cache-metadata.js +2 -2
- package/dist/src/runner-client.js +1 -1
- package/dist/src/runner-contract.js +3 -0
- package/dist/src/runner-dev-tools-security.js +1 -0
- package/dist/src/runner-device-readiness.js +1 -0
- package/dist/src/runner-disposal.js +1 -1
- package/dist/src/runner-operations-facade.js +1 -1
- package/dist/src/runner-presentation.js +1 -1
- package/dist/src/runner.js +1 -1
- package/dist/src/runtime.js +2 -2
- package/dist/src/runtime10.js +2 -1
- package/dist/src/runtime2.js +4 -4
- package/dist/src/runtime4.js +5 -5
- package/dist/src/runtime5.js +1 -1
- package/dist/src/runtime6.js +1 -1
- package/dist/src/runtime7.js +1 -1
- package/dist/src/runtime8.js +1 -1
- package/dist/src/runtime9.js +1 -1
- package/dist/src/screen-recording-admission-ledger.js +1 -1
- package/dist/src/screen-recording-resource-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.js +1 -0
- package/dist/src/screenshot-overlay-draw.js +1 -0
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/script.js +1 -1
- package/dist/src/scroll-gesture.js +1 -1
- package/dist/src/sdk-batch.js +2 -2
- package/dist/src/sdk-contracts.d.ts +7 -5
- 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-selectors.d.ts +58 -6
- package/dist/src/sdk-selectors.js +1 -1
- package/dist/src/selection.js +0 -0
- package/dist/src/selector-runtime.js +1 -1
- package/dist/src/selectors.js +1 -1
- package/dist/src/semantic-index.js +1 -1
- package/dist/src/session-routing.js +1 -1
- package/dist/src/session-snapshot.js +1 -1
- package/dist/src/session-store.js +3 -3
- package/dist/src/session2.js +3 -3
- package/dist/src/simctl.js +1 -1
- package/dist/src/simulator-boot.js +1 -1
- package/dist/src/simulator-facade.js +1 -1
- package/dist/src/simulator.js +1 -1
- package/dist/src/snapshot-runtime-binding.js +1 -1
- package/dist/src/snapshot-runtime.js +1 -1
- package/dist/src/snapshot-state.js +1 -1
- package/dist/src/snapshot4.js +1 -1
- package/dist/src/src.js +1 -1
- package/dist/src/src7.js +1 -1
- package/dist/src/src8.js +1 -1
- package/dist/src/stop-sequence.js +1 -1
- package/dist/src/text-entry-focus.js +1 -1
- package/dist/src/touch-runtime.js +1 -1
- package/dist/src/tree.js +1 -1
- package/dist/src/type-text-runtime.js +1 -1
- package/dist/src/video.js +2 -2
- package/dist/src/web2.js +1 -1
- package/package.json +3 -1
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.7.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.7.apk.sha256 +0 -1
- package/dist/src/png-transcode.js +0 -1
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Keyboard.swift
CHANGED
|
@@ -212,6 +212,7 @@ extension RunnerTests {
|
|
|
212
212
|
if tapKeyboardDismissControl(app: app) {
|
|
213
213
|
_ = keyboard.waitForNonExistence(timeout: KeyboardDismissObservationTiming.timeout)
|
|
214
214
|
waitForScreenshotStability(
|
|
215
|
+
app: app,
|
|
215
216
|
timeout: KeyboardDismissObservationTiming.settleTimeout,
|
|
216
217
|
sampleInterval: KeyboardDismissObservationTiming.settleSampleInterval,
|
|
217
218
|
requiredConsecutiveMatches: KeyboardDismissObservationTiming.settleRequiredConsecutiveMatches
|
|
@@ -240,23 +241,38 @@ extension RunnerTests {
|
|
|
240
241
|
|
|
241
242
|
|
|
242
243
|
private func waitForScreenshotStability(
|
|
244
|
+
app: XCUIApplication,
|
|
243
245
|
timeout: TimeInterval,
|
|
244
246
|
sampleInterval: TimeInterval,
|
|
245
247
|
requiredConsecutiveMatches: Int
|
|
246
248
|
) {
|
|
247
249
|
let deadline = Date().addingTimeInterval(timeout)
|
|
248
|
-
var samples: [Data?] = [screenshotFingerprintForStabilityCheck()]
|
|
250
|
+
var samples: [Data?] = [screenshotFingerprintForStabilityCheck(app: app)]
|
|
249
251
|
while Date() < deadline {
|
|
250
252
|
sleepFor(sampleInterval)
|
|
251
|
-
samples.append(screenshotFingerprintForStabilityCheck())
|
|
253
|
+
samples.append(screenshotFingerprintForStabilityCheck(app: app))
|
|
252
254
|
if runnerScreenshotStabilitySettled(samples, requiredConsecutiveMatches: requiredConsecutiveMatches) {
|
|
255
|
+
logScreenshotStability(samples: samples, settled: true)
|
|
253
256
|
return
|
|
254
257
|
}
|
|
255
258
|
}
|
|
259
|
+
logScreenshotStability(samples: samples, settled: false)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
private func logScreenshotStability(samples: [Data?], settled: Bool) {
|
|
266
|
+
NSLog(
|
|
267
|
+
"AGENT_DEVICE_RUNNER_KEYBOARD_STABILITY samples=%ld captured=%ld settled=%@",
|
|
268
|
+
samples.count,
|
|
269
|
+
samples.compactMap { $0 }.count,
|
|
270
|
+
settled ? "yes" : "no"
|
|
271
|
+
)
|
|
256
272
|
}
|
|
257
273
|
|
|
258
|
-
private func screenshotFingerprintForStabilityCheck() -> Data? {
|
|
259
|
-
guard let image = captureRunnerFrame() else { return nil }
|
|
274
|
+
private func screenshotFingerprintForStabilityCheck(app: XCUIApplication) -> Data? {
|
|
275
|
+
guard let image = captureRunnerFrame(app: app) else { return nil }
|
|
260
276
|
return runnerPngData(for: image)
|
|
261
277
|
}
|
|
262
278
|
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift
CHANGED
|
@@ -42,7 +42,20 @@ enum RunnerInteractionIdleWaits {
|
|
|
42
42
|
extension RunnerTests {
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
func captureRunnerFrame(app: XCUIApplication) -> RunnerImage? {
|
|
53
|
+
#if os(iOS)
|
|
54
|
+
guard case .success(let captured) = captureObservedScreen(app: app) else {
|
|
55
|
+
return nil
|
|
56
|
+
}
|
|
57
|
+
return captured.image
|
|
58
|
+
#else
|
|
46
59
|
var image: RunnerImage?
|
|
47
60
|
let capture = {
|
|
48
61
|
let screenshot = XCUIScreen.main.screenshot()
|
|
@@ -54,6 +67,7 @@ extension RunnerTests {
|
|
|
54
67
|
DispatchQueue.main.sync(execute: capture)
|
|
55
68
|
}
|
|
56
69
|
return image
|
|
70
|
+
#endif
|
|
57
71
|
}
|
|
58
72
|
|
|
59
73
|
func screenshotRoot(app: XCUIApplication) -> XCUIElement {
|
|
@@ -66,6 +80,54 @@ extension RunnerTests {
|
|
|
66
80
|
return app
|
|
67
81
|
}
|
|
68
82
|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
func screenshotResponse(
|
|
88
|
+
pngData: Data,
|
|
89
|
+
inlineScreenshot: Bool,
|
|
90
|
+
metadata: ScreenshotMetadataPayload? = nil
|
|
91
|
+
) -> Response {
|
|
92
|
+
if inlineScreenshot {
|
|
93
|
+
return Response(
|
|
94
|
+
ok: true,
|
|
95
|
+
data: DataPayload(imageBase64: pngData.base64EncodedString(), screenshotMetadata: metadata)
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
let fileName = "screenshot-\(Int(Date().timeIntervalSince1970 * 1000)).png"
|
|
99
|
+
let filePath = (NSTemporaryDirectory() as NSString).appendingPathComponent(fileName)
|
|
100
|
+
do {
|
|
101
|
+
try pngData.write(to: URL(fileURLWithPath: filePath))
|
|
102
|
+
} catch {
|
|
103
|
+
return Response(
|
|
104
|
+
ok: false,
|
|
105
|
+
error: ErrorPayload(message: "Failed to write screenshot: \(error.localizedDescription)")
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
#if os(macOS)
|
|
109
|
+
return Response(ok: true, data: DataPayload(message: filePath, screenshotMetadata: metadata))
|
|
110
|
+
#else
|
|
111
|
+
|
|
112
|
+
return Response(
|
|
113
|
+
ok: true,
|
|
114
|
+
data: DataPayload(message: "tmp/\(fileName)", screenshotMetadata: metadata)
|
|
115
|
+
)
|
|
116
|
+
#endif
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
func screenshotResponse(
|
|
121
|
+
image: RunnerImage,
|
|
122
|
+
inlineScreenshot: Bool,
|
|
123
|
+
metadata: ScreenshotMetadataPayload? = nil
|
|
124
|
+
) -> Response {
|
|
125
|
+
guard let pngData = runnerPngData(for: image) else {
|
|
126
|
+
return Response(ok: false, error: ErrorPayload(message: "Failed to encode screenshot as PNG"))
|
|
127
|
+
}
|
|
128
|
+
return screenshotResponse(pngData: pngData, inlineScreenshot: inlineScreenshot, metadata: metadata)
|
|
129
|
+
}
|
|
130
|
+
|
|
69
131
|
func stopRecordingIfNeeded() {
|
|
70
132
|
guard let recorder = activeRecording else { return }
|
|
71
133
|
do {
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift
CHANGED
|
@@ -263,6 +263,16 @@ extension Response {
|
|
|
263
263
|
|
|
264
264
|
|
|
265
265
|
|
|
266
|
+
struct ScreenshotMetadataPayload: Codable {
|
|
267
|
+
let displayID: UInt
|
|
268
|
+
let pixelWidth: Int
|
|
269
|
+
let pixelHeight: Int
|
|
270
|
+
let pixelsPerPoint: Double
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
266
276
|
|
|
267
277
|
|
|
268
278
|
|
|
@@ -330,6 +340,9 @@ struct DataPayload: Codable {
|
|
|
330
340
|
var failedStepIndex: Int?
|
|
331
341
|
var sequenceResults: [SequenceStepResult]?
|
|
332
342
|
var targetActivation: TargetActivationFactPayload?
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
var screenshotMetadata: ScreenshotMetadataPayload?
|
|
333
346
|
}
|
|
334
347
|
|
|
335
348
|
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift
CHANGED
|
@@ -115,7 +115,7 @@ extension RunnerTests {
|
|
|
115
115
|
guard let point = Self.topLeadingNavigationFallbackPoint(in: frame) else {
|
|
116
116
|
return false
|
|
117
117
|
}
|
|
118
|
-
let before = captureNavigationFallbackVisualState()
|
|
118
|
+
let before = captureNavigationFallbackVisualState(app: app)
|
|
119
119
|
let context = synthesizedCoordinateContext(
|
|
120
120
|
app: app,
|
|
121
121
|
policy: synthesizedGesturePolicy(.coordinateTap)
|
|
@@ -124,33 +124,48 @@ extension RunnerTests {
|
|
|
124
124
|
synthesizedTapAt(app: app, x: point.x, y: point.y, context: context)
|
|
125
125
|
}
|
|
126
126
|
if case .performed = synthesized.outcome {
|
|
127
|
-
return didNavigationFallbackChangeVisualState(before: before)
|
|
127
|
+
return didNavigationFallbackChangeVisualState(app: app, before: before)
|
|
128
128
|
}
|
|
129
129
|
let fallback = performGesture(app) {
|
|
130
130
|
tapAt(app: app, x: point.x, y: point.y)
|
|
131
131
|
}
|
|
132
132
|
if case .performed = fallback.outcome {
|
|
133
|
-
return didNavigationFallbackChangeVisualState(before: before)
|
|
133
|
+
return didNavigationFallbackChangeVisualState(app: app, before: before)
|
|
134
134
|
}
|
|
135
135
|
#endif
|
|
136
136
|
return false
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
private func captureNavigationFallbackVisualState() -> Data? {
|
|
139
|
+
private func captureNavigationFallbackVisualState(app: XCUIApplication) -> Data? {
|
|
140
140
|
#if os(iOS)
|
|
141
|
-
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
guard case .success(let captured) = captureObservedScreen(app: app) else {
|
|
146
|
+
return nil
|
|
147
|
+
}
|
|
148
|
+
return runnerPngData(for: captured.image)
|
|
142
149
|
#else
|
|
143
150
|
return nil
|
|
144
151
|
#endif
|
|
145
152
|
}
|
|
146
153
|
|
|
147
|
-
private func didNavigationFallbackChangeVisualState(
|
|
154
|
+
private func didNavigationFallbackChangeVisualState(
|
|
155
|
+
app: XCUIApplication,
|
|
156
|
+
before: Data?
|
|
157
|
+
) -> Bool {
|
|
148
158
|
sleepFor(Self.navigationFallbackVerificationDelay)
|
|
149
|
-
let after = captureNavigationFallbackVisualState()
|
|
159
|
+
let after = captureNavigationFallbackVisualState(app: app)
|
|
150
160
|
let changed = Self.didNavigationFallbackChangeVisualState(before: before, after: after)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
NSLog(
|
|
164
|
+
"AGENT_DEVICE_RUNNER_IN_APP_BACK_VISUAL_VERIFICATION beforeBytes=%ld afterBytes=%ld changed=%@",
|
|
165
|
+
before?.count ?? -1,
|
|
166
|
+
after?.count ?? -1,
|
|
167
|
+
changed ? "yes" : "no"
|
|
168
|
+
)
|
|
154
169
|
return changed
|
|
155
170
|
}
|
|
156
171
|
|