@swmansion/argent 0.36.1-next.0 → 0.36.1-next.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/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.36.1-next.0",
3
+ "version": "0.36.1-next.10",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
- "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
5
+ "description": "MCP server, CLI, and skills by Software Mansion that let AI coding agents control, test, debug, and profile apps on iOS simulators, Android emulators, physical devices, TVs, and desktop apps",
6
6
  "license": "Apache-2.0",
7
+ "homepage": "https://docs.swmansion.com/argent/",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/software-mansion/argent.git"
@@ -98,5 +99,5 @@
98
99
  "vitest": "^5.0.5",
99
100
  "yaml": "^2.9.1"
100
101
  },
101
- "gitHead": "55cef5cbb2744f082f11212b1ff1630174e399ab"
102
+ "gitHead": "03188df677b883dd20058352c99c5ec6b9db5790"
102
103
  }
@@ -38,7 +38,7 @@ During polish, use `within`, `after`, and `next` to disambiguate repeated elemen
38
38
  ## Workflow
39
39
 
40
40
  1. Choose the e2e test type:
41
- - **standalone:** the first step that is not `echo:` or `script:` is `launch:`. The test controls process start.
41
+ - **standalone:** the test starts its own app with a leading `launch:`. See [which setup steps can precede launch](references/e2e-yaml.md#file-shape-and-test-type).
42
42
  - **fragment:** there is no leading launch. Declare a precise `executionPrerequisite`.
43
43
 
44
44
  When a test needs the state that an earlier test leaves, put both in a [suite](references/e2e-yaml.md#suites).
@@ -28,7 +28,7 @@ steps:
28
28
  - await: { idle: true }
29
29
  ```
30
30
 
31
- A standalone e2e test has a literal `launch:` as its first step that is not `echo:` or `script:`. It cannot declare `executionPrerequisite`. Put the named start state in a leading echo.
31
+ A standalone e2e test starts with `launch:`, optionally preceded by `echo`, `script`, output assertions, or `system-settings`. A `when` block with a platform or output guard can also precede launch if all its nested steps qualify. Omit `executionPrerequisite` and put the named start state in a leading echo.
32
32
 
33
33
  A leading `run:` does not classify the outer test as standalone, but the runner still follows the chain to the launch it reaches, and on Chromium that launch boots the app before step 1. A test whose `run:` chain reaches a launch is refused an `executionPrerequisite` too: parse accepts the file, then the run rejects it. The one exception is a run pinned to a Chromium instance you brought to the required state yourself (`--device chromium-cdp-<port>`), where that leading launch only attaches.
34
34
 
@@ -114,7 +114,7 @@ Scopes can combine and nest, with at most six scope keys. Use strict selectors f
114
114
 
115
115
  ## Directives
116
116
 
117
- Directives stop the test on failure and skip later steps. The available directives are `launch`, `tap`, `long-press`, `swipe`, `type`, `scroll-to`, `pinch`, `rotate`, `fold`, `await`, `assert`, `wait`, `snapshot`, `run`, `script`, `when`, `echo`, and `tool`.
117
+ Directives stop the test on failure and skip later steps. The available directives are `launch`, `tap`, `long-press`, `swipe`, `type`, `scroll-to`, `pinch`, `rotate`, `fold`, `system-settings`, `await`, `assert`, `wait`, `snapshot`, `run`, `script`, `when`, `echo`, and `tool`.
118
118
 
119
119
  `fold` folds or unfolds a foldable iOS simulator or Android emulator. Write a posture (`fold: closed`, `fold: half-open`, `fold: open`) or an angle from 0 to 180 (`fold: 120`). The step waits until the device accepts input again. A recorded `fold` tool call becomes a `fold:` step. After a `fold` step:
120
120
 
@@ -123,6 +123,8 @@ Directives stop the test on failure and skip later steps. The available directiv
123
123
  - iOS: unfolded, the UI is landscape. `swipe` and `scroll-to` directions, the reading order and coordinates stay as the user sees the UI, the space of `describe` frames and screenshots.
124
124
  - iOS: a fold between two angles that are not `closed` or `open` can keep the current panel. The step passes, and the report names the panel. To change panels, fold to `closed` or `open`.
125
125
 
126
+ `system-settings` takes the tool's `settings` map, for example `system-settings: { appearance: dark }`. Put it before `launch:` so the app starts with the requested settings. If a running app needs a change to `language` or `region`, relaunch it. Use a platform guard for platform-specific keys when both targets support the tool. A guard for `ios` also matches physical iPhones and remote simulators, which cannot run `system-settings`. See [how to record cleanup](live-authoring.md#record-cleanup-after-the-main-steps).
127
+
126
128
  Use the launch map for cross-platform tests. A bare launch applies everywhere and becomes an app path on Chromium. The map takes `native:`, `ios:`, `android:`, `vega:`, `macos:`, and `chromium:`. `native:` is one id shared by iOS, Android, Vega, and macOS, and a per-platform key overrides it for that platform. `macos:` takes a Mac app's bundle id. `chromium:` accepts a relative or absolute app path. `ios:` and `macos:` also accept `{ app, args }`; Argent passes `args` to the app at launch. A launch that declares no id for the run's platform is an error, not a cue to switch platforms. A run on a remote simulator uses the `ios:` id, or the `native:` id when the map has no `ios:` key, so no test needs a key for a remote run. On an iOS simulator, a successful launch also pins later tree reads to that app until the next raw `tool:` step, so read [The runner tree is not the discovery tree](#the-runner-tree-is-not-the-discovery-tree) when a read describes the wrong screen.
127
129
 
128
130
  ```yaml
@@ -239,7 +241,7 @@ Put cleanup in `shutdown:` so it runs after `steps` pass or fail. A cancellation
239
241
 
240
242
  If setup can stop before writing an output, guard the cleanup with `when: { output: user.id, exists: true }` or supply a fallback the cleanup handles. A `run:` fragment queues its shutdown for the end of the run, most recently loaded first. If the fragment runs more than once, collect IDs in an output list and use `pop()` in its shutdown script. A separate `tool: e2e-execute` run performs its own cleanup.
241
243
 
242
- Inspect `shutdownFailed` and the steps marked `shutdown: true` before rerunning. See [Shutdown](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#shutdown).
244
+ Inspect `shutdownFailed` and the steps marked `shutdown: true` before rerunning. See [Shutdown](https://docs.swmansion.com/argent/docs/reference/e2e-yaml/#shutdown).
243
245
 
244
246
  ## Composition and platform limits
245
247
 
@@ -266,7 +268,7 @@ Use the map form shown above. A bare `script: scripts/seed.mjs` is invalid.
266
268
 
267
269
  Scripts get ordinary [vars](#vars) through `process.env`. Use step `env` to pass a secret var explicitly or override a value for one script. To let `--var` override an `env` entry, use `"{{var:NAME}}"` as its value.
268
270
 
269
- Quote numbers and booleans in `env`, for example `PORT: "8080"`. If a secret is missing, check the sources listed in the error. For a local call, check where the `argent` command or the MCP server started. See [Secret lookup](https://docs.swmansion.com/argent/docs/reference/configuration#secrets) for setup and [Script environment](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#script-environment) for excluded host names and redaction limits.
271
+ Quote numbers and booleans in `env`, for example `PORT: "8080"`. If a secret is missing, check the sources listed in the error. For a local call, check where the `argent` command or the MCP server started. See [Secret lookup](https://docs.swmansion.com/argent/docs/reference/configuration/#secrets) for setup and [Script environment](https://docs.swmansion.com/argent/docs/reference/e2e-yaml/#script-environment) for excluded host names and redaction limits.
270
272
 
271
273
  `.mjs` and `.mts` are always ES modules. `.js` and `.ts` take their module type from the project's `package.json` `type` field; with no `type`, Node reads a file with `import`, `export` or top-level `await` as an ES module, and each other file as CommonJS. So prefer `.mjs` or `.mts` for a new script and use `.js` or `.ts` for a script the project already has. `.cjs` and `.cts` are invalid: under `"type": "module"`, use `import` in the script, not `require`.
272
274
 
@@ -297,7 +299,7 @@ steps:
297
299
 
298
300
  Use quoted var references in the same fields as output references. For an unset var, supply a value or add a fallback such as `"{{var:USER_NAME ?? guest}}"`.
299
301
 
300
- Use secret placeholders for credentials, including values passed with `--var`. Pass secret vars in typed text, tool arguments, or explicit script `env` entries. Use ordinary vars in selectors and checks. See [Vars in the YAML reference](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#vars) for validation and precedence rules.
302
+ Use secret placeholders for credentials, including values passed with `--var`. Pass secret vars in typed text, tool arguments, or explicit script `env` entries. Use ordinary vars in selectors and checks. See [Vars in the YAML reference](https://docs.swmansion.com/argent/docs/reference/e2e-yaml/#vars) for validation and precedence rules.
301
303
 
302
304
  ### Pass values between steps
303
305
 
@@ -305,7 +307,7 @@ Save JSON data to the global `output`, for example `output.user = { id: "user-7"
305
307
 
306
308
  Quote references in YAML, such as `"{{output:user.id}}"`. Use dotted keys and indexes (`items.0.id`). If a script may be skipped, guard the use with an output check or provide a literal fallback, such as `"{{output:user.id ?? guest}}"`. For a required check, use `assert: { output: user.id, exists: true }`.
307
309
 
308
- Use references in selectors, typed text, equality or contains checks, tool arguments, and script-step environment values. A whole-value tool argument keeps its JSON type. Return a string when the tool expects text. Keep secret placeholders in the YAML. See [Script output](https://docs.swmansion.com/argent/docs/reference/e2e-yaml#script-output) for supported fields and fallback syntax.
310
+ Use references in selectors, typed text, equality or contains checks, tool arguments, and script-step environment values. A whole-value tool argument keeps its JSON type. Return a string when the tool expects text. Keep secret placeholders in the YAML. See [Script output](https://docs.swmansion.com/argent/docs/reference/e2e-yaml/#script-output) for supported fields and fallback syntax.
309
311
 
310
312
  ## Snapshots and CLI runs
311
313
 
@@ -43,6 +43,8 @@ Pass `shutdown: true` to `e2e-add-step` or `e2e-add-script` for cleanup. Use the
43
43
 
44
44
  A fragment recorded as `run:` in the main list usually defers cleanup until the first shutdown action or script, or until `e2e-finish-recording`. Read `fragmentShutdown` and the call message before assuming cleanup passed. If the call was cancelled, finish the recording or retry the shutdown call to run queued cleanup.
45
45
 
46
+ Save `toolResult.restore` from the recorded `system-settings` change. Check `toolResult.notes` for side effects and values the tool cannot restore. If the map has entries, record a `system-settings` call with `shutdown: true` after the last main step. In the JSON `args`, set `settings` to the saved map. If you abandon the recording, apply the map with a direct `system-settings` call.
47
+
46
48
  For an uploaded fragment or one that starts its own Chromium app, read the message for cleanup that ran immediately. If later steps need the state it removed, record the fragment's main steps individually and its cleanup with `shutdown: true`. Replace those steps after `e2e-finish-recording`. See [Shutdown](e2e-yaml.md#shutdown) for replay order.
47
49
 
48
50
  ## Start in the correct order
@@ -50,8 +52,9 @@ For an uploaded fragment or one that starts its own Chromium app, read the messa
50
52
  ### iOS, Android, and Vega standalone tests
51
53
 
52
54
  1. Call `e2e-start-recording` before launching or touching the app.
53
- 2. Record a plain `restart-app` as the first action that is neither an echo nor a script. Pass only the device id and app id. The recorder converts it to `launch:`.
54
- 3. Record `await-ui-element` for the real first screen immediately after restart.
55
+ 2. If the test needs a device setting, record a `system-settings` change with `e2e-add-step` before restart. Use a local iOS simulator or an Android emulator or device, excluding TVs. Omit `delayMs` so the recorder writes a `system-settings:` step. Read settings outside the recorder and [record cleanup after the main steps](#record-cleanup-after-the-main-steps).
56
+ 3. Record a plain `restart-app` with only the device id and app id. The recorder converts it to `launch:`. Follow the [rules for setup before launch](e2e-yaml.md#file-shape-and-test-type).
57
+ 4. Record `await-ui-element` for the real first screen immediately after restart.
55
58
 
56
59
  Extra restart arguments prevent `launch:` conversion. An Android `activity`, for example, leaves a raw tool step and therefore a fragment. On iOS, `launchArgs` is the exception: it records as `launch: { native: <app id>, ios: { app, args } }`.
57
60
 
@@ -17,6 +17,7 @@
17
17
  | Type text / press named key | `keyboard` | Every platform; text or one key per call |
18
18
  | Paste text | `paste` | Only where a user would paste; sim/emu, Mac app |
19
19
  | Slow or offline network | `network-conditions` | iOS sim app, Android emu, or Chromium tab |
20
+ | Dark mode or text size | `system-settings` | Device-wide settings on local iOS simulators and Android, excluding TVs |
20
21
  | Wait for UI / idle | `await-ui-element` / `await-screen-idle` | Server-side waits |
21
22
 
22
23
  ## Network Conditions Recovery
@@ -17,3 +17,4 @@ Read this only for a physical iPhone. `argent-device-interact` still applies for
17
17
 
18
18
  - Only these exist: `list-devices`, `launch-app`, `restart-app`, `reinstall-app`, `open-url`, `describe`, `screenshot`, `screenshot-diff`, `gesture-tap`, `gesture-swipe`, `gesture-custom`, `gesture-pinch`, `gesture-rotate`, `button` (`home`, `volumeUp`, `volumeDown`, `actionButton` on models that have one), `keyboard`, `await-ui-element`, `await-screen-idle`, `run-sequence`, `screen-recording-start` and `screen-recording-stop` on a cabled phone (`argent-screen-recording`), the e2e tools, `stop-simulator-server` and `stop-all-simulator-servers` (session end), and for launch time `native-profiler-launch-analysis` with `profiler-load` and `profiler-stack-query` on its session (`argent-native-profiler` §4). Every other device tool fails with `not supported on ios device`.
19
19
  - No `rotate` (the orientation tool), `shake`, `paste`, `settings-permissions`, `debugger-*`, `react-profiler-*`, `native-*` other than `native-profiler-launch-analysis`, `boot-device`: move the phone by hand, type with `keyboard`, change permissions in the phone's Settings, and debug or profile on a simulator.
20
+ - Use the phone's Settings app for device-wide changes. On iOS, `system-settings` requires a local simulator.
@@ -17,7 +17,7 @@ Load `argent-create-e2e` as the authoring engine. Follow its required references
17
17
 
18
18
  A QA e2e test is complete only when:
19
19
 
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.
20
+ 1. The test is standalone as defined in `argent-create-e2e`. 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
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.
@@ -45,6 +45,8 @@ Make repeated runs deterministic:
45
45
  3. After setup navigation, echo the named baseline and hard-check it before the first scenario mutation. Use `assert:` or a destination `await:` that fully proves the baseline.
46
46
  4. Prefer to restore the baseline at the end.
47
47
 
48
+ If a check or snapshot depends on a device setting, set it during setup and restore it during cleanup. Follow the `system-settings` recording workflow in `argent-create-e2e` for supported targets.
49
+
48
50
  An e2e test has two fixture mechanisms:
49
51
 
50
52
  - `run:` replays a separately recorded reset or seed e2e test.
@@ -9,16 +9,17 @@ description: Grant, deny, or reset app runtime permissions out-of-band on an iOS
9
9
 
10
10
  The first matching row wins.
11
11
 
12
- | Situation | Do this |
13
- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
14
- | The app has an **in-app control** for the permission (a toggle in its own settings screen) | **Tap it in the app** (`describe` → `gesture-tap`); it exercises the flow you're testing |
15
- | The app asked and the **system permission dialog is on screen** | **Tap the dialog** (`Allow` / `Don't Allow` / `Allow While Using App`); `describe` exposes its buttons |
16
- | The permission must be **granted/denied before the app runs**, so no dialog interrupts the flow | **Use this tool** (`grant` / `deny`) before `launch-app` |
17
- | The user **already denied** it and you need it **on** again | **Use this tool** (`grant`): iOS never re-shows a dialog once denied |
18
- | You need the **first-run dialog to appear again** | **Use this tool** (`reset`) |
19
- | The permission is unsupported on the target platform, or it isn't one of the 11 runtime permissions (Wi-Fi, dark mode, VPN, Focus, …) | **Do NOT use this tool**: answer the app's dialog, or drive the Settings app or the app's own UI |
12
+ | Situation | Do this |
13
+ | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
14
+ | The app has an **in-app control** for the permission (a toggle in its own settings screen) | **Tap it in the app** (`describe` → `gesture-tap`); it exercises the flow you're testing |
15
+ | The app asked and the **system permission dialog is on screen** | **Tap the dialog** (`Allow` / `Don't Allow` / `Allow While Using App`); `describe` exposes its buttons |
16
+ | The permission must be **granted/denied before the app runs**, so no dialog interrupts the flow | **Use this tool** (`grant` / `deny`) before `launch-app` |
17
+ | The user **already denied** it and you need it **on** again | **Use this tool** (`grant`): iOS never re-shows a dialog once denied |
18
+ | You need the **first-run dialog to appear again** | **Use this tool** (`reset`) |
19
+ | You need a device-wide setting such as dark mode or Wi-Fi | Use `system-settings` where supported, or use the device's Settings app |
20
+ | The tool cannot set the permission on this device | Answer the app's dialog, or use the app's UI or the Settings app |
20
21
 
21
- **Rule of thumb:** if a human tester could flip it _inside the app_, do that. Reach for `settings-permissions` only for a change a human would otherwise make in the **system Settings app**.
22
+ **Rule of thumb:** if a human tester could flip it _inside the app_, do that. Reach for `settings-permissions` only for an app's permission that a human would otherwise change in the **system Settings app**.
22
23
 
23
24
  ## Gotchas
24
25