@unotest/web 0.49.2 → 0.50.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unotest/web",
3
- "version": "0.49.2",
3
+ "version": "0.50.0",
4
4
  "description": "AI-native E2E testing for web applications. MCP server (run_test / step / resume / inspect_runtime / agent_fix) + CLI runner + JavaScript DSL scenarios on a sandboxed AST engine + semantic DOM snapshots.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -85,18 +85,18 @@
85
85
  "tsx": "^4.19.2",
86
86
  "yaml": "^2.6.0",
87
87
  "zod": "^3.23.8",
88
- "@unotest/core": "^0.49.2",
89
- "@unotest/grounder-client": "^0.49.2",
90
- "@unotest/dsl": "^0.49.2",
91
- "@unotest/protocol": "^0.49.2",
92
- "@unotest/viewer": "^0.49.2"
88
+ "@unotest/core": "^0.50.0",
89
+ "@unotest/grounder-client": "^0.50.0",
90
+ "@unotest/dsl": "^0.50.0",
91
+ "@unotest/viewer": "^0.50.0",
92
+ "@unotest/protocol": "^0.50.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@types/node": "^22.10.0",
96
96
  "javascript-obfuscator": "^4.1.1",
97
97
  "tsup": "^8.5.1",
98
98
  "typescript": "^5.7.2",
99
- "@unotest/grounder": "^0.49.2",
100
- "@unotest/judge": "^0.49.2"
99
+ "@unotest/judge": "^0.50.0",
100
+ "@unotest/grounder": "^0.50.0"
101
101
  }
102
102
  }
