@testspectra/skills 1.2.42 → 1.2.44
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.
|
@@ -100,6 +100,22 @@ intercept handle's, after a deliberate `delayMs`) — see the `network-intercept
|
|
|
100
100
|
await ReportPage.statusBadge.shouldHaveText('Ready', { timeoutMs: 5000 });
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
**Whose failure** — `err.name` tells the app's verdict from the machine's: every `should*` throws `AssertionError`; a hung tab or browser, a closed tab, a device or run timeout throw `CdpTimeoutError`, `BrowserHungError`, `CdpSocketClosedError`, `DriverTimeoutError`, `CaseAbortedError` or `TimeoutError`. To collect several differences from a spec and fail with all of them at the end, catch only `AssertionError` and rethrow the rest (never `.catch(() => {})` around an assertion: that passes the case):
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const open: string[] = [];
|
|
107
|
+
const check = async (where: string, assertion: () => Promise<void>) => {
|
|
108
|
+
try {
|
|
109
|
+
await assertion();
|
|
110
|
+
} catch (err) {
|
|
111
|
+
if (!(err instanceof Error) || err.name !== 'AssertionError') throw err;
|
|
112
|
+
open.push(`${where}: ${err.message}`);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
await check('amount', () => Page.amount.shouldHaveValue('10.50'));
|
|
116
|
+
if (open.length > 0) throw new Error(`${open.length} open gap(s):\n${open.join('\n')}`);
|
|
117
|
+
```
|
|
118
|
+
|
|
103
119
|
---
|
|
104
120
|
|
|
105
121
|
## 3. Collection Matchers (on `Spectra.getAll(selector)` getters)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testspectra/skills",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.44",
|
|
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",
|
|
@@ -100,6 +100,22 @@ intercept handle's, after a deliberate `delayMs`) — see the `network-intercept
|
|
|
100
100
|
await ReportPage.statusBadge.shouldHaveText('Ready', { timeoutMs: 5000 });
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
**Whose failure** — `err.name` tells the app's verdict from the machine's: every `should*` throws `AssertionError`; a hung tab or browser, a closed tab, a device or run timeout throw `CdpTimeoutError`, `BrowserHungError`, `CdpSocketClosedError`, `DriverTimeoutError`, `CaseAbortedError` or `TimeoutError`. To collect several differences from a spec and fail with all of them at the end, catch only `AssertionError` and rethrow the rest (never `.catch(() => {})` around an assertion: that passes the case):
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const open: string[] = [];
|
|
107
|
+
const check = async (where: string, assertion: () => Promise<void>) => {
|
|
108
|
+
try {
|
|
109
|
+
await assertion();
|
|
110
|
+
} catch (err) {
|
|
111
|
+
if (!(err instanceof Error) || err.name !== 'AssertionError') throw err;
|
|
112
|
+
open.push(`${where}: ${err.message}`);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
await check('amount', () => Page.amount.shouldHaveValue('10.50'));
|
|
116
|
+
if (open.length > 0) throw new Error(`${open.length} open gap(s):\n${open.join('\n')}`);
|
|
117
|
+
```
|
|
118
|
+
|
|
103
119
|
---
|
|
104
120
|
|
|
105
121
|
## 3. Collection Matchers (on `Spectra.getAll(selector)` getters)
|