agent-device 0.21.29 → 0.21.30
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.29.apk → agent-device-android-ime-helper-0.21.30.apk} +0 -0
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.30.apk.sha256 +1 -0
- package/android/ime-helper/dist/{agent-device-android-ime-helper-0.21.29.manifest.json → agent-device-android-ime-helper-0.21.30.manifest.json} +4 -4
- 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 +1 -0
- package/android/snapshot-helper/dist/{agent-device-android-snapshot-helper-0.21.29.manifest.json → agent-device-android-snapshot-helper-0.21.30.manifest.json} +7 -7
- package/apple/macos-helper/Sources/AgentDeviceMacOSHelper/AudioProbe.swift +4 -2
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandDispatch.swift +2 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +12 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +25 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +8 -1
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +9 -6
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SnapshotCapturePlan.swift +3 -0
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SynthesizedInteraction.swift +35 -9
- package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +44 -26
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotModels.swift +20 -1
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentation.swift +4 -3
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotPresentationProjection.swift +4 -2
- package/dist/apple/snapshot-presentation/Sources/AgentDeviceSnapshotPresentation/SnapshotVisibilityFold.swift +20 -2
- 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-browser-provider.js +1 -1
- package/dist/src/agent-device-client.js +1 -1
- package/dist/src/alert2.js +1 -1
- package/dist/src/android.js +1 -1
- package/dist/src/app-lifecycle.js +1 -1
- package/dist/src/app-log-runtime2.js +3 -3
- package/dist/src/auth.js +1 -1
- package/dist/src/automation-helper.js +1 -1
- package/dist/src/back-mode.js +1 -1
- package/dist/src/cli-config.js +1 -1
- package/dist/src/cli-help.js +13 -10
- package/dist/src/cli.js +3 -3
- package/dist/src/client-types.d.ts +82 -13
- package/dist/src/cloud-artifacts.d.ts +99 -3
- package/dist/src/command-metadata.js +42 -42
- package/dist/src/composed-inventory-gateways.js +1 -1
- package/dist/src/connection-runtime.js +1 -1
- package/dist/src/connection.js +1 -1
- package/dist/src/contract.d.ts +2 -2
- package/dist/src/contracts.d.ts +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.js +2 -2
- package/dist/src/daemon-lifecycle-errors.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-shutdown-report.js +1 -1
- package/dist/src/daemon-startup-diagnostics.js +1 -1
- package/dist/src/daemon.js +3 -3
- package/dist/src/device-claim-recovery.js +1 -1
- package/dist/src/durable-capture-resource.js +1 -1
- package/dist/src/durable-resource.js +1 -1
- package/dist/src/ended-lease.js +1 -1
- package/dist/src/find.js +1 -1
- package/dist/src/finders.js +1 -1
- package/dist/src/gesture-plan-types.d.ts +14 -4
- package/dist/src/gesture-plan.js +1 -1
- package/dist/src/gesture-runtime.js +1 -1
- package/dist/src/host4.js +1 -1
- package/dist/src/index.d.ts +3 -3
- package/dist/src/input-actions.js +1 -1
- package/dist/src/input-actions2.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/interactor3.js +1 -1
- package/dist/src/interactor4.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/inventory6.js +1 -1
- package/dist/src/ios-node-interpretation.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/launch-confirmation.js +1 -1
- package/dist/src/lease-context.js +1 -1
- package/dist/src/lease-registry-scope.js +1 -1
- package/dist/src/lease.js +1 -1
- package/dist/src/local-interactor-operation-set.js +1 -1
- package/dist/src/mechanics.js +12 -12
- package/dist/src/metro-session-hints.js +1 -1
- package/dist/src/mobile-snapshot-semantics.js +1 -1
- package/dist/src/observability.js +1 -1
- package/dist/src/observation.js +1 -1
- package/dist/src/parameterized-recorded-fill.js +1 -1
- package/dist/src/perf-facade.js +1 -1
- package/dist/src/platform-runtime-operation-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/plugins2.js +1 -1
- package/dist/src/png-resize.js +1 -1
- package/dist/src/png-worker-client.js +1 -1
- package/dist/src/png-worker-contract.js +1 -1
- package/dist/src/provider-device-runtime.d.ts +20 -1
- package/dist/src/provider-plugin.d.ts +1 -1
- package/dist/src/react-native-overlay2.js +1 -1
- package/dist/src/record-runtime.js +1 -1
- package/dist/src/replay-maestro-backend.js +3 -3
- package/dist/src/replay-script-selection.js +1 -1
- package/dist/src/replay.d.ts +1 -1
- package/dist/src/request-runtime-binding.js +1 -1
- package/dist/src/result-serialization.js +1 -1
- package/dist/src/runner-error-classification.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.js +5 -5
- package/dist/src/runtime10.js +2 -2
- package/dist/src/runtime3.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 +2 -2
- package/dist/src/screenshot-image-size.js +1 -0
- package/dist/src/screenshot-image.js +1 -1
- package/dist/src/screenshot-runtime.js +1 -1
- package/dist/src/screenshot3.js +2 -2
- package/dist/src/sdk-batch.js +1 -1
- package/dist/src/sdk-contracts.d.ts +7 -1
- package/dist/src/sdk-finders.js +1 -1
- package/dist/src/sdk-selectors.d.ts +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-replay-vars.js +1 -1
- package/dist/src/session-store.js +2 -2
- package/dist/src/session.js +1 -1
- package/dist/src/session2.js +5 -5
- package/dist/src/settle-observation-capture.js +1 -1
- package/dist/src/snapshot-capture-annotations.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 +7 -5
- 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/src.js +1 -1
- package/dist/src/src3.js +1 -1
- package/dist/src/src4.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/touch-reference-frame.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/video.js +1 -1
- package/dist/src/webdriver-source.js +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/android/ime-helper/dist/agent-device-android-ime-helper-0.21.29.apk.sha256 +0 -1
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.29.apk +0 -0
- package/android/snapshot-helper/dist/agent-device-android-snapshot-helper-0.21.29.apk.sha256 +0 -1
- package/dist/src/daemon-client-lifecycle-request.js +0 -1
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a0ebbbfbeec5d64f99ff481b73471805a5c689ccb346cb3fe51385ba772ebedf agent-device-android-ime-helper-0.21.30.apk
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "android-ime-helper",
|
|
3
|
-
"version": "0.21.
|
|
4
|
-
"assetName": "agent-device-android-ime-helper-0.21.
|
|
5
|
-
"sha256": "
|
|
3
|
+
"version": "0.21.30",
|
|
4
|
+
"assetName": "agent-device-android-ime-helper-0.21.30.apk",
|
|
5
|
+
"sha256": "a0ebbbfbeec5d64f99ff481b73471805a5c689ccb346cb3fe51385ba772ebedf",
|
|
6
6
|
"packageName": "com.callstack.agentdevice.imehelper",
|
|
7
|
-
"versionCode":
|
|
7
|
+
"versionCode": 21030,
|
|
8
8
|
"serviceComponent": "com.callstack.agentdevice.imehelper/.TestInputMethodService",
|
|
9
9
|
"broadcastProtocol": "android-ime-helper-v1"
|
|
10
10
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
13b710b0fb1b4e5a0258d10cf7a91c702a528a2e032bb0f8518aca6a8217b48d agent-device-android-snapshot-helper-0.21.30.apk
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "android-snapshot-helper",
|
|
3
|
-
"version": "0.21.
|
|
4
|
-
"releaseTag": "v0.21.
|
|
5
|
-
"assetName": "agent-device-android-snapshot-helper-0.21.
|
|
6
|
-
"apkUrl": "https://github.com/callstack/agent-device/releases/download/v0.21.
|
|
7
|
-
"sha256": "
|
|
8
|
-
"checksumName": "agent-device-android-snapshot-helper-0.21.
|
|
3
|
+
"version": "0.21.30",
|
|
4
|
+
"releaseTag": "v0.21.30",
|
|
5
|
+
"assetName": "agent-device-android-snapshot-helper-0.21.30.apk",
|
|
6
|
+
"apkUrl": "https://github.com/callstack/agent-device/releases/download/v0.21.30/agent-device-android-snapshot-helper-0.21.30.apk",
|
|
7
|
+
"sha256": "13b710b0fb1b4e5a0258d10cf7a91c702a528a2e032bb0f8518aca6a8217b48d",
|
|
8
|
+
"checksumName": "agent-device-android-snapshot-helper-0.21.30.apk.sha256",
|
|
9
9
|
"packageName": "com.callstack.agentdevice.snapshothelper",
|
|
10
|
-
"versionCode":
|
|
10
|
+
"versionCode": 21030,
|
|
11
11
|
"instrumentationRunner": "com.callstack.agentdevice.snapshothelper/.SnapshotInstrumentation",
|
|
12
12
|
"minSdk": 23,
|
|
13
13
|
"targetSdk": 36,
|
|
@@ -31,7 +31,7 @@ private struct AudioProbeBucket {
|
|
|
31
31
|
var peak: Double = 0
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
final class AudioProbeStatusWriter {
|
|
35
35
|
private let outPath: String
|
|
36
36
|
private let startedAt = Date()
|
|
37
37
|
private let durationMs: Int
|
|
@@ -61,6 +61,9 @@ private final class AudioProbeStatusWriter {
|
|
|
61
61
|
else {
|
|
62
62
|
return
|
|
63
63
|
}
|
|
64
|
+
// AVAudioPCMBuffer starts with frameLength 0, so every mDataByteSize is 0 until
|
|
65
|
+
// frameLength is set. Copying first leaves the destination empty (-12731).
|
|
66
|
+
pcmBuffer.frameLength = frameCount
|
|
64
67
|
let status = CMSampleBufferCopyPCMDataIntoAudioBufferList(
|
|
65
68
|
sampleBuffer,
|
|
66
69
|
at: 0,
|
|
@@ -70,7 +73,6 @@ private final class AudioProbeStatusWriter {
|
|
|
70
73
|
guard status == noErr else {
|
|
71
74
|
return
|
|
72
75
|
}
|
|
73
|
-
pcmBuffer.frameLength = frameCount
|
|
74
76
|
add(audioBufferList: pcmBuffer.mutableAudioBufferList, format: format)
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -751,7 +751,8 @@ extension RunnerTests {
|
|
|
751
751
|
|
|
752
752
|
return boundedBlockingSystemAlertSnapshot(
|
|
753
753
|
deadline: probeDeadline,
|
|
754
|
-
penaltyTarget: .mainOwnedTarget
|
|
754
|
+
penaltyTarget: .mainOwnedTarget,
|
|
755
|
+
options: PresentationOptions(interactiveOnly: false, depth: nil, scope: nil, raw: false)
|
|
755
756
|
) != nil
|
|
756
757
|
#else
|
|
757
758
|
return false
|
|
@@ -539,6 +539,18 @@ extension RunnerTests {
|
|
|
539
539
|
)
|
|
540
540
|
}
|
|
541
541
|
return Response(ok: true, data: DataPayload(message: "actionButton"))
|
|
542
|
+
case .volumeUp, .volumeDown:
|
|
543
|
+
guard pressVolumeButton(command.command) else {
|
|
544
|
+
return Response(
|
|
545
|
+
ok: false,
|
|
546
|
+
error: ErrorPayload(
|
|
547
|
+
code: "UNSUPPORTED_OPERATION",
|
|
548
|
+
message: "\(command.command) requires a physical iPhone or iPad; XCUIDevice exposes no volume press on a simulator",
|
|
549
|
+
hint: "hardware-button volume-up/volume-down is supported on physical iOS devices through the runner or Appium; iOS Simulators have no pressable volume key."
|
|
550
|
+
)
|
|
551
|
+
)
|
|
552
|
+
}
|
|
553
|
+
return Response(ok: true, data: DataPayload(message: command.command.rawValue))
|
|
542
554
|
case .keyboardDismiss:
|
|
543
555
|
let result = dismissKeyboard(app: activeApp)
|
|
544
556
|
if result.wasVisible && !result.dismissed {
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift
CHANGED
|
@@ -141,6 +141,31 @@ extension RunnerTests {
|
|
|
141
141
|
#endif
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
@discardableResult
|
|
152
|
+
func pressVolumeButton(_ button: CommandType) -> Bool {
|
|
153
|
+
#if os(iOS) && !targetEnvironment(simulator)
|
|
154
|
+
switch button {
|
|
155
|
+
case .volumeUp:
|
|
156
|
+
XCUIDevice.shared.press(.volumeUp)
|
|
157
|
+
return true
|
|
158
|
+
case .volumeDown:
|
|
159
|
+
XCUIDevice.shared.press(.volumeDown)
|
|
160
|
+
return true
|
|
161
|
+
default:
|
|
162
|
+
return false
|
|
163
|
+
}
|
|
164
|
+
#else
|
|
165
|
+
return false
|
|
166
|
+
#endif
|
|
167
|
+
}
|
|
168
|
+
|
|
144
169
|
func findElement(app: XCUIApplication, text: String) -> XCUIElement? {
|
|
145
170
|
let predicate = NSPredicate(format: "label CONTAINS[c] %@ OR identifier CONTAINS[c] %@ OR value CONTAINS[c] %@", text, text, text)
|
|
146
171
|
let element = app.descendants(matching: .any).matching(predicate).firstMatch
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift
CHANGED
|
@@ -23,6 +23,8 @@ enum CommandType: String, Codable, CaseIterable {
|
|
|
23
23
|
case rotate
|
|
24
24
|
case appSwitcher
|
|
25
25
|
case actionButton
|
|
26
|
+
case volumeUp
|
|
27
|
+
case volumeDown
|
|
26
28
|
case keyboardDismiss
|
|
27
29
|
case keyboardReturn
|
|
28
30
|
case alert
|
|
@@ -292,7 +294,7 @@ extension Command {
|
|
|
292
294
|
case .pasteboardWrite:
|
|
293
295
|
return .deviceState
|
|
294
296
|
|
|
295
|
-
case .actionButton:
|
|
297
|
+
case .actionButton, .volumeUp, .volumeDown:
|
|
296
298
|
return .presentedSurfaceMutation
|
|
297
299
|
|
|
298
300
|
case .querySelector:
|
|
@@ -343,6 +345,10 @@ struct RunnerGesturePoint: Codable {
|
|
|
343
345
|
|
|
344
346
|
|
|
345
347
|
|
|
348
|
+
let runnerGestureMaxContacts = 5
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
346
352
|
|
|
347
353
|
struct SequenceStep: Codable {
|
|
348
354
|
let kind: String
|
|
@@ -436,6 +442,7 @@ struct DataPayload: Codable {
|
|
|
436
442
|
var truncated: Bool?
|
|
437
443
|
var qualityPayload: SnapshotQualityPayload? = nil
|
|
438
444
|
var snapshotQuality: SnapshotQuality?
|
|
445
|
+
var snapshotQualityNotes: [SnapshotQualityNote]? = nil
|
|
439
446
|
|
|
440
447
|
var systemSurface: SystemSurfaceProvenancePayload?
|
|
441
448
|
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift
CHANGED
|
@@ -169,7 +169,8 @@ extension RunnerTests {
|
|
|
169
169
|
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
|
|
170
170
|
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
171
171
|
deadline: deadline,
|
|
172
|
-
penaltyTarget: .prepared(bundleId: target.bundleId)
|
|
172
|
+
penaltyTarget: .prepared(bundleId: target.bundleId),
|
|
173
|
+
options: options
|
|
173
174
|
) {
|
|
174
175
|
return blocking
|
|
175
176
|
}
|
|
@@ -298,7 +299,8 @@ extension RunnerTests {
|
|
|
298
299
|
let deadline = Date().addingTimeInterval(Self.snapshotPlanBudget)
|
|
299
300
|
if let blocking = boundedBlockingSystemAlertSnapshot(
|
|
300
301
|
deadline: deadline,
|
|
301
|
-
penaltyTarget: .prepared(bundleId: target.bundleId)
|
|
302
|
+
penaltyTarget: .prepared(bundleId: target.bundleId),
|
|
303
|
+
options: options
|
|
302
304
|
) {
|
|
303
305
|
return blocking
|
|
304
306
|
}
|
|
@@ -316,7 +318,8 @@ extension RunnerTests {
|
|
|
316
318
|
|
|
317
319
|
func boundedBlockingSystemAlertSnapshot(
|
|
318
320
|
deadline: Date,
|
|
319
|
-
penaltyTarget: SnapshotProbePenaltyTarget
|
|
321
|
+
penaltyTarget: SnapshotProbePenaltyTarget,
|
|
322
|
+
options: PresentationOptions
|
|
320
323
|
) -> DataPayload? {
|
|
321
324
|
boundedBlockingSystemAlertSnapshotBody(
|
|
322
325
|
deadline: deadline,
|
|
@@ -327,7 +330,7 @@ extension RunnerTests {
|
|
|
327
330
|
|
|
328
331
|
|
|
329
332
|
|
|
330
|
-
return self.blockingSystemAlertSnapshot(deadline: probeDeadline)
|
|
333
|
+
return try self.blockingSystemAlertSnapshot(options: options, deadline: probeDeadline)
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
|
|
@@ -339,7 +342,7 @@ extension RunnerTests {
|
|
|
339
342
|
private func boundedBlockingSystemAlertSnapshotBody(
|
|
340
343
|
deadline: Date,
|
|
341
344
|
penaltyTarget: SnapshotProbePenaltyTarget,
|
|
342
|
-
probe: @escaping @MainActor (Date) -> DataPayload?
|
|
345
|
+
probe: @escaping @MainActor (Date) throws -> DataPayload?
|
|
343
346
|
) -> DataPayload? {
|
|
344
347
|
#if os(macOS)
|
|
345
348
|
return nil
|
|
@@ -374,7 +377,7 @@ extension RunnerTests {
|
|
|
374
377
|
}
|
|
375
378
|
) {
|
|
376
379
|
penaltyIdentity.captureFromMain(bundleId: self.mainOwned.bundleId)
|
|
377
|
-
return probe(probeDeadline)
|
|
380
|
+
return try probe(probeDeadline)
|
|
378
381
|
}
|
|
379
382
|
} catch {
|
|
380
383
|
NSLog(
|
|
@@ -82,6 +82,7 @@ struct SnapshotBackendCapture {
|
|
|
82
82
|
var customActions: SnapshotCustomActionCoverage? = nil
|
|
83
83
|
var qualityPayload: DataPayload? = nil
|
|
84
84
|
var timing: SnapshotCaptureTiming? = nil
|
|
85
|
+
var qualityNotes: [SnapshotQualityNote] = []
|
|
85
86
|
|
|
86
87
|
|
|
87
88
|
|
|
@@ -108,6 +109,7 @@ extension RunnerTests {
|
|
|
108
109
|
qualityPayload: result.qualityNodes.map {
|
|
109
110
|
DataPayload(nodes: $0, truncated: result.truncated)
|
|
110
111
|
},
|
|
112
|
+
qualityNotes: result.qualityNotes,
|
|
111
113
|
presentedSurface: SnapshotPresentedSurface.classify(acquisition)
|
|
112
114
|
)
|
|
113
115
|
}
|
|
@@ -770,6 +772,7 @@ extension RunnerTests {
|
|
|
770
772
|
return SnapshotQualityPayload(nodes: nodes, truncated: quality.truncated == true)
|
|
771
773
|
},
|
|
772
774
|
snapshotQuality: quality,
|
|
775
|
+
snapshotQualityNotes: capture.qualityNotes.isEmpty ? nil : capture.qualityNotes,
|
|
773
776
|
presentedSurface: capture.presentedSurface,
|
|
774
777
|
keyboard: capture.keyboardBand,
|
|
775
778
|
runnerFatal: payload.runnerFatal,
|
|
@@ -461,12 +461,13 @@ extension RunnerTests {
|
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
func plannedGestureValidationError(_ plan: RunnerGesturePlan) -> String? {
|
|
464
|
-
guard plan.topology == "single" || plan.topology == "
|
|
465
|
-
return "planned gesture topology must be single or
|
|
464
|
+
guard plan.topology == "single" || plan.topology == "multi" else {
|
|
465
|
+
return "planned gesture topology must be single or multi"
|
|
466
466
|
}
|
|
467
|
+
let isTap = plan.topology == "multi" && plan.intent == "tap"
|
|
467
468
|
let supportedIntent = plan.topology == "single"
|
|
468
469
|
? plan.intent == "fling" || plan.intent == "pan"
|
|
469
|
-
: plan.intent == "pan" || plan.intent == "pinch" || plan.intent == "rotate"
|
|
470
|
+
: isTap || plan.intent == "pan" || plan.intent == "pinch" || plan.intent == "rotate"
|
|
470
471
|
|| plan.intent == "transform"
|
|
471
472
|
guard supportedIntent else { return "planned gesture has unsupported intent for its topology" }
|
|
472
473
|
if plan.topology == "single" {
|
|
@@ -485,8 +486,12 @@ extension RunnerTests {
|
|
|
485
486
|
else {
|
|
486
487
|
return "planned gesture viewport must be finite and positive"
|
|
487
488
|
}
|
|
488
|
-
let
|
|
489
|
-
|
|
489
|
+
let pointerCountMatches = plan.topology == "single"
|
|
490
|
+
? plan.pointers.count == 1
|
|
491
|
+
: isTap
|
|
492
|
+
? (2...runnerGestureMaxContacts).contains(plan.pointers.count)
|
|
493
|
+
: plan.pointers.count == 2
|
|
494
|
+
guard pointerCountMatches else {
|
|
490
495
|
return "planned gesture pointer count does not match topology"
|
|
491
496
|
}
|
|
492
497
|
for (index, pointer) in plan.pointers.enumerated() where pointer.pointerId != index {
|
|
@@ -523,7 +528,10 @@ extension RunnerTests {
|
|
|
523
528
|
return "planned pointer paths must start at 0 and end at durationMs"
|
|
524
529
|
}
|
|
525
530
|
}
|
|
526
|
-
if
|
|
531
|
+
if isTap {
|
|
532
|
+
return plannedTapValidationError(plan)
|
|
533
|
+
}
|
|
534
|
+
if plan.topology == "multi" {
|
|
527
535
|
guard let firstStart = firstSamples.first?.point,
|
|
528
536
|
let secondStart = plan.pointers[1].samples.first?.point,
|
|
529
537
|
hypot(firstStart.x - secondStart.x, firstStart.y - secondStart.y) > 0
|
|
@@ -534,6 +542,24 @@ extension RunnerTests {
|
|
|
534
542
|
return nil
|
|
535
543
|
}
|
|
536
544
|
|
|
545
|
+
|
|
546
|
+
private func plannedTapValidationError(_ plan: RunnerGesturePlan) -> String? {
|
|
547
|
+
var starts: [(x: Double, y: Double)] = []
|
|
548
|
+
for pointer in plan.pointers {
|
|
549
|
+
guard let start = pointer.samples.first?.point else {
|
|
550
|
+
return "planned pointer paths require at least two samples"
|
|
551
|
+
}
|
|
552
|
+
for sample in pointer.samples where sample.point.x != start.x || sample.point.y != start.y {
|
|
553
|
+
return "planned tap contacts must not move"
|
|
554
|
+
}
|
|
555
|
+
if starts.contains(where: { $0.x == start.x && $0.y == start.y }) {
|
|
556
|
+
return "planned tap contacts must start on distinct points"
|
|
557
|
+
}
|
|
558
|
+
starts.append((x: start.x, y: start.y))
|
|
559
|
+
}
|
|
560
|
+
return nil
|
|
561
|
+
}
|
|
562
|
+
|
|
537
563
|
func plannedGestureExecution(for plan: RunnerGesturePlan) -> PlannedGestureExecution {
|
|
538
564
|
plan.topology == "single" && plan.executionProfile == "endpoint-hold"
|
|
539
565
|
? .fastSwipe
|
|
@@ -582,17 +608,17 @@ extension RunnerTests {
|
|
|
582
608
|
return .performed
|
|
583
609
|
#elseif os(tvOS)
|
|
584
610
|
return .unsupported(
|
|
585
|
-
message: "
|
|
611
|
+
message: "multi-touch gestures are not supported on tvOS",
|
|
586
612
|
hint: "tvOS has no touch input; use remote-driven navigation."
|
|
587
613
|
)
|
|
588
614
|
#elseif os(visionOS)
|
|
589
615
|
return .unsupported(
|
|
590
|
-
message: "
|
|
616
|
+
message: "multi-touch gestures are not supported on visionOS",
|
|
591
617
|
hint: "The current XCTest synthesizer supports iOS and iPadOS touch simulators only."
|
|
592
618
|
)
|
|
593
619
|
#else
|
|
594
620
|
return .unsupported(
|
|
595
|
-
message: "
|
|
621
|
+
message: "multi-touch gestures are not supported on macOS",
|
|
596
622
|
hint: "macOS automation has no multi-touch input; run on an iOS simulator."
|
|
597
623
|
)
|
|
598
624
|
#endif
|
package/dist/apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift
CHANGED
|
@@ -4,21 +4,22 @@ import AgentDeviceSnapshotPresentation
|
|
|
4
4
|
extension RunnerTests {
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
func blockingSystemAlertSnapshot(deadline: Date = .distantFuture) -> DataPayload? {
|
|
7
|
+
func blockingSystemAlertSnapshot(options: PresentationOptions, deadline: Date = .distantFuture) throws -> DataPayload? {
|
|
8
8
|
#if os(macOS)
|
|
9
9
|
return nil
|
|
10
10
|
#else
|
|
11
11
|
guard case .resolved(let resolvedModal) = resolveBlockingSystemModal(deadline: deadline) else {
|
|
12
12
|
return nil
|
|
13
13
|
}
|
|
14
|
-
return snapshotForBlockingSystemModal(resolvedModal, deadline: deadline)
|
|
14
|
+
return try snapshotForBlockingSystemModal(resolvedModal, options: options, deadline: deadline)
|
|
15
15
|
#endif
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
func snapshotForBlockingSystemModal(
|
|
19
19
|
_ resolvedModal: ResolvedBlockingSystemModal,
|
|
20
|
+
options: PresentationOptions = PresentationOptions(interactiveOnly: false, depth: nil, scope: nil, raw: false),
|
|
20
21
|
deadline: Date = .distantFuture
|
|
21
|
-
) -> DataPayload? {
|
|
22
|
+
) throws -> DataPayload? {
|
|
22
23
|
let modal = resolvedModal.root
|
|
23
24
|
let actions = resolvedModal.actions
|
|
24
25
|
|
|
@@ -34,7 +35,7 @@ extension RunnerTests {
|
|
|
34
35
|
) else {
|
|
35
36
|
return nil
|
|
36
37
|
}
|
|
37
|
-
var nodes: [
|
|
38
|
+
var nodes: [RawAXNode] = [modalNode]
|
|
38
39
|
|
|
39
40
|
for action in actions {
|
|
40
41
|
guard let actionNode = safeMakeSnapshotNode(
|
|
@@ -71,15 +72,34 @@ extension RunnerTests {
|
|
|
71
72
|
|
|
72
73
|
|
|
73
74
|
|
|
74
|
-
return Self.blockingSystemModalPayload(nodes: nodes)
|
|
75
|
+
return try Self.blockingSystemModalPayload(nodes: nodes, options: options)
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
static func blockingSystemModalPayload(
|
|
82
|
-
|
|
82
|
+
static func blockingSystemModalPayload(
|
|
83
|
+
nodes: [RawAXNode],
|
|
84
|
+
options: PresentationOptions = PresentationOptions(interactiveOnly: false, depth: nil, scope: nil, raw: false)
|
|
85
|
+
) throws -> DataPayload {
|
|
86
|
+
let acquisition = SnapshotAcquisition(
|
|
87
|
+
hint: SnapshotPresentation.captureHint(for: options),
|
|
88
|
+
nodes: nodes,
|
|
89
|
+
truncated: false,
|
|
90
|
+
effectiveDepth: nil,
|
|
91
|
+
viewport: nodes.first.map { .derived(box: $0.rect.cgRect) } ?? .missing(reason: .notProvided)
|
|
92
|
+
)
|
|
93
|
+
let result = options.raw
|
|
94
|
+
? SnapshotPresentation.presentRaw(acquisition, options: options)
|
|
95
|
+
: try SnapshotPresentation.presentRegular(acquisition, options: options, policy: .cursorProjected)
|
|
96
|
+
return DataPayload(
|
|
97
|
+
nodes: result.nodes,
|
|
98
|
+
truncated: false,
|
|
99
|
+
qualityPayload: result.qualityNodes.map { SnapshotQualityPayload(nodes: $0, truncated: false) },
|
|
100
|
+
snapshotQualityNotes: result.qualityNotes.isEmpty ? nil : result.qualityNotes,
|
|
101
|
+
presentedSurface: .presented
|
|
102
|
+
)
|
|
83
103
|
}
|
|
84
104
|
|
|
85
105
|
func firstBlockingSystemModal(
|
|
@@ -231,27 +251,25 @@ extension RunnerTests {
|
|
|
231
251
|
depth: Int,
|
|
232
252
|
parentIndex: Int? = nil,
|
|
233
253
|
hittableOverride: Bool? = nil
|
|
234
|
-
) ->
|
|
254
|
+
) -> RawAXNode {
|
|
235
255
|
let label = (labelOverride ?? element.label).trimmingCharacters(in: .whitespacesAndNewlines)
|
|
236
256
|
let identifier = (identifierOverride ?? element.identifier).trimmingCharacters(in: .whitespacesAndNewlines)
|
|
237
257
|
let value = element.value.map { String(describing: $0).trimmingCharacters(in: .whitespacesAndNewlines) }
|
|
238
|
-
return
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
hiddenContentBelow: nil
|
|
254
|
-
)
|
|
258
|
+
return RawAXNode(
|
|
259
|
+
index: index,
|
|
260
|
+
type: type,
|
|
261
|
+
label: label.isEmpty ? nil : label,
|
|
262
|
+
identifier: identifier.isEmpty ? nil : identifier,
|
|
263
|
+
value: value.flatMap { $0.isEmpty ? nil : $0 },
|
|
264
|
+
rect: SnapshotRect(element.frame),
|
|
265
|
+
enabled: element.isEnabled,
|
|
266
|
+
focused: nil,
|
|
267
|
+
selected: nil,
|
|
268
|
+
hittable: hittableOverride ?? element.isHittable,
|
|
269
|
+
depth: depth,
|
|
270
|
+
parentIndex: parentIndex,
|
|
271
|
+
hiddenContentAbove: nil,
|
|
272
|
+
hiddenContentBelow: nil
|
|
255
273
|
)
|
|
256
274
|
}
|
|
257
275
|
|
|
@@ -264,7 +282,7 @@ extension RunnerTests {
|
|
|
264
282
|
depth: Int,
|
|
265
283
|
parentIndex: Int? = nil,
|
|
266
284
|
hittableOverride: Bool? = nil
|
|
267
|
-
) ->
|
|
285
|
+
) -> RawAXNode? {
|
|
268
286
|
safely("MODAL_NODE") {
|
|
269
287
|
makeSnapshotNode(
|
|
270
288
|
element: element,
|
|
@@ -333,11 +333,28 @@ public struct PresentedNode: Codable, Equatable {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
+
public struct SnapshotQualityNote: Codable, Equatable {
|
|
337
|
+
public enum Code: String, Codable {
|
|
338
|
+
case regularGeometryClipped = "regular-geometry-clipped"
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
public let code: Code
|
|
342
|
+
public let clippedNodeCount: Int
|
|
343
|
+
public let droppedNodeCount: Int
|
|
344
|
+
|
|
345
|
+
init(clippedNodeCount: Int, droppedNodeCount: Int) {
|
|
346
|
+
self.code = .regularGeometryClipped
|
|
347
|
+
self.clippedNodeCount = clippedNodeCount
|
|
348
|
+
self.droppedNodeCount = droppedNodeCount
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
336
352
|
public struct SnapshotPresentationResult {
|
|
337
353
|
public let nodes: [PresentedNode]
|
|
338
354
|
public let truncated: Bool
|
|
339
355
|
public let effectiveDepth: Int?
|
|
340
356
|
public let customActions: SnapshotCustomActionCoverage?
|
|
357
|
+
public let qualityNotes: [SnapshotQualityNote]
|
|
341
358
|
public let qualityNodes: [PresentedNode]?
|
|
342
359
|
|
|
343
360
|
public init(
|
|
@@ -345,12 +362,14 @@ public struct SnapshotPresentationResult {
|
|
|
345
362
|
truncated: Bool,
|
|
346
363
|
effectiveDepth: Int?,
|
|
347
364
|
customActions: SnapshotCustomActionCoverage?,
|
|
348
|
-
qualityNodes: [PresentedNode]
|
|
365
|
+
qualityNodes: [PresentedNode]?,
|
|
366
|
+
qualityNotes: [SnapshotQualityNote] = []
|
|
349
367
|
) {
|
|
350
368
|
self.nodes = nodes
|
|
351
369
|
self.truncated = truncated
|
|
352
370
|
self.effectiveDepth = effectiveDepth
|
|
353
371
|
self.customActions = customActions
|
|
354
372
|
self.qualityNodes = qualityNodes
|
|
373
|
+
self.qualityNotes = qualityNotes
|
|
355
374
|
}
|
|
356
375
|
}
|
|
@@ -30,15 +30,16 @@ public enum SnapshotPresentation {
|
|
|
30
30
|
policy: policy
|
|
31
31
|
)
|
|
32
32
|
try SnapshotPresentationInvariant.validateRegular(
|
|
33
|
-
folded,
|
|
33
|
+
folded.nodes,
|
|
34
34
|
viewport: acquisition.viewport,
|
|
35
35
|
policy: policy
|
|
36
36
|
)
|
|
37
37
|
return project(
|
|
38
|
-
folded,
|
|
38
|
+
folded.nodes,
|
|
39
39
|
acquisition: acquisition,
|
|
40
40
|
options: options,
|
|
41
|
-
projection: .regular
|
|
41
|
+
projection: .regular,
|
|
42
|
+
qualityNotes: folded.qualityNotes
|
|
42
43
|
)
|
|
43
44
|
}
|
|
44
45
|
|
|
@@ -33,7 +33,8 @@ extension SnapshotPresentation {
|
|
|
33
33
|
_ projectionNodes: [SnapshotPresentationNode],
|
|
34
34
|
acquisition: SnapshotAcquisition,
|
|
35
35
|
options: PresentationOptions,
|
|
36
|
-
projection: CaptureHint.Projection
|
|
36
|
+
projection: CaptureHint.Projection,
|
|
37
|
+
qualityNotes: [SnapshotQualityNote] = []
|
|
37
38
|
) -> SnapshotPresentationResult {
|
|
38
39
|
let scopedRawNodes = applyScope(to: projectionNodes, options: options, projection: projection)
|
|
39
40
|
let nodes = presentedNodes(
|
|
@@ -49,7 +50,8 @@ extension SnapshotPresentation {
|
|
|
49
50
|
truncated: acquisition.truncated,
|
|
50
51
|
effectiveDepth: acquisition.effectiveDepth,
|
|
51
52
|
customActions: acquisition.customActions,
|
|
52
|
-
qualityNodes: qualityNodes
|
|
53
|
+
qualityNodes: qualityNodes,
|
|
54
|
+
qualityNotes: qualityNotes
|
|
53
55
|
)
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -151,12 +151,17 @@ public enum SnapshotVisibilityFold {
|
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
public struct Result {
|
|
155
|
+
public let nodes: [SnapshotPresentationNode]
|
|
156
|
+
public let qualityNotes: [SnapshotQualityNote]
|
|
157
|
+
}
|
|
158
|
+
|
|
154
159
|
public static func fold(
|
|
155
160
|
_ nodes: [RawAXNode],
|
|
156
161
|
viewport: SnapshotViewport,
|
|
157
162
|
interactiveOnly: Bool,
|
|
158
163
|
policy: Policy
|
|
159
|
-
) ->
|
|
164
|
+
) -> Result {
|
|
160
165
|
var hasChildren = [Bool](repeating: false, count: nodes.count)
|
|
161
166
|
for node in nodes {
|
|
162
167
|
if let parentIndex = node.parentIndex, parentIndex >= 0, parentIndex < nodes.count {
|
|
@@ -167,6 +172,8 @@ public enum SnapshotVisibilityFold {
|
|
|
167
172
|
var states = [BranchState?](repeating: nil, count: nodes.count)
|
|
168
173
|
var kept: [SnapshotPresentationNode] = []
|
|
169
174
|
var hints: [Int: (above: Bool, below: Bool)] = [:]
|
|
175
|
+
var clippedNodeCount = 0
|
|
176
|
+
var droppedNodeCount = 0
|
|
170
177
|
|
|
171
178
|
for (offset, node) in nodes.enumerated() {
|
|
172
179
|
let parentState = node.parentIndex.flatMap { states[$0] }
|
|
@@ -182,6 +189,14 @@ public enum SnapshotVisibilityFold {
|
|
|
182
189
|
policy: policy
|
|
183
190
|
)
|
|
184
191
|
|
|
192
|
+
if SnapshotGeometry.isPositiveFinite(rect) {
|
|
193
|
+
if decision.isIncluded && decision.effectiveFrame != rect {
|
|
194
|
+
clippedNodeCount += 1
|
|
195
|
+
} else if !decision.isIncluded && !SnapshotGeometry.isPositiveFinite(decision.effectiveFrame) {
|
|
196
|
+
droppedNodeCount += 1
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
185
200
|
if let hiddenFrame = decision.hiddenContentFrame, let parentAnchor {
|
|
186
201
|
rememberHiddenContentHint(for: hiddenFrame, relativeTo: parentAnchor, hints: &hints)
|
|
187
202
|
}
|
|
@@ -224,7 +239,10 @@ public enum SnapshotVisibilityFold {
|
|
|
224
239
|
keptDepth: keptDepth
|
|
225
240
|
)
|
|
226
241
|
}
|
|
227
|
-
|
|
242
|
+
let notes = clippedNodeCount + droppedNodeCount > 0
|
|
243
|
+
? [SnapshotQualityNote(clippedNodeCount: clippedNodeCount, droppedNodeCount: droppedNodeCount)]
|
|
244
|
+
: []
|
|
245
|
+
return Result(nodes: applyHiddenContentHints(hints, to: kept), qualityNotes: notes)
|
|
228
246
|
}
|
|
229
247
|
|
|
230
248
|
/// The fold's share of the `hittable` policy (#2891). A declared `false` is kept; anything the
|