saffron-ai 0.8.0 → 0.8.2
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/CHANGELOG.md +99 -8
- package/README.md +1 -1
- package/dist-pkg/cli.js +119 -110
- package/package.json +1 -1
- package/skills/saffron/SKILL.md +1 -0
- package/skills/saffron/references/config.md +5 -3
package/package.json
CHANGED
package/skills/saffron/SKILL.md
CHANGED
|
@@ -69,6 +69,7 @@ strict under every policy. Use `Given`/`When` for actions.
|
|
|
69
69
|
|
|
70
70
|
- Secrets: `{env:VAR}`, as in `When I enter "{env:ADMIN_PASSWORD}" in the password field`.
|
|
71
71
|
- Shared test data (accounts, names, enum values): put it in `data/*.json` and write `{data:users.admin.email}` (file, then dotted path; one value, not a list). The recording stores the token, so editing the file changes the next replay at zero tokens. Never for secrets: data files are committed. To check a whole list (an enum), point a Then step at it: `Then the status filter should list every {data:enums.OrderStatus}`; replay iterates the file's list, so adding a value needs no re-record. `Examples: {data:roles}` reads outline rows from `data/roles.csv` or a JSON list (`.saffron` only). A value that must be new on every run (an email for a sign-up) is `{unique:name}`: fresh per run, the same within it.
|
|
72
|
+
- State the application must be in before the suite (seeded users, a reset database): do not script it through the UI in every scenario. The project's `saffron.config.json` takes `"setup"` and `"teardown"` shell commands, run once around `saffron run` (teardown always runs). Propose a seed script there; keep scenario steps for the behaviour under test.
|
|
72
73
|
- Dates: write intent, not literals: "1 day from today" records as `{date+1}`.
|
|
73
74
|
- Dynamic display values: capture and compare, e.g. `I record the total as "first"` … `"first" should differ from the displayed total`.
|
|
74
75
|
|
|
@@ -53,15 +53,17 @@ your-project/
|
|
|
53
53
|
| `verifyProposals` | Proof-replay every recording zero-AI before filing (default true) |
|
|
54
54
|
| `reuseSteps` | Seed new recordings from existing step recordings (default true) |
|
|
55
55
|
| `snapshotMode` | `none` (default, ~60% fewer AI calls) or `full` for highly dynamic pages |
|
|
56
|
-
| `
|
|
56
|
+
| `setup` / `teardown` | shell command or list, run once before / after the run in the project root (seed and clean test data). Failed setup: exit 2, nothing runs. Teardown always runs. They receive `SAFFRON_BASE_URL` and `SAFFRON_ENV`. `--no-hooks` skips them; `hookTimeoutMs` (default 300000) bounds each |
|
|
57
|
+
| `browser` | `chromium` / `chrome` / `msedge` / `firefox` / `webkit`: replay runs anywhere; recording and healing need one of the first three. `chrome` and `msedge` must be installed on the machine |
|
|
57
58
|
| `workers` | Parallel replay workers; agent work stays sequential |
|
|
59
|
+
| `shardBy` | How `--shard` splits the suite: `"scenario"` (default) or `"file"` (each feature file on one machine) |
|
|
58
60
|
| `healModel` | Cheaper model for heal sessions only |
|
|
59
61
|
|
|
60
62
|
## CLI
|
|
61
63
|
|
|
62
64
|
| Command | Purpose |
|
|
63
65
|
|---|---|
|
|
64
|
-
| `saffron run [paths] [--filter @tag] [--no-agent] [--strict] [--browser b] [--workers n] [--heal-model m] [--headed]` | Run; cached replay, agent on misses/failures |
|
|
66
|
+
| `saffron run [paths] [--filter @tag] [--no-agent] [--strict] [--browser b] [--workers n] [--shard i/n] [--shard-by scenario\|file] [--heal-model m] [--headed]` | Run; cached replay, agent on misses/failures. `--shard 2/4` runs one part of the suite on one CI machine and writes `shard-2-of-4.json` instead of `latest.json` |
|
|
65
67
|
| `saffron accept [files... \| --all] [--include-unverified] [--with-feature-edit] [--propagate]` | Promote proposals (`--all` skips UNVERIFIED ones unless `--include-unverified`); `--with-feature-edit` rewrites adapted steps in the feature file; `--propagate` applies a heal's locator fix to every cache using that locator |
|
|
66
68
|
| `saffron reject [files... \| --all]` | Discard proposals |
|
|
67
69
|
| `saffron prune [--yes] [--check] [--json]` | List recordings no scenario owns any more; `--yes` deletes them, `--check` exits 1 for CI |
|
|
@@ -70,7 +72,7 @@ your-project/
|
|
|
70
72
|
| `saffron author <prose-file>` | Draft a `.saffron` file from plain-paragraph requirements using the project vocabulary |
|
|
71
73
|
| `saffron mcp` / `saffron lsp` | MCP tools (`search_steps`, `list_step_sets`, `project_status`) for AI assistants / language server for editors |
|
|
72
74
|
| `saffron init [--examples] [--agents list]` | Install this skill into the project's agent directories, register MCP, add an AGENTS.md block, scaffold config; `--examples` adds the Saucedemo example suite |
|
|
73
|
-
| `saffron report` | Open the latest HTML report |
|
|
75
|
+
| `saffron report [--merge [paths]]` | Open the latest HTML report; `--merge` combines a complete set of shard reports into `latest.json`, `latest.html` and one history line |
|
|
74
76
|
|
|
75
77
|
Exit codes: 0 green/yellow, 1 red (or yellow with `--strict`), 2 usage /
|
|
76
78
|
preflight (e.g. a missing `{env:VAR}`).
|