@unotest/protocol 0.48.0 → 0.49.1

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 CHANGED
@@ -1,5 +1,69 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.49.1] - 2026-10-11
4
+
5
+ ### Patch Changes
6
+
7
+ - 4897ede: A run of one test on a box:
8
+
9
+ - A test the file does not have is refused when the run is ordered, with the file's tests listed, the same refusal the viewer and `e2e --test` give. Before, the box accepted the run, it exited without a word and the notification said "tests failed". The check needs a bundle pushed with this version, since `bundle push` now lists each scenario file's tests in the bundle. An older bundle is not checked.
10
+ - `box runs`, `box run` and notifications name such a run `file › test`, as `bundle push --follow` already did. This also applies to a file with a single test, whose runs used to show only the file. `box queue` names a waiting or running run of one test the same way. `box run --json` and `box queue --json` gain a `test` field on those runs. A run of a whole file of several tests is named as before, and a file's notification series is the same whether a run played one of its tests or all of them.
11
+
12
+ - 4897ede: Box runs of one test: the box accepts a test name only as a scenario function is spelled (letters, digits, `_`, `$`, up to 128 characters) and refuses anything else before it reaches the queue; the box and the run sidecar check it by the same rule, so a name with Cyrillic letters or `$` is played instead of lost. `box queue`, `box runs` and `box run` print run labels with control characters shown as escapes, so a name written by an older box cannot drive the terminal.
13
+ - 4897ede: `run:finished`, the per-test outcome of a file run and `RunMeta` carry an optional `expectFail: true` when a run failed and every failure in it was marked `@expect-fail`. The outcome stays `failed`, so a reader that does not know the field still sees the failure.
14
+ - ab0fb14: `bundle push --follow` now reads tests marked `@expect-fail` the way a local run does: a marked test that fails prints `✓ <test> — failed on purpose (@expect-fail)`, and a marked test that passes prints `✗ <test> — passed, but it is marked @expect-fail`. Previously a control collection on a box streamed its expected failures as ordinary ones. The line that ends a failed scenario in `--follow` also uses the local run's words: `✗ login — failed` instead of `✗ login (failed)`. In a local run, a test of a multi-test file that failed on purpose now carries the same `(@expect-fail)` suffix as a single test. Run lines from a box carry a new optional `expectFail` field; older clients ignore it.
15
+ - 4897ede: `env push` / `env set`: a box that refuses a name of the run's identity (`UNOTEST_RUN_ID` and the rest) no longer gets the advice about `APP_BASE_URL`. The box's refusal now says which kind of name it reserved, under the same `reserved` code, so older CLIs still show the box's own words. A refusal code this CLI does not know is shown as the box worded it, with exit 1, instead of "not a box's answer".
16
+ - 4897ede: The step a test skipped itself in now shows as skipped in the viewer, not as passed; the steps before it stay passed. The run journal marks that statement and its step block with an optional `skipped: true` next to `ok: true`, so readers that do not know the field see the same events as before.
17
+
18
+ ## [0.49.0] - 2026-10-09
19
+
20
+ ### Minor Changes
21
+
22
+ - 3531ce6: A collection can set the browser window of its scenarios.
23
+
24
+ - `viewport:` in a collection's YAML: `null` for the real browser window, `{width, height}` for an emulated size. It replaces the project's `viewport` for every scenario the collection runs; the same scenario run on its own keeps the project's window. It works with a browser profile, where `setViewport(null)` is refused.
25
+ - A wrong value is refused with what to write instead. `viewport: null` over a project `device` is refused before the first scenario starts, as in the config.
26
+ - The `setViewport(null)` refusal on a browser profile now points at the collection field.
27
+ - The viewer's collection editor keeps a hand-written `viewport:` and `prepare:` when it saves a collection.
28
+
29
+ - 970813c: A scenario file can hold several `test_*` functions, and each one is a test of its own: its own run, browser context, retry and verdict, with its own failure bundle, screenshots and console. Functions of the file are shared between its tests; state is not. `npx @unotest/web e2e <file>` plays them in order and exits 1 when any of them failed. A file with one test runs exactly as before. `e2e <file> --test <name>` plays one test, named as the function is or without its `test_` prefix. A name the file does not have is refused with exit 2 and the list of its tests.
30
+
31
+ `// @expect-fail` can mark one test: put it in the `//` comments directly above that test's `function` line, with no blank line between. A marker in the file's leading comments, set apart from the first function by a blank line, still marks every test of the file.
32
+
33
+ The MCP tool `run_test` takes `test` too. A debug session follows one test, so for a file that holds several, `run_test` without `test` starts nothing and answers with the tests and the call to make:
34
+
35
+ ```json
36
+ {
37
+ "status": "test_required",
38
+ "reason": "auth/login holds 3 tests; run_test plays one — name it in `test`.",
39
+ "tests": ["test_login_ok", "test_login_locked", "test_logout"],
40
+ "next": "run_test {name: \"auth/login\", test: \"test_login_ok\"}"
41
+ }
42
+ ```
43
+
44
+ An unknown `test` answers `status: "test_not_found"` with the same list.
45
+
46
+ A collection counts tests, not files. A file of three tests is three verdicts: its line in the `collection` output says `✗ <file> — 1 of 3 failed` and lists each test under it, and the summary counts passed, failed and skipped tests. A file that never started (bailed or busy) is still counted as one file.
47
+
48
+ The viewer shows each test on its own. A file of several tests is a node in the scenarios tree with one row per test, and the chevron opens it from the keyboard too (ArrowRight / ArrowLeft). The file's tab shows the steps of every test under its name. The file's dot and status sum its tests up: failed when one failed, skipped only when all of them skipped, failed on purpose only when every test that ran was expected to fail, otherwise passed. History shows each test's run under the file's run, and can be filtered to one test. A test's run tab shows its own steps, screenshots, console and failure, titled `file › test`, and Run again runs that test only. Home and a collection run's summary count tests, and the Home card says "tests". A link to a test's run opens that test, with its name and status in the tab.
49
+
50
+ `lint:one-test-per-file` no longer reports anything: several `test_*` in one file is now the way to write a suite of related tests.
51
+
52
+ A test that skips itself (`skip(reason)`) now shows as **skipped**, not as passed. The run tree, the history strip, the run tab (its progress bar included) and the overview draw it grey with its reason, the overview gets a "skipped" card when any test's last run skipped and no longer calls such a field "Everything is green", and a collection row counts skipped tests apart from passed ones. A run still in progress that ends in a skip turns skipped at once, without a reload. `box run` prints `(skipped)` with the reason, and its `--json` answer carries `skipReason`. Like a local `e2e`, it exits 0 on a skip.
53
+
54
+ **Migration:** `RunStatus` has a new value, `"skipped"`, and `RunMeta` and the scenario index entry carry the reason (`skipReason`, `lastSkipReason`). Code that switches over `RunStatus` exhaustively must handle the new value. Code that treated `"passed"` as "finished without failing" should accept `"skipped"` as well. The run index schema version moves to 3: the viewer discards an older index on start and rebuilds it from the runs on disk. Past skipped runs then show as skipped too.
55
+
56
+ **Migration:** the run journal has two new event kinds, `file-run:test-started` and `file-run:test-finished`, written by the run of a file with several tests. Code that switches over journal events exhaustively must handle them. Runs, manifests and `run:started` carry `test` (the function name). Its tests point at the file's run through `parentRunId`, as a collection's scenarios point at the collection's.
57
+
58
+ **Migration:** `lint:one-test-per-file` is deprecated and does nothing. A config that sets it (`"lint:one-test-per-file": "error"`) still loads; remove the entry when convenient. The rule id goes away in the next major version.
59
+
60
+ ### Patch Changes
61
+
62
+ - aac77aa: A failed step now brings its notes and the whole diff along.
63
+
64
+ - A failed statement carries the `note(label, value)` calls of its `step(...)` block: printed under the error in the `e2e` output as `note label: value`, and returned as `lastFailure.notes` (the `error` of a `run_test` reply). Secrets are masked as in the run journal. A nested step reports its own notes; a step that noted nothing reports an empty list.
65
+ - `assertEqual` shows every line of its diff. The `… N unchanged …` folding is gone from its failure message.
66
+
3
67
  ## [0.48.0] - 2026-10-08
4
68
 
5
69
  ### Minor Changes