@swmansion/argent 0.34.1-next.47 → 0.34.1-next.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.34.1-next.47",
3
+ "version": "0.34.1-next.48",
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",
@@ -15,6 +15,7 @@ Read this file before creating or changing an e2e test. Exercise the saved path
15
15
  - [Typing](#typing)
16
16
  - [Scrolling and swiping](#scrolling-and-swiping)
17
17
  - [Live waits and checks](#live-waits-and-checks)
18
+ - [Network capture](#network-capture)
18
19
  - [Wrong turns](#wrong-turns)
19
20
  - [Finish and polish](#finish-and-polish)
20
21
  - [Worked example](#worked-example)
@@ -143,6 +144,16 @@ The live tool and e2e runner use [different trees](e2e-yaml.md#the-runner-tree-i
143
144
 
144
145
  A warning does not reject the step. If `e2e-finish-recording` reports dropped warnings, record those waits again. Replay every conversion. Keep a raw tool only for `pollIntervalMs`, `bundleId`, or a cross-tree mismatch.
145
146
 
147
+ ### Network capture
148
+
149
+ On iOS and Android, `view-network-logs` and `native-network-logs` only read. Before `network-capture-start`, they say that capture is not started. A `tool:` step passes whatever text it returns, so a read before a start replays green and proves nothing.
150
+
151
+ 1. Record `network-capture-start` through `e2e-add-step` after the launch and its first-screen wait, before the action whose requests the test reads. A launch ends the capture of the JS layer. A start before `launch:` makes the test a fragment.
152
+ 2. Before a recorded `network-capture-stop`, record a wait for the screen that shows the result of the request. Argent records no request that the app sends after the stop.
153
+ 3. If a read says that capture is not started, do not answer it with a direct `network-capture-start` call: the replay does not have that call. Record the start, then record the action and the read again.
154
+ 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. A `tool: network-capture-start` or `tool: network-capture-stop` step passes whatever its `armed` says. A start that armed no layer passes, and so does a stop whose JS layer stays `armed: true`. After each replay, read `armed` and `reason` of each layer in the step's `result`. If the start did not arm the layer that the test reads, or the stop did not disarm it, the reads after it prove nothing.
156
+
146
157
  ### Wrong turns
147
158
 
148
159
  Stop immediately. Restore the last valid screen with direct MCP calls, not `e2e-add-step`. Continue only from verified state. Remove the bad step after finishing. If recovery changed or skipped meaningful behavior, re-record that portion live.
@@ -14,19 +14,19 @@ Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`
14
14
 
15
15
  ## 2. Tools
16
16
 
17
- Pass the same `device_id`, the id from `list-devices`, to every call. With two or more devices on one Metro, `debugger-connect` refuses a serial, or a simulator udid it cannot match to one Metro device by name, and returns a `logicalDeviceId`: use that as `device_id` from then on, and include it in `stop-all-simulator-servers`' `devices` at teardown, or the debugger session outlives yours.
18
-
19
- | Tool | Use for |
20
- | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
21
- | `debugger-status` | Diagnosing the connection. Call it first when anything fails |
22
- | `debugger-connect` | Connecting to the runtime's CDP (Metro on iOS / Android / Vega; the page session on Chromium) |
23
- | `debugger-reload-metro` | Reloading the JS bundle of an attached app |
24
- | `restart-app` | Relaunching the app when it lost its Metro connection |
25
- | `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
26
- | `debugger-inspect-element` | Which component is at a point and where it is defined (source file:line). Takes **logical pixels**, not normalized 0–1 |
27
- | `debugger-log-registry` | Console log summary and the log file path (§4) |
28
- | `debugger-evaluate` | Running a JS expression in the app runtime |
29
- | `view-network-logs` → `view-network-request-details` | JS-level HTTP traffic, then the headers and body of one request |
17
+ Pass the same `device_id`, the id from `list-devices`, to every call. With two or more devices on one Metro, `debugger-connect` refuses a serial, or a simulator udid it cannot match to one Metro device by name, and returns a `logicalDeviceId`: use that as `device_id` from then on, and include it in `stop-all-simulator-servers`' `devices` at teardown, or the debugger session outlives yours. `network-capture-start` and `network-capture-stop` take a `udid`, not a `device_id`: always pass them the id from `list-devices`, never a `logicalDeviceId`. On a shared Metro, their JS layer is unavailable until you also pass the device's `logicalDeviceId` in their own `logicalDeviceId` parameter; then read with that id as `device_id`.
18
+
19
+ | Tool | Use for |
20
+ | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
+ | `debugger-status` | Diagnosing the connection. Call it first when anything fails |
22
+ | `debugger-connect` | Connecting to the runtime's CDP (Metro on iOS / Android / Vega; the page session on Chromium) |
23
+ | `debugger-reload-metro` | Reloading the JS bundle of an attached app |
24
+ | `restart-app` | Relaunching the app when it lost its Metro connection |
25
+ | `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
26
+ | `debugger-inspect-element` | Which component is at a point and where it is defined (source file:line). Takes **logical pixels**, not normalized 0–1 |
27
+ | `debugger-log-registry` | Console log summary and the log file path (§4) |
28
+ | `debugger-evaluate` | Running a JS expression in the app runtime |
29
+ | `view-network-logs` → `view-network-request-details` | JS-level HTTP traffic, then the headers and body of one request. On iOS and Android, call `network-capture-start` before the action, and `network-capture-stop` when you have the requests |
30
30
 
31
31
  A component missing from `debugger-component-tree`? `includeSkipped` only adds counts of what was pruned. Use `onScreenOnly: false` for one off screen, or `debugger-inspect-element` at its point for one on screen.
32
32
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Match profiler findings and semantic sweep results to concrete fixes. With React Compiler active, skip the first three rows for the components it compiles; keep them for components it skips (`compilationMode: "annotation"`, `"use no memo"`, a `sources` filter).
4
4
 
5
- | Finding | Fix | Detail |
6
- | -------------------------------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
7
- | Re-renders with same props | `React.memo(Comp)` | Only where the props really are equal between renders |
8
- | Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])` | `useCallback` must pair with `React.memo` on child; alone it has no effect |
9
- | Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const | New reference every render breaks shallow equality |
10
- | List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout` | Or migrate to `@shopify/flash-list` (v2 needs the New Architecture) |
11
- | JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated` | `useNativeDriver` can't animate layout props (width, height, margins, …) |
12
- | Heavy work during transitions | `requestIdleCallback()` | Runs the work when the JS thread is idle; `InteractionManager` is deprecated |
13
- | Slow startup | Defer heavy imports (lazy `require()`) | Check inline requires in the Metro config (on in bare RN, off in Expo) |
14
- | Redundant, heavy, or n+1 network calls | `view-network-logs` → `view-network-request-details` | Batch, debounce, or cache at the data layer |
5
+ | Finding | Fix | Detail |
6
+ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
7
+ | Re-renders with same props | `React.memo(Comp)` | Only where the props really are equal between renders |
8
+ | Expensive recomputation / unstable callbacks | `useMemo(fn, [deps])` / `useCallback(fn, [deps])` | `useCallback` must pair with `React.memo` on child; alone it has no effect |
9
+ | Inline objects/arrays in JSX | `StyleSheet.create()` / module-level const | New reference every render breaks shallow equality |
10
+ | List jank | `removeClippedSubviews`, `maxToRenderPerBatch`, `windowSize`, `getItemLayout` | Or migrate to `@shopify/flash-list` (v2 needs the New Architecture) |
11
+ | JS-thread animation jank | `useNativeDriver: true` or `react-native-reanimated` | `useNativeDriver` can't animate layout props (width, height, margins, …) |
12
+ | Heavy work during transitions | `requestIdleCallback()` | Runs the work when the JS thread is idle; `InteractionManager` is deprecated |
13
+ | Slow startup | Defer heavy imports (lazy `require()`) | Check inline requires in the Metro config (on in bare RN, off in Expo) |
14
+ | Redundant, heavy, or n+1 network calls | `network-capture-start` (iOS and Android), repeat the action, then `view-network-logs` → `view-network-request-details`. Before the next profile, call `network-capture-stop`, then `restart-app` | Batch, debounce, or cache at the data layer |
@@ -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): verify with `view-network-logs`, `debugger-log-registry`, `debugger-evaluate`, or targeted tests. A `not_connected` result from the debugger tools is not evidence about the app: follow its `guidance`, then re-verify.
23
+ - **Runtime / log / network** (console errors, API calls, persistence, timing): verify with `view-network-logs` (on iOS and Android, call `network-capture-start` before the action whose requests you check, and `network-capture-stop` when you have them), `debugger-log-registry`, `debugger-evaluate`, or targeted tests. A `not_connected` result from the debugger tools is not evidence about the app: follow its `guidance`, then re-verify.
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.