@testspectra/skills 1.2.39 → 1.2.41

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.
@@ -45,7 +45,7 @@ spectra inspect exec "await Spectra.get('~Close').click(); return Spectra.browse
45
45
  spectra inspect screenshot
46
46
  spectra inspect next # run one step, pause again
47
47
  spectra inspect continue # run to the next breakpoint or the end
48
- spectra inspect abort # fail the case here
48
+ spectra inspect abort # fail the case here and stop the run (no hooks after it)
49
49
  ```
50
50
 
51
51
  Try a fix with `exec` on the paused page, then put it in the script. A pause nobody resumes continues
@@ -54,17 +54,18 @@ the test timeout.
54
54
 
55
55
  ## 1. Signals and what they mean
56
56
 
57
- | Signal | Meaning | Do |
58
- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
59
- | `── 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 |
60
- | `"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) |
61
- | `⚠ 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 |
62
- | `⚠ 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 |
63
- | `[TESTSPECTRA_INTERCEPT] '<pattern>' (METHOD) answered METHOD <url>` | Which mock answered which request | A URL you did not mean: narrow the pattern (a glob matches the whole URL) |
64
- | `⚠ intercept '<pattern>' … answered no request` | The mock never matched | Check its URL and method |
65
- | `[TESTSPECTRA_STATE_CARRIED] … sessionStorage: <keys>` | Storage the previous test case left (`isolation: 'suite'`) | A test that passes alone but fails in the suite: clear those keys in `beforeEach`, or set `webConfig.isolation: 'testcase'` |
66
- | `⚠ another spectra run (pid …) is testing <url>` | Two runs share one server and reset each other's data | Stop one; results of both runs are unreliable |
67
- | `Typed text did not reach … (focus was on …; the field is …)` | The keystrokes went elsewhere, or the field was disabled/inert | Wait for the state that enables the field |
57
+ | Signal | Meaning | Do |
58
+ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
59
+ | `── 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 |
60
+ | `"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) |
61
+ | `⚠ 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 |
62
+ | `⚠ 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 |
63
+ | `[TESTSPECTRA_INTERCEPT] '<pattern>' (METHOD) answered METHOD <url>` | Which mock answered which request | A URL you did not mean: narrow the pattern (a glob matches the whole URL) |
64
+ | `⚠ intercept '<pattern>' … answered no request` | The mock never matched | Check its URL and method |
65
+ | `[TESTSPECTRA_STATE_CARRIED] … sessionStorage: <keys>` | Storage the previous test case left (`isolation: 'suite'`) | A test that passes alone but fails in the suite: clear those keys in `beforeEach`, or set `webConfig.isolation: 'testcase'` |
66
+ | `⚠ another spectra run (pid …) is testing <url>` | Two runs share one server and reset each other's data | Stop one; results of both runs are unreliable |
67
+ | `⚠ another spectra run (pid …) writes its report to <folder>` | Two runs share one report folder: the one ending last overwrites the other's report, snapshots and screenshots | Give each run its own `-o <own-dir>/result.json` |
68
+ | `Typed text did not reach … (focus was on …; the field is …)` | The keystrokes went elsewhere, or the field was disabled/inert | Wait for the state that enables the field |
68
69
 
69
70
  `network-resources.json` holds every request with its HTTP method, request body and, when a mock
70
71
  answered it, `interceptedBy`. The terminal no longer prints one line per request; set
@@ -87,7 +88,9 @@ Put a `should*` assertion there for the state the app reaches — never a sleep.
87
88
 
88
89
  ```ts
89
90
  await Spectra.browser.addInitScript(source); // runs in every document from its first instant
90
- const stop = Spectra.onConsole(({ type, text }) => { /* … */ });
91
+ const stop = Spectra.onConsole(({ type, text }) => {
92
+ /* … */
93
+ });
91
94
  await Spectra.browser.cdp('Performance.getMetrics');
92
95
  await Spectra.sleep(500); // probes only
