@testspectra/skills 1.3.5 → 1.3.6

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.
@@ -12,7 +12,7 @@ printed by `spectra run` (plain output, CI, or an agent's shell) and saved under
12
12
 
13
13
  | Signal | Meaning | Do |
14
14
  | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
15
- | `── failure context ──` (`[TESTSPECTRA_FAILURE_CONTEXT]` as JSON) | The page when the test failed: last step, URL, focused element, open dialogs, input rates, CDP calls, a screenshot | Open the screenshot; check the focused element and the dialogs against what the step expected |
15
+ | `── failure context ──` (`[TESTSPECTRA_FAILURE_CONTEXT]` as JSON) | The page when the test failed: the `Spectra.step` it failed in (`in step:`), last step, URL, focused element, open dialogs, input rates, CDP calls, a screenshot | Open the screenshot; check the focused element and the dialogs against what the step expected |
16
16
  | `"resolved":"<button aria-label=…>"` on a click/type step | The element the action actually hit | If it is not the one you meant, the lookup is wrong (a position, a repeated name) |
17
17
  | `⚠ the page received N keydown events/s` | Input is repeating (a stuck key, a script re-dispatching) | Find the step named in the warning; the page is unusable after it |
18
18
  | `⚠ the page's main thread is busy` / `CDP command … timed out during step #N` | The page did not answer | Look for an input storm or long tasks first, not for a longer timeout |
@@ -143,6 +143,7 @@ collection carry the scope forward too. No behavior difference on web vs. Androi
143
143
  | Category | Syntax |
144
144
  | :------------- | :------------------------------------------------------------------------------------------------------------------------------- |
145
145
  | Navigation | `await Spectra.navigate("/login")` / `.back()` / `.forward()` / `.refresh()` |
146
+ | Step group | `await Spectra.step('TC-12: Sort by name', async () => { … })` — nests the actions under the spec's step title; returns `fn`'s value |
146
147
  | Element query | `Spectra.get(selector)` / `Spectra.getAll(selector)` — chain `.get()`/`.getAll()` on the result to scope a lookup, see section 4 |
147
148
  | Focus | `await Spectra.focus(target)` / `await Spectra.blur(target)` |
148
149
  | Coordinate | `await Spectra.clickAt(x, y)` — absolute viewport click |
@@ -92,6 +92,20 @@ it('Verify element visibility and existence matchers', async () => {
92
92
  });
93
93
  ```
94
94
 
95
+ Each step the spec names (a `###` heading, or a numbered step that stands alone) is a
96
+ `Spectra.step` in the script, titled exactly as the spec names it. The run, the terminal, the
97
+ report and the VS Code panel nest that step's actions and assertions under the title, and a
98
+ failure names the step it failed in (`in step: TC-12: …`):
99
+
100
+ ```typescript
101
+ it('Sort Brand Name, Used By (Items), dan Last Updated', async () => {
102
+ await Spectra.step('TC-GS-BRAND-146: Sort Brand Name 3 state', async () => {
103
+ await table.sortBy('Brand Name', 'asc');
104
+ await table.shouldHaveCellText('Acme Corp', 'Brand Name', 0);
105
+ });
106
+ });
107
+ ```
108
+
95
109
  ### Hard rules (each is a `spectra lint` error unless noted):
96
110
 
97
111
  1. **Exactly one `it(...)` block, nothing else at the top level.** Zero or multiple `it()` blocks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/skills",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Installer & manager for modular AI agent skills that standardize TestSpectra script authoring (specs, page objects, steps, actions, hooks, fixtures, matchers)",
5
5
  "keywords": [
6
6
  "agents",
@@ -12,7 +12,7 @@ printed by `spectra run` (plain output, CI, or an agent's shell) and saved under
12
12
 
13
13
  | Signal | Meaning | Do |
14
14
  | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
15
- | `── failure context ──` (`[TESTSPECTRA_FAILURE_CONTEXT]` as JSON) | The page when the test failed: last step, URL, focused element, open dialogs, input rates, CDP calls, a screenshot | Open the screenshot; check the focused element and the dialogs against what the step expected |
15
+ | `── failure context ──` (`[TESTSPECTRA_FAILURE_CONTEXT]` as JSON) | The page when the test failed: the `Spectra.step` it failed in (`in step:`), last step, URL, focused element, open dialogs, input rates, CDP calls, a screenshot | Open the screenshot; check the focused element and the dialogs against what the step expected |
16
16
  | `"resolved":"<button aria-label=…>"` on a click/type step | The element the action actually hit | If it is not the one you meant, the lookup is wrong (a position, a repeated name) |
17
17
  | `⚠ the page received N keydown events/s` | Input is repeating (a stuck key, a script re-dispatching) | Find the step named in the warning; the page is unusable after it |
18
18
  | `⚠ the page's main thread is busy` / `CDP command … timed out during step #N` | The page did not answer | Look for an input storm or long tasks first, not for a longer timeout |
@@ -143,6 +143,7 @@ collection carry the scope forward too. No behavior difference on web vs. Androi
143
143
  | Category | Syntax |
144
144
  | :------------- | :------------------------------------------------------------------------------------------------------------------------------- |
145
145
  | Navigation | `await Spectra.navigate("/login")` / `.back()` / `.forward()` / `.refresh()` |
146
+ | Step group | `await Spectra.step('TC-12: Sort by name', async () => { … })` — nests the actions under the spec's step title; returns `fn`'s value |
146
147
  | Element query | `Spectra.get(selector)` / `Spectra.getAll(selector)` — chain `.get()`/`.getAll()` on the result to scope a lookup, see section 4 |
147
148
  | Focus | `await Spectra.focus(target)` / `await Spectra.blur(target)` |
148
149
  | Coordinate | `await Spectra.clickAt(x, y)` — absolute viewport click |
@@ -92,6 +92,20 @@ it('Verify element visibility and existence matchers', async () => {
92
92
  });
93
93
  ```
94
94
 
95
+ Each step the spec names (a `###` heading, or a numbered step that stands alone) is a
96
+ `Spectra.step` in the script, titled exactly as the spec names it. The run, the terminal, the
97
+ report and the VS Code panel nest that step's actions and assertions under the title, and a
98
+ failure names the step it failed in (`in step: TC-12: …`):
99
+
100
+ ```typescript
101
+ it('Sort Brand Name, Used By (Items), dan Last Updated', async () => {
102
+ await Spectra.step('TC-GS-BRAND-146: Sort Brand Name 3 state', async () => {
103
+ await table.sortBy('Brand Name', 'asc');
104
+ await table.shouldHaveCellText('Acme Corp', 'Brand Name', 0);
105
+ });
106
+ });
107
+ ```
108
+
95
109
  ### Hard rules (each is a `spectra lint` error unless noted):
96
110
 
97
111
  1. **Exactly one `it(...)` block, nothing else at the top level.** Zero or multiple `it()` blocks