@swmansion/argent 0.34.1-next.80 → 0.34.1-next.82
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/dist/cli-cmds.mjs +7 -5
- package/dist/client.js +1 -0
- package/dist/installer.mjs +2 -1
- package/dist/mcp-server.mjs +1 -0
- package/dist/tool-args.generated.d.ts +28 -8
- package/dist/tool-server.cjs +949 -207
- package/package.json +2 -2
- package/skills/argent-create-e2e/references/live-authoring.md +17 -6
- package/skills/argent-device-interact/SKILL.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +7 -3
- package/skills/argent-qa-e2e/SKILL.md +3 -2
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.34.1-next.
|
|
3
|
+
"version": "0.34.1-next.82",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
5
|
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"vitest": "^5.0.5",
|
|
99
99
|
"yaml": "^2.9.1"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "8eb9229560692d827bdd12df1ce9605d45995fd8"
|
|
102
102
|
}
|
|
@@ -16,6 +16,7 @@ Read this file before creating or changing an e2e test. Exercise the saved path
|
|
|
16
16
|
- [Scrolling and swiping](#scrolling-and-swiping)
|
|
17
17
|
- [Live waits and checks](#live-waits-and-checks)
|
|
18
18
|
- [Network capture](#network-capture)
|
|
19
|
+
- [Network checks](#network-checks)
|
|
19
20
|
- [Wrong turns](#wrong-turns)
|
|
20
21
|
- [Finish and polish](#finish-and-polish)
|
|
21
22
|
- [Worked example](#worked-example)
|
|
@@ -33,7 +34,7 @@ Obey these lifecycle rules:
|
|
|
33
34
|
1. Choose a name unique to the task: another caller can take over the same `name` + `project_root` pair without an ownership check. The pair is keyed by the file the filesystem resolves to, not the spelling you passed, so a differently-cased name or a symlinked `.argent/e2e` collides too. That collision is reported: the second start says `restarted`, and the first recording's next call fails naming both spellings.
|
|
34
35
|
2. Treat `e2e-start-recording` as destructive. It truncates the named YAML even when it holds a finished or committed test. `restarted` reports only a displaced live take.
|
|
35
36
|
3. If a call says the recording is inactive, do not restart under that name. The completed take can still be on disk. Copy it aside or record under a fresh name.
|
|
36
|
-
4. Read `recorded` after each call. The recorder does not always store the tool call you made, and that line is where a rewrite shows up.
|
|
37
|
+
4. Read `recorded` after each call. The recorder does not always store the tool call you made, and that line is where a rewrite shows up. The recorder still appends `await-ui-element` and `await-network-request` steps that return `success: false`. Check the warning before continuing. To see the whole file mid-recording, read it at `savedTo`. A `null` `savedTo` means only the write on your side failed: the step is still in the recording, the next step rewrites the whole file, and `e2e-finish-recording` returns `e2eTestFile` regardless.
|
|
37
38
|
5. Edit or reorder the YAML only after `e2e-finish-recording`.
|
|
38
39
|
|
|
39
40
|
## Start in the correct order
|
|
@@ -146,13 +147,23 @@ A warning does not reject the step. If `e2e-finish-recording` reports dropped wa
|
|
|
146
147
|
|
|
147
148
|
### Network capture
|
|
148
149
|
|
|
149
|
-
On iOS, Android, and Mac apps, record a capture start before
|
|
150
|
+
On iOS, Android, and Mac apps, record a capture start before reproducing the request. On Chromium, record `view-network-logs` before the action if you only need to inspect requests. Use start and stop steps when the test needs a capture window. The Chromium log includes requests outside that window.
|
|
150
151
|
|
|
151
|
-
1.
|
|
152
|
-
2.
|
|
153
|
-
3. If a read
|
|
152
|
+
1. Add `network-capture-start` through `e2e-add-step` after the launch and first-screen wait, if present, and before the action. A relaunch ends JS capture. A start before `launch:` makes the test a fragment.
|
|
153
|
+
2. After the action, record a network check if the test must verify the request. Record `network-capture-stop` as soon as you have the requests you need.
|
|
154
|
+
3. If a read reports that capture never started, record the start through `e2e-add-step`, then re-record the action and the read. Replay only runs the steps you recorded.
|
|
154
155
|
4. A `tool:` step keeps its recorded `bundleId` on every platform. Only `launch:` takes an id per platform. If the app id differs by platform, add a top-level `requires:` block with the recording platform (see [File shape and test type](e2e-yaml.md#file-shape-and-test-type)). Record a separate test for each other platform.
|
|
155
|
-
5.
|
|
156
|
+
5. After replay, check `armed` and `reason` for the layer the test uses in each step's `result`. A passed step can report an unarmed start or an unconfirmed stop. A Chromium stop reports `armed: false` even when `reason` says no capture window was started. Fix the reported problem and replay before relying on the capture.
|
|
157
|
+
|
|
158
|
+
### Network checks
|
|
159
|
+
|
|
160
|
+
Use `await-network-request` when the replay must verify that the action sent a request. A log listing passes even when the request is missing. Record start → action → wait → stop through `e2e-add-step`. This works on iOS simulators, Android, Mac apps, and Chromium. On Chromium use the same valid `bundleId` placeholder, such as `argent.capture`, for the capture calls and the wait.
|
|
161
|
+
|
|
162
|
+
Keep the wait as a `tool:` step in YAML. Match on a part of the URL that contains no secret.
|
|
163
|
+
|
|
164
|
+
On Android, capture can slow the app. Start just before the triggering action and stop immediately after the wait, before checking the UI. For many related requests, keep capture running through the group and stop after the last wait. If a replay fails before the stop, stop capture before retrying.
|
|
165
|
+
|
|
166
|
+
If the recorder reports `NETWORK_CAPTURE_NOT_STARTED`, record the start and repeat the action. If it records a wait with `success: false`, read the warning. For `unmet`, inspect the request counts in `toolResult.note` and check the action and matcher. For `unreadable`, fix the layer named in the result before repeating the action. For `cancelled`, record the wait again. Remove superseded steps after `e2e-finish-recording`.
|
|
156
167
|
|
|
157
168
|
### Wrong turns
|
|
158
169
|
|
|
@@ -80,7 +80,7 @@ Use `run-sequence` when every step is known in advance; if a step depends on wha
|
|
|
80
80
|
- "submit form": fill every field, then tap submit
|
|
81
81
|
- "go back to X": a known tap path
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Use `await-ui-element` to gate a step on a screen transition. To gate on a network request, start capture before the sequence, then put `await-network-request` after the triggering action. A failed step, including a wait with `success: false`, stops the sequence and returns partial results.
|
|
84
84
|
|
|
85
85
|
## 6. Text Entry and Secrets
|
|
86
86
|
|
|
@@ -32,11 +32,15 @@ A component missing from `debugger-component-tree`? `includeSkipped` only adds c
|
|
|
32
32
|
|
|
33
33
|
### Inspect HTTP requests
|
|
34
34
|
|
|
35
|
-
On iOS, Android, and Mac apps, call `network-capture-start` before reproducing the request
|
|
35
|
+
On iOS simulators, Android, and Mac apps, call `network-capture-start` before reproducing the request and check that `js` reports `armed: true`. Start again once JavaScript is ready after a reload or relaunch.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
After the action, use `await-network-request` if you know which request to check. Use `view-network-logs` to explore the traffic. Open the details with `view-network-request-details` when needed. Stop capture when you have what you need. If the stop still reports `armed: true`, follow its `reason`.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Use the device ID as `udid` for start, stop, and the wait. On shared Metro, pass the logical ID as `logicalDeviceId` for start and stop, or `device_id` for the log tools. The wait reuses the Metro target from the start. Keep the Metro port consistent across the other calls.
|
|
40
|
+
|
|
41
|
+
On Vega, call `view-network-logs` before reproducing the request and again after a reload.
|
|
42
|
+
|
|
43
|
+
On Chromium and Electron, call `view-network-logs` before reproducing the request so Argent connects to the page. Use `network-capture-start` and `network-capture-stop` to mark a capture window when needed. The log includes requests outside that window.
|
|
40
44
|
|
|
41
45
|
### React Native Mac apps
|
|
42
46
|
|
|
@@ -7,7 +7,7 @@ description: Write repeatable QA regression e2e tests from test cases, tickets,
|
|
|
7
7
|
|
|
8
8
|
Load `argent-create-e2e` as the authoring engine. Follow its required references for recorder syntax, selectors, polish, platform exceptions, and repair. This skill adds the QA contract and completion gate.
|
|
9
9
|
|
|
10
|
-
**Vega** supports
|
|
10
|
+
**Vega** supports `launch: { vega: ... }`, `await:`/`assert:` selectors, `snapshot:`, and `idle`. Network checks are unavailable on Vega. Navigate with recorded `tool: tv-remote` steps and type with `tool: keyboard`, which leaves item 5 with nothing to govern. A D-pad path is relative to where focus already is, so gate every move with item 4's identity check rather than assuming the cursor landed. Read `argent-tv-interact` for focus reading and remote navigation.
|
|
11
11
|
|
|
12
12
|
**Apple TV and Android TV are out of scope.** The runner does not reject touch directives there: on Apple TV they fail at the gesture layer, and on Android TV a `tap:` can pass without doing anything. Use `argent-tv-interact` and report the limitation.
|
|
13
13
|
|
|
@@ -19,7 +19,7 @@ A QA e2e test is complete only when:
|
|
|
19
19
|
|
|
20
20
|
1. The first step that is not `echo:` or `script:` is `launch:`. In-test setup proves a deterministic data baseline. Repeated runs do not accumulate artifacts or require manual cleanup.
|
|
21
21
|
2. The first walkthrough recorded every action and live structural check. Only the three documented polish insertions are unrecorded.
|
|
22
|
-
3. Every requirement maps to
|
|
22
|
+
3. Every requirement maps to an executable check: `await:`, `assert:`, a reviewed `snapshot:`, or `tool: await-network-request`. Echoes and screenshots are not verdicts. A negative UI check needs the same stable selector established as visible earlier.
|
|
23
23
|
4. Every screen change has destination identity followed by `idle` readiness.
|
|
24
24
|
5. Targets satisfy the stable-selector and coordinate-fallback rules. QA keeps coordinates only for genuinely unlabeled targets. Vacuous on Vega, which has no coordinate targets.
|
|
25
25
|
6. The unchanged YAML passes twice with the same runner. Pass 1 starts with fresh mobile Argent services, and pass 2 follows immediately.
|
|
@@ -83,6 +83,7 @@ A snapshot has no recorder form. Inspect its stable state during the walkthrough
|
|
|
83
83
|
- **Repeated controls:** prefer an id. Otherwise use YAML-only `within` with a stable container. Use `text.in` to prove rendered membership inside that container.
|
|
84
84
|
- **Dynamic content:** assert controlled state or stable app chrome. Use anchored structure for unavoidable dynamic values and disclose the dependency.
|
|
85
85
|
- **Visual state:** snapshot only a correct, settled, deterministic screen. Use full screen for global changes and `cropOn` for one component.
|
|
86
|
+
- **Network requests:** record capture inside the test, after `launch:`, so both replays establish their own capture window. On Android, start just before the triggering action and stop after the wait. For many related requests, stop after the last wait. A wait requires a match, so use it only for requests the app must send. See [Network checks](../argent-create-e2e/references/live-authoring.md#network-checks).
|
|
86
87
|
|
|
87
88
|
Never put acceptance evidence inside `when:`. Use `when:` only for optional setup that reconverges to the required path.
|
|
88
89
|
|
|
@@ -20,7 +20,7 @@ For implementation tasks that modify visible UI, this workflow also serves as a
|
|
|
20
20
|
4. **Verify**: check the returned screenshot. If it shows a loading/transitional state, block with `await-ui-element` (expected element `visible`, or a spinner `hidden`) rather than a guessed delay (its result carries the new screenshot and element tree), but only with a selector you can trust (`text`/`identifier`/`role`) that the screen is known to have or that you saw in a prior `describe`; a guessed one just times out. Otherwise use a short fixed wait. Pick evidence by what's being asserted:
|
|
21
21
|
- **Visual** (layout, spacing, color, typography, image/icon rendering, clipping, overflow, text rendering): prefer `screenshot-diff` against the step 1 baseline: it surfaces pixel-visible changes the auto-screenshot might miss. Fall back to inspecting the auto-screenshot only when a stable baseline isn't available.
|
|
22
22
|
- **Structural** (navigation state, element existence, accessibility labels/values, selection, hierarchy, route): verify with `describe` or `debugger-component-tree`.
|
|
23
|
-
- **Runtime / log / network** (console errors, API calls, persistence, timing): use `debugger-log-registry`, `debugger-evaluate`, or targeted tests. If a debugger tool returns `not_connected`, follow its `guidance` and verify again.
|
|
23
|
+
- **Runtime / log / network** (console errors, API calls, persistence, timing): use `debugger-log-registry`, `debugger-evaluate`, or targeted tests. If a debugger tool returns `not_connected`, follow its `guidance` and verify again. To verify a specific request, start capture before the action, call `await-network-request` after it, then stop capture. See `argent-metro-debugger` for capture setup and recovery.
|
|
24
24
|
- **Mixed**: collect evidence for each relevant class.
|
|
25
25
|
- Report the combined verdict: expected behavior, observed behavior, evidence used, and any blocker for requested visual diffing.
|
|
26
26
|
5. **Repeat** for each step in the flow.
|