agent-device 0.16.8 → 0.16.10
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/README.md +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.8.apk → agent-device-android-multitouch-helper-0.16.10.apk} +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.16.10.apk.sha256 +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.8.manifest.json → agent-device-android-multitouch-helper-0.16.10.manifest.json} +4 -4
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.8.apk → agent-device-android-snapshot-helper-0.16.10.apk} +0 -0
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.16.10.apk.sha256 +1 -0
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.8.manifest.json → agent-device-android-snapshot-helper-0.16.10.manifest.json} +6 -6
- package/dist/src/2415.js +19 -19
- package/dist/src/8114.js +3 -3
- package/dist/src/apps.js +2 -2
- package/dist/src/generic.js +4 -3
- package/dist/src/input-actions.js +1 -1
- package/dist/src/session.js +2 -2
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +197 -232
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +282 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +29 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +8 -771
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +30 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +2 -20
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SystemModal.swift +10 -50
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TextEntry.swift +723 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +64 -22
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +7 -4
- package/package.json +1 -1
- package/server.json +2 -2
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.16.8.apk.sha256 +0 -1
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.16.8.apk.sha256 +0 -1
|
@@ -30,6 +30,7 @@ enum CommandType: String, Codable {
|
|
|
30
30
|
case transformGesture
|
|
31
31
|
case recordStart
|
|
32
32
|
case recordStop
|
|
33
|
+
case status
|
|
33
34
|
case uptime
|
|
34
35
|
case shutdown
|
|
35
36
|
}
|
|
@@ -91,6 +92,9 @@ extension CommandType {
|
|
|
91
92
|
case .recordStop, .uptime, .shutdown:
|
|
92
93
|
return CommandTraits(isInteraction: false, readOnly: .never, isLifecycle: true)
|
|
93
94
|
|
|
95
|
+
case .status:
|
|
96
|
+
return CommandTraits(isInteraction: false, readOnly: .always, isLifecycle: true)
|
|
97
|
+
|
|
94
98
|
// Normal preflight, not retried.
|
|
95
99
|
// NOTE: mouseClick stays non-interaction for now — it is macOS-only and the foreground
|
|
96
100
|
// guard interacts with bespoke macOS activation, so classifying it needs a macOS smoke
|
|
@@ -104,6 +108,8 @@ extension CommandType {
|
|
|
104
108
|
|
|
105
109
|
struct Command: Codable {
|
|
106
110
|
let command: CommandType
|
|
111
|
+
let commandId: String?
|
|
112
|
+
let statusCommandId: String?
|
|
107
113
|
let appBundleId: String?
|
|
108
114
|
let text: String?
|
|
109
115
|
let selectorKey: String?
|
|
@@ -171,6 +177,14 @@ struct DataPayload: Codable {
|
|
|
171
177
|
let referenceWidth: Double?
|
|
172
178
|
let referenceHeight: Double?
|
|
173
179
|
let currentUptimeMs: Double?
|
|
180
|
+
let commandId: String?
|
|
181
|
+
let lifecycleState: String?
|
|
182
|
+
let lifecycleCommand: String?
|
|
183
|
+
let lifecycleResponseOk: Bool?
|
|
184
|
+
let lifecycleResponseJson: String?
|
|
185
|
+
let lifecycleErrorCode: String?
|
|
186
|
+
let lifecycleErrorMessage: String?
|
|
187
|
+
let lifecycleErrorHint: String?
|
|
174
188
|
let visible: Bool?
|
|
175
189
|
let wasVisible: Bool?
|
|
176
190
|
let dismissed: Bool?
|
|
@@ -192,6 +206,14 @@ struct DataPayload: Codable {
|
|
|
192
206
|
referenceWidth: Double? = nil,
|
|
193
207
|
referenceHeight: Double? = nil,
|
|
194
208
|
currentUptimeMs: Double? = nil,
|
|
209
|
+
commandId: String? = nil,
|
|
210
|
+
lifecycleState: String? = nil,
|
|
211
|
+
lifecycleCommand: String? = nil,
|
|
212
|
+
lifecycleResponseOk: Bool? = nil,
|
|
213
|
+
lifecycleResponseJson: String? = nil,
|
|
214
|
+
lifecycleErrorCode: String? = nil,
|
|
215
|
+
lifecycleErrorMessage: String? = nil,
|
|
216
|
+
lifecycleErrorHint: String? = nil,
|
|
195
217
|
visible: Bool? = nil,
|
|
196
218
|
wasVisible: Bool? = nil,
|
|
197
219
|
dismissed: Bool? = nil,
|
|
@@ -212,6 +234,14 @@ struct DataPayload: Codable {
|
|
|
212
234
|
self.referenceWidth = referenceWidth
|
|
213
235
|
self.referenceHeight = referenceHeight
|
|
214
236
|
self.currentUptimeMs = currentUptimeMs
|
|
237
|
+
self.commandId = commandId
|
|
238
|
+
self.lifecycleState = lifecycleState
|
|
239
|
+
self.lifecycleCommand = lifecycleCommand
|
|
240
|
+
self.lifecycleResponseOk = lifecycleResponseOk
|
|
241
|
+
self.lifecycleResponseJson = lifecycleResponseJson
|
|
242
|
+
self.lifecycleErrorCode = lifecycleErrorCode
|
|
243
|
+
self.lifecycleErrorMessage = lifecycleErrorMessage
|
|
244
|
+
self.lifecycleErrorHint = lifecycleErrorHint
|
|
215
245
|
self.visible = visible
|
|
216
246
|
self.wasVisible = wasVisible
|
|
217
247
|
self.dismissed = dismissed
|
|
@@ -354,14 +354,7 @@ extension RunnerTests {
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
private func safeSnapshotViewport(app: XCUIApplication) -> CGRect {
|
|
357
|
-
|
|
358
|
-
let exceptionMessage = RunnerObjCExceptionCatcher.catchException({
|
|
359
|
-
viewport = snapshotViewport(app: app)
|
|
360
|
-
})
|
|
361
|
-
if let exceptionMessage {
|
|
362
|
-
NSLog("AGENT_DEVICE_RUNNER_SNAPSHOT_VIEWPORT_IGNORED_EXCEPTION=%@", exceptionMessage)
|
|
363
|
-
}
|
|
364
|
-
return viewport
|
|
357
|
+
safely("SNAPSHOT_VIEWPORT", CGRect.infinite) { snapshotViewport(app: app) }
|
|
365
358
|
}
|
|
366
359
|
|
|
367
360
|
private func describeSnapshotError(_ error: Error) -> String {
|
|
@@ -718,18 +711,7 @@ extension RunnerTests {
|
|
|
718
711
|
}
|
|
719
712
|
|
|
720
713
|
private func safeSnapshotElementsQuery(_ fetch: () -> [XCUIElement]) -> [XCUIElement] {
|
|
721
|
-
|
|
722
|
-
let exceptionMessage = RunnerObjCExceptionCatcher.catchException({
|
|
723
|
-
elements = fetch()
|
|
724
|
-
})
|
|
725
|
-
if let exceptionMessage {
|
|
726
|
-
NSLog(
|
|
727
|
-
"AGENT_DEVICE_RUNNER_SNAPSHOT_QUERY_IGNORED_EXCEPTION=%@",
|
|
728
|
-
exceptionMessage
|
|
729
|
-
)
|
|
730
|
-
return []
|
|
731
|
-
}
|
|
732
|
-
return elements
|
|
714
|
+
safely("SNAPSHOT_QUERY", [], fetch)
|
|
733
715
|
}
|
|
734
716
|
|
|
735
717
|
private func isScrollableContainer(_ snapshot: XCUIElementSnapshot, visible: Bool) -> Bool {
|
|
@@ -77,33 +77,11 @@ extension RunnerTests {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
func safeElementsQuery(_ fetch: () -> [XCUIElement]) -> [XCUIElement] {
|
|
80
|
-
|
|
81
|
-
let exceptionMessage = RunnerObjCExceptionCatcher.catchException({
|
|
82
|
-
elements = fetch()
|
|
83
|
-
})
|
|
84
|
-
if let exceptionMessage {
|
|
85
|
-
NSLog(
|
|
86
|
-
"AGENT_DEVICE_RUNNER_MODAL_QUERY_IGNORED_EXCEPTION=%@",
|
|
87
|
-
exceptionMessage
|
|
88
|
-
)
|
|
89
|
-
return []
|
|
90
|
-
}
|
|
91
|
-
return elements
|
|
80
|
+
safely("MODAL_QUERY", [], fetch)
|
|
92
81
|
}
|
|
93
82
|
|
|
94
83
|
private func safeIsBlockingSystemModal(_ element: XCUIElement, in springboard: XCUIApplication) -> Bool {
|
|
95
|
-
|
|
96
|
-
let exceptionMessage = RunnerObjCExceptionCatcher.catchException({
|
|
97
|
-
isBlocking = isBlockingSystemModal(element, in: springboard)
|
|
98
|
-
})
|
|
99
|
-
if let exceptionMessage {
|
|
100
|
-
NSLog(
|
|
101
|
-
"AGENT_DEVICE_RUNNER_MODAL_CHECK_IGNORED_EXCEPTION=%@",
|
|
102
|
-
exceptionMessage
|
|
103
|
-
)
|
|
104
|
-
return false
|
|
105
|
-
}
|
|
106
|
-
return isBlocking
|
|
84
|
+
safely("MODAL_CHECK", false) { isBlockingSystemModal(element, in: springboard) }
|
|
107
85
|
}
|
|
108
86
|
|
|
109
87
|
private func isBlockingSystemModal(_ element: XCUIElement, in springboard: XCUIApplication) -> Bool {
|
|
@@ -134,25 +112,16 @@ extension RunnerTests {
|
|
|
134
112
|
}
|
|
135
113
|
|
|
136
114
|
private func safeIsActionableCandidate(_ candidate: XCUIElement, seen: inout Set<String>) -> Bool {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if !
|
|
140
|
-
if !actionableTypes.contains(candidate.elementType) { return }
|
|
115
|
+
safely("MODAL_ACTION", false) {
|
|
116
|
+
if !candidate.exists || !candidate.isHittable { return false }
|
|
117
|
+
if !actionableTypes.contains(candidate.elementType) { return false }
|
|
141
118
|
let frame = candidate.frame
|
|
142
|
-
if frame.isNull || frame.isEmpty { return }
|
|
119
|
+
if frame.isNull || frame.isEmpty { return false }
|
|
143
120
|
let key = "\(candidate.elementType.rawValue)-\(frame.origin.x)-\(frame.origin.y)-\(frame.size.width)-\(frame.size.height)-\(candidate.label)"
|
|
144
|
-
if seen.contains(key) { return }
|
|
121
|
+
if seen.contains(key) { return false }
|
|
145
122
|
seen.insert(key)
|
|
146
|
-
|
|
147
|
-
})
|
|
148
|
-
if let exceptionMessage {
|
|
149
|
-
NSLog(
|
|
150
|
-
"AGENT_DEVICE_RUNNER_MODAL_ACTION_IGNORED_EXCEPTION=%@",
|
|
151
|
-
exceptionMessage
|
|
152
|
-
)
|
|
153
|
-
return false
|
|
123
|
+
return true
|
|
154
124
|
}
|
|
155
|
-
return include
|
|
156
125
|
}
|
|
157
126
|
|
|
158
127
|
private func preferredSystemModalTitle(_ element: XCUIElement) -> String {
|
|
@@ -205,9 +174,8 @@ extension RunnerTests {
|
|
|
205
174
|
depth: Int,
|
|
206
175
|
hittableOverride: Bool? = nil
|
|
207
176
|
) -> SnapshotNode? {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
node = makeSnapshotNode(
|
|
177
|
+
safely("MODAL_NODE") {
|
|
178
|
+
makeSnapshotNode(
|
|
211
179
|
element: element,
|
|
212
180
|
index: index,
|
|
213
181
|
type: type,
|
|
@@ -216,14 +184,6 @@ extension RunnerTests {
|
|
|
216
184
|
depth: depth,
|
|
217
185
|
hittableOverride: hittableOverride
|
|
218
186
|
)
|
|
219
|
-
})
|
|
220
|
-
if let exceptionMessage {
|
|
221
|
-
NSLog(
|
|
222
|
-
"AGENT_DEVICE_RUNNER_MODAL_NODE_IGNORED_EXCEPTION=%@",
|
|
223
|
-
exceptionMessage
|
|
224
|
-
)
|
|
225
|
-
return nil
|
|
226
187
|
}
|
|
227
|
-
return node
|
|
228
188
|
}
|
|
229
189
|
}
|