@testspectra/skills 1.2.34 → 1.2.36

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: debugging-runs
3
- description: How to read a failing or slow `spectra run` — the failure context, the warnings, the step lines, the network and intercept records — and `spectra diagnose` for failures that pass with `--delay`. Use whenever a test fails, times out, or a run slows down, before changing the script.
3
+ description: How to read a failing or slow `spectra run` — `--agent` output, `spectra report`, the page snapshot, the failure context, the warnings, the step lines, the network and intercept records — how to pause a test at a line or a failure and inspect the live page with `spectra inspect`, and `spectra diagnose` for failures that pass with `--delay`. Use whenever a test fails, times out, or a run slows down, before changing the script.
4
4
  ---
5
5
 
6
6
  # Skill: Debugging a run
@@ -8,6 +8,50 @@ description: How to read a failing or slow `spectra run` — the failure context
8
8
  Read what the run already reports before you change a script or add a wait. Every signal below is
9
9
  printed by `spectra run` (plain output, CI, or an agent's shell) and saved under `.testspectra/reports/`.
10
10
 
11
+ ## 0. Agent workflow
12
+
13
+ ```bash
14
+ spectra run <spec> --agent # compact output; ends with a failure digest
15
+ spectra report # the same digest for the last run (--json for JSON)
16
+ ```
17
+
18
+ For each failed case the digest gives `at:` (the spec/page-object line), `failed step:` (or
19
+ `after step:` when the test's own code threw), the error, the last steps, and three files:
20
+
21
+ - `page:` — `.testspectra/reports/snapshots/<case>.md`, a text outline of the page at the failure:
22
+ URL, open dialogs, alerts, headings, every visible interactive element with its state
23
+ (`disabled`, `covered by <div#overlay>`, `off-screen`) and a selector `Spectra.get()` accepts.
24
+ Read it before the screenshot.
25
+ - `screenshot:` and `video:`.
26
+
27
+ The `⏱` line splits a case's time into setup / beforeEach / body / afterEach / artifacts and says how
28
+ much no step accounts for; `… untracked Nms` under a group is time spent outside reported steps.
29
+
30
+ ### Breakpoints: look at the live page
31
+
32
+ ```bash
33
+ spectra run <spec> --agent --break-at specs/Auth/TC-1/web.test.ts:42 # before the steps line 42 runs
34
+ spectra run <spec> --agent --break-at step:7 # before step #7
35
+ spectra run <spec> --agent --break-on-failure # where it fails, before afterEach
36
+ ```
37
+
38
+ Run it in the background; when it prints `⏸ Paused`, drive it from another shell:
39
+
40
+ ```bash
41
+ spectra inspect # where it is paused and why
42
+ spectra inspect snapshot # page outline with selectors
43
+ spectra inspect eval "document.querySelector('#email').value"
44
+ spectra inspect exec "await Spectra.get('~Close').click(); return Spectra.browser.getUrl()"
45
+ spectra inspect screenshot
46
+ spectra inspect next # run one step, pause again
47
+ spectra inspect continue # run to the next breakpoint or the end
48
+ spectra inspect abort # fail the case here
49
+ ```
50
+
51
+ Try a fix with `exec` on the paused page, then put it in the script. A pause nobody resumes continues
52
+ by itself after 15 minutes (`TESTSPECTRA_BREAK_TIMEOUT_MS`). Breakpoints run one worker and lift
53
+ the test timeout.
54
+
11
55
  ## 1. Signals and what they mean
12
56
 
13
57
  | Signal | Meaning | Do |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/skills",
3
- "version": "1.2.34",
3
+ "version": "1.2.36",
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",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: debugging-runs
3
- description: How to read a failing or slow `spectra run` — the failure context, the warnings, the step lines, the network and intercept records — and `spectra diagnose` for failures that pass with `--delay`. Use whenever a test fails, times out, or a run slows down, before changing the script.
3
+ description: How to read a failing or slow `spectra run` — `--agent` output, `spectra report`, the page snapshot, the failure context, the warnings, the step lines, the network and intercept records — how to pause a test at a line or a failure and inspect the live page with `spectra inspect`, and `spectra diagnose` for failures that pass with `--delay`. Use whenever a test fails, times out, or a run slows down, before changing the script.
4
4
  ---
5
5
 
6
6
  # Skill: Debugging a run
@@ -8,6 +8,50 @@ description: How to read a failing or slow `spectra run` — the failure context
8
8
  Read what the run already reports before you change a script or add a wait. Every signal below is
9
9
  printed by `spectra run` (plain output, CI, or an agent's shell) and saved under `.testspectra/reports/`.
10
10
 
11
+ ## 0. Agent workflow
12
+
13
+ ```bash
14
+ spectra run <spec> --agent # compact output; ends with a failure digest
15
+ spectra report # the same digest for the last run (--json for JSON)
16
+ ```
17
+
18
+ For each failed case the digest gives `at:` (the spec/page-object line), `failed step:` (or
19
+ `after step:` when the test's own code threw), the error, the last steps, and three files:
20
+
21
+ - `page:` — `.testspectra/reports/snapshots/<case>.md`, a text outline of the page at the failure:
22
+ URL, open dialogs, alerts, headings, every visible interactive element with its state
23
+ (`disabled`, `covered by <div#overlay>`, `off-screen`) and a selector `Spectra.get()` accepts.
24
+ Read it before the screenshot.
25
+ - `screenshot:` and `video:`.
26
+
27
+ The `⏱` line splits a case's time into setup / beforeEach / body / afterEach / artifacts and says how
28
+ much no step accounts for; `… untracked Nms` under a group is time spent outside reported steps.
29
+
30
+ ### Breakpoints: look at the live page
31
+
32
+ ```bash
33
+ spectra run <spec> --agent --break-at specs/Auth/TC-1/web.test.ts:42 # before the steps line 42 runs
34
+ spectra run <spec> --agent --break-at step:7 # before step #7
35
+ spectra run <spec> --agent --break-on-failure # where it fails, before afterEach
36
+ ```
37
+
38
+ Run it in the background; when it prints `⏸ Paused`, drive it from another shell:
39
+
40
+ ```bash
41
+ spectra inspect # where it is paused and why
42
+ spectra inspect snapshot # page outline with selectors
43
+ spectra inspect eval "document.querySelector('#email').value"
44
+ spectra inspect exec "await Spectra.get('~Close').click(); return Spectra.browser.getUrl()"
45
+ spectra inspect screenshot
46
+ spectra inspect next # run one step, pause again
47
+ spectra inspect continue # run to the next breakpoint or the end
48
+ spectra inspect abort # fail the case here
49
+ ```
50
+
51
+ Try a fix with `exec` on the paused page, then put it in the script. A pause nobody resumes continues
52
+ by itself after 15 minutes (`TESTSPECTRA_BREAK_TIMEOUT_MS`). Breakpoints run one worker and lift
53
+ the test timeout.
54
+
11
55
  ## 1. Signals and what they mean
12
56
 
13
57
  | Signal | Meaning | Do |