@swmansion/argent 0.29.1-next.21 → 0.29.1-next.23
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/README.md +1 -1
- package/dist/cli-cmds.mjs +808 -574
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/client.js +389 -226
- package/dist/flow-script-runner.mjs +1 -1
- package/dist/installer.mjs +606 -496
- package/dist/mcp-server.mjs +467 -298
- package/dist/tool-args.generated.d.ts +51 -37
- package/dist/tool-server.cjs +1994 -1738
- package/package.json +1 -1
- package/rules/argent.md +10 -10
- package/skills/{argent-create-flow → argent-create-e2e}/SKILL.md +16 -16
- package/skills/{argent-create-flow/references/flow-yaml.md → argent-create-e2e/references/e2e-yaml.md} +30 -30
- package/skills/{argent-create-flow → argent-create-e2e}/references/live-authoring.md +62 -62
- package/skills/{argent-create-flow → argent-create-e2e}/references/reliability-and-recovery.md +18 -18
- package/skills/argent-device-interact/SKILL.md +2 -2
- package/skills/argent-device-interact/references/chromium.md +1 -1
- package/skills/argent-ios-device-interact/SKILL.md +1 -1
- package/skills/argent-native-profiler/SKILL.md +1 -1
- package/skills/{argent-qa-flows → argent-qa-e2e}/SKILL.md +23 -23
- package/skills/argent-react-native-optimization/SKILL.md +2 -2
- package/skills/argent-react-native-profiler/SKILL.md +3 -3
- package/skills/argent-screen-recording/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +4 -4
package/package.json
CHANGED
package/rules/argent.md
CHANGED
|
@@ -76,7 +76,7 @@ Decision order:
|
|
|
76
76
|
- Interaction tools (`gesture-tap`, `gesture-swipe`, `gesture-pinch`, `gesture-rotate`, `gesture-custom`, `launch-app`, etc.) return a screenshot and the element tree automatically.
|
|
77
77
|
Call `screenshot` or `describe` separately only for a baseline before any action or after a delay.
|
|
78
78
|
- Always open apps with `launch-app` or `open-url`; never tap home screen icons.
|
|
79
|
-
- If a task can require a saved
|
|
79
|
+
- If a task can require a saved e2e test, choose `argent-create-e2e` or `argent-qa-e2e` before the first launch or in-app action. Start the recorder before walking the path; recording is not retroactive.
|
|
80
80
|
- Always use `run-sequence` when performing multiple sequential device actions where you don't need to observe the screen between steps. More in `argent-device-interact` skill.
|
|
81
81
|
- When the session ends or the user says they are done: call `stop-all-simulator-servers` with `devices: [...]`
|
|
82
82
|
naming the devices this session actually used. One tool-server is shared by every other agent using this
|
|
@@ -130,7 +130,7 @@ TV INTERACTION (APPLE TV / ANDROID TV / FIRE TV)
|
|
|
130
130
|
Skill: `argent-tv-interact`
|
|
131
131
|
When: Any TV target: a `list-devices` entry with `runtimeKind: "tv"` (Apple TV simulator or Android TV emulator) or `platform:"vega"` / `kind:"vvd"` (Amazon Fire TV / VVD), or the user mentions Apple TV / tvOS / Android TV / leanback / Vega / Fire TV. A TV UI is focus-driven, not touch-driven: drive it with `describe` (read focus) + `tv-remote` (D-pad presses) + `keyboard` (type); `gesture-*` tools do NOT apply. Covers booting the target, app lifecycle, focus navigation, typing, screenshots, and (Vega) VVD lifecycle + Fast Refresh + JS-runtime debugging (evaluate, console logs, network inspector).
|
|
132
132
|
Prompt keywords: apple tv, tvos, android tv, leanback, vega, fire tv, vvd, d-pad
|
|
133
|
-
Saved artifacts: on Vega, a replayable path is `argent-create-
|
|
133
|
+
Saved artifacts: on Vega, a replayable path is `argent-create-e2e` and an acceptance-criteria regression test is `argent-qa-e2e`; both record D-pad navigation as `tool: tv-remote` steps. Apple TV and Android TV have no e2e support; report that limitation.
|
|
134
134
|
|
|
135
135
|
SCREENSHOT DIFF & VISUAL REGRESSION
|
|
136
136
|
Skill: `argent-screenshot-diff`
|
|
@@ -138,7 +138,7 @@ When: Explicit visual regression, screenshot diff, compare screenshots, before/a
|
|
|
138
138
|
|
|
139
139
|
SCREEN RECORDING (VIDEO CAPTURE)
|
|
140
140
|
Skill: `argent-screen-recording`
|
|
141
|
-
When: The user wants an mp4 of an interaction, animation, or bug reproduction. Use `argent-create-
|
|
141
|
+
When: The user wants an mp4 of an interaction, animation, or bug reproduction. Use `argent-create-e2e` instead for a replayable sequence.
|
|
142
142
|
Prompt keywords: record, recording, screen recording, video, capture video, clip, mp4
|
|
143
143
|
|
|
144
144
|
RUNNING / BUILDING / DEBUGGING REACT NATIVE APP
|
|
@@ -165,16 +165,16 @@ INTERACTIVE UI TESTING (ONE-OFF, NOT SAVED)
|
|
|
165
165
|
Skill: `argent-test-ui-flow`
|
|
166
166
|
When: Running a one-off interact → screenshot → verify check with no saved regression artifact.
|
|
167
167
|
|
|
168
|
-
RECORDING & REPLAYING
|
|
169
|
-
Use skill: `argent-create-
|
|
170
|
-
When: Saving or replaying a repeatable path for profiling, A/B comparison, retry, or reuse. For acceptance-driven regression tests, use `argent-qa-
|
|
171
|
-
Prompt keywords: flow, repeat, test X times
|
|
168
|
+
RECORDING & REPLAYING E2E TESTS
|
|
169
|
+
Use skill: `argent-create-e2e`
|
|
170
|
+
When: Saving or replaying a repeatable path for profiling, A/B comparison, retry, or reuse. For acceptance-driven regression tests, use `argent-qa-e2e`.
|
|
171
|
+
Prompt keywords: record e2e, replay e2e, run e2e, flow, repeat, test X times
|
|
172
172
|
|
|
173
173
|
GENERATED QA REGRESSION TESTS
|
|
174
|
-
Use skill: `argent-qa-
|
|
174
|
+
Use skill: `argent-qa-e2e`
|
|
175
175
|
When: Saving a test case, ticket, or acceptance criteria as a repeatable regression test. Requires stable evidence and two unchanged full passes. iOS, Android, Chromium, and Vega (D-pad navigation records as `tool: tv-remote` steps); not Apple TV or Android TV.
|
|
176
|
-
Prompt keywords: QA test, regression test, test case, automate
|
|
177
|
-
Routing: one-off check → `argent-test-ui-flow`; saved path → `argent-create-
|
|
176
|
+
Prompt keywords: QA test, regression test, test case, automate an e2e test, write an e2e test, generate a test
|
|
177
|
+
Routing: one-off check → `argent-test-ui-flow`; saved path → `argent-create-e2e`; saved acceptance test → `argent-qa-e2e`.
|
|
178
178
|
|
|
179
179
|
PROPOSING DESIGN VARIANTS FOR HUMAN SELECTION
|
|
180
180
|
Use skill: `argent-lens`
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: argent-create-
|
|
3
|
-
description: Create, record, edit, replay, or repair reusable Argent
|
|
2
|
+
name: argent-create-e2e
|
|
3
|
+
description: Create, record, edit, replay, or repair reusable Argent e2e test YAML files. Use when the user asks to record, replay, or run an e2e test or a repeatable device path, set up profiling or an A/B comparison, or invoke the authoring engine behind argent-qa-e2e. Also use before repeating three or more interactions. For one-off UI checks, acceptance-driven regression tests, or screen video, use argent-test-ui-flow, argent-qa-e2e, or argent-screen-recording respectively.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Create an Argent
|
|
6
|
+
# Create an Argent e2e test
|
|
7
7
|
|
|
8
|
-
An Argent
|
|
8
|
+
An Argent e2e test is a replayable sequence in `.argent/e2e/<name>.yaml` (`.argent/flows/` is still read).
|
|
9
9
|
|
|
10
|
-
For a saved QA test case, ticket, or acceptance criterion, load `argent-qa-
|
|
10
|
+
For a saved QA test case, ticket, or acceptance criterion, load `argent-qa-e2e` first. It adds deterministic setup, acceptance evidence, and two-pass proof.
|
|
11
11
|
|
|
12
12
|
## Read the relevant reference
|
|
13
13
|
|
|
14
|
-
- Before creating or changing
|
|
15
|
-
- When polishing, composing, or manually reviewing YAML, read [
|
|
16
|
-
-
|
|
14
|
+
- Before creating or changing an e2e test, read [Live authoring](references/live-authoring.md) completely.
|
|
15
|
+
- When polishing, composing, or manually reviewing YAML, read [E2E YAML](references/e2e-yaml.md). For Vega, read its platform limits before recording remote or keyboard tools.
|
|
16
|
+
- E2E tests run on physical iPhones (an iOS `list-devices` entry with kind `"device"`), but replay never auto-binds one, even when no simulator is booted: pass the phone's udid as `device` (CLI `--device`), and only a `connected` phone can run. `pinch`/`rotate` steps fail there like the live tools. On hardware the runner tree is the `describe` tree: same ids and roles, no UIView hierarchy. See `argent-ios-device-interact` for the hardware contract.
|
|
17
17
|
- On capture warnings, raw coordinates, unavailable trees, mistimed transitions, overlays, or replay failures, read [Reliability and recovery](references/reliability-and-recovery.md).
|
|
18
18
|
|
|
19
19
|
## Non-negotiable rules
|
|
@@ -23,21 +23,21 @@ For a saved QA test case, ticket, or acceptance criterion, load `argent-qa-flows
|
|
|
23
23
|
3. **Use semantic targets.** Prefer a strict id, then stable text or an accessibility label. Use `scroll-to` for off-screen elements. Resolve every raw-point warning immediately through the [coordinate fallback gate](references/reliability-and-recovery.md#coordinate-fallback-gate).
|
|
24
24
|
4. **Prove every screen change.** Record a destination-only identity check. During polish, follow it with `await: { idle: true }`. Stillness does not prove identity, and `idle` can pass with a warning.
|
|
25
25
|
5. **Polish only executed behavior.** Convert recorded steps without changing their meaning. Record any missing action or structural check live. The only unrecorded insertions are a planned `snapshot:`, a navigation `await: { idle: true }`, and the documented Chromium packaging `launch:`.
|
|
26
|
-
6. **Use scripts only when the user requests them.** Read [
|
|
27
|
-
7. **Replay the final YAML end to end.** A normal
|
|
26
|
+
6. **Use scripts only when the user requests them.** Read [E2E YAML: Local scripts](references/e2e-yaml.md#local-scripts), then record each script with `e2e-add-script`.
|
|
27
|
+
7. **Replay the final YAML end to end.** A normal e2e test needs one uninterrupted full pass. `argent-qa-e2e` requires two consecutive passes.
|
|
28
28
|
|
|
29
29
|
### Stable selectors
|
|
30
30
|
|
|
31
|
-
A stable selector is fixed by app code and survives account, data, time, count, order, and every locale and environment the
|
|
31
|
+
A stable selector is fixed by app code and survives account, data, time, count, order, and every locale and environment the e2e test supports. Prefer ids such as `settings-screen`. Do not gate on values such as `Today`, `Item 4`, usernames, counters, or timestamps.
|
|
32
32
|
|
|
33
|
-
###
|
|
33
|
+
### YAML-only selector scopes
|
|
34
34
|
|
|
35
|
-
During polish, use `within`, `after`, and `next` to disambiguate repeated elements. Read [
|
|
35
|
+
During polish, use `within`, `after`, and `next` to disambiguate repeated elements. Read [E2E YAML: Relational scopes](references/e2e-yaml.md#relational-scopes) for their frame-based semantics and failure cases.
|
|
36
36
|
|
|
37
37
|
## Workflow
|
|
38
38
|
|
|
39
|
-
1. Choose the
|
|
40
|
-
- **
|
|
39
|
+
1. Choose the e2e test type:
|
|
40
|
+
- **standalone:** the first step that is not `echo:` or `script:` is `launch:`. The test controls process start.
|
|
41
41
|
- **fragment:** there is no leading launch. Declare a precise `executionPrerequisite`.
|
|
42
42
|
2. Follow [Live authoring](references/live-authoring.md): start, record one verified step at a time, finish, polish, audit, and replay.
|
|
43
43
|
3. Report the file, replay command, result, prerequisite or side effects, and every coordinate or raw-gesture exception.
|
|
@@ -48,4 +48,4 @@ Before repeating three or more interactions, tell the user and start a recording
|
|
|
48
48
|
|
|
49
49
|
## Repair
|
|
50
50
|
|
|
51
|
-
When replay fails, follow [Reliability and recovery](references/reliability-and-recovery.md). Inspect the first divergence, correct the smallest justified unit, audit, and replay the full
|
|
51
|
+
When replay fails, follow [Reliability and recovery](references/reliability-and-recovery.md). Inspect the first divergence, correct the smallest justified unit, audit, and replay the full e2e test. Stop after two unsuccessful correction cycles. Never weaken a requested check to obtain a pass.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# E2E YAML
|
|
2
2
|
|
|
3
|
-
Read this reference when polishing, composing, or manually reviewing
|
|
3
|
+
Read this reference when polishing, composing, or manually reviewing an e2e test.
|
|
4
4
|
|
|
5
|
-
- [
|
|
6
|
-
- [File shape and
|
|
5
|
+
- [E2E YAML](#e2e-yaml)
|
|
6
|
+
- [File shape and test type](#file-shape-and-test-type)
|
|
7
7
|
- [Selectors](#selectors)
|
|
8
8
|
- [The runner tree is not the discovery tree](#the-runner-tree-is-not-the-discovery-tree)
|
|
9
9
|
- [Relational scopes](#relational-scopes)
|
|
@@ -15,10 +15,10 @@ Read this reference when polishing, composing, or manually reviewing a flow.
|
|
|
15
15
|
- [Optional divergences](#optional-divergences)
|
|
16
16
|
- [Composition and platform limits](#composition-and-platform-limits)
|
|
17
17
|
- [Local scripts](#local-scripts)
|
|
18
|
-
- [Snapshots and
|
|
18
|
+
- [Snapshots and CLI runs](#snapshots-and-cli-runs)
|
|
19
19
|
- [YAML safety](#yaml-safety)
|
|
20
20
|
|
|
21
|
-
## File shape and
|
|
21
|
+
## File shape and test type
|
|
22
22
|
|
|
23
23
|
```yaml
|
|
24
24
|
steps:
|
|
@@ -27,9 +27,9 @@ steps:
|
|
|
27
27
|
- await: { idle: true }
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
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
31
|
|
|
32
|
-
A leading `run:` does not classify the outer
|
|
32
|
+
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.
|
|
33
33
|
|
|
34
34
|
A fragment reaches no leading launch, by its own step or through a `run:` chain, and can declare:
|
|
35
35
|
|
|
@@ -38,9 +38,9 @@ executionPrerequisite: User is signed in and viewing Settings
|
|
|
38
38
|
steps: []
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
E2E tests never store a device id. The runner binds the device. `launch:` restarts the process but does not clear app, account, or backend data.
|
|
42
42
|
|
|
43
|
-
The one exception is a device _scope_ rather than a target: `stop-all-simulator-servers`' `devices` list **is** kept in the YAML, because without it the step means the machine-wide sweep and would tear down devices other agents are mid-session on. Replay rebinds a recorded scope only when you pass `device` explicitly: an auto-detected device would retarget the teardown at a device the
|
|
43
|
+
The one exception is a device _scope_ rather than a target: `stop-all-simulator-servers`' `devices` list **is** kept in the YAML, because without it the step means the machine-wide sweep and would tear down devices other agents are mid-session on. Replay rebinds a recorded scope only when you pass `device` explicitly: an auto-detected device would retarget the teardown at a device the test never named. So the recorded ids are what run when you replay without `device`; on another host they reap nothing and come back in `unmatched`, so re-record the cleanup test there or pass `device`. A step that recorded no scope is narrowed onto the run's device **only when the run resolved one**. A cleanup test whose only step is that teardown needs no device, so with none or several booted it resolves none, replays as the machine-wide sweep, and still reports a pass. Record the scope, or pass `device` at replay, whenever the sweep must stay confined.
|
|
44
44
|
|
|
45
45
|
## Selectors
|
|
46
46
|
|
|
@@ -63,7 +63,7 @@ Use single quotes for anchored, case-sensitive regexes:
|
|
|
63
63
|
|
|
64
64
|
### The runner tree is not the discovery tree
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
YAML selectors and live discovery use different screen projections:
|
|
67
67
|
|
|
68
68
|
| Platform | Runner tree | `describe` / `await-ui-element` | Important difference |
|
|
69
69
|
| -------- | --------------------------------------------------------- | ------------------------------- | ------------------------------------------------------ |
|
|
@@ -72,7 +72,7 @@ Flow selectors and live discovery use different screen projections:
|
|
|
72
72
|
| Chromium | filtered DOM nodes with id, label, value, click, or focus | shorter DOM walk | Projections and node limits differ (12,000 vs. 5,000) |
|
|
73
73
|
| Vega | toolkit page source | same source | Same elements, different shape |
|
|
74
74
|
|
|
75
|
-
On iOS, Android, and Chromium, an id absent from `describe` can still resolve in
|
|
75
|
+
On iOS, Android, and Chromium, an id absent from `describe` can still resolve in an e2e test. Verify it in a scratch fragment. Chromium exposes password fields to the runner as `[password]`; select them by id or role.
|
|
76
76
|
|
|
77
77
|
The recorder rechecks each successful `await-ui-element` against the runner tree. Follow any `message` warning and replay each conversion. On Vega, a mismatch usually means the screen changed. A `text` check can also select different elements from the same source. See [Live waits and checks](live-authoring.md#live-waits-and-checks).
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ Any raw `tool:` step ends the pin, because its effect on the screen is opaque to
|
|
|
82
82
|
|
|
83
83
|
So on iOS recording and replay can read different apps, not only different projections: recording has no run state and always auto-detects the frontmost connected app, while a replay read between a `launch:` and the next raw `tool:` step reads the launched app.
|
|
84
84
|
|
|
85
|
-
**On iOS, never copy a `role` from `describe` into a
|
|
85
|
+
**On iOS, never copy a `role` from `describe` into a YAML selector.** The runner derives iOS roles from the UIView class name and `describe` from accessibility traits, so a React Native `Pressable` (class `RCTView`) is `AXGroup` to the runner and `AXButton` to `describe`. Select on `id`/`text`, or confirm the role against the runner's own tree.
|
|
86
86
|
|
|
87
87
|
When several nodes match, the directive decides:
|
|
88
88
|
|
|
@@ -93,7 +93,7 @@ A container that aggregates a child's text therefore splits them: `tap` hits the
|
|
|
93
93
|
|
|
94
94
|
### Relational scopes
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
YAML selectors support frame-based `within`, `after`, and `next` in every selector slot. Live `await-ui-element` does not support them.
|
|
97
97
|
|
|
98
98
|
```yaml
|
|
99
99
|
- tap: { text: Delete, within: { id: profile-card } } # inside a container
|
|
@@ -109,7 +109,7 @@ Scopes can combine and nest, with at most six scope keys. Use strict selectors f
|
|
|
109
109
|
|
|
110
110
|
## Directives
|
|
111
111
|
|
|
112
|
-
Directives stop the
|
|
112
|
+
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`.
|
|
113
113
|
|
|
114
114
|
`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:
|
|
115
115
|
|
|
@@ -118,14 +118,14 @@ Directives stop the flow on failure and skip later steps. The available directiv
|
|
|
118
118
|
- iOS: unfolded, the UI is landscape. `swipe` and `scroll-to` directions and the reading order stay as the user sees the UI. Coordinates stay in the space of the `describe` frames.
|
|
119
119
|
- 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`.
|
|
120
120
|
|
|
121
|
-
Use the launch map for cross-platform
|
|
121
|
+
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:`, and `chromium:`. `native:` is one id shared by iOS, Android, and Vega, and a per-platform key overrides it for that platform. `chromium:` accepts a relative or absolute app path. `ios:` also accepts `{ app, args }`; a simulator 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 iOS, 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.
|
|
122
122
|
|
|
123
123
|
```yaml
|
|
124
124
|
- launch: { native: com.acme.app, chromium: ../../app }
|
|
125
125
|
- launch: { ios: com.acme.app, android: com.acme.app.android, chromium: ../../app }
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
-
An Android app that needs a non-launcher activity has no `launch:` form. Record `restart-app` with `activity` and keep the
|
|
128
|
+
An Android app that needs a non-launcher activity has no `launch:` form. Record `restart-app` with `activity` and keep the test as a fragment.
|
|
129
129
|
|
|
130
130
|
In a `scroll-to` map, put the selector under `target:`. The map supports `up`, `down`, `left`, and `right` directions. The default is `down`; set it explicitly to reach a target above the viewport or along a horizontal carousel. If the target is already visible, the step is a safe no-op. `tap`, `type`, and `long-press` do not auto-scroll. Add `scroll-to` when the target can be off-screen. Use `within` for a nested scroller.
|
|
131
131
|
|
|
@@ -226,21 +226,21 @@ Use `when:` only for optional setup or an interstitial that reconverges:
|
|
|
226
226
|
- tap: { text: Got it }
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
The guard accepts one `exists`, `visible`, `hidden`, or `text` condition, or `{ platform: ios|android|chromium|vega }`. A run on a remote simulator matches `ios`. UI guards use the short assert grace and reject `timeout`. There is no `else` or per-step `optional`. Put separate behavioral paths in separate
|
|
229
|
+
The guard accepts one `exists`, `visible`, `hidden`, or `text` condition, or `{ platform: ios|android|chromium|vega }`. A run on a remote simulator matches `ios`. UI guards use the short assert grace and reject `timeout`. There is no `else` or per-step `optional`. Put separate behavioral paths in separate tests. Never place a required acceptance check inside `when:`.
|
|
230
230
|
|
|
231
231
|
## Composition and platform limits
|
|
232
232
|
|
|
233
|
-
A `run:` target is a YAML path resolved against the directory of the
|
|
233
|
+
A `run:` target is a YAML path resolved against the directory of the test file containing the step, so `../shared/login.yaml` reaches a sibling directory rather than the project root. The `.yaml` suffix is optional: `run: login` and `run: login.yaml` both name `login.yaml` beside the test. A bare name that is missing beside a test in `.argent/e2e/` is also looked up in `.argent/flows/`, and the reverse. The recorder writes a nested test that is only in the other directory by its path, for example `run: ../flows/login.yaml`.
|
|
234
234
|
|
|
235
|
-
`run:` steps and `tool:
|
|
235
|
+
`run:` steps and `tool: e2e-execute` steps make one chain of tests. A step that closes a cycle in that chain, such as a test that runs itself through `tool: e2e-execute`, fails with a reason that contains `cyclic e2e test reference:`. A step that makes the chain longer than 20 tests fails with a reason that contains `max run depth exceeded`.
|
|
236
236
|
|
|
237
|
-
- iOS and Android can run fragments or
|
|
238
|
-
- Chromium boots one instance per launch **step**, not one per run. The leading launch (the
|
|
237
|
+
- iOS and Android can run fragments or standalone tests inline. A nested standalone launch restarts its app.
|
|
238
|
+
- Chromium boots one instance per launch **step**, not one per run. The leading launch (the test's own, or the one its leading `run:` chain reaches) boots before step 1, unless you pinned the run with an explicit `device`, where it only attaches. Every later launch boots a fresh instance, moves the run onto it, and tears down the instance the run already owned for that app path. Nesting a Chromium standalone test with its own launch is therefore the supported way to give a sub-scenario its own restart. Chromium rejects `pinch` and `rotate`. Use the app's own zoom or rotate controls.
|
|
239
239
|
- Vega uses `tool: tv-remote` and raw `tool: keyboard`. The touch directives (`tap`, `long-press`, `swipe`, `type`, `scroll-to`, `pinch`, `rotate`) are unsupported. Gate focus and navigation results with `await`.
|
|
240
240
|
|
|
241
241
|
## Local scripts
|
|
242
242
|
|
|
243
|
-
Use a local `.mjs` script only when the user requests one. Record it with `
|
|
243
|
+
Use a local `.mjs` script only when the user requests one. Record it with `e2e-add-script` at the point where it must run.
|
|
244
244
|
|
|
245
245
|
```yaml
|
|
246
246
|
- script: { path: ../../scripts/seed-order.mjs }
|
|
@@ -249,25 +249,25 @@ Use a local `.mjs` script only when the user requests one. Record it with `flow-
|
|
|
249
249
|
|
|
250
250
|
Use the map form shown above. A bare `script: scripts/seed.mjs` is invalid.
|
|
251
251
|
|
|
252
|
-
- **`path`** is relative to the
|
|
252
|
+
- **`path`** is relative to the test file that contains the step. Include `.mjs` and match the file name's letter case.
|
|
253
253
|
- **`timeout`** is optional and uses milliseconds. The default is 30000. The minimum is 100.
|
|
254
254
|
|
|
255
|
-
Over a link (`argent link` or `ARGENT_TOOLS_URL`, also to 127.0.0.1), `
|
|
255
|
+
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.
|
|
256
256
|
|
|
257
257
|
If a script fails, check its changes before you retry.
|
|
258
258
|
|
|
259
|
-
## Snapshots and
|
|
259
|
+
## Snapshots and CLI runs
|
|
260
260
|
|
|
261
|
-
`argent
|
|
261
|
+
`argent e2e run <name> [--device <id>] [--platform ios|android|chromium|vega|ios-remote] [--update-baselines] [--output <dir>] [--json]` runs without an LLM and exits non-zero on failure.
|
|
262
262
|
|
|
263
263
|
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.
|
|
264
264
|
|
|
265
265
|
Do not use a snapshot as the only proof of navigation, persistence, data, accessibility state, logs, or network behavior. Avoid unstable timestamps, live data, ads, animation, and device drift. First establish deterministic state, identity, and readiness.
|
|
266
266
|
|
|
267
|
-
Baselines live under `.argent/
|
|
267
|
+
Baselines live beside the test, under `.argent/e2e/__baselines__/<name>/` and are keyed by platform and full-capture geometry; `cropOn` also contributes its selector. A run on a remote simulator uses `ios` in the key, so it uses the same baseline as a local iOS run with the same capture geometry. Seed from a known-good state with `--update-baselines`. A test that a `tool: e2e-execute` step runs keeps its own baselines, and `--update-baselines` updates them too unless the step sets `updateBaselines` itself. A run on a remote simulator with `--update-baselines` rewrites the same baseline file that a local run uses, and its step reason says that a remote simulator wrote it. Inspect every baseline and require user review. Do not commit it yourself. Baseline creation or update is not a test pass. Never update a baseline only to make a diff pass. The default `maxMismatch` is 0.5 percent.
|
|
268
268
|
|
|
269
|
-
Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed baseline, current, and diff images under `<dir>/<
|
|
269
|
+
Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed baseline, current, and diff images under `<dir>/<name>/` for CI artifact upload.
|
|
270
270
|
|
|
271
271
|
## YAML safety
|
|
272
272
|
|
|
273
|
-
Quote strings containing `#`, `:`, or quotes. Quote numbers and `true` or `false` in text slots. Use single quotes for regexes with backslashes. Parsing rejects invalid directives, selectors, regexes, `else`, unsupported options, and
|
|
273
|
+
Quote strings containing `#`, `:`, or quotes. Quote numbers and `true` or `false` in text slots. Use single quotes for regexes with backslashes. Parsing rejects invalid directives, selectors, regexes, `else`, unsupported options, and standalone tests that also declare `executionPrerequisite`.
|