@unotest/web 0.53.0 → 0.55.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/CHANGELOG.md +94 -4
- package/README.md +42 -12
- package/dist/config/schema.d.ts +6 -3
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +2 -2
- package/dist/driver/index.js +1 -1
- package/dist/dsl/index.d.ts +19 -2
- package/dist/dsl/index.js +1 -1
- package/dist/dsl/v8/scenario-worker.js +1 -1
- package/dist/dsl/web-dsl-language-service.js +1 -1
- package/dist/inspection/page-inject.d.ts +9 -4
- package/dist/inspection/page-inject.js +3 -2
- package/dist/{interfaces-BU-PQbt4.d.ts → interfaces-CNvyInrY.d.ts} +10 -0
- package/dist/mcp/server.js +1 -1
- package/dist/runner/cli.js +1 -1
- package/dist/runner/init/chrome-probe.js +1 -1
- package/dist/runner/init.d.ts +1 -1
- package/dist/runner/init.js +1 -1
- package/dist/runner/install-chromium.js +1 -1
- package/dist/runner/prepare-fix.js +1 -1
- package/dist/runner/scaffold-workspace.js +1 -1
- package/dist/runner/serve-fixture.js +1 -1
- package/dist/runner/web-runner-adapter.js +1 -1
- package/guides/agent-integration.md +17 -3
- package/guides/dsl-reference.md +81 -6
- package/llms.txt +2 -1
- package/package.json +8 -8
- package/types/unotest-dsl.d.ts +9 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InjectedDomHelpers } from '@unotest/grounder-client/dom-walker';
|
|
2
2
|
import { PickerMode } from '@unotest/protocol';
|
|
3
|
-
import { E as ElementHint, A as AnimationInfo } from '../interfaces-
|
|
3
|
+
import { E as ElementHint, A as AnimationInfo } from '../interfaces-CNvyInrY.js';
|
|
4
4
|
import '../config/schema.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -477,13 +477,18 @@ declare function readLocalStorageItem(key: string): string | null;
|
|
|
477
477
|
declare function writeDocumentHidden([hidden, announce]: [boolean, boolean]): void;
|
|
478
478
|
/** Make the document's scripts see the app launched in `mode` (`standalone`
|
|
479
479
|
* for one added to the home screen): `matchMedia('(display-mode: …)')`
|
|
480
|
-
* answers for that mode, and `
|
|
481
|
-
*
|
|
480
|
+
* answers for that mode, and with `navigatorStandalone` (WebKit)
|
|
481
|
+
* `navigator.standalone` says whether it is standalone. The caller names
|
|
482
|
+
* the engine rather than the page probing for the property: Playwright's
|
|
483
|
+
* WebKit has it on macOS and not on Linux, where boxes run. No engine
|
|
482
484
|
* emulates the feature itself, so CSS `@media (display-mode: …)` and a
|
|
483
485
|
* query combining it with other features still see the browser; the
|
|
484
486
|
* config reference says so. The answer is the real list object (listeners,
|
|
485
487
|
* `onchange`) of a query that is always true or always false. */
|
|
486
|
-
declare function writeDisplayMode(
|
|
488
|
+
declare function writeDisplayMode(args: {
|
|
489
|
+
mode: string;
|
|
490
|
+
navigatorStandalone: boolean;
|
|
491
|
+
}): void;
|
|
487
492
|
/** Read every identifying attribute off a live element (role inferred from
|
|
488
493
|
* tag + ARIA, accname approximated). Returns a structured raw hint. */
|
|
489
494
|
declare function inspectElementRaw(el: Element, args: {
|
|
@@ -2883,7 +2883,8 @@ function writeDocumentHidden([hidden, announce]) {
|
|
|
2883
2883
|
if (!hidden) window.dispatchEvent(new FocusEvent("focus"));
|
|
2884
2884
|
}
|
|
2885
2885
|
__name(writeDocumentHidden, "writeDocumentHidden");
|
|
2886
|
-
function writeDisplayMode(
|
|
2886
|
+
function writeDisplayMode(args) {
|
|
2887
|
+
const { mode } = args;
|
|
2887
2888
|
globalThis.__name ??= (fn) => fn;
|
|
2888
2889
|
const original = window.matchMedia.bind(window);
|
|
2889
2890
|
function askedMode(query) {
|
|
@@ -2901,7 +2902,7 @@ function writeDisplayMode(mode) {
|
|
|
2901
2902
|
Object.defineProperty(list, "media", { configurable: true, value: query });
|
|
2902
2903
|
return list;
|
|
2903
2904
|
};
|
|
2904
|
-
if (
|
|
2905
|
+
if (args.navigatorStandalone) {
|
|
2905
2906
|
Object.defineProperty(navigator, "standalone", { configurable: true, get: /* @__PURE__ */ __name(() => mode === "standalone", "get") });
|
|
2906
2907
|
}
|
|
2907
2908
|
}
|
|
@@ -398,6 +398,8 @@ interface PageNetworkEntry {
|
|
|
398
398
|
/** 0 when the request failed before any response. */
|
|
399
399
|
status: number;
|
|
400
400
|
ok: boolean;
|
|
401
|
+
/** The response's headers, names in lower case; empty without a response. */
|
|
402
|
+
headers: Readonly<Record<string, string>>;
|
|
401
403
|
failureText?: string;
|
|
402
404
|
/** A `mockRoute` answered or aborted it. */
|
|
403
405
|
mocked?: true;
|
|
@@ -694,6 +696,14 @@ interface DriverContext {
|
|
|
694
696
|
* always (500 entries per context), unlike `networkEntries()`.
|
|
695
697
|
*/
|
|
696
698
|
pageNetwork(): ReadonlyArray<PageNetworkEntry>;
|
|
699
|
+
/**
|
|
700
|
+
* An entry of the active page `accept` takes — of those recorded, the
|
|
701
|
+
* one sent first; else the first to finish — or null after `timeoutMs`.
|
|
702
|
+
* What to take is the caller's choice: the driver hands entries over.
|
|
703
|
+
*/
|
|
704
|
+
waitForPageResponse(accept: (entry: PageNetworkEntry) => boolean, opts: {
|
|
705
|
+
timeoutMs: number;
|
|
706
|
+
}): Promise<PageNetworkEntry | null>;
|
|
697
707
|
/**
|
|
698
708
|
* The first download of this context the scenario has not taken yet,
|
|
699
709
|
* waiting up to `timeoutMs` (default: the navigation budget) for one.
|