agent-device 0.16.14 → 0.17.1
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-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.14.apk → agent-device-android-multitouch-helper-0.17.1.apk} +0 -0
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.17.1.apk.sha256 +1 -0
- package/android-multitouch-helper/dist/{agent-device-android-multitouch-helper-0.16.14.manifest.json → agent-device-android-multitouch-helper-0.17.1.manifest.json} +4 -4
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.14.apk → agent-device-android-snapshot-helper-0.17.1.apk} +0 -0
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.17.1.apk.sha256 +1 -0
- package/android-snapshot-helper/dist/{agent-device-android-snapshot-helper-0.16.14.manifest.json → agent-device-android-snapshot-helper-0.17.1.manifest.json} +6 -6
- package/dist/src/1352.js +1 -1
- package/dist/src/221.js +4 -4
- package/dist/src/2415.js +29 -29
- package/dist/src/2805.js +1 -1
- package/dist/src/6232.js +1 -1
- package/dist/src/7599.js +4 -3
- package/dist/src/8020.js +1 -0
- package/dist/src/8699.js +1 -1
- package/dist/src/9238.js +3 -3
- package/dist/src/940.js +1 -1
- package/dist/src/9533.js +1 -1
- package/dist/src/9542.js +3 -3
- package/dist/src/android-snapshot-helper.d.ts +1 -0
- package/dist/src/apple.js +1 -1
- package/dist/src/apps.js +1 -1
- package/dist/src/args.js +15 -10
- package/dist/src/cli.js +9 -9
- package/dist/src/command-metadata.js +1 -1
- package/dist/src/contracts.d.ts +1 -0
- package/dist/src/find.js +1 -1
- package/dist/src/finders.d.ts +1 -0
- package/dist/src/generic.js +12 -10
- package/dist/src/index.d.ts +20 -1
- package/dist/src/interaction.js +1 -1
- package/dist/src/record-trace-recording.js +26 -0
- package/dist/src/record-trace.js +1 -26
- package/dist/src/selectors.d.ts +1 -0
- package/dist/src/session.js +11 -11
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.h +4 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m +71 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Alert.swift +41 -7
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandExecution.swift +160 -13
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+CommandJournal.swift +11 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Exceptions.swift +12 -4
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Interaction.swift +26 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Lifecycle.swift +8 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Models.swift +7 -1
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Snapshot.swift +571 -56
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift +21 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+TvRemote.swift +11 -0
- package/ios-runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests.swift +13 -2
- package/ios-runner/README.md +13 -0
- package/package.json +2 -2
- package/server.json +2 -2
- package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.16.14.apk.sha256 +0 -1
- package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.16.14.apk.sha256 +0 -1
|
@@ -112,12 +112,33 @@ extension RunnerTests {
|
|
|
112
112
|
completion((jsonResponse(status: 200, response: executeStatus(command: command)), false))
|
|
113
113
|
return
|
|
114
114
|
}
|
|
115
|
+
if command.command == .uptime {
|
|
116
|
+
completion((jsonResponse(status: 200, response: executeUptime()), false))
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
NSLog(
|
|
120
|
+
"AGENT_DEVICE_RUNNER_COMMAND_ACCEPTED command=%@ commandId=%@",
|
|
121
|
+
command.command.rawValue,
|
|
122
|
+
command.commandId ?? ""
|
|
123
|
+
)
|
|
115
124
|
commandJournal.accept(command: command)
|
|
116
125
|
commandExecutionQueue.async {
|
|
117
126
|
do {
|
|
118
127
|
let response = try self.executeAccepted(command: command)
|
|
128
|
+
NSLog(
|
|
129
|
+
"AGENT_DEVICE_RUNNER_COMMAND_COMPLETED command=%@ commandId=%@ ok=%d",
|
|
130
|
+
command.command.rawValue,
|
|
131
|
+
command.commandId ?? "",
|
|
132
|
+
response.ok ? 1 : 0
|
|
133
|
+
)
|
|
119
134
|
completion((self.jsonResponse(status: 200, response: response), command.command == .shutdown))
|
|
120
135
|
} catch {
|
|
136
|
+
NSLog(
|
|
137
|
+
"AGENT_DEVICE_RUNNER_COMMAND_FAILED command=%@ commandId=%@ error=%@",
|
|
138
|
+
command.command.rawValue,
|
|
139
|
+
command.commandId ?? "",
|
|
140
|
+
String(describing: error)
|
|
141
|
+
)
|
|
121
142
|
completion((
|
|
122
143
|
self.jsonResponse(
|
|
123
144
|
status: 500,
|
|
@@ -81,7 +81,18 @@ extension RunnerTests {
|
|
|
81
81
|
if let outcome = selectFocusedTvElement(app: app, element: element, action: action) {
|
|
82
82
|
return outcome
|
|
83
83
|
}
|
|
84
|
+
#if os(tvOS)
|
|
84
85
|
return performElementTap(element)
|
|
86
|
+
#else
|
|
87
|
+
let frame = element.frame
|
|
88
|
+
if !frame.isEmpty {
|
|
89
|
+
// XCUIElement.tap() can fail the whole XCTest after navigation because it
|
|
90
|
+
// re-resolves the tapped element even after the app removed it. Keep the
|
|
91
|
+
// selector target semantic, then activate its resolved stable screen point.
|
|
92
|
+
return tapAt(app: app, x: frame.midX, y: frame.midY)
|
|
93
|
+
}
|
|
94
|
+
return performElementTap(element)
|
|
95
|
+
#endif
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
func selectFocusedTvElement(app: XCUIApplication, point: CGPoint, action: String) -> RunnerInteractionOutcome? {
|
|
@@ -39,8 +39,6 @@ final class RunnerTests: XCTestCase {
|
|
|
39
39
|
var currentApp: XCUIApplication?
|
|
40
40
|
var currentBundleId: String?
|
|
41
41
|
let maxRequestBytes = 2 * 1024 * 1024
|
|
42
|
-
let maxSnapshotElements = 600
|
|
43
|
-
let fastSnapshotLimit = 300
|
|
44
42
|
let mainThreadExecutionTimeout: TimeInterval = 30
|
|
45
43
|
let appExistenceTimeout: TimeInterval = 30
|
|
46
44
|
let retryCooldown: TimeInterval = 0.2
|
|
@@ -48,6 +46,7 @@ final class RunnerTests: XCTestCase {
|
|
|
48
46
|
let firstInteractionAfterActivateDelay: TimeInterval = 0.25
|
|
49
47
|
let scrollInteractionIdleTimeoutDefault: TimeInterval = 1.0
|
|
50
48
|
let tvRemoteDoublePressDelayDefault: TimeInterval = 0.0
|
|
49
|
+
let xctestIdleKeepaliveInterval: TimeInterval = 5.0
|
|
51
50
|
let minRecordingFps = 1
|
|
52
51
|
let maxRecordingFps = 120
|
|
53
52
|
let minRecordingQuality = 5
|
|
@@ -119,6 +118,18 @@ final class RunnerTests: XCTestCase {
|
|
|
119
118
|
self.handle(connection: conn)
|
|
120
119
|
}
|
|
121
120
|
listener?.start(queue: transportQueue)
|
|
121
|
+
let idleKeepaliveTimer = DispatchSource.makeTimerSource(queue: transportQueue)
|
|
122
|
+
idleKeepaliveTimer.schedule(
|
|
123
|
+
deadline: .now() + xctestIdleKeepaliveInterval,
|
|
124
|
+
repeating: xctestIdleKeepaliveInterval
|
|
125
|
+
)
|
|
126
|
+
idleKeepaliveTimer.setEventHandler {
|
|
127
|
+
NSLog("AGENT_DEVICE_RUNNER_IDLE_KEEPALIVE")
|
|
128
|
+
}
|
|
129
|
+
idleKeepaliveTimer.resume()
|
|
130
|
+
defer {
|
|
131
|
+
idleKeepaliveTimer.cancel()
|
|
132
|
+
}
|
|
122
133
|
|
|
123
134
|
guard let expectation = doneExpectation else {
|
|
124
135
|
XCTFail("runner expectation was not initialized")
|
package/ios-runner/README.md
CHANGED
|
@@ -33,6 +33,19 @@ Protocol and maintenance references:
|
|
|
33
33
|
- `RunnerTests+SystemModal.swift`: SpringBoard/system modal detection and modal snapshot shaping.
|
|
34
34
|
- `RunnerTests+ScreenRecorder.swift`: nested `ScreenRecorder` implementation.
|
|
35
35
|
|
|
36
|
+
## Snapshot Strategy
|
|
37
|
+
|
|
38
|
+
iOS snapshots have two explicit capture modes:
|
|
39
|
+
|
|
40
|
+
- full/raw snapshots use recursive XCTest snapshots for rich hierarchy and diagnostics;
|
|
41
|
+
- compact interactive snapshots use a bounded flat XCTest query path for fast agent-facing refs.
|
|
42
|
+
|
|
43
|
+
Some simulator apps expose accessibility trees that lower-level AX services can inspect but XCTest
|
|
44
|
+
cannot serialize reliably. In those cases compact interactive snapshots may return a sparse root
|
|
45
|
+
quickly, while full snapshots preserve the XCTest error. See
|
|
46
|
+
[`../docs/adr/0004-ios-snapshot-backend-strategy.md`](../docs/adr/0004-ios-snapshot-backend-strategy.md)
|
|
47
|
+
for the backend boundary and the rationale for a future simulator AX-service backend.
|
|
48
|
+
|
|
36
49
|
## Protocol Notes
|
|
37
50
|
|
|
38
51
|
- The daemon posts JSON commands to `POST /command` on the runner's local HTTP listener.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-device",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Agent-native CLI for AI mobile testing and app automation across iOS, Android, tvOS, Android TV, macOS, and Linux.",
|
|
5
5
|
"mcpName": "io.github.callstackincubator/agent-device",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
},
|
|
76
76
|
"scripts": {
|
|
77
77
|
"build": "rslib build",
|
|
78
|
-
"clean:daemon": "
|
|
78
|
+
"clean:daemon": "node --experimental-strip-types scripts/clean-daemon.ts",
|
|
79
79
|
"clean:xcuitest": "node scripts/clean-xcuitest-derived.mjs",
|
|
80
80
|
"clean:xcuitest:ios": "node scripts/clean-xcuitest-derived.mjs ios",
|
|
81
81
|
"clean:xcuitest:macos": "node scripts/clean-xcuitest-derived.mjs macos",
|
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/callstackincubator/agent-device",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.17.1",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "agent-device",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.17.1",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
package/android-multitouch-helper/dist/agent-device-android-multitouch-helper-0.16.14.apk.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9c73eeabd11869aa1d1cdae98a27decae8368d1a293bc33c3386702c1bbbcabd agent-device-android-multitouch-helper-0.16.14.apk
|
package/android-snapshot-helper/dist/agent-device-android-snapshot-helper-0.16.14.apk.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0d887ea04ab808776d705f7a5dc428f272f4b7e2cd8ba088d18e59fddf2a7106 agent-device-android-snapshot-helper-0.16.14.apk
|