@testsprite/testsprite-cli 0.16.0 → 0.17.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 +51 -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 +38 -54
- 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 +702 -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 +388 -37
- 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 +15 -186
- package/dist/commands/project.js +89 -924
- package/dist/commands/result.d.ts +10 -0
- package/dist/commands/result.js +215 -0
- package/dist/commands/schedule.d.ts +0 -29
- package/dist/commands/schedule.js +28 -87
- package/dist/commands/test.d.ts +301 -1816
- package/dist/commands/test.js +1951 -13902
- package/dist/commands/testlist.d.ts +128 -5
- package/dist/commands/testlist.js +269 -339
- package/dist/commands/tunnel.d.ts +2 -2
- package/dist/commands/tunnel.js +23 -19
- package/dist/commands/usage.d.ts +12 -45
- package/dist/commands/usage.js +50 -131
- package/dist/index.js +182 -104
- 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 +10 -2
- package/dist/lib/client-factory.js +38 -26
- 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 +71 -0
- package/dist/lib/conversation/api.js +150 -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 +19 -0
- package/dist/lib/conversation/context.js +70 -0
- package/dist/lib/conversation/environment.d.ts +15 -0
- package/dist/lib/conversation/environment.js +33 -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 +315 -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 +156 -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 +71 -0
- package/dist/lib/download.js +274 -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 +16 -27
- package/dist/lib/environment-tunnel.js +161 -154
- 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 +16 -22
- package/dist/lib/first-suite-hint.js +38 -47
- 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 +352 -289
- 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 +3 -3
- package/dist/lib/local-target.js +3 -3
- package/dist/lib/output.d.ts +1 -40
- package/dist/lib/output.js +11 -49
- 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 +154 -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 +71 -0
- package/dist/lib/result/evidence.js +420 -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 +1 -1
- package/dist/lib/target-url.js +6 -16
- package/dist/lib/telemetry.d.ts +31 -11
- package/dist/lib/telemetry.js +37 -8
- 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 +7 -1
- package/dist/lib/tunnel-session.js +22 -9
- 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 +48 -18
- package/skills/testsprite-onboard.skill.md +66 -151
- package/skills/testsprite-verify.codex.md +50 -52
- package/skills/testsprite-verify.skill.md +184 -351
- 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,41 @@ 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 --local <port>
|
|
75
67
|
```
|
|
76
68
|
|
|
77
|
-
|
|
69
|
+
`--local` stores `http://localhost:<port>`; `--url http://127.0.0.1:<port>` or
|
|
70
|
+
`http://[::1]:<port>` keeps another loopback host. Reuse that host on runs with
|
|
71
|
+
`--local-host`; omit it for `localhost`. Dead port: exit 5 (`--skip-preflight` bypasses).
|
|
72
|
+
Local runs work on Free and need `run:tunnel` (mint a new key if missing).
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
With a frontend test account, the cloud agent logs in through the tunnel using the
|
|
75
|
+
environment's username/password. OTP environments are refused before charge (exit 6).
|
|
76
|
+
|
|
77
|
+
Backend: configure the API credential once on its environment (ask the user for the value —
|
|
78
|
+
never invent it or reuse a key you happened to see). The agent's tests read it from the
|
|
79
|
+
injected `__AUTH_HEADERS__`; they never hardcode it. A static credential:
|
|
80
|
+
`testsprite project env update <projectId> <env> --auth bearer|basic|apikey --credential-file <f>`
|
|
81
|
+
(extra headers: `--header "Name: value"`, secret ones in `--header-file <f>`); a sign-in that
|
|
82
|
+
refreshes the credential: `--auto-auth-file <f>`.
|
|
83
83
|
|
|
84
84
|
#### 2b. FE: register the app's test-hook attribute
|
|
85
85
|
|
|
@@ -87,157 +87,75 @@ If the source tags elements with something other than `data-testid` (e.g. `data-
|
|
|
87
87
|
run `testsprite project update <projectId> --test-id-attributes data-element,data-testid`
|
|
88
88
|
once; exported locators then use the tag (check: `project get` → `testIdAttrs:`).
|
|
89
89
|
|
|
90
|
-
### 3.
|
|
90
|
+
### 3. Ask the project's agent for the tests
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
Name the flows from step 1 in the request, so the suite covers them rather than one page.
|
|
93
|
+
Attach what the agent can't see: an API spec (backend projects need one), a PRD, your
|
|
94
|
+
change.
|
|
94
95
|
|
|
95
96
|
```bash
|
|
96
|
-
testsprite
|
|
97
|
-
|
|
97
|
+
testsprite plan "Seed a first suite: <the 4–8 flows from step 1>" --project <projectId> \
|
|
98
|
+
[--file ./openapi.yaml] [--file ./prd.md] [--diff] --output json
|
|
98
99
|
```
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
API projects require an API spec (`no_processed_inputs` without one). An optional
|
|
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.
|
|
101
|
+
- Frontend: the agent explores the deployed app in a real browser. A local project's app
|
|
102
|
+
can't be opened from the cloud: attach your change (`--diff`) and the agent works from it.
|
|
103
|
+
- `"state": "replied"` → read `reply`; answer from the code what you can with
|
|
104
|
+
`testsprite reply "..."`, ask the user only what only they know.
|
|
105
|
+
- Exit 7: still working; `testsprite status --wait` follows it.
|
|
106
|
+
- Exit 13: the agent isn't enabled for this account. Tell the user and stop — the CLI
|
|
107
|
+
has no other way to write tests.
|
|
125
108
|
|
|
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
|
-
```
|
|
109
|
+
`"state": "proposed"` → review the plan against the source before applying it:
|
|
197
110
|
|
|
198
|
-
|
|
111
|
+
- Drop flows that don't exist and duplicates.
|
|
112
|
+
- Every assertion names an observable element, text, URL, count, or status; vague
|
|
113
|
+
ones like "verify it works" create false passes.
|
|
114
|
+
- Aim for ~8–15 tests covering the core flows. Don't pad.
|
|
199
115
|
|
|
200
116
|
```bash
|
|
201
|
-
testsprite
|
|
202
|
-
|
|
117
|
+
testsprite apply # all of it
|
|
118
|
+
testsprite apply --exclude <ref>,<ref> # without some tests
|
|
119
|
+
testsprite apply --answer 1=b --answer 2=a,c # a card that asks questions: answer by letter
|
|
120
|
+
testsprite reject "<what to change>" # the agent revises and proposes again
|
|
203
121
|
```
|
|
204
122
|
|
|
205
|
-
|
|
123
|
+
`apply` prints the saved test ids (`applied.tests` in JSON).
|
|
206
124
|
|
|
207
|
-
###
|
|
125
|
+
### 4. Smoke-run a few — NOT all (protect credits)
|
|
208
126
|
|
|
209
127
|
Pick the **2–3 highest-value happy-path** tests (prefer ones you're most confident are green)
|
|
210
128
|
and run only those:
|
|
211
129
|
|
|
212
130
|
```bash
|
|
213
|
-
testsprite
|
|
214
|
-
testsprite
|
|
131
|
+
testsprite run <test-id> --wait # deployed target
|
|
132
|
+
testsprite run <test-id> --local <port> --local-host <host> # local frontend
|
|
215
133
|
```
|
|
216
134
|
|
|
217
|
-
Do **not** run the whole suite automatically.
|
|
135
|
+
Do **not** run the whole suite automatically. Frontend runs, including local runs,
|
|
218
136
|
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
|
-
`--local <port> --local-host <host> --timeout 1800` (same host), not `
|
|
137
|
+
Local runs wait (1200 s each). Put several in ONE `run <id> <id> --local <port>`
|
|
138
|
+
(one tunnel, 5 at a time; each process holds 1 of 5 tunnel slots). Keep the stderr
|
|
139
|
+
`Run <run-id>` receipt. An owned local timeout cancels by default: start a new run with
|
|
140
|
+
`--local <port> --local-host <host> --timeout 1800` (same host), not `run wait`. For a frontend test cancelled before a terminal verdict the server attempts a refund; read the reported `refund`.
|
|
223
141
|
|
|
224
|
-
###
|
|
142
|
+
### 5. Report
|
|
225
143
|
|
|
226
144
|
Tell the user, plainly:
|
|
227
145
|
|
|
228
146
|
- "Your project now has **N** tests covering: <list the flows>."
|
|
229
147
|
- "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
|
|
148
|
+
- "To run the rest (≈X credits, so they choose knowingly):
|
|
149
|
+
- frontend — use `run <test-id> --wait` for deployed targets or
|
|
150
|
+
`run --project <id> --local <port> --local-host <host>` for local targets;
|
|
151
|
+
- backend — `testsprite run --project <id>` (wave-ordered, runs every BE test)."
|
|
234
152
|
|
|
235
153
|
## Quality checklist (self-check before reporting done)
|
|
236
154
|
|
|
237
155
|
- [ ] FE project has a public `--url` or uses `--local`; login configured if needed.
|
|
238
|
-
- [ ] API project:
|
|
239
|
-
- [ ]
|
|
240
|
-
rather than
|
|
156
|
+
- [ ] API project: the API spec attached to the request (a PRD is optional, alongside it).
|
|
157
|
+
- [ ] You **read the plan** and rejected or excluded the tests that don't fit,
|
|
158
|
+
rather than applying it unseen.
|
|
241
159
|
- [ ] Every FE assertion names a concrete, observable outcome (no "verify it works").
|
|
242
160
|
- [ ] Tests cover the core flows you found in the code, not just one page.
|
|
243
161
|
- [ ] Smoke-ran 2–3 happy-path tests, not the whole suite.
|
|
@@ -246,14 +164,11 @@ Tell the user, plainly:
|
|
|
246
164
|
## Don'ts
|
|
247
165
|
|
|
248
166
|
- Don't auto-run the full suite (credit wall / surprise 402).
|
|
249
|
-
- Don't
|
|
167
|
+
- Don't apply narrative assertions an AI judge can't fail.
|
|
250
168
|
- Don't call backend endpoints directly — only the `testsprite` CLI.
|
|
251
169
|
- Don't create a FE project without public `--url` or `--local <port>`.
|
|
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.
|
|
170
|
+
- Don't apply a plan unread — reviewing it is the point of the proposal.
|
|
171
|
+
- Don't write or edit tests yourself — ask the agent (`reply`, `reject`, or a new `plan`).
|
|
257
172
|
|
|
258
173
|
## Hand off to verify
|
|
259
174
|
|
|
@@ -17,17 +17,16 @@ 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 --local <port>
|
|
22
|
+
testsprite plan "<what you built>" --diff --project <projectId>
|
|
23
|
+
testsprite apply
|
|
24
|
+
testsprite run --project <projectId> --wait --local <port> --local-host <host> --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
|
|
|
@@ -35,60 +34,59 @@ The CLI does not host apps. Create a deployed environment once; select it with
|
|
|
35
34
|
`--env <name>` or omit for Default. Unknown names list valid names. Use `--local
|
|
36
35
|
<port>` for local FE runs.
|
|
37
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.
|
|
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
58
|
exits 3. Free-plan local runs work. BE cannot use `--local`.
|
|
56
|
-
- `--local` implies `--wait` (1200 s
|
|
57
|
-
`localhost`, `127.0.0.1
|
|
59
|
+
- `--local` implies `--wait` (shared 1200 s deadline; public: 600). `--local-host`:
|
|
60
|
+
`localhost`, `127.0.0.1`, `::1`. A dead port exits 5 before charge;
|
|
58
61
|
`--skip-preflight` skips the probe. Environment `--url` rejects private (non-loopback) hosts.
|
|
59
|
-
`--local` selects/creates `local-<port>`;
|
|
62
|
+
`--local` selects/creates `local-<port>`; `--env` keeps its sign-in settings.
|
|
60
63
|
`--target-url` cannot combine with `--local`.
|
|
61
|
-
- Run local ids together
|
|
62
|
-
|
|
63
|
-
(`--max-concurrency` 1–10). Five live bindings per user; `tunnel_binding_limit`
|
|
64
|
+
- Run local ids together in one `run`; `run --project <id> --local <port>` skips BE tests. One run per project, one tunnel, 5 tests at once per execution by default
|
|
65
|
+
(`--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
66
|
exits 11 without retry. Use `tunnel list` then `tunnel stop <id>` or `--all --confirm`.
|
|
65
|
-
- Keep
|
|
66
|
-
|
|
67
|
+
- 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`,
|
|
68
|
+
`results[].resultId` and counts in `summary`. Only an incomplete timeout or
|
|
69
|
+
interruption adds `partial: true`.
|
|
67
70
|
- An **owned** local timeout, Ctrl-C, or poll failure requests cancellation and
|
|
68
|
-
closes the tunnel. Before a terminal
|
|
71
|
+
closes the tunnel. Before a terminal FE verdict, the backend attempts a refund;
|
|
69
72
|
check `refund.status`: cancellation does not guarantee a refund.
|
|
70
73
|
`--no-cancel-on-interrupt` detaches, but the owned tunnel still closes.
|
|
71
|
-
- After an owned timeout, start a **new** `
|
|
72
|
-
--timeout 1800` (retain `--local-host`). `
|
|
73
|
-
ordinary/adopted waits can resume with `
|
|
74
|
+
- After an owned timeout, start a **new** `run <test-id> --local <port>
|
|
75
|
+
--timeout 1800` (retain `--local-host`). `run wait` cannot reopen the tunnel;
|
|
76
|
+
ordinary/adopted waits can resume with `run wait <run-id>` if reachable.
|
|
74
77
|
- Keep `tunnel start` alive; borrow with `--local <port> --tunnel-client <uuid>`.
|
|
75
78
|
Adopted runs normally detach without cancellation or closing the owner's tunnel.
|
|
76
79
|
If the owner has disappeared during a run, cancellation is requested by default;
|
|
77
80
|
`--no-cancel-on-interrupt` skips it. A second connection with the same credential
|
|
78
81
|
takes over; the first exits **10**.
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
- Saved loopback frontend environments open a tunnel automatically, including
|
|
83
|
+
list mappings. Lists use pinned environments; no target/env overrides.
|
|
84
|
+
- Choose project, named IDs, or list; never combine project with IDs/list.
|
|
85
|
+
No IDs/list: project flag then `TESTSPRITE_PROJECT_ID`. Named/list ignore it.
|
|
86
|
+
`--filter` narrows project selection. Resume with `run wait <run-id...>
|
|
87
|
+
--timeout 600`; cancel with `run cancel <run-id...>`. Child flags follow the child.
|
|
85
88
|
- `--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
|
|
89
|
+
- Use `run --project <project-id>` for backend producer → consumer → teardown ordering
|
|
92
90
|
and variable passing. A BE run includes that closure and its side effects;
|
|
93
91
|
`--skip-dependencies` selects only the named test. Triage failed producers before
|
|
94
92
|
blaming consumers starved of their token/fixture.
|
|
@@ -96,13 +94,14 @@ testsprite test run --all --project <id> --env staging --wait --output json
|
|
|
96
94
|
## 3. Inspect and report
|
|
97
95
|
|
|
98
96
|
```bash
|
|
99
|
-
testsprite
|
|
100
|
-
testsprite
|
|
97
|
+
testsprite result list --run <run-id> --status failed,blocked # what did not pass
|
|
98
|
+
testsprite result get <result-id> --output json # error, cause, fix, every step; BE: trace, apiOutput
|
|
99
|
+
testsprite result get <result-id> --out .testsprite/results/<result-id> # evidence
|
|
101
100
|
```
|
|
102
101
|
|
|
103
|
-
Read
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
Read the result of the run you verify, not an older one (`result list --test
|
|
103
|
+
<test-id>` lists them). `--out` writes `result.json`, the video and `steps/`, and
|
|
104
|
+
replaces those in an existing dir: one dir per result. Report verdict and links.
|
|
106
105
|
|
|
107
106
|
Exits: 0 passed; 1 failed/blocked/cancelled; 3 auth/scope; 4 not found;
|
|
108
107
|
5 validation; 6 conflict/precondition; 7 timeout/unsupported; 10 unavailable;
|
|
@@ -113,8 +112,7 @@ Exits: 0 passed; 1 failed/blocked/cancelled; 3 auth/scope; 4 not found;
|
|
|
113
112
|
`--dry-run` works without credentials:
|
|
114
113
|
|
|
115
114
|
```bash
|
|
116
|
-
testsprite
|
|
117
|
-
testsprite test create --plan-from plan.json --dry-run --output json
|
|
115
|
+
testsprite run <test-id> --dry-run --output json
|
|
118
116
|
```
|
|
119
117
|
|
|
120
118
|
Setup: `npm install -g @testsprite/testsprite-cli`; `testsprite setup`.
|