93
96
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testspectra/skills",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
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",
@@ -45,7 +45,7 @@ spectra inspect exec "await Spectra.get('~Close').click(); return Spectra.browse
45
45
  spectra inspect screenshot
46
46
  spectra inspect next # run one step, pause again
47
47
  spectra inspect continue # run to the next breakpoint or the end
48
- spectra inspect abort # fail the case here
48
+ spectra inspect abort # fail the case here and stop the run (no hooks after it)
49
49
  ```
50
50
 
51
51
  Try a fix with `exec` on the paused page, then put it in the script. A pause nobody resumes continues
@@ -54,17 +54,18 @@ the test timeout.
54
54
 
55
55
  ## 1. Signals and what they mean
56
56
 
57
- | Signal | Meaning | Do |
58
- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
59
- | `── 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 |
60
- | `"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) |
61
- | `⚠ 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 |
62
- | `⚠ 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 |
63
- | `[TESTSPECTRA_INTERCEPT] '<pattern>' (METHOD) answered METHOD <url>` | Which mock answered which request | A URL you did not mean: narrow the pattern (a glob matches the whole URL) |
64
- | `⚠ intercept '<pattern>' … answered no request` | The mock never matched | Check its URL and method |
65
- | `[TESTSPECTRA_STATE_CARRIED] … sessionStorage: <keys>` | Storage the previous test case left (`isolation: 'suite'`) | A test that passes alone but fails in the suite: clear those keys in `beforeEach`, or set `webConfig.isolation: 'testcase'` |
66
- | `⚠ another spectra run (pid …) is testing <url>` | Two runs share one server and reset each other's data | Stop one; results of both runs are unreliable |
67
- | `Typed text did not reach … (focus was on …; the field is …)` | The keystrokes went elsewhere, or the field was disabled/inert | Wait for the state that enables the field |
57
+ | Signal | Meaning | Do |
58
+ | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
59
+ | `── 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 |
60
+ | `"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) |
61
+ | `⚠ 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 |
62
+ | `⚠ 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 |
63
+ | `[TESTSPECTRA_INTERCEPT] '<pattern>' (METHOD) answered METHOD <url>` | Which mock answered which request | A URL you did not mean: narrow the pattern (a glob matches the whole URL) |
64
+ | `⚠ intercept '<pattern>' … answered no request` | The mock never matched | Check its URL and method |
65
+ | `[TESTSPECTRA_STATE_CARRIED] … sessionStorage: <keys>` | Storage the previous test case left (`isolation: 'suite'`) | A test that passes alone but fails in the suite: clear those keys in `beforeEach`, or set `webConfig.isolation: 'testcase'` |
66
+ | `⚠ another spectra run (pid …) is testing <url>` | Two runs share one server and reset each other's data | Stop one; results of both runs are unreliable |
67
+ | `⚠ another spectra run (pid …) writes its report to <folder>` | Two runs share one report folder: the one ending last overwrites the other's report, snapshots and screenshots | Give each run its own `-o <own-dir>/result.json` |
68
+ | `Typed text did not reach … (focus was on …; the field is …)` | The keystrokes went elsewhere, or the field was disabled/inert | Wait for the state that enables the field |
68
69
 
69
70
  `network-resources.json` holds every request with its HTTP method, request body and, when a mock
70
71
  answered it, `interceptedBy`. The terminal no longer prints one line per request; set
@@ -87,7 +88,9 @@ Put a `should*` assertion there for the state the app reaches — never a sleep.
87
88
 
88
89
  ```ts
89
90
  await Spectra.browser.addInitScript(source); // runs in every document from its first instant
90
- const stop = Spectra.onConsole(({ type, text }) => { /* … */ });
91
+ const stop = Spectra.onConsole(({ type, text }) => {
92
+ /* … */
93
+ });
91
94
  await Spectra.browser.cdp('Performance.getMetrics');
92
95
  await Spectra.sleep(500); // probes only
93
96
  ```