@unotest/web 0.49.1 → 0.49.2
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 +55 -3
- package/README.md +5 -4
- package/bin/unotest-web.js +10 -9
- package/dist/config/schema.d.ts +11 -11
- 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 +4 -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/inspection/page-inject.js +15 -9
- package/dist/{interfaces-D5ePwBX6.d.ts → interfaces-mlRtu8mL.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.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 +15 -1
- package/guides/dsl-reference.md +94 -14
- package/package.json +8 -8
- package/types/unotest-dsl.d.ts +29 -15
|
@@ -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-mlRtu8mL.js';
|
|
4
4
|
import '../config/schema.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
@@ -2775,15 +2775,21 @@ function pasteValue(el, pasted) {
|
|
|
2775
2775
|
__name(pasteValue, "pasteValue");
|
|
2776
2776
|
function readCheckedState(el) {
|
|
2777
2777
|
globalThis.__name ??= (fn) => fn;
|
|
2778
|
-
const
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2778
|
+
const own = /* @__PURE__ */ __name((node) => {
|
|
2779
|
+
const input = node;
|
|
2780
|
+
if (input.tagName === "INPUT" && (input.type === "checkbox" || input.type === "radio")) {
|
|
2781
|
+
return input.checked;
|
|
2782
|
+
}
|
|
2783
|
+
const role = node.getAttribute("role");
|
|
2784
|
+
if (role === "checkbox" || role === "radio" || role === "switch") {
|
|
2785
|
+
return node.getAttribute("aria-checked") === "true";
|
|
2786
|
+
}
|
|
2787
|
+
return null;
|
|
2788
|
+
}, "own");
|
|
2789
|
+
const state = own(el);
|
|
2790
|
+
if (state !== null) return state;
|
|
2791
|
+
const control = el.closest("label")?.control;
|
|
2792
|
+
return control ? own(control) : null;
|
|
2787
2793
|
}
|
|
2788
2794
|
__name(readCheckedState, "readCheckedState");
|
|
2789
2795
|
function readDisabledState(el) {
|
|
@@ -9,6 +9,13 @@ type LocatorStep = {
|
|
|
9
9
|
role: string;
|
|
10
10
|
name?: Matcher;
|
|
11
11
|
exact?: boolean;
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
expanded?: boolean;
|
|
15
|
+
includeHidden?: boolean;
|
|
16
|
+
level?: number;
|
|
17
|
+
pressed?: boolean;
|
|
18
|
+
selected?: boolean;
|
|
12
19
|
} | {
|
|
13
20
|
kind: 'getByText';
|
|
14
21
|
text: Matcher;
|
|
@@ -629,6 +636,9 @@ interface DriverPage {
|
|
|
629
636
|
clipboardPaste(loc: LocatorValue, text: string): Promise<void>;
|
|
630
637
|
count(loc: LocatorValue): Promise<number>;
|
|
631
638
|
textContent(loc: LocatorValue): Promise<string | null>;
|
|
639
|
+
/** `textContent` of every match, in DOM order; `[]` when nothing
|
|
640
|
+
* matches. One read, no wait — a query, not an assertion. */
|
|
641
|
+
textContents(loc: LocatorValue): Promise<string[]>;
|
|
632
642
|
/** RENDERED text: line breaks preserved, `display:none` subtrees and
|
|
633
643
|
* `<script>`/`<style>` excluded. What a human reads on screen —
|
|
634
644
|
* `textContent` is the raw source-order concatenation and answers a
|