@burdenoff/ui-engine 2026.1127.2 → 2026.1127.3
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/README.md +33 -3
- package/dist/capture.js +3 -2
- package/dist/dom-runtime/actions.d.ts +65 -0
- package/dist/dom-runtime/iife.d.ts +1 -0
- package/dist/dom-runtime/index.d.ts +7 -0
- package/dist/dom-runtime/runtime.d.ts +79 -0
- package/dist/dom-runtime.d.ts +2 -0
- package/dist/dom-runtime.iife.js +1 -0
- package/dist/dom-runtime.js +535 -0
- package/dist/{index-n5amgh31.js → index-2kgsgn1c.js} +1 -1
- package/dist/{index-phd8yhyg.js → index-bnvmt4wf.js} +7 -5
- package/dist/{index-c6pmt2rg.js → index-cs6acyjn.js} +6 -59
- package/dist/index-mgztm37r.js +57 -0
- package/dist/index-q1b0j9yr.js +1349 -0
- package/dist/{index-tqffkt91.js → index-zwrxw3zp.js} +5 -3
- package/dist/index.js +8 -6
- package/dist/recording.js +1 -1
- package/dist/replay.js +2 -2
- package/dist/script.js +2 -2
- package/dist/target/aria.d.ts +31 -0
- package/dist/target/dom.d.ts +35 -0
- package/dist/target/index.d.ts +13 -0
- package/dist/target/markers.d.ts +18 -0
- package/dist/target/methods.d.ts +52 -0
- package/dist/target/resolve.d.ts +46 -0
- package/dist/target/snapshot.d.ts +57 -0
- package/dist/target/text.d.ts +23 -0
- package/dist/target/types.d.ts +88 -0
- package/dist/target.d.ts +2 -0
- package/dist/target.js +92 -0
- package/dist/testing/fixtures/ambiguous.d.ts +7 -0
- package/dist/testing/fixtures/iframe.d.ts +6 -0
- package/dist/testing/fixtures/index.d.ts +26 -0
- package/dist/testing/fixtures/invoices-v2.d.ts +8 -0
- package/dist/testing/fixtures/invoices-v3.d.ts +7 -0
- package/dist/testing/fixtures/invoices.d.ts +6 -0
- package/dist/testing/fixtures/login.d.ts +6 -0
- package/dist/testing/fixtures/shadow.d.ts +7 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/mount.d.ts +18 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +324 -0
- package/package.json +21 -5
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
containsCredential,
|
|
3
|
-
containsCredentialInUrl,
|
|
4
2
|
sha256Hex2,
|
|
5
3
|
targetFingerprint2,
|
|
6
4
|
RecordingError2,
|
|
7
5
|
parseRecording2
|
|
8
|
-
} from "./index-
|
|
6
|
+
} from "./index-cs6acyjn.js";
|
|
7
|
+
import {
|
|
8
|
+
containsCredential,
|
|
9
|
+
containsCredentialInUrl
|
|
10
|
+
} from "./index-mgztm37r.js";
|
|
9
11
|
|
|
10
12
|
// src/script/types.ts
|
|
11
13
|
var UI_EXPRESSION_OPS2 = [
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
REDACTED2,
|
|
3
|
-
redactCredentials2,
|
|
4
2
|
sha256Hex2,
|
|
5
3
|
RECORDING_VERSION2,
|
|
6
4
|
MAX_RECORDED_STEPS2,
|
|
@@ -13,11 +11,11 @@ import {
|
|
|
13
11
|
RecordingError2,
|
|
14
12
|
parseRecording2,
|
|
15
13
|
isSavedStepAuthor2
|
|
16
|
-
} from "./index-
|
|
14
|
+
} from "./index-cs6acyjn.js";
|
|
17
15
|
import {
|
|
18
16
|
maskUrl2,
|
|
19
17
|
captureRecording2
|
|
20
|
-
} from "./index-
|
|
18
|
+
} from "./index-bnvmt4wf.js";
|
|
21
19
|
import {
|
|
22
20
|
MAX_SNAPSHOT_NODES2,
|
|
23
21
|
readSnapshotNodes2,
|
|
@@ -31,7 +29,7 @@ import {
|
|
|
31
29
|
finishFallback2,
|
|
32
30
|
markFallbackAsked2,
|
|
33
31
|
replayReasons2
|
|
34
|
-
} from "./index-
|
|
32
|
+
} from "./index-2kgsgn1c.js";
|
|
35
33
|
import {
|
|
36
34
|
UI_EXPRESSION_OPS2,
|
|
37
35
|
UI_ANCHOR_RELATIONS2,
|
|
@@ -118,7 +116,11 @@ import {
|
|
|
118
116
|
fromRemoteBrowserSteps2,
|
|
119
117
|
fromRecording2,
|
|
120
118
|
toRecording2
|
|
121
|
-
} from "./index-
|
|
119
|
+
} from "./index-zwrxw3zp.js";
|
|
120
|
+
import {
|
|
121
|
+
REDACTED2,
|
|
122
|
+
redactCredentials2
|
|
123
|
+
} from "./index-mgztm37r.js";
|
|
122
124
|
export {
|
|
123
125
|
BROWSER_STEP_ACTIONS2 as BROWSER_STEP_ACTIONS,
|
|
124
126
|
CAPABILITY_IDS2 as CAPABILITY_IDS,
|
package/dist/recording.js
CHANGED
package/dist/replay.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
finishFallback2,
|
|
7
7
|
markFallbackAsked2,
|
|
8
8
|
replayReasons2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-2kgsgn1c.js";
|
|
10
10
|
import"./index-3v887c75.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-cs6acyjn.js";
|
|
12
12
|
export {
|
|
13
13
|
afterReplayCall2 as afterReplayCall,
|
|
14
14
|
finishFallback2 as finishFallback,
|
package/dist/script.js
CHANGED
|
@@ -84,8 +84,8 @@ import {
|
|
|
84
84
|
fromRemoteBrowserSteps2,
|
|
85
85
|
fromRecording2,
|
|
86
86
|
toRecording2
|
|
87
|
-
} from "./index-
|
|
88
|
-
import"./index-
|
|
87
|
+
} from "./index-zwrxw3zp.js";
|
|
88
|
+
import"./index-cs6acyjn.js";
|
|
89
89
|
export {
|
|
90
90
|
BROWSER_STEP_ACTIONS2 as BROWSER_STEP_ACTIONS,
|
|
91
91
|
CAPABILITY_IDS2 as CAPABILITY_IDS,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Longest accessible name kept; longer names are cut. */
|
|
2
|
+
export declare const MAX_NAME_LENGTH = 512;
|
|
3
|
+
/** Longest visible text read from one element (the `getText` read limit). */
|
|
4
|
+
export declare const MAX_VISIBLE_TEXT = 65536;
|
|
5
|
+
/**
|
|
6
|
+
* Visibility known from elsewhere: a document rebuilt from a tree snapshot has
|
|
7
|
+
* no styles, so the snapshot's hidden flags decide what text a person saw.
|
|
8
|
+
* Undefined means "compute it from the element's styles".
|
|
9
|
+
*/
|
|
10
|
+
export interface TextProbe {
|
|
11
|
+
isVisible?: (element: Element) => boolean | undefined;
|
|
12
|
+
}
|
|
13
|
+
/** The element's role: the first token of its `role` attribute, else its implicit role, else ''. */
|
|
14
|
+
export declare function roleOf(element: Element): string;
|
|
15
|
+
/** True when the element is typed content: an editing host or a text area, or inside one (rendered tree). */
|
|
16
|
+
export declare function isTypedContent(element: Element): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The element's accessible name, whitespace collapsed and cut to
|
|
19
|
+
* `MAX_NAME_LENGTH`. Form fields never take their name from their value.
|
|
20
|
+
*/
|
|
21
|
+
export declare function accessibleName(element: Element, probe?: TextProbe): string;
|
|
22
|
+
/**
|
|
23
|
+
* The name an element has from its labels alone (aria-labelledby, aria-label,
|
|
24
|
+
* associated labels, alt, legend, caption, title, placeholder), never from its
|
|
25
|
+
* content. Reports use it for typed content, whose text is a form-field value.
|
|
26
|
+
*/
|
|
27
|
+
export declare function labelName(element: Element, probe?: TextProbe): string;
|
|
28
|
+
/** The text a person reads in the element (its content, never a form-field value), whitespace collapsed. */
|
|
29
|
+
export declare function visibleText(element: Element, probe?: TextProbe): string;
|
|
30
|
+
/** True when the role and name are the ones asked for (names compared after normalisation). */
|
|
31
|
+
export declare function matchesRoleAndName(element: Element, role: string, name: string, probe?: TextProbe): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SENSITIVE_MARKERS } from './markers.js';
|
|
2
|
+
import type { WebRect } from './types.js';
|
|
3
|
+
/** Where a search starts: a document, a shadow root or an element. */
|
|
4
|
+
export type WebSearchRoot = Document | ShadowRoot | Element;
|
|
5
|
+
/** Overrides for documents without layout (a test DOM, a document rebuilt from a snapshot). */
|
|
6
|
+
export interface ElementStateProbe {
|
|
7
|
+
/** The element's bounds in the top viewport, or null to measure it. */
|
|
8
|
+
rectOf?: (element: Element) => WebRect | null;
|
|
9
|
+
/** Whether the element is visible, or undefined to compute it. */
|
|
10
|
+
isVisible?: (element: Element) => boolean | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** The parent in the rendered tree: the assigned slot of slotted content, else the parent element, else a shadow root's host. */
|
|
13
|
+
export declare function parentAcrossShadow(element: Element): Element | null;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a person can see the element: it is connected, neither it nor an
|
|
16
|
+
* ancestor (across shadow roots) is `hidden`, `display: none` or a hidden
|
|
17
|
+
* input, and its own computed visibility is not hidden. Where the browser
|
|
18
|
+
* offers `checkVisibility`, that must agree too.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isElementVisible(element: Element, probe?: ElementStateProbe): boolean;
|
|
21
|
+
/** Whether the element accepts input: not disabled (natively, through a disabled fieldset or control), not `aria-disabled`, not `inert`. */
|
|
22
|
+
export declare function isElementEnabled(element: Element): boolean;
|
|
23
|
+
/** The element's bounds, rounded to whole pixels, with the offset of the frames it sits in added. */
|
|
24
|
+
export declare function elementRect(element: Element, probe?: ElementStateProbe, offset?: WebRect): WebRect;
|
|
25
|
+
/** Every element under a root, in document order (the root element itself included). */
|
|
26
|
+
export declare function elementsUnder(root: WebSearchRoot): Element[];
|
|
27
|
+
export { SENSITIVE_MARKERS };
|
|
28
|
+
/** True when a field name reads like a secret (the capture rule for element names). */
|
|
29
|
+
export declare function isSecretFieldName(name: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* True when the element holds or shows data that must never leave the page in
|
|
32
|
+
* a snapshot or a report: password, one-time-code and card fields, fields named
|
|
33
|
+
* like secrets, and any element (or descendant of one) marked sensitive.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isSensitiveElement(element: Element): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@burdenoff/ui-engine/target`: the multi-method web target resolver (plan
|
|
3
|
+
* P1-01). It works on any DOM (a content script, a CDP isolated world, a test
|
|
4
|
+
* DOM or a document rebuilt from a tree snapshot) and reads no globals.
|
|
5
|
+
*/
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
export { hasSensitiveMarker } from './markers.js';
|
|
8
|
+
export { MAX_COMPARED_TEXT, clip, containsText, editDistance, normaliseText, sameText, textSimilarity, } from './text.js';
|
|
9
|
+
export { MAX_NAME_LENGTH, MAX_VISIBLE_TEXT, type TextProbe, accessibleName, isTypedContent, labelName, matchesRoleAndName, roleOf, visibleText, } from './aria.js';
|
|
10
|
+
export { type ElementStateProbe, SENSITIVE_MARKERS, type WebSearchRoot, elementRect, elementsUnder, isElementEnabled, isElementVisible, isSecretFieldName, isSensitiveElement, parentAcrossShadow, } from './dom.js';
|
|
11
|
+
export { ANCHOR_MARGIN_PX, DEFAULT_FUZZY_THRESHOLD, FUZZY_MARGIN, INTERACTIVE_ROLES, MAX_XPATH_RESULTS, type MethodMatch, type ScoredElement, matchMethod, relationDistance, } from './methods.js';
|
|
12
|
+
export { type ResolveWebTargetOptions, type WebFrameEntry, describeCandidate, enterFrames, resolveWebTarget, } from './resolve.js';
|
|
13
|
+
export { DEFAULT_SNAPSHOT_MAX_NODES, type HydratedSnapshot, MAX_SNAPSHOT_DEPTH, MAX_SNAPSHOT_TEXT, type SerializeTreeSnapshotOptions, UI_TREE_SNAPSHOT_VERSION, type UiTreeSnapshot, type UiTreeSnapshotChild, type UiTreeSnapshotNode, hydrateTreeSnapshot, serializeTreeSnapshot, snapshotUrl, } from './snapshot.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Attributes a page or an author sets to mark an element, and everything inside it, as sensitive. */
|
|
2
|
+
export declare const SENSITIVE_MARKERS: readonly ["data-fg-sensitive", "data-sensitive", "data-private"];
|
|
3
|
+
/** True when the element itself carries a sensitive marker. */
|
|
4
|
+
export declare function hasSensitiveMarker(element: Element): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The slot an element or a text node renders in: `assignedSlot` where the DOM has it, else
|
|
7
|
+
* the slot of the parent's open shadow root that lists the element among its
|
|
8
|
+
* assigned nodes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assignedSlotOf(element: Element | Text): Element | null;
|
|
11
|
+
/**
|
|
12
|
+
* The element a node hangs from in the rendered (flat) tree: its assigned slot,
|
|
13
|
+
* its parent, a shadow root's host, or the frame element of a same-origin frame
|
|
14
|
+
* document.
|
|
15
|
+
*/
|
|
16
|
+
export declare function containerOf(element: Element): Element | null;
|
|
17
|
+
/** True when the element or any ancestor, across shadow roots and same-origin frames, carries a sensitive marker. */
|
|
18
|
+
export declare function isMarkedSensitive(element: Element): boolean;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One matcher per target method (spec 05 section 3.1). A matcher finds the
|
|
3
|
+
* elements a method describes under a search root; the resolver then filters
|
|
4
|
+
* them by state and decides whether exactly one is left.
|
|
5
|
+
*
|
|
6
|
+
* Matchers that only filter (`role`, `css`, `testId`, `xpath`, `text`) return a
|
|
7
|
+
* list in document order. Matchers that rank (`fuzzy` by similarity, the
|
|
8
|
+
* geometric `anchor` relations by distance) return scores; the resolver takes
|
|
9
|
+
* the best one only when it is clearly better than the next.
|
|
10
|
+
*/
|
|
11
|
+
import type { UiAnchorMethod, UiTargetMethod } from '../script/types.js';
|
|
12
|
+
import { type ElementStateProbe, type WebSearchRoot } from './dom.js';
|
|
13
|
+
import type { WebRect } from './types.js';
|
|
14
|
+
/** Default lowest similarity of the fuzzy method (the schema documents 0.8). */
|
|
15
|
+
export declare const DEFAULT_FUZZY_THRESHOLD = 0.8;
|
|
16
|
+
/** How much better than the runner-up the best fuzzy score must be; closer scores are ambiguous. */
|
|
17
|
+
export declare const FUZZY_MARGIN = 0.05;
|
|
18
|
+
/** How much nearer than the runner-up (in CSS pixels) the best anchored element must be; closer is ambiguous. */
|
|
19
|
+
export declare const ANCHOR_MARGIN_PX = 4;
|
|
20
|
+
/** Most elements an XPath result is read for. */
|
|
21
|
+
export declare const MAX_XPATH_RESULTS = 1000;
|
|
22
|
+
/** Roles an anchor method considers when it names no role: the controls a step acts on. */
|
|
23
|
+
export declare const INTERACTIVE_ROLES: Set<string>;
|
|
24
|
+
/** A scored element: higher scores are better (similarity, or minus a distance). */
|
|
25
|
+
export interface ScoredElement {
|
|
26
|
+
element: Element;
|
|
27
|
+
score: number;
|
|
28
|
+
}
|
|
29
|
+
export type MethodMatch = {
|
|
30
|
+
kind: 'list';
|
|
31
|
+
elements: Element[];
|
|
32
|
+
nth?: number;
|
|
33
|
+
overflow?: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'ranked';
|
|
36
|
+
scored: ScoredElement[];
|
|
37
|
+
margin: number;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'invalid';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'unsupported';
|
|
42
|
+
};
|
|
43
|
+
export interface MatchContext {
|
|
44
|
+
root: WebSearchRoot;
|
|
45
|
+
probe?: ElementStateProbe;
|
|
46
|
+
/** The resolver's state filter. A text hit that fails it does not hide a matching ancestor. */
|
|
47
|
+
keep?: (element: Element) => boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Distance from the anchor to the element along the relation, or null when the element is not in that relation. */
|
|
50
|
+
export declare function relationDistance(relation: UiAnchorMethod['relation'], anchor: WebRect, element: WebRect): number | null;
|
|
51
|
+
/** Run one method under the root. */
|
|
52
|
+
export declare function matchMethod(method: UiTargetMethod, context: MatchContext): MethodMatch;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The multi-method web target resolver (spec 05 section 3, plan P1-01).
|
|
3
|
+
*
|
|
4
|
+
* A target is an ordered list of methods. The resolver follows the frame and
|
|
5
|
+
* shadow-root chain, then tries the methods in order and uses the first that
|
|
6
|
+
* finds exactly one element in the required state. It records what every
|
|
7
|
+
* method found, and reports a fallback when a later method succeeded.
|
|
8
|
+
*
|
|
9
|
+
* It never picks the first of several elements silently. Several matches are
|
|
10
|
+
* resolved only by a rule the target states: an explicit `nth` on the `role`
|
|
11
|
+
* and `text` methods, or a clearly best score for `fuzzy` (similarity) and the
|
|
12
|
+
* spatial `anchor` relations (distance). Otherwise the method is ambiguous and
|
|
13
|
+
* the next method is tried; when no method finds exactly one element, the
|
|
14
|
+
* result is `ELEMENT_AMBIGUOUS` with up to five candidates. A failed resolution
|
|
15
|
+
* carries no element, so a caller has nothing to act on.
|
|
16
|
+
*
|
|
17
|
+
* Page content is untrusted. It is only compared here; candidate names are cut
|
|
18
|
+
* to 200 characters and sensitive elements report no name.
|
|
19
|
+
*/
|
|
20
|
+
import type { UiTarget, UiTargetMethod } from '../script/types.js';
|
|
21
|
+
import { type ElementStateProbe, type WebSearchRoot } from './dom.js';
|
|
22
|
+
import { type WebCandidate, type WebElementState, type WebFrameProblem, type WebRect, type WebTargetResolution } from './types.js';
|
|
23
|
+
export interface ResolveWebTargetOptions extends ElementStateProbe {
|
|
24
|
+
/** What a matched element must be. Absent means `interactable`. */
|
|
25
|
+
state?: WebElementState;
|
|
26
|
+
}
|
|
27
|
+
/** Where the frame chain led: the search root inside it, the frames' offset, and whether a frame is hidden. */
|
|
28
|
+
export interface WebFrameEntry {
|
|
29
|
+
root: WebSearchRoot;
|
|
30
|
+
offset: WebRect;
|
|
31
|
+
/** A frame element of the chain is not visible, so nothing inside it is. */
|
|
32
|
+
hidden: boolean;
|
|
33
|
+
/** A frame element of the chain does not accept input (inert, aria-disabled), so nothing inside it does. */
|
|
34
|
+
disabled: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Follow `target.frame`: each selector names one iframe (entered through its document) or one open shadow host. */
|
|
37
|
+
export declare function enterFrames(root: WebSearchRoot, chain: readonly string[] | undefined, probe?: ElementStateProbe): WebFrameEntry | WebFrameProblem;
|
|
38
|
+
/** The report form of an element: role, name (cut, empty for sensitive elements), bounds and the matching method. */
|
|
39
|
+
export declare function describeCandidate(element: Element, method: UiTargetMethod, methodIndex: number, offset: WebRect, probe?: ElementStateProbe): WebCandidate;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a target under a root (a document, a shadow root or an element).
|
|
42
|
+
* Returns the element with the method that found it, or a failure with the
|
|
43
|
+
* error code, the attempts and, for an ambiguous or non-interactable target,
|
|
44
|
+
* up to five candidates.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveWebTarget(root: WebSearchRoot, target: UiTarget, options?: ResolveWebTargetOptions): WebTargetResolution<Element>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ElementStateProbe } from './dom.js';
|
|
2
|
+
export declare const UI_TREE_SNAPSHOT_VERSION = 1;
|
|
3
|
+
/** Default most nodes (elements and texts) a snapshot keeps; the rest is cut and `truncated` is set. */
|
|
4
|
+
export declare const DEFAULT_SNAPSHOT_MAX_NODES = 5000;
|
|
5
|
+
/** Deepest element nesting kept. */
|
|
6
|
+
export declare const MAX_SNAPSHOT_DEPTH = 64;
|
|
7
|
+
/** Longest text or attribute value kept. */
|
|
8
|
+
export declare const MAX_SNAPSHOT_TEXT = 500;
|
|
9
|
+
/** A snapshot element: `t` tag, `a` attributes, `c` children, `s` open shadow-root children, `f` frame document, `r` bounds, `h` hidden. */
|
|
10
|
+
export interface UiTreeSnapshotNode {
|
|
11
|
+
t: string;
|
|
12
|
+
a?: Record<string, string>;
|
|
13
|
+
c?: UiTreeSnapshotChild[];
|
|
14
|
+
s?: UiTreeSnapshotChild[];
|
|
15
|
+
f?: UiTreeSnapshotNode;
|
|
16
|
+
r?: [number, number, number, number];
|
|
17
|
+
h?: 1;
|
|
18
|
+
}
|
|
19
|
+
/** A child is an element or a text. */
|
|
20
|
+
export type UiTreeSnapshotChild = UiTreeSnapshotNode | string;
|
|
21
|
+
export interface UiTreeSnapshot {
|
|
22
|
+
snapshotVersion: typeof UI_TREE_SNAPSHOT_VERSION;
|
|
23
|
+
/** The page URL without query or fragment. */
|
|
24
|
+
url: string;
|
|
25
|
+
title: string;
|
|
26
|
+
viewport: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
};
|
|
30
|
+
/** The `html` element (its `head` is left out). */
|
|
31
|
+
root: UiTreeSnapshotNode;
|
|
32
|
+
nodeCount: number;
|
|
33
|
+
truncated: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface SerializeTreeSnapshotOptions extends ElementStateProbe {
|
|
36
|
+
/** Most nodes kept. Absent means `DEFAULT_SNAPSHOT_MAX_NODES`. */
|
|
37
|
+
maxNodes?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A URL as a snapshot keeps it: http(s) and relative URLs only, without user
|
|
41
|
+
* information, query or fragment, cut after a reset-style path segment, and
|
|
42
|
+
* with recognisable credentials replaced. Anything else is dropped (null).
|
|
43
|
+
*/
|
|
44
|
+
export declare function snapshotUrl(raw: string): string | null;
|
|
45
|
+
/** Serialise a live document into a value-free tree snapshot. */
|
|
46
|
+
export declare function serializeTreeSnapshot(document: Document, options?: SerializeTreeSnapshotOptions): UiTreeSnapshot;
|
|
47
|
+
/** The result of hydration: the probe that reports recorded bounds and visibility to `resolveWebTarget`. */
|
|
48
|
+
export interface HydratedSnapshot {
|
|
49
|
+
probe: Required<ElementStateProbe>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Rebuild a snapshot into an empty document (its current content is replaced)
|
|
53
|
+
* and return the probe to resolve targets against it. The document must be
|
|
54
|
+
* inert (a `DOMParser` document or a server-side DOM with scripts off); the
|
|
55
|
+
* snapshot holds no scripts or handlers in any case.
|
|
56
|
+
*/
|
|
57
|
+
export declare function hydrateTreeSnapshot(document: Document, snapshot: UiTreeSnapshot): HydratedSnapshot;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text comparison for target methods: the same normalisation the Stewards
|
|
3
|
+
* resolver uses (NFKC, whitespace collapsed, trimmed, case-insensitive), plus a
|
|
4
|
+
* similarity score for the fuzzy method.
|
|
5
|
+
*/
|
|
6
|
+
/** Longest text compared by the fuzzy method; longer names are cut before scoring. */
|
|
7
|
+
export declare const MAX_COMPARED_TEXT = 256;
|
|
8
|
+
/** NFKC, whitespace collapsed, trimmed and lower-cased. */
|
|
9
|
+
export declare function normaliseText(value: string | null | undefined): string;
|
|
10
|
+
/** True when two texts are equal after normalisation. */
|
|
11
|
+
export declare function sameText(a: string | null | undefined, b: string | null | undefined): boolean;
|
|
12
|
+
/** True when `haystack` contains `needle` after normalisation. An empty needle never matches. */
|
|
13
|
+
export declare function containsText(haystack: string | null | undefined, needle: string | null | undefined): boolean;
|
|
14
|
+
/** Levenshtein edit distance (insert, delete, substitute), with one row of memory. */
|
|
15
|
+
export declare function editDistance(a: string, b: string): number;
|
|
16
|
+
/**
|
|
17
|
+
* Similarity of two texts between 0 and 1: one minus the edit distance over the
|
|
18
|
+
* longer length, after normalisation. Two empty texts score 0, so an unnamed
|
|
19
|
+
* element never matches a fuzzy name.
|
|
20
|
+
*/
|
|
21
|
+
export declare function textSimilarity(a: string | null | undefined, b: string | null | undefined): number;
|
|
22
|
+
/** Cut a text for reports (candidates, attempts); page text is untrusted and never grows a report unbounded. */
|
|
23
|
+
export declare function clip(value: string, max: number): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of the multi-method web target resolver (spec 05 section 3, plan P1-01).
|
|
3
|
+
*
|
|
4
|
+
* Everything a resolution reports is plain JSON (no element references), so the
|
|
5
|
+
* DOM runtime can hand it across an isolated-world or CDP boundary unchanged.
|
|
6
|
+
*/
|
|
7
|
+
import type { UiTargetMethodKind } from '../script/types.js';
|
|
8
|
+
/** Bounds in CSS pixels, relative to the top viewport (frame offsets added). */
|
|
9
|
+
export interface WebRect {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
/** The error codes a resolution can end with (spec 05 section 10). The interpreter maps them to node error families. */
|
|
16
|
+
export declare const WEB_TARGET_ERROR_CODES: readonly ["ELEMENT_NOT_FOUND", "ELEMENT_AMBIGUOUS", "ELEMENT_NOT_INTERACTABLE"];
|
|
17
|
+
export type WebTargetErrorCode = (typeof WEB_TARGET_ERROR_CODES)[number];
|
|
18
|
+
/** Most candidates an ambiguous resolution lists (spec 19 section 11). */
|
|
19
|
+
export declare const MAX_CANDIDATES = 5;
|
|
20
|
+
/** Longest candidate name reported; page text is untrusted and is cut (threat review U7). */
|
|
21
|
+
export declare const MAX_CANDIDATE_NAME = 200;
|
|
22
|
+
/**
|
|
23
|
+
* What an element must be for a method to count it:
|
|
24
|
+
* - `interactable`: visible and enabled (the default, for steps that act);
|
|
25
|
+
* - `visible`: visible, enabled or not (for steps that read);
|
|
26
|
+
* - `attached`: present in the document, visible or not.
|
|
27
|
+
*/
|
|
28
|
+
export type WebElementState = 'interactable' | 'visible' | 'attached';
|
|
29
|
+
/**
|
|
30
|
+
* What one method found:
|
|
31
|
+
* - `found`: exactly one element;
|
|
32
|
+
* - `none`: no element in the required state;
|
|
33
|
+
* - `ambiguous`: several, and the method had no rule to pick one;
|
|
34
|
+
* - `notInteractable`: elements were found but none is visible and enabled;
|
|
35
|
+
* - `invalid`: the method cannot run (a selector the browser rejects, an unusable attribute name);
|
|
36
|
+
* - `unsupported`: the page cannot run this method (no XPath engine, for example);
|
|
37
|
+
* - `disabled`: the method is switched off in the target;
|
|
38
|
+
* - `notTried`: an earlier method already found the element.
|
|
39
|
+
*/
|
|
40
|
+
export type WebMethodOutcome = 'found' | 'none' | 'ambiguous' | 'notInteractable' | 'invalid' | 'unsupported' | 'disabled' | 'notTried';
|
|
41
|
+
/** The result of one method, in target order. */
|
|
42
|
+
export interface WebMethodAttempt {
|
|
43
|
+
index: number;
|
|
44
|
+
method: UiTargetMethodKind;
|
|
45
|
+
outcome: WebMethodOutcome;
|
|
46
|
+
/** Elements the method matched in the required state. */
|
|
47
|
+
matches: number;
|
|
48
|
+
}
|
|
49
|
+
/** One element a method matched, as an ambiguity report lists it. */
|
|
50
|
+
export interface WebCandidate {
|
|
51
|
+
role: string;
|
|
52
|
+
/** The accessible name, cut to `MAX_CANDIDATE_NAME`. Sensitive elements report an empty name. */
|
|
53
|
+
name: string;
|
|
54
|
+
bounds: WebRect;
|
|
55
|
+
/** The method that matched this element. */
|
|
56
|
+
method: UiTargetMethodKind;
|
|
57
|
+
/** The position of that method in the target. */
|
|
58
|
+
methodIndex: number;
|
|
59
|
+
}
|
|
60
|
+
/** Why the frame and shadow-root chain could not be followed. */
|
|
61
|
+
export interface WebFrameProblem {
|
|
62
|
+
/** Position in `target.frame` of the selector that failed. */
|
|
63
|
+
index: number;
|
|
64
|
+
reason: 'notFound' | 'ambiguous' | 'invalid' | 'notAFrame' | 'inaccessible';
|
|
65
|
+
}
|
|
66
|
+
/** A resolution that found exactly one element. */
|
|
67
|
+
export interface WebTargetFound<E> {
|
|
68
|
+
status: 'found';
|
|
69
|
+
element: E;
|
|
70
|
+
method: UiTargetMethodKind;
|
|
71
|
+
methodIndex: number;
|
|
72
|
+
/** True when a method other than the first enabled one found the element (spec 05: method drift is reported). */
|
|
73
|
+
fallback: boolean;
|
|
74
|
+
candidate: WebCandidate;
|
|
75
|
+
attempts: WebMethodAttempt[];
|
|
76
|
+
}
|
|
77
|
+
/** A resolution that did not find exactly one element. Nothing may be acted on. */
|
|
78
|
+
export interface WebTargetFailed {
|
|
79
|
+
status: 'failed';
|
|
80
|
+
code: WebTargetErrorCode;
|
|
81
|
+
/** Up to `MAX_CANDIDATES` elements, for `ELEMENT_AMBIGUOUS` and `ELEMENT_NOT_INTERACTABLE`; empty for `ELEMENT_NOT_FOUND`. */
|
|
82
|
+
candidates: WebCandidate[];
|
|
83
|
+
/** How many elements the reported method matched (may exceed the candidates listed). */
|
|
84
|
+
candidateCount: number;
|
|
85
|
+
attempts: WebMethodAttempt[];
|
|
86
|
+
frame?: WebFrameProblem;
|
|
87
|
+
}
|
|
88
|
+
export type WebTargetResolution<E = Element> = WebTargetFound<E> | WebTargetFailed;
|
package/dist/target.d.ts
ADDED
package/dist/target.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WEB_TARGET_ERROR_CODES2,
|
|
3
|
+
MAX_CANDIDATES2,
|
|
4
|
+
MAX_CANDIDATE_NAME2,
|
|
5
|
+
SENSITIVE_MARKERS2,
|
|
6
|
+
hasSensitiveMarker2,
|
|
7
|
+
MAX_COMPARED_TEXT2,
|
|
8
|
+
normaliseText2,
|
|
9
|
+
sameText2,
|
|
10
|
+
containsText2,
|
|
11
|
+
editDistance2,
|
|
12
|
+
textSimilarity2,
|
|
13
|
+
clip2,
|
|
14
|
+
MAX_NAME_LENGTH3,
|
|
15
|
+
MAX_VISIBLE_TEXT2,
|
|
16
|
+
roleOf2,
|
|
17
|
+
isTypedContent2,
|
|
18
|
+
accessibleName2,
|
|
19
|
+
labelName2,
|
|
20
|
+
visibleText2,
|
|
21
|
+
matchesRoleAndName2,
|
|
22
|
+
parentAcrossShadow2,
|
|
23
|
+
isElementVisible2,
|
|
24
|
+
isElementEnabled2,
|
|
25
|
+
elementRect2,
|
|
26
|
+
elementsUnder2,
|
|
27
|
+
isSecretFieldName2,
|
|
28
|
+
isSensitiveElement2,
|
|
29
|
+
DEFAULT_FUZZY_THRESHOLD2,
|
|
30
|
+
FUZZY_MARGIN2,
|
|
31
|
+
ANCHOR_MARGIN_PX2,
|
|
32
|
+
MAX_XPATH_RESULTS2,
|
|
33
|
+
INTERACTIVE_ROLES2,
|
|
34
|
+
relationDistance2,
|
|
35
|
+
matchMethod2,
|
|
36
|
+
enterFrames2,
|
|
37
|
+
describeCandidate2,
|
|
38
|
+
resolveWebTarget2,
|
|
39
|
+
UI_TREE_SNAPSHOT_VERSION2,
|
|
40
|
+
DEFAULT_SNAPSHOT_MAX_NODES2,
|
|
41
|
+
MAX_SNAPSHOT_DEPTH2,
|
|
42
|
+
MAX_SNAPSHOT_TEXT2,
|
|
43
|
+
snapshotUrl2,
|
|
44
|
+
serializeTreeSnapshot2,
|
|
45
|
+
hydrateTreeSnapshot2
|
|
46
|
+
} from "./index-q1b0j9yr.js";
|
|
47
|
+
export {
|
|
48
|
+
ANCHOR_MARGIN_PX2 as ANCHOR_MARGIN_PX,
|
|
49
|
+
DEFAULT_FUZZY_THRESHOLD2 as DEFAULT_FUZZY_THRESHOLD,
|
|
50
|
+
DEFAULT_SNAPSHOT_MAX_NODES2 as DEFAULT_SNAPSHOT_MAX_NODES,
|
|
51
|
+
FUZZY_MARGIN2 as FUZZY_MARGIN,
|
|
52
|
+
INTERACTIVE_ROLES2 as INTERACTIVE_ROLES,
|
|
53
|
+
MAX_CANDIDATES2 as MAX_CANDIDATES,
|
|
54
|
+
MAX_CANDIDATE_NAME2 as MAX_CANDIDATE_NAME,
|
|
55
|
+
MAX_COMPARED_TEXT2 as MAX_COMPARED_TEXT,
|
|
56
|
+
MAX_NAME_LENGTH3 as MAX_NAME_LENGTH,
|
|
57
|
+
MAX_SNAPSHOT_DEPTH2 as MAX_SNAPSHOT_DEPTH,
|
|
58
|
+
MAX_SNAPSHOT_TEXT2 as MAX_SNAPSHOT_TEXT,
|
|
59
|
+
MAX_VISIBLE_TEXT2 as MAX_VISIBLE_TEXT,
|
|
60
|
+
MAX_XPATH_RESULTS2 as MAX_XPATH_RESULTS,
|
|
61
|
+
SENSITIVE_MARKERS2 as SENSITIVE_MARKERS,
|
|
62
|
+
UI_TREE_SNAPSHOT_VERSION2 as UI_TREE_SNAPSHOT_VERSION,
|
|
63
|
+
WEB_TARGET_ERROR_CODES2 as WEB_TARGET_ERROR_CODES,
|
|
64
|
+
accessibleName2 as accessibleName,
|
|
65
|
+
clip2 as clip,
|
|
66
|
+
containsText2 as containsText,
|
|
67
|
+
describeCandidate2 as describeCandidate,
|
|
68
|
+
editDistance2 as editDistance,
|
|
69
|
+
elementRect2 as elementRect,
|
|
70
|
+
elementsUnder2 as elementsUnder,
|
|
71
|
+
enterFrames2 as enterFrames,
|
|
72
|
+
hasSensitiveMarker2 as hasSensitiveMarker,
|
|
73
|
+
hydrateTreeSnapshot2 as hydrateTreeSnapshot,
|
|
74
|
+
isElementEnabled2 as isElementEnabled,
|
|
75
|
+
isElementVisible2 as isElementVisible,
|
|
76
|
+
isSecretFieldName2 as isSecretFieldName,
|
|
77
|
+
isSensitiveElement2 as isSensitiveElement,
|
|
78
|
+
isTypedContent2 as isTypedContent,
|
|
79
|
+
labelName2 as labelName,
|
|
80
|
+
matchMethod2 as matchMethod,
|
|
81
|
+
matchesRoleAndName2 as matchesRoleAndName,
|
|
82
|
+
normaliseText2 as normaliseText,
|
|
83
|
+
parentAcrossShadow2 as parentAcrossShadow,
|
|
84
|
+
relationDistance2 as relationDistance,
|
|
85
|
+
resolveWebTarget2 as resolveWebTarget,
|
|
86
|
+
roleOf2 as roleOf,
|
|
87
|
+
sameText2 as sameText,
|
|
88
|
+
serializeTreeSnapshot2 as serializeTreeSnapshot,
|
|
89
|
+
snapshotUrl2 as snapshotUrl,
|
|
90
|
+
textSimilarity2 as textSimilarity,
|
|
91
|
+
visibleText2 as visibleText
|
|
92
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPA playground fixture `ambiguous`: two identical "Save" buttons (same tag,
|
|
3
|
+
* class and name) in two sections, and a visible counter of saved changes.
|
|
4
|
+
* A step that targets "the Save button" must fail with both candidates listed
|
|
5
|
+
* and must leave the counter at 0. The inline script only counts clicks.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AMBIGUOUS_HTML = "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Invoice editor - RPA playground</title>\n</head>\n<body>\n<main>\n <h1>Invoice editor</h1>\n <section id=\"header-section\">\n <h2>Invoice header</h2>\n <label for=\"customer\">Customer</label>\n <input id=\"customer\" name=\"customer\" type=\"text\">\n <button class=\"save\" type=\"button\">Save</button>\n </section>\n <section id=\"lines-section\">\n <h2>Line items</h2>\n <label for=\"line-1\">Line 1</label>\n <input id=\"line-1\" name=\"line1\" type=\"text\">\n <button class=\"save\" type=\"button\">Save</button>\n </section>\n <p>Saved changes: <output id=\"saved-count\" aria-label=\"Saved changes\">0</output></p>\n</main>\n<script>\n for (const button of document.querySelectorAll('button.save')) {\n button.addEventListener('click', () => {\n const counter = document.getElementById('saved-count');\n counter.textContent = String(Number(counter.textContent) + 1);\n });\n }\n</script>\n</body>\n</html>\n";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPA playground fixture `iframe`: a payment form inside a same-origin frame.
|
|
3
|
+
* Targets reach it through `frame: ['iframe#payment-frame']`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const IFRAME_INNER_HTML = "<!doctype html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><title>Payment</title></head>\n<body>\n <form aria-label=\"Payment\">\n <label for=\"amount\">Amount</label>\n <input id=\"amount\" name=\"amount\" type=\"text\">\n <button id=\"pay\" type=\"button\">Pay now</button>\n </form>\n</body>\n</html>\n";
|
|
6
|
+
export declare const IFRAME_HTML: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies of the RPA playground fixture pages (plan P0-08, "Fixtures"), for
|
|
3
|
+
* tests that run the resolver, the DOM runtime or the interpreter against the
|
|
4
|
+
* same pages the live suites use. The live copies are served at
|
|
5
|
+
* `https://www.fluidgrids.ai/playground/rpa/<name>.html`.
|
|
6
|
+
*/
|
|
7
|
+
import { AMBIGUOUS_HTML } from './ambiguous.js';
|
|
8
|
+
import { IFRAME_HTML, IFRAME_INNER_HTML } from './iframe.js';
|
|
9
|
+
import { INVOICES_V2_HTML } from './invoices-v2.js';
|
|
10
|
+
import { INVOICES_V3_HTML } from './invoices-v3.js';
|
|
11
|
+
import { INVOICES_HTML } from './invoices.js';
|
|
12
|
+
import { LOGIN_HTML } from './login.js';
|
|
13
|
+
import { SHADOW_HTML } from './shadow.js';
|
|
14
|
+
export { AMBIGUOUS_HTML, IFRAME_HTML, IFRAME_INNER_HTML, INVOICES_HTML, INVOICES_V2_HTML, INVOICES_V3_HTML, LOGIN_HTML, SHADOW_HTML, };
|
|
15
|
+
/** The fixture pages by name (the file name on the playground, without `.html`). */
|
|
16
|
+
export declare const RPA_FIXTURES: {
|
|
17
|
+
readonly invoices: "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Invoices - RPA playground</title>\n</head>\n<body>\n<header>\n <nav aria-label=\"Portal menu\">\n <a id=\"nav-home\" href=\"/playground/rpa/\">Home</a>\n <a id=\"nav-invoices\" href=\"/playground/rpa/invoices.html\" aria-current=\"page\">Invoices</a>\n <a id=\"nav-settings\" href=\"/playground/rpa/settings.html\">Settings</a>\n </nav>\n</header>\n<main>\n <h1>Invoices</h1>\n <form id=\"invoice-search\" aria-label=\"Invoice search\" action=\"/playground/rpa/invoices.html\">\n <label for=\"invoice-number\">Invoice number</label>\n <input id=\"invoice-number\" name=\"invoiceNumber\" data-testid=\"invoice-number\" type=\"text\">\n <label for=\"invoice-status\">Status</label>\n <select id=\"invoice-status\" name=\"status\" data-testid=\"invoice-status\">\n <option value=\"\">Any</option>\n <option value=\"paid\">Paid</option>\n <option value=\"due\">Due</option>\n </select>\n <button id=\"search-btn\" class=\"btn search\" data-testid=\"search\" type=\"submit\">Search</button>\n </form>\n <table id=\"results\" aria-label=\"Results\">\n <caption>Results</caption>\n <thead><tr><th>Invoice</th><th>Status</th><th>Amount</th><th>File</th></tr></thead>\n <tbody>\n <tr data-invoice=\"INV-1041\"><td>INV-1041</td><td class=\"status\">Paid</td><td>120.00</td><td><a class=\"download\" href=\"/playground/rpa/files/INV-1041.pdf\">Download</a></td></tr>\n <tr data-invoice=\"INV-1042\"><td>INV-1042</td><td class=\"status\">Due</td><td>87.50</td><td><a class=\"download\" href=\"/playground/rpa/files/INV-1042.pdf\">Download</a></td></tr>\n </tbody>\n </table>\n</main>\n</body>\n</html>\n";
|
|
18
|
+
readonly 'invoices-v2': "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Invoices - RPA playground (v2)</title>\n</head>\n<body>\n<div class=\"shell\">\n <aside class=\"side\">\n <ul class=\"menu\" role=\"list\">\n <li><span class=\"menu-entry\" role=\"link\" tabindex=\"0\" data-qa=\"menu-invoices\">Invoices</span></li>\n <li><a class=\"menu-link\" href=\"/playground/rpa/\">Home</a></li>\n <li><a class=\"menu-link\" href=\"/playground/rpa/settings.html\">Settings</a></li>\n </ul>\n </aside>\n <section class=\"content\">\n <h1 class=\"page-title\">Invoices</h1>\n <form class=\"filters\" aria-label=\"Invoice search\" action=\"/playground/rpa/invoices-v2.html\">\n <div class=\"toolbar\">\n <button class=\"primary-action\" data-qa=\"run-search\" type=\"submit\">Search</button>\n </div>\n <div class=\"field\">\n <label for=\"f-ref\">Invoice number</label>\n <input id=\"f-ref\" name=\"ref\" data-qa=\"ref\" type=\"text\">\n </div>\n <div class=\"field\">\n <label for=\"f-state\">Status</label>\n <select id=\"f-state\" name=\"state\">\n <option value=\"\">Any</option>\n <option value=\"paid\">Paid</option>\n <option value=\"due\">Due</option>\n </select>\n </div>\n </form>\n <table class=\"grid\" aria-label=\"Results\">\n <thead><tr><th>Invoice</th><th>Amount</th><th>Status</th><th>File</th></tr></thead>\n <tbody>\n <tr><td>INV-1041</td><td>120.00</td><td>Paid</td><td><a class=\"dl\" href=\"/playground/rpa/files/INV-1041.pdf\">Download</a></td></tr>\n <tr><td>INV-1042</td><td>87.50</td><td>Due</td><td><a class=\"dl\" href=\"/playground/rpa/files/INV-1042.pdf\">Download</a></td></tr>\n </tbody>\n </table>\n </section>\n</div>\n</body>\n</html>\n";
|
|
19
|
+
readonly 'invoices-v3': "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Invoices - RPA playground (v3)</title>\n</head>\n<body>\n<div class=\"shell\">\n <aside class=\"side\">\n <ul class=\"menu\" role=\"list\">\n <li><a class=\"menu-link\" href=\"/playground/rpa/\">Home</a></li>\n <li><span class=\"menu-entry\" role=\"link\" tabindex=\"0\" data-qa=\"menu-invoices\">All invoices</span></li>\n <li><a class=\"menu-link\" href=\"/playground/rpa/settings.html\">Settings</a></li>\n </ul>\n </aside>\n <section class=\"content\">\n <h1 class=\"page-title\">Invoices</h1>\n <form class=\"filters\" aria-label=\"Invoice search\" action=\"/playground/rpa/invoices-v3.html\">\n <div class=\"toolbar\">\n <button class=\"primary-action\" data-qa=\"run-search\" type=\"submit\">Search…</button>\n <button class=\"secondary-action\" data-qa=\"reset-search\" type=\"reset\">Reset filters</button>\n </div>\n <div class=\"field\">\n <label for=\"f-ref\">Invoice number *</label>\n <input id=\"f-ref\" name=\"ref\" data-qa=\"ref\" type=\"text\" required>\n </div>\n <div class=\"field\">\n <label for=\"f-date\">Invoice date</label>\n <input id=\"f-date\" name=\"date\" type=\"text\">\n </div>\n </form>\n <table class=\"grid\" aria-label=\"Results\">\n <thead><tr><th>Invoice</th><th>Amount</th><th>Status</th><th>File</th></tr></thead>\n <tbody>\n <tr><td>INV-1041</td><td>120.00</td><td>Paid</td><td><a class=\"dl\" href=\"/playground/rpa/files/INV-1041.pdf\">Download</a></td></tr>\n <tr><td>INV-1042</td><td>87.50</td><td>Due</td><td><a class=\"dl\" href=\"/playground/rpa/files/INV-1042.pdf\">Download</a></td></tr>\n </tbody>\n </table>\n </section>\n</div>\n</body>\n</html>\n";
|
|
20
|
+
readonly ambiguous: "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Invoice editor - RPA playground</title>\n</head>\n<body>\n<main>\n <h1>Invoice editor</h1>\n <section id=\"header-section\">\n <h2>Invoice header</h2>\n <label for=\"customer\">Customer</label>\n <input id=\"customer\" name=\"customer\" type=\"text\">\n <button class=\"save\" type=\"button\">Save</button>\n </section>\n <section id=\"lines-section\">\n <h2>Line items</h2>\n <label for=\"line-1\">Line 1</label>\n <input id=\"line-1\" name=\"line1\" type=\"text\">\n <button class=\"save\" type=\"button\">Save</button>\n </section>\n <p>Saved changes: <output id=\"saved-count\" aria-label=\"Saved changes\">0</output></p>\n</main>\n<script>\n for (const button of document.querySelectorAll('button.save')) {\n button.addEventListener('click', () => {\n const counter = document.getElementById('saved-count');\n counter.textContent = String(Number(counter.textContent) + 1);\n });\n }\n</script>\n</body>\n</html>\n";
|
|
21
|
+
readonly iframe: string;
|
|
22
|
+
readonly shadow: "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Shadow DOM - RPA playground</title>\n</head>\n<body>\n<main>\n <h1>Invoice card</h1>\n <button type=\"button\">Approve</button>\n <invoice-card id=\"card\">\n <template shadowrootmode=\"open\">\n <h2>INV-1042</h2>\n <label for=\"note\">Note</label>\n <input id=\"note\" name=\"note\" type=\"text\">\n <button type=\"button\" part=\"approve\">Approve</button>\n </template>\n </invoice-card>\n</main>\n</body>\n</html>\n";
|
|
23
|
+
readonly login: "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"robots\" content=\"noindex, nofollow\">\n<title>Sign in - RPA playground</title>\n</head>\n<body>\n<main>\n <h1>Sign in</h1>\n <form aria-label=\"Sign in\" action=\"/playground/rpa/invoices.html\">\n <label for=\"username\">Email</label>\n <input id=\"username\" name=\"username\" type=\"email\" autocomplete=\"username\">\n <label for=\"password\">Password</label>\n <input id=\"password\" name=\"password\" type=\"password\" autocomplete=\"current-password\">\n <label for=\"otp\">One-time code</label>\n <input id=\"otp\" name=\"otp\" type=\"text\" autocomplete=\"one-time-code\" inputmode=\"numeric\">\n <label for=\"comment\">Comment</label>\n <textarea id=\"comment\" name=\"comment\"></textarea>\n <button id=\"sign-in\" type=\"submit\">Sign in</button>\n </form>\n <p data-sensitive>Recovery phrase: <span id=\"phrase\">apple banana cherry</span></p>\n</main>\n</body>\n</html>\n";
|
|
24
|
+
};
|
|
25
|
+
export type RpaFixtureName = keyof typeof RPA_FIXTURES;
|
|
26
|
+
export declare const RPA_FIXTURE_NAMES: RpaFixtureName[];
|