@@ -10,7 +10,7 @@ interface Locator {
10
10
  *
11
11
  * Keep matches by contained text or a nested child locator.
12
12
  */
13
- filter(options: any): Locator;
13
+ filter(options: { [key: string]: unknown }): Locator;
14
14
  /**
15
15
  * first(locator)
16
16
  *
@@ -40,43 +40,43 @@ interface Locator {
40
40
  *
41
41
  * Match by raw CSS selector. Last resort — the linter warns on deep/brittle CSS. Options narrow the matches exactly as filter() does.
42
42
  */
43
- locator(selector: string, options?: any): Locator;
43
+ locator(selector: string, options?: { [key: string]: unknown }): Locator;
44
44
  /**
45
45
  * getByRole(role, { name?, exact?, checked?, disabled?, expanded?, includeHidden?, level?, pressed?, selected? })
46
46
  *
47
47
  * Match by ARIA role + accessible name. `name` accepts a string or `/regex/`; the state options narrow by ARIA state (`{disabled: false}` skips a disabled button). Any other key is refused.
48
48
  */
49
- getByRole(role: string, options?: any): Locator;
49
+ getByRole(role: string, options?: { [key: string]: unknown }): Locator;
50
50
  /**
51
51
  * getByText(text, { exact? })
52
52
  *
53
53
  * Match by visible text content.
54
54
  */
55
- getByText(text: string | RegExp, options?: any): Locator;
55
+ getByText(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
56
56
  /**
57
57
  * getByLabel(text, { exact? })
58
58
  *
59
59
  * Match a form control by its associated label.
60
60
  */
61
- getByLabel(text: string | RegExp, options?: any): Locator;
61
+ getByLabel(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
62
62
  /**
63
63
  * getByPlaceholder(text, { exact? })
64
64
  *
65
65
  * Match an input by its placeholder.
66
66
  */
67
- getByPlaceholder(text: string | RegExp, options?: any): Locator;
67
+ getByPlaceholder(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
68
68
  /**
69
69
  * getByAltText(text, { exact? })
70
70
  *
71
71
  * Match an image by its `alt` text.
72
72
  */
73
- getByAltText(text: string | RegExp, options?: any): Locator;
73
+ getByAltText(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
74
74
  /**
75
75
  * getByTitle(text, { exact? })
76
76
  *
77
77
  * Match by `title` attribute.
78
78
  */
79
- getByTitle(text: string | RegExp, options?: any): Locator;
79
+ getByTitle(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
80
80
  /**
81
81
  * getByTestId(id)
82
82
  *
@@ -96,70 +96,70 @@ interface Locator {
96
96
  *
97
97
  * Click an element.
98
98
  */
99
- declare function click(locator: Locator, options?: any): void;
99
+ declare function click(locator: Locator, options?: { [key: string]: unknown }): void;
100
100
 
101
101
  /**
102
102
  * doubleClick(locator, { force?, timeout? })
103
103
  *
104
104
  * Double-click an element.
105
105
  */
106
- declare function doubleClick(locator: Locator, options?: any): void;
106
+ declare function doubleClick(locator: Locator, options?: { [key: string]: unknown }): void;
107
107
 
108
108
  /**
109
109
  * check(locator, { force?, timeout? })
110
110
  *
111
111
  * Check a checkbox/radio/switch: click, then wait until it reads checked (a controlled widget may flip a beat later). Already checked → no click.
112
112
  */
113
- declare function check(locator: Locator, options?: any): void;
113
+ declare function check(locator: Locator, options?: { [key: string]: unknown }): void;
114
114
 
115
115
  /**
116
116
  * uncheck(locator, { force?, timeout? })
117
117
  *
118
118
  * Uncheck a checkbox/switch: click, then wait until it reads unchecked. Already unchecked → no click.
119
119
  */
120
- declare function uncheck(locator: Locator, options?: any): void;
120
+ declare function uncheck(locator: Locator, options?: { [key: string]: unknown }): void;
121
121
 
122
122
  /**
123
123
  * hover(locator, { force?, position?, timeout? })
124
124
  *
125
125
  * Hover over an element. `position` is an {x, y} offset inside it — for a menu that only appears at one edge of a tall element.
126
126
  */
127
- declare function hover(locator: Locator, options?: any): void;
127
+ declare function hover(locator: Locator, options?: { [key: string]: unknown }): void;
128
128
 
129
129
  /**
130
130
  * scrollIntoView(locator)
131
131
  *
132
132
  * Scroll an element into the viewport.
133
133
  */
134
- declare function scrollIntoView(locator: Locator, options?: any): void;
134
+ declare function scrollIntoView(locator: Locator): void;
135
135
 
136
136
  /**
137
137
  * fill(locator, value, { force?, timeout? })
138
138
  *
139
139
  * Clear and type a value into an input.
140
140
  */
141
- declare function fill(locator: Locator, text: string, options?: any): void;
141
+ declare function fill(locator: Locator, text: string, options?: { [key: string]: unknown }): void;
142
142
 
143
143
  /**
144
144
  * press(locator, key, { delay?, timeout? })
145
145
  *
146
146
  * Press a key (e.g. 'Enter', 'Control+A').
147
147
  */
148
- declare function press(locator: Locator, key: string, options?: any): void;
148
+ declare function press(locator: Locator, key: string, options?: { [key: string]: unknown }): void;
149
149
 
150
150
  /**
151
151
  * selectOption(locator, value, { timeout? })
152
152
  *
153
153
  * Select option(s) in a `<select>`. `value` is a string or string[].
154
154
  */
155
- declare function selectOption(locator: Locator, value: any): void;
155
+ declare function selectOption(locator: Locator, value: any, options?: { [key: string]: unknown }): void;
156
156
 
157
157
  /**
158
158
  * dragAndDrop(from, to, { force?, timeout? })
159
159
  *
160
160
  * Drag one element onto another. Uses synthetic mouse events (not native HTML5 DragEvent).
161
161
  */
162
- declare function dragAndDrop(source: Locator, target: Locator): void;
162
+ declare function dragAndDrop(source: Locator, target: Locator, options?: { [key: string]: unknown }): void;
163
163
 
164
164
  /**
165
165
  * uploadFile(locator, files)
@@ -180,63 +180,63 @@ declare function clipboardPaste(target: Locator, text: string): void;
180
180
  *
181
181
  * Element's text equals `expected` (a string; exact: false — contains it) or matches it (a /regex/). {not: true} waits until it no longer does. Empty: assertText(loc, ''); not empty: assertText(loc, '', {not: true}).
182
182
  */
183
- declare function assertText(locator: Locator, text: string | RegExp, options?: any): void;
183
+ declare function assertText(locator: Locator, text: string | RegExp, options?: { [key: string]: unknown }): void;
184
184
 
185
185
  /**
186
186
  * assertTexts(locator, expected, { exact?, timeout? })
187
187
  *
188
188
  * The locator matches exactly expected.length elements, and element i's text matches expected[i] (string or /regex/, same rules as assertText), in order.
189
189
  */
190
- declare function assertTexts(locator: Locator, expected: unknown[], options?: any): void;
190
+ declare function assertTexts(locator: Locator, expected: unknown[], options?: { [key: string]: unknown }): void;
191
191
 
192
192
  /**
193
193
  * assertAttribute(locator, name, expected, { exact?, not?, timeout? })
194
194
  *
195
195
  * Polls the attribute `name` until it equals `expected` (exact: false — contains) or matches a /regex/. An absent attribute matches nothing. {not: true} waits until it no longer matches or is gone.
196
196
  */
197
- declare function assertAttribute(locator: Locator, name: string, value: string | RegExp, options?: any): void;
197
+ declare function assertAttribute(locator: Locator, name: string, value: string | RegExp, options?: { [key: string]: unknown }): void;
198
198
 
199
199
  /**
200
200
  * assertVisible(locator, { timeout? })
201
201
  *
202
202
  * Element is visible.
203
203
  */
204
- declare function assertVisible(locator: Locator, options?: any): void;
204
+ declare function assertVisible(locator: Locator, options?: { [key: string]: unknown }): void;
205
205
 
206
206
  /**
207
207
  * assertHidden(locator, { timeout? })
208
208
  *
209
209
  * Element is hidden or detached.
210
210
  */
211
- declare function assertHidden(locator: Locator, options?: any): void;
211
+ declare function assertHidden(locator: Locator, options?: { [key: string]: unknown }): void;
212
212
 
213
213
  /**
214
214
  * assertNeverAppears(locator, { withinMs })
215
215
  *
216
216
  * Negative window assert: FAIL the moment the locator becomes visible; pass when the whole window elapsed clean. withinMs required; the step always costs that long.
217
217
  */
218
- declare function assertNeverAppears(locator: Locator, options: any): void;
218
+ declare function assertNeverAppears(locator: Locator, options: { [key: string]: unknown }): void;
219
219
 
220
220
  /**
221
221
  * assertValue(locator, expected, { timeout? })
222
222
  *
223
223
  * Input's value equals `expected`. On a checkbox/radio/switch: its checked state — pass 'true' or 'false'.
224
224
  */
225
- declare function assertValue(locator: Locator, value: string, options?: any): void;
225
+ declare function assertValue(locator: Locator, value: string, options?: { [key: string]: unknown }): void;
226
226
 
227
227
  /**
228
228
  * assertCount(locator, expected, { timeout? })
229
229
  *
230
230
  * Number of matches equals `expected`.
231
231
  */
232
- declare function assertCount(locator: Locator, count: number, options?: any): void;
232
+ declare function assertCount(locator: Locator, count: number, options?: { [key: string]: unknown }): void;
233
233
 
234
234
  /**
235
235
  * assertUrl(pattern, { timeout? })
236
236
  *
237
237
  * Current URL contains `pattern` (a string) or matches it (a /regex/, unanchored). A failure names the pattern as /source/flags.
238
238
  */
239
- declare function assertUrl(pattern: string | RegExp, options?: any): void;
239
+ declare function assertUrl(pattern: string | RegExp, options?: { [key: string]: unknown }): void;
240
240
 
241
241
  /**
242
242
  * assertJudge(locator, rubric)
@@ -250,7 +250,7 @@ declare function assertJudge(locator: Locator, rubric: string): void;
250
250
  *
251
251
  * The page (or an element) against the PNG baseline unotest/e2e/<scenario>.screenshots/<name>.png. A pixel differs when any channel differs by more than threshold (default 32); fails when the share of differing pixels is MORE than maxDiffRatio (default 0). mask: locators, ignore: rectangles in baseline pixels — both left out of the comparison. No baseline: fails and saves the snapshot as a candidate; accept with e2e --update-screenshots. On failure the run keeps expected / actual / diff.
252
252
  */
253
- declare function assertScreenshot(nameOrLocator: any, nameOrOptions?: any, options?: any): void;
253
+ declare function assertScreenshot(nameOrLocator: any, nameOrOptions?: any, options?: { [key: string]: unknown }): void;
254
254
 
255
255
  /**
256
256
  * assertEqual(actual, expected)
@@ -292,7 +292,7 @@ declare function setTestTimeout(ms: number): void;
292
292
  *
293
293
  * Keep matches by contained text or a nested child locator.
294
294
  */
295
- declare function filter(receiver: Locator, options: any): Locator;
295
+ declare function filter(receiver: Locator, options: { [key: string]: unknown }): Locator;
296
296
 
297
297
  /**
298
298
  * first(locator)
@@ -327,7 +327,7 @@ declare function randomNth(receiver: Locator): Locator;
327
327
  *
328
328
  * Capture the active page into the run's artifact dir; returns the project-relative path. For a PNG after EVERY step without calling it, set UNOTEST_STEP_SCREENSHOTS=1 in the run's environment.
329
329
  */
330
- declare function screenshot(name?: string, options?: any): string;
330
+ declare function screenshot(name?: string, options?: { [key: string]: unknown }): string;
331
331
 
332
332
  /**
333
333
  * note(label, value)
@@ -341,49 +341,49 @@ declare function note(label: string, value: any): void;
341
341
  *
342
342
  * What the active page wrote to its console, oldest first: `level` is log, info, warn, error or debug. Recorded from the moment the page opened, so act first, then ask. Extension pages (chrome-extension://) too. options: {level} (one level or a list), {since} (epoch ms, from nowMs()).
343
343
  */
344
- declare function consoleEntries(options?: any): any;
344
+ declare function consoleEntries(options?: { [key: string]: unknown }): any;
345
345
 
346
346
  /**
347
347
  * pageErrors({ since? }) → [{ message, stack }]
348
348
  *
349
349
  * Errors the active page threw and nothing caught (an uncaught exception, a rejected promise), oldest first; `stack` is empty when the browser gave none. options: {since} (epoch ms, from nowMs()).
350
350
  */
351
- declare function pageErrors(options?: any): any;
351
+ declare function pageErrors(options?: { [key: string]: unknown }): any;
352
352
 
353
353
  /**
354
354
  * assertNoConsoleErrors({ includePageErrors?, since? })
355
355
  *
356
356
  * FAIL when the active page logged console errors, or threw uncaught ones (unless {includePageErrors: false}), quoting the first three. With `since` (epoch ms, from nowMs()) only from then on.
357
357
  */
358
- declare function assertNoConsoleErrors(options?: any): void;
358
+ declare function assertNoConsoleErrors(options?: { [key: string]: unknown }): void;
359
359
 
360
360
  /**
361
361
  * evaluate(js, arg?) → any
362
362
  *
363
363
  * Run raw JS in the page context. Last resort — prefer typed helpers. Returns JSON-serializable values only. Extra arguments reach the body as: none → nothing, exactly one → the value itself, two or more → ONE array (destructure `([a, b]) => …`).
364
364
  */
365
- declare function evaluate(jsBody: string, ...args: unknown[]): any;
365
+ declare function evaluate(jsBody: any, ...args: unknown[]): any;
366
366
 
367
367
  /**
368
368
  * evaluateOnLocator(locator, js, ...args) → any
369
369
  *
370
370
  * Like evaluate, on the matched element: the body is called with the element, then the extra arguments by the same rule (`(el, x) => …`, two or more → `(el, [a, b]) => …`). Last resort — prefer typed getters.
371
371
  */
372
- declare function evaluateOnLocator(locator: Locator, jsBody: string, ...args: unknown[]): any;
372
+ declare function evaluateOnLocator(locator: Locator, jsBody: any, ...args: unknown[]): any;
373
373
 
374
374
  /**
375
375
  * setPage(index, options?)
376
376
  *
377
377
  * Switch the active tab/page by index (0-based) and bring it to front. {activate: false} switches only the tab the steps act on and leaves the visible tab as is.
378
378
  */
379
- declare function setPage(indexOrTitle: string | number, options?: any): void;
379
+ declare function setPage(indexOrTitle: string | number, options?: { [key: string]: unknown }): void;
380
380
 
381
381
  /**
382
382
  * waitForPage(options?) → number
383
383
  *
384
384
  * Wait for a tab the scenario has not been handed yet (window.open, target=_blank, an extension), switch to it and return its index. Counts a tab that opened before the call. {timeoutMs} defaults to the navigation timeout.
385
385
  */
386
- declare function waitForPage(options?: any): number;
386
+ declare function waitForPage(options?: { [key: string]: unknown }): number;
387
387
 
388
388
  /**
389
389
  * bringToFront(index?)
@@ -453,42 +453,42 @@ declare function exitFrame(): void;
453
453
  *
454
454
  * Navigate to a URL. `waitUntil`: 'load' | 'domcontentloaded' | 'networkidle'. Relative paths resolve against `baseUrl`.
455
455
  */
456
- declare function goto(url: string, options?: any): void;
456
+ declare function goto(url: string, options?: { [key: string]: unknown }): void;
457
457
 
458
458
  /**
459
459
  * reload({ waitUntil?, timeout? })
460
460
  *
461
461
  * Reload the current page.
462
462
  */
463
- declare function reload(options?: any): void;
463
+ declare function reload(options?: { [key: string]: unknown }): void;
464
464
 
465
465
  /**
466
466
  * goBack({ timeout? })
467
467
  *
468
468
  * Navigate back in history.
469
469
  */
470
- declare function goBack(): void;
470
+ declare function goBack(options?: { [key: string]: unknown }): void;
471
471
 
472
472
  /**
473
473
  * goForward({ timeout? })
474
474
  *
475
475
  * Navigate forward in history.
476
476
  */
477
- declare function goForward(): void;
477
+ declare function goForward(options?: { [key: string]: unknown }): void;
478
478
 
479
479
  /**
480
480
  * waitForUrl(pattern, { timeout? })
481
481
  *
482
482
  * Wait until the URL contains `pattern` (a string, substring match) or matches it (a /regex/, unanchored).
483
483
  */
484
- declare function waitForUrl(pattern: string | RegExp, options?: any): void;
484
+ declare function waitForUrl(pattern: string | RegExp, options?: { [key: string]: unknown }): void;
485
485
 
486
486
  /**
487
487
  * waitForNavigation({ timeout? })
488
488
  *
489
489
  * Wait for the next navigation event.
490
490
  */
491
- declare function waitForNavigation(options?: any): void;
491
+ declare function waitForNavigation(options?: { [key: string]: unknown }): void;
492
492
 
493
493
  /**
494
494
  * count(locator) → number
@@ -677,7 +677,7 @@ declare function urlParam(url: string, key: string): any;
677
677
  *
678
678
  * A number as a page writes it: '1 234,5', '1,234.56', '−12'. Spaces (NBSP too) group digits; with both ',' and '.' the last one is the decimal mark; one mark used twice groups. '1,234' and '1.234' read both ways and FAIL unless {decimal: ',' | '.'} says which. Units and currency ('440px', '€12') FAIL, quoting the input — cut the number out with textMatches first. A number passes through.
679
679
  */
680
- declare function toNumber(text: any, options?: any): number;
680
+ declare function toNumber(text: any, options?: { [key: string]: unknown }): number;
681
681
 
682
682
  /**
683
683
  * round(n, digits?) → number
@@ -691,7 +691,7 @@ declare function round(n: number, digits?: number): number;
691
691
  *
692
692
  * A number as text, via Intl.NumberFormat with digit grouping. Without a locale it is en-US on every machine: formatNumber(1234.5) → '1,234.5'. Another locale's output (its spaces and marks) comes from the ICU of the Node that runs it.
693
693
  */
694
- declare function formatNumber(n: number, options?: any): string;
694
+ declare function formatNumber(n: number, options?: { [key: string]: unknown }): string;
695
695
 
696
696
  /**
697
697
  * env(name, fallback?) → string | fallback | null
@@ -712,28 +712,28 @@ declare function shell(cmd: string, ...args: unknown[]): any;
712
712
  *
713
713
  * Poll a file (relative to config `shellCwd`) until it exists / contains a substring or regex, then return its content. options: {timeoutMs} (default 20s). The waitForText of background processes.
714
714
  */
715
- declare function waitForFile(path: string, pattern?: any, options?: any): string;
715
+ declare function waitForFile(path: string, pattern?: any, options?: { [key: string]: unknown }): string;
716
716
 
717
717
  /**
718
718
  * assertNoFile(path, pattern?, { withinMs })
719
719
  *
720
720
  * Mirror of waitForFile with inverted polarity: FAIL the moment the file exists (and matches pattern); pass when the window elapsed clean. withinMs required.
721
721
  */
722
- declare function assertNoFile(path: string, pattern?: any, options?: any): void;
722
+ declare function assertNoFile(path: string, pattern?: any, options?: { [key: string]: unknown }): void;
723
723
 
724
724
  /**
725
725
  * waitForJsonLine(path, filter, options?) → object
726
726
  *
727
727
  * Wait for a LINE of a JSONL file that matches every key of `filter` (strict equality, dot paths for nesting), then return it parsed. What a substring cannot express: JSON key order is not guaranteed. options: {timeoutMs} (default 20s).
728
728
  */
729
- declare function waitForJsonLine(path: string, filter: any, options?: any): any;
729
+ declare function waitForJsonLine(path: string, filter: any, options?: { [key: string]: unknown }): any;
730
730
 
731
731
  /**
732
732
  * assertNoJsonLine(path, filter, { withinMs })
733
733
  *
734
734
  * Negative twin of waitForJsonLine: FAIL the moment a matching line appears; pass when the window elapsed clean. withinMs required.
735
735
  */
736
- declare function assertNoJsonLine(path: string, filter: any, options?: any): void;
736
+ declare function assertNoJsonLine(path: string, filter: any, options?: { [key: string]: unknown }): void;
737
737
 
738
738
  /**
739
739
  * readJsonLine(path, filter) → object
@@ -754,7 +754,7 @@ declare function readJson(path: string): any;
754
754
  *
755
755
  * A whole file, read once: its text, or its bytes as base64 with {encoding: 'base64'}. Path is relative to config `shellCwd`, or absolute inside the project or to a file waitForDownload saved (its .path). FAILS at once when the path or a symlink leads out, the file is missing or the encoding is unknown.
756
756
  */
757
- declare function readFile(path: string, options?: any): string;
757
+ declare function readFile(path: string, options?: { [key: string]: unknown }): string;
758
758
 
759
759
  /**
760
760
  * readFileInfo(path) → object
@@ -768,7 +768,7 @@ declare function readFileInfo(path: string): any;
768
768
  *
769
769
  * Wait until AT LEAST `count` lines match, then return how many there are. `pattern` is a substring, a regex or a JSON key filter. options: {timeoutMs} (default 20s).
770
770
  */
771
- declare function waitForFileCount(path: string, pattern: any, count: number, options?: any): number;
771
+ declare function waitForFileCount(path: string, pattern: any, count: number, options?: { [key: string]: unknown }): number;
772
772
 
773
773
  /**
774
774
  * assertFileCount(path, pattern, count)
@@ -796,63 +796,63 @@ declare function dbExec(sql: string, ...args: unknown[]): number;
796
796
  *
797
797
  * HTTP call. `path` is relative — base is the config `apiBaseUrl`. Multipart: pass upload(...) as the body.
798
798
  */
799
- declare function apiCall(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS", path: string, body?: any, headers?: any, options?: any): any;
799
+ declare function apiCall(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS", path: string, body?: any, headers?: any, options?: { [key: string]: unknown }): any;
800
800
 
801
801
  /**
802
802
  * upload(path, options?) → UploadRef
803
803
  *
804
804
  * Multipart marker for apiCall's body (options: field, fields). Path is relative to the project root / config `uploadDir`.
805
805
  */
806
- declare function upload(path: string, options?: any): any;
806
+ declare function upload(path: string, options?: { [key: string]: unknown }): any;
807
807
 
808
808
  /**
809
809
  * locator(css, { hasText?, hasNotText?, has?, hasNot? }?)
810
810
  *
811
811
  * Match by raw CSS selector. Last resort — the linter warns on deep/brittle CSS. Options narrow the matches exactly as filter() does.
812
812
  */
813
- declare function locator(selector: string, options?: any): Locator;
813
+ declare function locator(selector: string, options?: { [key: string]: unknown }): Locator;
814
814
 
815
815
  /**
816
816
  * getByRole(role, { name?, exact?, checked?, disabled?, expanded?, includeHidden?, level?, pressed?, selected? })
817
817
  *
818
818
  * Match by ARIA role + accessible name. `name` accepts a string or `/regex/`; the state options narrow by ARIA state (`{disabled: false}` skips a disabled button). Any other key is refused.
819
819
  */
820
- declare function getByRole(role: string, options?: any): Locator;
820
+ declare function getByRole(role: string, options?: { [key: string]: unknown }): Locator;
821
821
 
822
822
  /**
823
823
  * getByText(text, { exact? })
824
824
  *
825
825
  * Match by visible text content.
826
826
  */
827
- declare function getByText(text: string | RegExp, options?: any): Locator;
827
+ declare function getByText(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
828
828
 
829
829
  /**
830
830
  * getByLabel(text, { exact? })
831
831
  *
832
832
  * Match a form control by its associated label.
833
833
  */
834
- declare function getByLabel(text: string | RegExp, options?: any): Locator;
834
+ declare function getByLabel(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
835
835
 
836
836
  /**
837
837
  * getByPlaceholder(text, { exact? })
838
838
  *
839
839
  * Match an input by its placeholder.
840
840
  */
841
- declare function getByPlaceholder(text: string | RegExp, options?: any): Locator;
841
+ declare function getByPlaceholder(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
842
842
 
843
843
  /**
844
844
  * getByAltText(text, { exact? })
845
845
  *
846
846
  * Match an image by its `alt` text.
847
847
  */
848
- declare function getByAltText(text: string | RegExp, options?: any): Locator;
848
+ declare function getByAltText(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
849
849
 
850
850
  /**
851
851
  * getByTitle(text, { exact? })
852
852
  *
853
853
  * Match by `title` attribute.
854
854
  */
855
- declare function getByTitle(text: string | RegExp, options?: any): Locator;
855
+ declare function getByTitle(text: string | RegExp, options?: { [key: string]: unknown }): Locator;
856
856
 
857
857
  /**
858
858
  * getByTestId(id)
@@ -936,7 +936,7 @@ declare function getLocalStorage(key: string): string;
936
936
  *
937
937
  * Set a cookie (options: path, domain, expires, httpOnly, secure, sameSite).
938
938
  */
939
- declare function setCookie(name: string, value: string, options?: any): void;
939
+ declare function setCookie(name: string, value: string, options?: { [key: string]: unknown }): void;
940
940
 
941
941
  /**
942
942
  * getCookie(name) → string
@@ -950,28 +950,28 @@ declare function getCookie(name: string): string;
950
950
  *
951
951
  * Wait for an element state: DOM presence ('visible' default, 'hidden', 'attached', 'detached') or interaction ('enabled' / 'disabled' — same probe as isEnabled, so aria-disabled counts).
952
952
  */
953
- declare function waitFor(locator: Locator, options?: any): void;
953
+ declare function waitFor(locator: Locator, options?: { [key: string]: unknown }): void;
954
954
 
955
955
  /**
956
956
  * waitForText(text, { first?, timeout? })
957
957
  *
958
958
  * Wait until `text` appears anywhere on the page. `first: true` waits for the first VISIBLE occurrence when the text is duplicated (otherwise duplicates fail strict mode).
959
959
  */
960
- declare function waitForText(text: string | RegExp, options?: any): void;
960
+ declare function waitForText(text: string | RegExp, options?: { [key: string]: unknown }): void;
961
961
 
962
962
  /**
963
963
  * waitForCount(locator, count, { exact?, timeout? })
964
964
  *
965
965
  * Poll until the locator matches AT LEAST `count` elements (`{exact: true}` for exactly). Default timeout 5000 ms.
966
966
  */
967
- declare function waitForCount(locator: Locator, count: number, options?: any): void;
967
+ declare function waitForCount(locator: Locator, count: number, options?: { [key: string]: unknown }): void;
968
968
 
969
969
  /**
970
970
  * waitForAnimations(locator, { timeout? })
971
971
  *
972
972
  * Wait until the element and its descendants have no animation still running — a dialog done fading in, a card done sliding. Infinite ones (spinners) and paused ones are not waited for. Default timeout 5000 ms; a timeout names the element and how many were left.
973
973
  */
974
- declare function waitForAnimations(locator: Locator, options?: any): void;
974
+ declare function waitForAnimations(locator: Locator, options?: { [key: string]: unknown }): void;
975
975
 
976
976
  /**
977
977
  * pause(ms)
@@ -985,7 +985,7 @@ declare function pause(ms: number): void;
985
985
  *
986
986
  * The first file the page downloaded that the scenario has not taken yet, saved with the run: `path` is absolute (read it with waitForFile), `name` is the name the site suggested. Downloads are recorded from the start, so click first, then call this. options: {timeoutMs} (default: the navigation timeout), {name} (substring or regex of the file name).
987
987
  */
988
- declare function waitForDownload(options?: any): any;
988
+ declare function waitForDownload(options?: { [key: string]: unknown }): any;
989
989
 
990
990
  /**
991
991
  * clockFreeze(iso)
@@ -1027,21 +1027,21 @@ declare function unmockRoute(glob?: string): void;
1027
1027
  *
1028
1028
  * Wait for a request matching `glob` and return it; `postDataJson` is the body read as JSON (null when it is not). On a mocked mask it also finds a request sent before the call, each one returned once; on any other mask only requests from the call on. Default timeout 20 s.
1029
1029
  */
1030
- declare function waitForRequest(glob: string, options?: any): any;
1030
+ declare function waitForRequest(glob: string, options?: { [key: string]: unknown }): any;
1031
1031
 
1032
1032
  /**
1033
1033
  * assertNoRequest(glob, { since? })
1034
1034
  *
1035
1035
  * FAIL if the recording abort at `glob` — mockRoute(glob, {abort: true, record: true}) — stopped any request; with `since` (epoch ms, from nowMs()) only from then on. A mask without a recording abort is an error, not a pass.
1036
1036
  */
1037
- declare function assertNoRequest(glob: string, options?: any): void;
1037
+ declare function assertNoRequest(glob: string, options?: { [key: string]: unknown }): void;
1038
1038
 
1039
1039
  /**
1040
1040
  * waitForServiceWorker({ timeoutMs?, url? }) → string
1041
1041
  *
1042
1042
  * Wait for a browser extension's service worker and return its URL (`chrome-extension://<id>/sw.js`); a running one comes back at once. `url` — substring or /regex/ when several extensions run. Extensions load only with `launch.userDataDir`: without it the call fails at once.
1043
1043
  */
1044
- declare function waitForServiceWorker(options?: any): string;
1044
+ declare function waitForServiceWorker(options?: { [key: string]: unknown }): string;
1045
1045
 
1046
1046
  /**
1047
1047
  * extensionId() → string
@@ -1053,9 +1053,9 @@ declare function extensionId(): string;
1053
1053
  /**
1054
1054
  * evaluateInServiceWorker(js, ...args) → any
1055
1055
  *
1056
- * Like evaluate, in the extension's service worker — the way to `chrome.storage`, `chrome.tabs`, `chrome.runtime`. Same argument and JSON-return rules; waits for the worker if none runs. Each call finds the worker anew: MV3 stops an idle one.
1056
+ * Like evaluate, in the extension's service worker — the way to `chrome.storage`, `chrome.tabs`, `chrome.runtime`. `js` is a function or a string; same argument, page-code and JSON-return rules; waits for the worker if none runs. Each call finds the worker anew: MV3 stops an idle one.
1057
1057
  */
1058
- declare function evaluateInServiceWorker(jsBody: string, ...args: unknown[]): any;
1058
+ declare function evaluateInServiceWorker(jsBody: any, ...args: unknown[]): any;
1059
1059
 
1060
1060
  /** step(label, [options,] body)
1061
1061
  *
@@ -1072,3 +1072,20 @@ declare namespace step {
1072
1072
  function soft(label: string, body: () => void): void;
1073
1073
  function soft(label: string, options: { tag: unknown }, body: () => void): void;
1074
1074
  }
1075
+
1076
+ /** teardown(label, body)
1077
+ *
1078
+ * Registers a block that gives the stand back. Nothing runs where it
1079
+ * stands; the block plays after the test, passed or failed, newest
1080
+ * first, and sees the values as they are then. */
1081
+ declare function teardown(label: string, body: () => void): void;
1082
+
1083
+ /** waitUntil(() => condition, options?)
1084
+ *
1085
+ * Runs the body again and again until it gives a truthy value, and
1086
+ * gives that value back. Only a falsy value is retried: an error fails
1087
+ * at once. */
1088
+ declare function waitUntil<T>(
1089
+ condition: () => T,
1090
+ options?: { timeoutMs?: number; intervalMs?: number; label?: string },
1091
+ ): T;