@testsprite/testsprite-cli 0.16.0 → 0.18.0
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 +52 -147
- package/dist/commands/agent.d.ts +12 -4
- package/dist/commands/agent.js +48 -63
- package/dist/commands/auth.d.ts +6 -10
- package/dist/commands/auth.js +40 -56
- package/dist/commands/ci.d.ts +23 -100
- package/dist/commands/ci.js +293 -487
- package/dist/commands/conversation.d.ts +27 -0
- package/dist/commands/conversation.js +741 -0
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.js +129 -34
- package/dist/commands/init.d.ts +4 -45
- package/dist/commands/init.js +108 -66
- package/dist/commands/project-env.d.ts +62 -2
- package/dist/commands/project-env.js +434 -43
- package/dist/commands/project-sign-in.d.ts +0 -48
- package/dist/commands/project-sign-in.js +1 -229
- package/dist/commands/project.d.ts +19 -186
- package/dist/commands/project.js +108 -926
- package/dist/commands/result.d.ts +10 -0
- package/dist/commands/result.js +216 -0
- package/dist/commands/schedule.d.ts +0 -29
- package/dist/commands/schedule.js +28 -87
- package/dist/commands/test.d.ts +301 -1838
- package/dist/commands/test.js +1880 -13917
- package/dist/commands/testlist.d.ts +130 -5
- package/dist/commands/testlist.js +300 -342
- package/dist/commands/tunnel.d.ts +3 -3
- package/dist/commands/tunnel.js +23 -20
- package/dist/commands/usage.d.ts +12 -45
- package/dist/commands/usage.js +50 -131
- package/dist/index.js +191 -110
- package/dist/lib/agent-detect.js +9 -5
- package/dist/lib/agent-targets.d.ts +21 -2
- package/dist/lib/agent-targets.js +88 -11
- package/dist/lib/args.d.ts +13 -0
- package/dist/lib/args.js +49 -0
- package/dist/lib/basic-auth.d.ts +3 -0
- package/dist/lib/basic-auth.js +15 -0
- package/dist/lib/billing-refusal.js +4 -3
- package/dist/lib/ci-linkage.d.ts +4 -82
- package/dist/lib/ci-linkage.js +4 -157
- package/dist/lib/ci-run.js +1 -1
- package/dist/lib/client-factory.d.ts +12 -4
- package/dist/lib/client-factory.js +41 -30
- package/dist/lib/commit-signal.d.ts +65 -0
- package/dist/lib/commit-signal.js +305 -0
- package/dist/lib/concurrency-limiter.d.ts +6 -0
- package/dist/lib/concurrency-limiter.js +29 -0
- package/dist/lib/config.js +10 -5
- package/dist/lib/conflict-reason.d.ts +9 -3
- package/dist/lib/conflict-reason.js +6 -3
- package/dist/lib/conversation/answers.d.ts +9 -0
- package/dist/lib/conversation/answers.js +49 -0
- package/dist/lib/conversation/api.d.ts +75 -0
- package/dist/lib/conversation/api.js +151 -0
- package/dist/lib/conversation/change.d.ts +31 -0
- package/dist/lib/conversation/change.js +124 -0
- package/dist/lib/conversation/context.d.ts +29 -0
- package/dist/lib/conversation/context.js +82 -0
- package/dist/lib/conversation/environment.d.ts +16 -0
- package/dist/lib/conversation/environment.js +21 -0
- package/dist/lib/conversation/follow.d.ts +24 -0
- package/dist/lib/conversation/follow.js +42 -0
- package/dist/lib/conversation/render.d.ts +33 -0
- package/dist/lib/conversation/render.js +318 -0
- package/dist/lib/conversation/title.d.ts +2 -0
- package/dist/lib/conversation/title.js +18 -0
- package/dist/lib/conversation/types.d.ts +158 -0
- package/dist/lib/conversation/types.js +6 -0
- package/dist/lib/credentials.js +67 -11
- package/dist/lib/cron.d.ts +1 -1
- package/dist/lib/cron.js +2 -2
- package/dist/lib/dispatch-stop.d.ts +20 -0
- package/dist/lib/dispatch-stop.js +30 -0
- package/dist/lib/download.d.ts +100 -0
- package/dist/lib/download.js +408 -0
- package/dist/lib/dry-run/fetch.d.ts +10 -0
- package/dist/lib/dry-run/fetch.js +20 -0
- package/dist/lib/dry-run/samples.d.ts +6 -34
- package/dist/lib/dry-run/samples.js +375 -747
- package/dist/lib/environment-tunnel.d.ts +19 -30
- package/dist/lib/environment-tunnel.js +168 -202
- package/dist/lib/errors.d.ts +20 -4
- package/dist/lib/errors.js +36 -16
- package/dist/lib/facade.d.ts +7 -29
- package/dist/lib/facade.js +7 -36
- package/dist/lib/failing-fe-resolver.d.ts +13 -58
- package/dist/lib/failing-fe-resolver.js +47 -132
- package/dist/lib/first-suite-hint.d.ts +20 -30
- package/dist/lib/first-suite-hint.js +57 -72
- package/dist/lib/gh-output.d.ts +76 -21
- package/dist/lib/gh-output.js +171 -90
- package/dist/lib/git-utils.d.ts +56 -0
- package/dist/lib/git-utils.js +212 -0
- package/dist/lib/github-context.d.ts +2 -0
- package/dist/lib/github-context.js +40 -8
- package/dist/lib/history-retention.d.ts +6 -2
- package/dist/lib/history-retention.js +10 -7
- package/dist/lib/http.d.ts +58 -134
- package/dist/lib/http.js +354 -291
- package/dist/lib/interrupt.d.ts +14 -8
- package/dist/lib/interrupt.js +28 -10
- package/dist/lib/junit-report.d.ts +57 -4
- package/dist/lib/junit-report.js +202 -32
- package/dist/lib/local-target.d.ts +8 -7
- package/dist/lib/local-target.js +14 -13
- package/dist/lib/output.d.ts +2 -41
- package/dist/lib/output.js +13 -51
- package/dist/lib/pagination.d.ts +2 -5
- package/dist/lib/pagination.js +2 -5
- package/dist/lib/presigned-url.d.ts +22 -0
- package/dist/lib/presigned-url.js +90 -0
- package/dist/lib/prompt.js +36 -2
- package/dist/lib/proxy.js +2 -1
- package/dist/lib/redact.d.ts +2 -2
- package/dist/lib/redact.js +3 -4
- package/dist/lib/removed-commands.d.ts +18 -0
- package/dist/lib/removed-commands.js +170 -0
- package/dist/lib/render-error.d.ts +31 -6
- package/dist/lib/render-error.js +88 -25
- package/dist/lib/response-schemas.d.ts +38 -30
- package/dist/lib/response-schemas.js +207 -207
- package/dist/lib/result/api.d.ts +24 -0
- package/dist/lib/result/api.js +28 -0
- package/dist/lib/result/evidence.d.ts +73 -0
- package/dist/lib/result/evidence.js +422 -0
- package/dist/lib/result/render.d.ts +20 -0
- package/dist/lib/result/render.js +194 -0
- package/dist/lib/result/types.d.ts +122 -0
- package/dist/lib/result/types.js +19 -0
- package/dist/lib/run-output.d.ts +275 -0
- package/dist/lib/run-output.js +227 -0
- package/dist/lib/run-render.d.ts +101 -0
- package/dist/lib/run-render.js +183 -0
- package/dist/lib/run-wait.d.ts +192 -0
- package/dist/lib/run-wait.js +452 -0
- package/dist/lib/runs.types.d.ts +118 -367
- package/dist/lib/runs.types.js +0 -14
- package/dist/lib/secret-file.d.ts +1 -1
- package/dist/lib/secret-file.js +11 -2
- package/dist/lib/skill-nudge.d.ts +7 -27
- package/dist/lib/skill-nudge.js +9 -37
- package/dist/lib/target-path.d.ts +15 -0
- package/dist/lib/target-path.js +35 -0
- package/dist/lib/target-url-advisory.d.ts +19 -0
- package/dist/lib/target-url-advisory.js +31 -0
- package/dist/lib/target-url-preflight.d.ts +9 -0
- package/dist/lib/target-url-preflight.js +214 -106
- package/dist/lib/target-url.d.ts +8 -8
- package/dist/lib/target-url.js +14 -24
- package/dist/lib/telemetry.d.ts +35 -15
- package/dist/lib/telemetry.js +38 -9
- package/dist/lib/terminal-text.d.ts +41 -0
- package/dist/lib/terminal-text.js +127 -0
- package/dist/lib/testlist.types.d.ts +16 -8
- package/dist/lib/testlist.types.js +1 -1
- package/dist/lib/text-equality.d.ts +2 -0
- package/dist/lib/text-equality.js +5 -0
- package/dist/lib/text-file.d.ts +16 -0
- package/dist/lib/text-file.js +41 -0
- package/dist/lib/text-table.d.ts +46 -0
- package/dist/lib/text-table.js +72 -4
- package/dist/lib/ticker.d.ts +9 -2
- package/dist/lib/ticker.js +16 -3
- package/dist/lib/transport-failure.d.ts +22 -0
- package/dist/lib/transport-failure.js +126 -0
- package/dist/lib/tunnel-session.d.ts +8 -2
- package/dist/lib/tunnel-session.js +24 -11
- package/dist/lib/update-check.js +3 -2
- package/dist/lib/url-template.d.ts +43 -0
- package/dist/lib/url-template.js +151 -0
- package/dist/lib/validate.d.ts +0 -64
- package/dist/lib/validate.js +2 -131
- package/dist/lib/version-notice.js +4 -3
- package/dist/lib/wait-exit.d.ts +37 -2
- package/dist/lib/wait-exit.js +88 -30
- package/dist/lib/workspace-status.js +10 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -3
- package/skills/testsprite-ci.skill.md +52 -23
- package/skills/testsprite-onboard.skill.md +70 -153
- package/skills/testsprite-verify.codex.md +54 -58
- package/skills/testsprite-verify.skill.md +189 -358
- package/dist/lib/browser.d.ts +0 -6
- package/dist/lib/browser.js +0 -54
- package/dist/lib/bundle.d.ts +0 -234
- package/dist/lib/bundle.js +0 -781
- package/dist/lib/deprecate.d.ts +0 -32
- package/dist/lib/deprecate.js +0 -39
- package/dist/lib/flaky.d.ts +0 -91
- package/dist/lib/flaky.js +0 -71
- package/dist/lib/plan-poll.d.ts +0 -171
- package/dist/lib/plan-poll.js +0 -441
- package/dist/lib/plans.types.d.ts +0 -130
- package/dist/lib/plans.types.js +0 -31
- package/dist/lib/poll.d.ts +0 -100
- package/dist/lib/poll.js +0 -290
- package/dist/lib/rate-throttle.d.ts +0 -49
- package/dist/lib/rate-throttle.js +0 -75
- package/dist/lib/run-progress.d.ts +0 -41
- package/dist/lib/run-progress.js +0 -56
- package/dist/lib/v3-advisory.d.ts +0 -55
- package/dist/lib/v3-advisory.js +0 -74
- package/schemas/plan.schema.json +0 -61
|
@@ -11,8 +11,8 @@ Seed a repo with no tests into a coherent suite and 2–3 passing smoke tests.
|
|
|
11
11
|
|
|
12
12
|
This skill only uses shipped CLI commands. Do **not** call backend APIs directly.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
The tests are written by the project's agent (`testsprite plan` → `testsprite apply`);
|
|
15
|
+
you give it what it needs, review what it proposes, and smoke-run the result.
|
|
16
16
|
|
|
17
17
|
## When to use
|
|
18
18
|
|
|
@@ -45,41 +45,42 @@ Read the source to identify:
|
|
|
45
45
|
|
|
46
46
|
Use code-derived routes/handlers; do not guess.
|
|
47
47
|
|
|
48
|
-
### 2. Create the project
|
|
49
|
-
|
|
50
|
-
Deployed frontend:
|
|
48
|
+
### 2. Create the project and its environment
|
|
51
49
|
|
|
52
50
|
```bash
|
|
53
|
-
testsprite project create --type frontend --name "<repo name>" --
|
|
54
|
-
[--username <user> --password-file <path-to-secret>]
|
|
51
|
+
testsprite project create --type frontend --name "<repo name>" # or --type backend
|
|
55
52
|
```
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
Capture the returned `projectId`, then say where the app runs.
|
|
55
|
+
|
|
56
|
+
Deployed:
|
|
58
57
|
|
|
59
58
|
```bash
|
|
60
|
-
testsprite project create
|
|
59
|
+
testsprite project env create <projectId> --name default --url <app-url> \
|
|
60
|
+
[--username <user> --password-file <path-to-secret>]
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
`localhost`, `127.0.0.1` (default), or `::1` (`http://[::1]:<port>`).
|
|
65
|
-
Reuse the host on runs; omit for default IPv4.
|
|
66
|
-
`project get/list`: JSON `originMode: 'local'`, text `(Local)`.
|
|
67
|
-
No `--url`. Dead port: exit 5 (`--skip-preflight` bypasses).
|
|
68
|
-
V2-only: exit 7 (`local-origin-requires-v3`). Local runs work on Free and need
|
|
69
|
-
`run:tunnel` (mint a new key if missing).
|
|
70
|
-
|
|
71
|
-
Backend:
|
|
63
|
+
Local frontend (start the app first):
|
|
72
64
|
|
|
73
65
|
```bash
|
|
74
|
-
testsprite project create --
|
|
66
|
+
testsprite project env create <projectId> --name local --url http://localhost:<port>
|
|
75
67
|
```
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
`--url` also takes `http://127.0.0.1:<port>` or `http://[::1]:<port>`, and the app's
|
|
70
|
+
entry path may follow (`--url http://localhost:<port>/app`); `--local <port>` is shorthand
|
|
71
|
+
for `--url http://localhost:<port>`. Dead port: exit 5 (`--skip-preflight` bypasses).
|
|
72
|
+
A backend project can't be local: its environment must point at a publicly deployed API.
|
|
73
|
+
Local runs work on Free and need `run:tunnel` (mint a new key if missing).
|
|
78
74
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
With a frontend test account, the cloud agent logs in through the tunnel using the
|
|
76
|
+
environment's username/password. OTP environments are refused before charge (exit 6).
|
|
77
|
+
|
|
78
|
+
Backend: configure the API credential once on its environment (ask the user for the value —
|
|
79
|
+
never invent it or reuse a key you happened to see). The agent's tests read it from the
|
|
80
|
+
injected `__AUTH_HEADERS__`; they never hardcode it. A static credential:
|
|
81
|
+
`testsprite project env update <projectId> <env> --auth bearer|basic|apikey --credential-file <f>`
|
|
82
|
+
(extra headers: `--header "Name: value"`, secret ones in `--header-file <f>`); a sign-in that
|
|
83
|
+
refreshes the credential: `--auto-auth-file <f>`.
|
|
83
84
|
|
|
84
85
|
#### 2b. FE: register the app's test-hook attribute
|
|
85
86
|
|
|
@@ -87,157 +88,76 @@ If the source tags elements with something other than `data-testid` (e.g. `data-
|
|
|
87
88
|
run `testsprite project update <projectId> --test-id-attributes data-element,data-testid`
|
|
88
89
|
once; exported locators then use the tag (check: `project get` → `testIdAttrs:`).
|
|
89
90
|
|
|
90
|
-
### 3.
|
|
91
|
+
### 3. Ask the project's agent for the tests
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
Name the flows from step 1 in the request, so the suite covers them rather than one page.
|
|
94
|
+
Attach what the agent can't see: an API spec (backend projects need one), a PRD, your
|
|
95
|
+
change.
|
|
94
96
|
|
|
95
97
|
```bash
|
|
96
|
-
testsprite
|
|
97
|
-
|
|
98
|
+
testsprite plan "Seed a first suite: <the 4–8 flows from step 1>" --project <projectId> \
|
|
99
|
+
[--file ./openapi.yaml] [--file ./prd.md] [--diff] --output json
|
|
98
100
|
```
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
a
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
PRD supplements it (`--role prd`, 0.5 credits); a PRD alone can charge strategy and
|
|
109
|
-
then fail for missing endpoints. Deployed frontend exploration supplies its inputs.
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
testsprite project docs upload ./openapi.yaml --project <projectId> --role api-doc
|
|
113
|
-
testsprite project docs upload ./prd.md --project <projectId> --role prd # optional, with the spec
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
testsprite test plan generate --project <projectId>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
Only missing stages run. Frontend exploration can take minutes. If cut off, the
|
|
121
|
-
running stage finishes; re-run to continue. If inputs are processing, wait and re-run.
|
|
122
|
-
|
|
123
|
-
Review titles and steps against the source. Drop nonexistent flows, duplicates,
|
|
124
|
-
and vague assertions before accepting.
|
|
102
|
+
- Frontend: the agent explores the app in a real browser. An app on this machine is reached
|
|
103
|
+
through a tunnel: when the agent asks for one, run `testsprite tunnel start` in another
|
|
104
|
+
terminal and `testsprite reply "The tunnel is running."`.
|
|
105
|
+
- `"state": "replied"` → read `reply`; answer from the code what you can with
|
|
106
|
+
`testsprite reply "..."`, ask the user only what only they know.
|
|
107
|
+
- Exit 7: still working; `testsprite status --wait` follows it.
|
|
108
|
+
- Exit 13: the agent isn't enabled for this account. Tell the user and stop — the CLI
|
|
109
|
+
has no other way to write tests.
|
|
125
110
|
|
|
126
|
-
|
|
127
|
-
testsprite test plan accept --project <projectId> # all of them
|
|
128
|
-
testsprite test plan accept --project <projectId> --only prop_2 prop_5 # or a subset
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
A subset accept **discards the rest**, so name every proposal you want in that one call.
|
|
132
|
-
Then `testsprite test list --project <projectId>` for the ids, and go to step 5
|
|
133
|
-
(**skip step 4** — that's the hand-authoring path).
|
|
134
|
-
|
|
135
|
-
If generation is unavailable (older CLI, non-V3 account/exit 6, or missing inputs),
|
|
136
|
-
report the reason and author tests using 3b. Local-project creation itself still
|
|
137
|
-
requires V3.
|
|
138
|
-
|
|
139
|
-
#### 3b. Author the tests by hand
|
|
140
|
-
|
|
141
|
-
**Frontend** — one JSON plan file per flow, in a directory (e.g. `./testsprite-plans/`).
|
|
142
|
-
Each file is a COMPLETE plan and must include `projectId` (from step 2), `type: "frontend"`,
|
|
143
|
-
`name`, and `planSteps` — `create-batch` reads the project from each file, not from a flag:
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"projectId": "<projectId from step 2>",
|
|
148
|
-
"type": "frontend",
|
|
149
|
-
"name": "Checkout — guest can complete a purchase",
|
|
150
|
-
"planSteps": [
|
|
151
|
-
{ "type": "action", "description": "Navigate to /products and open the first product" },
|
|
152
|
-
{ "type": "action", "description": "Click 'Add to cart', then go to /cart" },
|
|
153
|
-
{
|
|
154
|
-
"type": "assertion",
|
|
155
|
-
"description": "The cart shows exactly 1 line item with the product's name and price"
|
|
156
|
-
},
|
|
157
|
-
{ "type": "action", "description": "Proceed to checkout as guest and submit the test payment" },
|
|
158
|
-
{ "type": "assertion", "description": "A confirmation page appears showing an order number" }
|
|
159
|
-
]
|
|
160
|
-
}
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
**Backend** — one `.py` file per endpoint, using `requests` with concrete assertions on
|
|
164
|
-
status code and response body.
|
|
165
|
-
|
|
166
|
-
**Backend auth:** read injected `__AUTH_HEADERS__`; never hardcode Bearer/JWT tokens,
|
|
167
|
-
API keys, basic-auth blobs, or cookies. TestSprite injects `__AUTH_CREDENTIAL__`,
|
|
168
|
-
`__AUTH_TYPE__`, and `__AUTH_HEADERS__` from project Authentication settings.
|
|
169
|
-
The headers already match the configured type (Authorization for Bearer/basic,
|
|
170
|
-
X-API-Key for API keys). Spread them into each request:
|
|
171
|
-
|
|
172
|
-
```python
|
|
173
|
-
r = requests.get(f"{TARGET_URL}/orders", headers={**__AUTH_HEADERS__})
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Configure the credential once on the project (ask the user for the value — never invent it or
|
|
177
|
-
reuse a key you happened to see): a static credential with
|
|
178
|
-
`testsprite project credential <projectId> --type "Bearer token"|"API key"|"basic token" --credential <value>`,
|
|
179
|
-
or an auto-refreshing login with `testsprite project auto-auth <projectId> …` so scheduled/repeat
|
|
180
|
-
runs keep working after the token expires. A hardcoded token expires within hours and a hardcoded
|
|
181
|
-
key can't be rotated centrally — `test create` emits a `[warn]` on an inlined credential; treat it
|
|
182
|
-
as a must-fix.
|
|
183
|
-
|
|
184
|
-
Each assertion must name an observable element, text, URL, count, or status;
|
|
185
|
-
vague ones like "verify it works" create false passes.
|
|
186
|
-
|
|
187
|
-
Aim for ~8–15 tests covering the core flows. Don't pad.
|
|
188
|
-
|
|
189
|
-
### 4. Batch-create (hand-authored path only — skip if you accepted generated proposals)
|
|
190
|
-
|
|
191
|
-
Frontend (one call, up to 50 plans from the directory — `create-batch` is FE-only and has
|
|
192
|
-
**no `--project` flag**; the project comes from each plan file's `projectId`):
|
|
193
|
-
|
|
194
|
-
```bash
|
|
195
|
-
testsprite test create-batch --plan-from-dir ./testsprite-plans
|
|
196
|
-
```
|
|
111
|
+
`"state": "proposed"` → review the plan against the source before applying it:
|
|
197
112
|
|
|
198
|
-
|
|
113
|
+
- Drop flows that don't exist and duplicates.
|
|
114
|
+
- Every assertion names an observable element, text, URL, count, or status; vague
|
|
115
|
+
ones like "verify it works" create false passes.
|
|
116
|
+
- Aim for ~8–15 tests covering the core flows. Don't pad.
|
|
199
117
|
|
|
200
118
|
```bash
|
|
201
|
-
testsprite
|
|
202
|
-
|
|
119
|
+
testsprite apply # all of it
|
|
120
|
+
testsprite apply --exclude <ref>,<ref> # without some tests
|
|
121
|
+
testsprite apply --answer 1=b --answer 2=a,c # a card that asks questions: answer by letter
|
|
122
|
+
testsprite reject "<what to change>" # the agent revises and proposes again
|
|
203
123
|
```
|
|
204
124
|
|
|
205
|
-
|
|
125
|
+
`apply` prints the saved test ids (`applied.tests` in JSON).
|
|
206
126
|
|
|
207
|
-
###
|
|
127
|
+
### 4. Smoke-run a few — NOT all (protect credits)
|
|
208
128
|
|
|
209
129
|
Pick the **2–3 highest-value happy-path** tests (prefer ones you're most confident are green)
|
|
210
130
|
and run only those:
|
|
211
131
|
|
|
212
132
|
```bash
|
|
213
|
-
testsprite
|
|
214
|
-
testsprite
|
|
133
|
+
testsprite run <test-id> --wait # deployed target
|
|
134
|
+
testsprite run <test-id> --env local # local frontend
|
|
215
135
|
```
|
|
216
136
|
|
|
217
|
-
Do **not** run the whole suite automatically.
|
|
137
|
+
Do **not** run the whole suite automatically. Frontend runs, including local runs,
|
|
218
138
|
cost 0.5 credit each; check `testsprite usage` before sizing the suite.
|
|
219
|
-
Local runs wait (1200 s
|
|
220
|
-
(one tunnel, 5 at a time
|
|
221
|
-
`Run <
|
|
222
|
-
`--
|
|
139
|
+
Local runs wait (1200 s each). Put several in ONE `run <id> <id> --env local`
|
|
140
|
+
(one tunnel, 5 at a time; each process holds 1 of 5 tunnel slots). Keep the stderr
|
|
141
|
+
`Run <run-id>` receipt. An owned local timeout cancels by default: start a new run with
|
|
142
|
+
`--env local --timeout 1800`, not `run wait`. For a frontend test cancelled before a terminal verdict the server attempts a refund; read the reported `refund`.
|
|
223
143
|
|
|
224
|
-
###
|
|
144
|
+
### 5. Report
|
|
225
145
|
|
|
226
146
|
Tell the user, plainly:
|
|
227
147
|
|
|
228
148
|
- "Your project now has **N** tests covering: <list the flows>."
|
|
229
149
|
- "I smoke-ran **M** — here's the result: <pass/fail + the dashboard link from the run output>."
|
|
230
|
-
- "To run the rest (≈X credits
|
|
231
|
-
- frontend — use `
|
|
232
|
-
`
|
|
233
|
-
- backend — `testsprite
|
|
150
|
+
- "To run the rest (≈X credits, so they choose knowingly):
|
|
151
|
+
- frontend — use `run <test-id> --wait` for deployed targets or
|
|
152
|
+
`run --project <id> --env local` for local targets;
|
|
153
|
+
- backend — `testsprite run --project <id>` (wave-ordered, runs every BE test)."
|
|
234
154
|
|
|
235
155
|
## Quality checklist (self-check before reporting done)
|
|
236
156
|
|
|
237
|
-
- [ ] FE project has a public
|
|
238
|
-
- [ ] API project:
|
|
239
|
-
- [ ]
|
|
240
|
-
rather than
|
|
157
|
+
- [ ] FE project has a public or local (`http://localhost:<port>`) `--url`; login configured if needed.
|
|
158
|
+
- [ ] API project: the API spec attached to the request (a PRD is optional, alongside it).
|
|
159
|
+
- [ ] You **read the plan** and rejected or excluded the tests that don't fit,
|
|
160
|
+
rather than applying it unseen.
|
|
241
161
|
- [ ] Every FE assertion names a concrete, observable outcome (no "verify it works").
|
|
242
162
|
- [ ] Tests cover the core flows you found in the code, not just one page.
|
|
243
163
|
- [ ] Smoke-ran 2–3 happy-path tests, not the whole suite.
|
|
@@ -246,14 +166,11 @@ Tell the user, plainly:
|
|
|
246
166
|
## Don'ts
|
|
247
167
|
|
|
248
168
|
- Don't auto-run the full suite (credit wall / surprise 402).
|
|
249
|
-
- Don't
|
|
169
|
+
- Don't apply narrative assertions an AI judge can't fail.
|
|
250
170
|
- Don't call backend endpoints directly — only the `testsprite` CLI.
|
|
251
|
-
- Don't create a FE project without public
|
|
252
|
-
- Don't
|
|
253
|
-
- Don't
|
|
254
|
-
- Don't stall when generation isn't available — say so and hand-author instead.
|
|
255
|
-
- Don't re-run `test plan generate` hoping for a different batch: with proposals already
|
|
256
|
-
staged it starts nothing, and regenerating is a Portal action today.
|
|
171
|
+
- Don't create a FE project without a public or local (`http://localhost:<port>`) `--url`.
|
|
172
|
+
- Don't apply a plan unread — reviewing it is the point of the proposal.
|
|
173
|
+
- Don't write or edit tests yourself — ask the agent (`reply`, `reject`, or a new `plan`).
|
|
257
174
|
|
|
258
175
|
## Hand off to verify
|
|
259
176
|
|
|
@@ -17,78 +17,74 @@ If missing, advise CLI install or `testsprite setup`. Find the project via
|
|
|
17
17
|
For a local app without a project:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
testsprite project create --type frontend --name "<repo name>"
|
|
21
|
-
testsprite
|
|
22
|
-
testsprite
|
|
20
|
+
testsprite project create --type frontend --name "<repo name>"
|
|
21
|
+
testsprite project env create <projectId> --name local --url http://localhost:<port>
|
|
22
|
+
testsprite plan "<what you built>" --diff --project <projectId>
|
|
23
|
+
testsprite apply
|
|
24
|
+
testsprite run --project <projectId> --env local --output json
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
are blocked free until `project update <id> --url https://…` sets a public URL.
|
|
29
|
-
For deployed projects use `project create --url`; empty suites can use `test plan
|
|
30
|
-
generate --project <id>` then `test plan accept`.
|
|
27
|
+
Portal runs of a local environment are blocked free until a public environment is
|
|
28
|
+
the default: `project env create <id> --name staging --url https://… --set-default`.
|
|
29
|
+
For a deployed app, `project env create … --url` is the only environment needed.
|
|
31
30
|
|
|
32
31
|
## 2. Run against the change
|
|
33
32
|
|
|
34
33
|
The CLI does not host apps. Create a deployed environment once; select it with
|
|
35
|
-
`--env <name>` or omit for Default. Unknown names list valid names.
|
|
36
|
-
|
|
34
|
+
`--env <name>` or omit for Default. Unknown names list valid names. A local
|
|
35
|
+
environment opens a tunnel from this machine (FE only).
|
|
36
|
+
|
|
37
|
+
You don't write or edit tests. New tests (frontend or backend): ask the
|
|
38
|
+
project's agent, show the user its plan, apply it, run the saved ids. A test
|
|
39
|
+
that is itself wrong: `testsprite plan "the <name> test should …"`, then apply.
|
|
40
|
+
Exit 13: the agent isn't enabled; say so and stop.
|
|
37
41
|
|
|
38
42
|
```bash
|
|
39
|
-
|
|
43
|
+
testsprite plan "<what you built + the user's rules>" --diff --project <id>
|
|
44
|
+
testsprite apply # or --exclude <ref>; or reject "<what to change>"
|
|
40
45
|
testsprite project env create <id> --name staging --url https://staging.example.com
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
#
|
|
46
|
-
testsprite test
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
testsprite
|
|
50
|
-
# Dependency batch; --filter <substr>, --status failed,blocked
|
|
51
|
-
testsprite test run --all --project <id> --env staging --wait --output json
|
|
46
|
+
# Project suite
|
|
47
|
+
testsprite run --project <id> --env staging --wait --output json
|
|
48
|
+
# One test
|
|
49
|
+
testsprite run <test-id> --env staging --wait --timeout 600 --output json
|
|
50
|
+
# Several tests, one batch (FE: 0.5 credit each)
|
|
51
|
+
testsprite run <test-id> <test-id> --env staging --wait --output json
|
|
52
|
+
# Saved list or positional subset
|
|
53
|
+
testsprite run --testlist <listId> --wait
|
|
54
|
+
testsprite run <test-id> --testlist <listId> --wait
|
|
52
55
|
```
|
|
53
56
|
|
|
54
57
|
- Supported backends grant existing keys `run:tunnel`; a narrowed key without it
|
|
55
|
-
exits 3. Free-plan local runs work. BE cannot
|
|
56
|
-
-
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`--
|
|
61
|
-
- Run local ids together (`test run <id> <id> … --local <port>`); `--all --project
|
|
62
|
-
<id> --local <port>` skips BE tests. One tunnel, 5 concurrent runs by default
|
|
63
|
-
(`--max-concurrency` 1–10). Five live bindings per user; `tunnel_binding_limit`
|
|
58
|
+
exits 3. Free-plan local runs work. BE cannot run through a tunnel.
|
|
59
|
+
- A tunnel run implies `--wait` (shared 1200 s deadline; public: 600). A dead port exits 5 before charge;
|
|
60
|
+
`--skip-preflight` skips the probe. Environment `--url` rejects private (non-loopback) hosts;
|
|
61
|
+
the app's entry path may follow the port. `--env` keeps its sign-in settings.
|
|
62
|
+
- Run local ids together in one `run`; `run --project <id> --env local` skips BE tests. One run per project, one tunnel, 5 tests at once per execution by default
|
|
63
|
+
(`--max-concurrency` 1–15, a server dispatch cap only). Each distinct run is waited on independently. Five live bindings per user; `tunnel_binding_limit`
|
|
64
64
|
exits 11 without retry. Use `tunnel list` then `tunnel stop <id>` or `--all --confirm`.
|
|
65
|
-
- Keep
|
|
66
|
-
|
|
65
|
+
- Keep each run's `Run <id>` line and its stdout `Dashboard:` link (a no-wait `--testlist` launch has none until `run wait`). All waits return `runs[].runId`,
|
|
66
|
+
`results[].resultId` and counts in `summary`. Only an incomplete timeout or
|
|
67
|
+
interruption adds `partial: true`.
|
|
67
68
|
- An **owned** local timeout, Ctrl-C, or poll failure requests cancellation and
|
|
68
|
-
closes the tunnel. Before a terminal
|
|
69
|
+
closes the tunnel. Before a terminal FE verdict, the backend attempts a refund;
|
|
69
70
|
check `refund.status`: cancellation does not guarantee a refund.
|
|
70
71
|
`--no-cancel-on-interrupt` detaches, but the owned tunnel still closes.
|
|
71
|
-
- After an owned timeout, start a **new** `
|
|
72
|
-
--timeout 1800
|
|
73
|
-
ordinary/adopted waits can resume with `
|
|
74
|
-
- Keep `tunnel start` alive; borrow with `--
|
|
72
|
+
- After an owned timeout, start a **new** `run <test-id> --env <name>
|
|
73
|
+
--timeout 1800`. `run wait` cannot reopen the tunnel;
|
|
74
|
+
ordinary/adopted waits can resume with `run wait <run-id>` if reachable.
|
|
75
|
+
- Keep `tunnel start` alive; borrow with `--env <name> --tunnel-client <uuid>`.
|
|
75
76
|
Adopted runs normally detach without cancellation or closing the owner's tunnel.
|
|
76
77
|
If the owner has disappeared during a run, cancellation is requested by default;
|
|
77
78
|
`--no-cancel-on-interrupt` skips it. A second connection with the same credential
|
|
78
79
|
takes over; the first exits **10**.
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
- Saved loopback frontend environments open a tunnel automatically, including
|
|
81
|
+
list mappings. Lists use pinned environments; no target/env overrides.
|
|
82
|
+
- Choose project, named IDs, or list; never combine project with IDs/list.
|
|
83
|
+
No IDs/list: project flag then `TESTSPRITE_PROJECT_ID`. Named/list ignore it.
|
|
84
|
+
`--filter` narrows project selection. Resume with `run wait <run-id...>
|
|
85
|
+
--timeout 600`; cancel with `run cancel <run-id...>`. Child flags follow the child.
|
|
85
86
|
- `--wait` handles polling/backoff; don't wrap it in a retry loop.
|
|
86
|
-
-
|
|
87
|
-
The sandbox has stdlib, `requests`, `pytest`, `numpy`, `scipy`; use HTTP,
|
|
88
|
-
not project imports or uninstalled packages.
|
|
89
|
-
- Backend `--produces`/`--needs` are repeatable; `--category teardown` marks cleanup.
|
|
90
|
-
Set dependencies with `test create` or edit with `test update`; do not delete
|
|
91
|
-
and recreate. Use `test run --all` for producer → consumer → teardown ordering
|
|
87
|
+
- Use `run --project <project-id>` for backend producer → consumer → teardown ordering
|
|
92
88
|
and variable passing. A BE run includes that closure and its side effects;
|
|
93
89
|
`--skip-dependencies` selects only the named test. Triage failed producers before
|
|
94
90
|
blaming consumers starved of their token/fixture.
|
|
@@ -96,13 +92,14 @@ testsprite test run --all --project <id> --env staging --wait --output json
|
|
|
96
92
|
## 3. Inspect and report
|
|
97
93
|
|
|
98
94
|
```bash
|
|
99
|
-
testsprite
|
|
100
|
-
testsprite
|
|
95
|
+
testsprite result list --run <run-id> --status failed,blocked # what did not pass
|
|
96
|
+
testsprite result get <result-id> --output json # error, cause, fix, every step; BE: trace, apiOutput
|
|
97
|
+
testsprite result get <result-id> --out .testsprite/results/<result-id> # evidence
|
|
101
98
|
```
|
|
102
99
|
|
|
103
|
-
Read
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
Read the result of the run you verify, not an older one (`result list --test
|
|
101
|
+
<test-id>` lists them). `--out` writes `result.json`, the video and `steps/`, and
|
|
102
|
+
replaces those in an existing dir: one dir per result. Report verdict and links.
|
|
106
103
|
|
|
107
104
|
Exits: 0 passed; 1 failed/blocked/cancelled; 3 auth/scope; 4 not found;
|
|
108
105
|
5 validation; 6 conflict/precondition; 7 timeout/unsupported; 10 unavailable;
|
|
@@ -113,8 +110,7 @@ Exits: 0 passed; 1 failed/blocked/cancelled; 3 auth/scope; 4 not found;
|
|
|
113
110
|
`--dry-run` works without credentials:
|
|
114
111
|
|
|
115
112
|
```bash
|
|
116
|
-
testsprite
|
|
117
|
-
testsprite test create --plan-from plan.json --dry-run --output json
|
|
113
|
+
testsprite run <test-id> --dry-run --output json
|
|
118
114
|
```
|
|
119
115
|
|
|
120
116
|
Setup: `npm install -g @testsprite/testsprite-cli`; `testsprite setup`.
|