@unotest/web 0.45.0 → 0.46.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 +37 -3
- package/README.md +2 -0
- package/dist/config/schema.d.ts +205 -18
- package/dist/config/schema.js +1 -1
- package/dist/driver/index.d.ts +5 -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/web-dsl-language-service.js +1 -1
- package/dist/inspection/page-inject.d.ts +1 -1
- package/dist/{interfaces-OvnJKELk.d.ts → interfaces-CYoL4Taq.d.ts} +42 -2
- 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.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/dsl-reference.md +248 -12
- package/package.json +9 -8
- package/types/unotest-dsl.d.ts +68 -5
|
@@ -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 } from '../interfaces-
|
|
3
|
+
import { E as ElementHint } from '../interfaces-CYoL4Taq.js';
|
|
4
4
|
import '../config/schema.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -88,6 +88,10 @@ interface LaunchOptions {
|
|
|
88
88
|
* persistent context, which every `newContext()` then returns
|
|
89
89
|
* (`config.launch.userDataDir`). */
|
|
90
90
|
userDataDir?: string;
|
|
91
|
+
/** A new browser on a new profile directory for every context
|
|
92
|
+
* (`config.launch.profile`); each `newContext()` then needs
|
|
93
|
+
* `ContextOptions.profileDir`. */
|
|
94
|
+
profile?: "per-test";
|
|
91
95
|
/** Extra browser command-line arguments (`config.launch.args`). */
|
|
92
96
|
args?: string[];
|
|
93
97
|
}
|
|
@@ -139,6 +143,10 @@ interface ContextOptions {
|
|
|
139
143
|
* `UNOTEST_DEFAULT_NAVIGATION_TIMEOUT_MS` env overrides.
|
|
140
144
|
*/
|
|
141
145
|
defaultNavigationTimeoutMs?: number;
|
|
146
|
+
/** The directory a `profile: "per-test"` browser starts on. The caller
|
|
147
|
+
* makes it and decides whether it stays; given to any other launch it
|
|
148
|
+
* is refused. */
|
|
149
|
+
profileDir?: string;
|
|
142
150
|
}
|
|
143
151
|
interface ActionTimeout {
|
|
144
152
|
/** Override default action timeout (D-7 actionability wait). Milliseconds. */
|
|
@@ -324,6 +332,11 @@ interface WebDriver {
|
|
|
324
332
|
wsEndpoint(): string | undefined;
|
|
325
333
|
connectShared(wsEndpoint: string, browser: LaunchOptions["browser"]): Promise<void>;
|
|
326
334
|
attachExisting(opts?: AttachOptions): Promise<DriverContext>;
|
|
335
|
+
/** True while the browser `connectShared` joined is still there. A run
|
|
336
|
+
* on `launch.profile: "per-test"` closes it with each test and starts
|
|
337
|
+
* the next one at the same endpoint, so a joined client asks this
|
|
338
|
+
* before it follows the run. False when nothing is joined. */
|
|
339
|
+
sharedBrowserConnected(): boolean;
|
|
327
340
|
}
|
|
328
341
|
/** One captured network request/response, recorded only under
|
|
329
342
|
* `UNOTEST_NETWORK`. `status`/`ok` come from the response; `failureText`
|
|
@@ -545,10 +558,16 @@ interface DriverContext {
|
|
|
545
558
|
* runner can pull the tail when a test fails.
|
|
546
559
|
*/
|
|
547
560
|
consoleEntries(): ReadonlyArray<{
|
|
548
|
-
level:
|
|
561
|
+
level: ConsoleLevel;
|
|
549
562
|
text: string;
|
|
550
563
|
timestamp: string;
|
|
551
564
|
}>;
|
|
565
|
+
/** The console lines and uncaught errors of the ACTIVE page, oldest
|
|
566
|
+
* first. Recorded always, from the moment the page opened — unlike
|
|
567
|
+
* `consoleEntries()`, which only `UNOTEST_CONSOLE` fills — so a
|
|
568
|
+
* scenario that clicks and then asks finds what the click logged.
|
|
569
|
+
* Extension pages (`chrome-extension://`) are pages like any other. */
|
|
570
|
+
pageConsole(): PageConsole;
|
|
552
571
|
/**
|
|
553
572
|
* Snapshot of network request/response entries captured since context
|
|
554
573
|
* creation, oldest first. Populated only when `UNOTEST_NETWORK` is on (else
|
|
@@ -787,5 +806,26 @@ interface AncestorHint {
|
|
|
787
806
|
/** A single stable, semantic class token (not a hash / utility class). */
|
|
788
807
|
className?: string;
|
|
789
808
|
}
|
|
809
|
+
type ConsoleLevel = "log" | "info" | "warn" | "error" | "debug";
|
|
810
|
+
/** One console line of a page: `url` is the page's at the time, `at`
|
|
811
|
+
* epoch ms — the scale `nowMs()` gives a scenario. */
|
|
812
|
+
interface PageConsoleEntry {
|
|
813
|
+
level: ConsoleLevel;
|
|
814
|
+
text: string;
|
|
815
|
+
url: string;
|
|
816
|
+
at: number;
|
|
817
|
+
}
|
|
818
|
+
/** An error the page threw and nothing caught (`pageerror`). `stack` is
|
|
819
|
+
* empty when the browser gave none. */
|
|
820
|
+
interface PageErrorEntry {
|
|
821
|
+
message: string;
|
|
822
|
+
stack: string;
|
|
823
|
+
url: string;
|
|
824
|
+
at: number;
|
|
825
|
+
}
|
|
826
|
+
interface PageConsole {
|
|
827
|
+
entries: readonly PageConsoleEntry[];
|
|
828
|
+
errors: readonly PageErrorEntry[];
|
|
829
|
+
}
|
|
790
830
|
|
|
791
|
-
export { type AttachOptions as A, type BoundingBox as B, type CaptureFrame as C, type DriverContext as D, type ElementHint as E, type FillOptions as F, type GotoOptions as G, type HoverOptions as H, type LocatorValue as L, type NetworkEntry as N, type
|
|
831
|
+
export { type AttachOptions as A, type BoundingBox as B, type CaptureFrame as C, type DriverContext as D, type ElementHint as E, type FillOptions as F, type GotoOptions as G, type HoverOptions as H, type LocatorValue as L, type NetworkEntry as N, type PageConsole as P, type ReloadOptions as R, type ScreenshotOptions as S, type Viewport as V, type WebDriver as W, type CaptureRect as a, type LaunchOptions as b, type ContextOptions as c, type ActionTimeout as d, type CheckOptions as e, type ClickOptions as f, type CookieOptions as g, type DriverPage as h, type NavigationOptions as i, type PressOptions as j, type SelectOptions as k, type ViewportSize as l, type WaitOptions as m, type WaitState as n, type DriverDownload as o, type LocatorStep as p, appendStep as q, describeLocator as r, isLocatorValue as s, rootedAt as t };
|