@testsprite/testsprite-cli 0.4.0 → 0.6.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 +27 -1
- package/dist/commands/agent.js +17 -6
- package/dist/commands/auth.d.ts +46 -0
- package/dist/commands/auth.js +37 -2
- package/dist/commands/completion.d.ts +36 -0
- package/dist/commands/completion.js +111 -0
- package/dist/commands/doctor.js +20 -2
- package/dist/commands/init.d.ts +32 -1
- package/dist/commands/init.js +40 -10
- package/dist/commands/project.d.ts +77 -3
- package/dist/commands/project.js +176 -43
- package/dist/commands/test.d.ts +200 -10
- package/dist/commands/test.js +1636 -351
- package/dist/commands/usage.d.ts +56 -17
- package/dist/commands/usage.js +144 -29
- package/dist/index.js +132 -26
- package/dist/lib/browser.d.ts +6 -0
- package/dist/lib/browser.js +54 -0
- package/dist/lib/bundle.d.ts +32 -31
- package/dist/lib/bundle.js +125 -83
- package/dist/lib/client-factory.d.ts +23 -0
- package/dist/lib/client-factory.js +33 -1
- package/dist/lib/config.js +7 -3
- package/dist/lib/credentials.d.ts +17 -1
- package/dist/lib/credentials.js +175 -16
- package/dist/lib/dry-run/samples.js +15 -1
- package/dist/lib/errors.d.ts +6 -1
- package/dist/lib/errors.js +70 -19
- package/dist/lib/flaky.d.ts +12 -1
- package/dist/lib/flaky.js +7 -12
- package/dist/lib/gh-output.d.ts +84 -0
- package/dist/lib/gh-output.js +202 -0
- package/dist/lib/http.d.ts +33 -15
- package/dist/lib/http.js +141 -7
- package/dist/lib/org-render.d.ts +52 -0
- package/dist/lib/org-render.js +59 -0
- package/dist/lib/poll.js +72 -36
- package/dist/lib/render-error.d.ts +14 -0
- package/dist/lib/render-error.js +30 -0
- package/dist/lib/response-schemas.d.ts +83 -0
- package/dist/lib/response-schemas.js +282 -0
- package/dist/lib/runs.types.d.ts +53 -8
- package/dist/lib/skill-nudge.d.ts +17 -0
- package/dist/lib/skill-nudge.js +19 -0
- package/dist/lib/telemetry.d.ts +90 -0
- package/dist/lib/telemetry.js +171 -0
- package/dist/lib/text-table.d.ts +14 -0
- package/dist/lib/text-table.js +45 -0
- package/dist/lib/v3-advisory.d.ts +30 -1
- package/dist/lib/v3-advisory.js +35 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +17 -5
- package/schemas/plan.schema.json +61 -0
- package/skills/testsprite-verify.codex.md +2 -2
- package/skills/testsprite-verify.skill.md +3 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/TestSprite/testsprite-cli/main/schemas/plan.schema.json",
|
|
4
|
+
"title": "TestSprite CLI plan file",
|
|
5
|
+
"description": "Shape ingested by `testsprite test create --plan-from <file>` (and, per-line, by `test create-batch --plans <file.jsonl>` / `--plan-from-dir <dir>`). One plan file describes exactly ONE test — a top-level JSON array is rejected; use create-batch for many. This schema is the machine-readable ground truth for THIS command (`--plan-from`), not for `assertPlanShape`'s raw structural check in isolation — where the two diverge (see `type` below), this schema encodes what `--plan-from` actually accepts end-to-end. It is asserted in `src/lib/plan-schema.spec.ts` against the real validator; if the two ever disagree, the validator's actual acceptance behavior is authoritative and this file is out of date. Not enforced by this schema (checked separately by the CLI as a pre-flight guard, not a structural JSON constraint): a plan file must be <= 256 KB total.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["projectId", "type", "name", "planSteps"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$schema": {
|
|
10
|
+
"description": "Optional. Point your editor at this file (e.g. the raw URL in the plan template, or a local path to a copy shipped in node_modules/@testsprite/testsprite-cli/schemas/plan.schema.json) to get inline validation and completion while authoring. Ignored by the CLI — plan files are not restricted to a fixed property set (see `additionalProperties`, implicitly true throughout this schema), and this property is deliberately left type-unconstrained here to match: assertPlanShape does not inspect `$schema` at all, so a non-string value here is exactly as valid to the CLI as a string one."
|
|
11
|
+
},
|
|
12
|
+
"projectId": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"pattern": "\\S",
|
|
16
|
+
"description": "Project id returned by `testsprite project list`. Must be non-empty and not whitespace-only."
|
|
17
|
+
},
|
|
18
|
+
"type": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["frontend"],
|
|
21
|
+
"description": "Restricted to `frontend` — `--plan-from` rejects a `backend`-typed plan pre-flight with a `nextAction` pointing at `test create --type backend --code-file <path>` (backend tests are authored from a code file, not a plan). `assertPlanShape`'s own structural check is looser (it accepts `backend` as a bare shape check before that later rejection), but this schema is the ground truth for the `--plan-from` COMMAND as a whole, not for the isolated structural check — so it encodes the value that actually succeeds end-to-end."
|
|
22
|
+
},
|
|
23
|
+
"name": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"minLength": 1,
|
|
26
|
+
"pattern": "\\S",
|
|
27
|
+
"description": "Human-readable test name. Write it as an assertable behavior statement (subject + verb + outcome), not a noun fragment."
|
|
28
|
+
},
|
|
29
|
+
"description": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Optional one-sentence elaboration of `name` — the condition plus the expected outcome. Any string is accepted (including empty), unlike `name`/`projectId`."
|
|
32
|
+
},
|
|
33
|
+
"priority": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"enum": ["p0", "p1", "p2", "p3"],
|
|
36
|
+
"description": "Optional. p0 = must-pass, p1 = important paths, p2 = edge cases, p3 = cosmetic."
|
|
37
|
+
},
|
|
38
|
+
"planSteps": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"maxItems": 200,
|
|
42
|
+
"description": "1-200 steps describing user intent in plain language, not selectors. `{{...}}`-style placeholders are NOT substituted by the CLI — a step containing one is structurally valid (passes this schema and assertPlanShape) but triggers a non-fatal `[advisory]` at `test create --plan-from` time; store login credentials on the project instead (`project update --username/--password`, or Portal -> Project Settings).",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["type", "description"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"type": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"enum": ["action", "assertion"]
|
|
50
|
+
},
|
|
51
|
+
"description": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"minLength": 1,
|
|
54
|
+
"pattern": "\\S",
|
|
55
|
+
"description": "One verb per step. Describe the outcome/intent, not a CSS selector or literal button label."
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -22,11 +22,11 @@ unverified-because-undeployed and stop. If the user explicitly named a tool
|
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
testsprite --version # CLI installed?
|
|
25
|
-
testsprite auth
|
|
25
|
+
testsprite auth status # credentials valid?
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
If `--version` fails, tell the user to install the CLI and stop.
|
|
29
|
-
If `auth
|
|
29
|
+
If `auth status` fails, tell the user to run `testsprite setup` and stop.
|
|
30
30
|
|
|
31
31
|
### 2. Find the project
|
|
32
32
|
|
|
@@ -67,13 +67,13 @@ because <X>. Treat this as unverified until that's resolved." Don't claim done.
|
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
69
|
testsprite --version # CLI installed?
|
|
70
|
-
testsprite auth
|
|
70
|
+
testsprite auth status # credentials configured?
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
- `--version` fails → the CLI isn't installed. Tell the user to install the
|
|
74
74
|
TestSprite CLI (see the TestSprite docs) and stop; don't install it for them.
|
|
75
|
-
- `auth
|
|
76
|
-
`testsprite
|
|
75
|
+
- `auth status` fails → no credentials. Tell the user they can run
|
|
76
|
+
`testsprite setup`, then stop.
|
|
77
77
|
|
|
78
78
|
## 2. Find the project
|
|
79
79
|
|