@swmansion/argent 0.35.1-next.44 → 0.35.1-next.46
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 +238 -165
- package/dist/client.js +164 -97
- package/dist/installer.mjs +86 -76
- package/dist/mcp-server.mjs +192 -125
- package/dist/tool-args.generated.d.ts +10 -10
- package/dist/tool-server.cjs +633 -327
- package/package.json +2 -2
- package/skills/argent-create-e2e/references/e2e-yaml.md +22 -5
- package/skills/argent-create-e2e/references/live-authoring.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.35.1-next.
|
|
3
|
+
"version": "0.35.1-next.46",
|
|
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": "beb7ec4477738f030b4ad11bd8c8f27a00e52a83"
|
|
102
102
|
}
|
|
@@ -257,16 +257,16 @@ A `run:` target is a YAML path resolved against the directory of the test file c
|
|
|
257
257
|
```yaml
|
|
258
258
|
- script: { path: ../../scripts/seed-order.mjs }
|
|
259
259
|
- script: { path: ../../scripts/seed-order.mjs, timeout: 60000 }
|
|
260
|
-
- script: { path: ../../scripts/seed-order.mjs, env: { API_TOKEN: "{{
|
|
260
|
+
- script: { path: ../../scripts/seed-order.mjs, env: { API_TOKEN: "{{var:API_TOKEN}}" } }
|
|
261
261
|
```
|
|
262
262
|
|
|
263
263
|
Use the map form shown above. A bare `script: scripts/seed.mjs` is invalid.
|
|
264
264
|
|
|
265
265
|
`path` is relative to the test file that contains the step. Use an `.mjs` or `.js` file, or an `.mts` or `.ts` file for TypeScript, and match the file name's letter case. `timeout` is in milliseconds, as in `e2e-add-script`.
|
|
266
266
|
|
|
267
|
-
|
|
267
|
+
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
268
|
|
|
269
|
-
Quote
|
|
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.
|
|
270
270
|
|
|
271
271
|
`.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
272
|
|
|
@@ -282,9 +282,26 @@ A script reads the run's device from three environment variables: `ARGENT_DEVICE
|
|
|
282
282
|
|
|
283
283
|
Over a link (`argent link` or `ARGENT_TOOLS_URL`, also to 127.0.0.1), `e2e-add-script` refuses the call, and a replay rejects a test with a `script:` step. Record and replay a test with a script without a link.
|
|
284
284
|
|
|
285
|
+
### Vars
|
|
286
|
+
|
|
287
|
+
Define test inputs under `vars:`. Override defaults with `--var NAME=value` or `e2e-execute.vars`. Use `run:` to inherit the caller's vars. For a separate `tool: e2e-execute` run, pass any overrides explicitly.
|
|
288
|
+
|
|
289
|
+
```yaml
|
|
290
|
+
vars:
|
|
291
|
+
USER_NAME: alice
|
|
292
|
+
PASSWORD: "{{secret:ALICE_PASSWORD}}"
|
|
293
|
+
steps:
|
|
294
|
+
- type: { into: { id: user }, text: "{{var:USER_NAME}}" }
|
|
295
|
+
- type: { into: { id: password }, text: "{{var:PASSWORD}}" }
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
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
|
+
|
|
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.
|
|
301
|
+
|
|
285
302
|
### Pass values between steps
|
|
286
303
|
|
|
287
|
-
Save JSON data to the global `output`, for example `output.user = { id: "user-7" }`. Record scripts one at a time so each starts with the previous output. Inspect `e2e-add-script.outputJson` before writing a reference. A `run:` fragment shares output. For a separate `tool: e2e-execute` run, pass inputs through `
|
|
304
|
+
Save JSON data to the global `output`, for example `output.user = { id: "user-7" }`. Record scripts one at a time so each starts with the previous output. Inspect `e2e-add-script.outputJson` before writing a reference. A `run:` fragment shares output. For a separate `tool: e2e-execute` run, pass inputs through `vars`.
|
|
288
305
|
|
|
289
306
|
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 }`.
|
|
290
307
|
|
|
@@ -292,7 +309,7 @@ Use references in selectors, typed text, equality or contains checks, tool argum
|
|
|
292
309
|
|
|
293
310
|
## Snapshots and CLI runs
|
|
294
311
|
|
|
295
|
-
`argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--
|
|
312
|
+
`argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|macos|ios-remote] [--update-baselines] [--var NAME=value] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
|
|
296
313
|
|
|
297
314
|
A screenshot is human evidence. A `snapshot:` is executable visual verification. A missing baseline or excessive mismatch fails. A `cropOn` size change also fails. Use snapshots for color, layout, size, spacing, typography, clipping, overflow, images, icons, or stable component appearance. Use full screen for global changes and `cropOn` for one component.
|
|
298
315
|
|
|
@@ -35,7 +35,7 @@ Obey these lifecycle rules:
|
|
|
35
35
|
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
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. 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
37
|
5. Edit or reorder the YAML only after `e2e-finish-recording`.
|
|
38
|
-
6. Set
|
|
38
|
+
6. Set vars with `e2e-start-recording.vars` or call `e2e-set-vars` directly before recording steps that use them. For a fragment that expects a caller's var, set a recording default or add a fallback. See [Vars](e2e-yaml.md#vars) before adding references to the YAML.
|
|
39
39
|
|
|
40
40
|
## Record cleanup after the main steps
|
|
41
41
|
|