@e2edev/agent-device 0.1.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/LICENSE +21 -0
- package/README.md +131 -0
- package/dist/backend.d.ts +16 -0
- package/dist/backend.d.ts.map +1 -0
- package/dist/backend.js +66 -0
- package/dist/backend.js.map +1 -0
- package/dist/device.d.ts +69 -0
- package/dist/device.d.ts.map +1 -0
- package/dist/device.js +77 -0
- package/dist/device.js.map +1 -0
- package/dist/errors.d.ts +25 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +72 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/locate.d.ts +14 -0
- package/dist/locate.d.ts.map +1 -0
- package/dist/locate.js +100 -0
- package/dist/locate.js.map +1 -0
- package/dist/nodes.d.ts +82 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +295 -0
- package/dist/nodes.js.map +1 -0
- package/dist/png.d.ts +22 -0
- package/dist/png.d.ts.map +1 -0
- package/dist/png.js +172 -0
- package/dist/png.js.map +1 -0
- package/dist/selector.d.ts +17 -0
- package/dist/selector.d.ts.map +1 -0
- package/dist/selector.js +84 -0
- package/dist/selector.js.map +1 -0
- package/dist/support.d.ts +59 -0
- package/dist/support.d.ts.map +1 -0
- package/dist/support.js +105 -0
- package/dist/support.js.map +1 -0
- package/dist/surface.d.ts +146 -0
- package/dist/surface.d.ts.map +1 -0
- package/dist/surface.js +485 -0
- package/dist/surface.js.map +1 -0
- package/dist/tools.d.ts +24 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +110 -0
- package/dist/tools.js.map +1 -0
- package/package.json +80 -0
package/dist/locate.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocatorExpression evaluation over one projected snapshot: the location
|
|
3
|
+
* capability's query language answered against the accessibility tree the
|
|
4
|
+
* device just reported. One immediate pass, every match in document order;
|
|
5
|
+
* polling, strictness, and staleness stay with the runner.
|
|
6
|
+
*/
|
|
7
|
+
import { BackendError, matchesText } from '@e2edev/e2e/backend';
|
|
8
|
+
import { isWithin } from './nodes.js';
|
|
9
|
+
import { compileSelector } from './selector.js';
|
|
10
|
+
/** Resolves one expression to the nodes it currently matches. */
|
|
11
|
+
export function resolveExpression(expression, index, options) {
|
|
12
|
+
switch (expression.kind) {
|
|
13
|
+
case 'query': {
|
|
14
|
+
const candidates = expression.scope === undefined ? index : descendantsOf(resolveExpression(expression.scope, index, options), index);
|
|
15
|
+
return candidates.filter((entry) => matchesQuery(entry, expression.query, options));
|
|
16
|
+
}
|
|
17
|
+
case 'filter': {
|
|
18
|
+
const source = resolveExpression(expression.source, index, options);
|
|
19
|
+
return source.filter((entry) => {
|
|
20
|
+
if (expression.hasText !== undefined && !subtreeHasText(entry, index, expression.hasText))
|
|
21
|
+
return false;
|
|
22
|
+
if (expression.has !== undefined) {
|
|
23
|
+
const within = descendantsOf([entry], index);
|
|
24
|
+
if (resolveExpression(expression.has, within, options).length === 0)
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
case 'index': {
|
|
31
|
+
const source = resolveExpression(expression.source, index, options);
|
|
32
|
+
const position = expression.index === 'first' ? 0 : expression.index === 'last' ? source.length - 1 : expression.index;
|
|
33
|
+
const picked = source[position];
|
|
34
|
+
return picked === undefined ? [] : [picked];
|
|
35
|
+
}
|
|
36
|
+
case 'selector':
|
|
37
|
+
return compileSelector(expression.selector)(index);
|
|
38
|
+
case 'frame':
|
|
39
|
+
throw new BackendError('FRAME_NOT_FOUND', 'a device surface has no nested documents to scope a query into', {
|
|
40
|
+
retryable: false,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Strict descendants of any node in `ancestors`, in document order. */
|
|
45
|
+
function descendantsOf(ancestors, index) {
|
|
46
|
+
if (ancestors.length === 0)
|
|
47
|
+
return [];
|
|
48
|
+
return index.filter((entry) => ancestors.some((ancestor) => isWithin(entry, ancestor)));
|
|
49
|
+
}
|
|
50
|
+
function subtreeHasText(entry, index, pattern) {
|
|
51
|
+
const ownTexts = [entry.node.name, entry.node.text, entry.node.value];
|
|
52
|
+
if (ownTexts.some((text) => text !== undefined && matchesText(text, pattern)))
|
|
53
|
+
return true;
|
|
54
|
+
return descendantsOf([entry], index).some((child) => [child.node.name, child.node.text, child.node.value].some((text) => text !== undefined && matchesText(text, pattern)));
|
|
55
|
+
}
|
|
56
|
+
const STATE_KEYS = ['checked', 'disabled', 'selected', 'expanded'];
|
|
57
|
+
/**
|
|
58
|
+
* One node against one semantic query. Role queries skip hidden nodes unless
|
|
59
|
+
* the query asks for them, as a browser's role query does; the other kinds
|
|
60
|
+
* answer with every node and leave visibility to the action or assertion.
|
|
61
|
+
*/
|
|
62
|
+
function matchesQuery(entry, query, options) {
|
|
63
|
+
const node = entry.node;
|
|
64
|
+
switch (query.kind) {
|
|
65
|
+
case 'role': {
|
|
66
|
+
if (query.value.kind !== 'string') {
|
|
67
|
+
throw new BackendError('BACKEND_FAILURE', 'role query value must be a string', { retryable: false });
|
|
68
|
+
}
|
|
69
|
+
if ((node.role ?? '') !== query.value.value)
|
|
70
|
+
return false;
|
|
71
|
+
if (query.name !== undefined && !matchesText(node.name ?? '', query.name))
|
|
72
|
+
return false;
|
|
73
|
+
const wanted = query.states ?? {};
|
|
74
|
+
if (wanted.hidden !== true && node.states?.hidden === true)
|
|
75
|
+
return false;
|
|
76
|
+
for (const key of STATE_KEYS) {
|
|
77
|
+
const expected = wanted[key];
|
|
78
|
+
if (expected !== undefined && (node.states?.[key] ?? false) !== expected)
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
case 'label':
|
|
84
|
+
return node.name !== undefined && matchesText(node.name, query.value);
|
|
85
|
+
case 'placeholder': {
|
|
86
|
+
const placeholder = node.attributes?.['placeholder'];
|
|
87
|
+
return placeholder !== undefined && matchesText(placeholder, query.value);
|
|
88
|
+
}
|
|
89
|
+
case 'text':
|
|
90
|
+
return ((node.name !== undefined && matchesText(node.name, query.value)) ||
|
|
91
|
+
(node.text !== undefined && matchesText(node.text, query.value)));
|
|
92
|
+
case 'displayValue':
|
|
93
|
+
return node.value !== undefined && matchesText(node.value, query.value);
|
|
94
|
+
case 'testId': {
|
|
95
|
+
const testId = node.attributes?.[options.testIdAttribute];
|
|
96
|
+
return testId !== undefined && matchesText(testId, query.value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=locate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locate.js","sourceRoot":"","sources":["../src/locate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAA8C,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMhD,iEAAiE;AACjE,MAAM,UAAU,iBAAiB,CAC/B,UAA6B,EAC7B,KAA+B,EAC/B,OAAsB;IAEtB,QAAQ,UAAU,CAAC,IAAI,EAAE,CAAC;QACxB,KAAK,OAAO,EAAE,CAAC;YACb,MAAM,UAAU,GACd,UAAU,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,iBAAiB,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;YACrH,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC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K,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACxE,KAAK,aAAa,EAAE,CAAC;YACnB,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,CAAC;YACrD,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5E,CAAC;QACD,KAAK,MAAM;YACT,OAAO,CACL,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;gBAChE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CACjE,CAAC;QACJ,KAAK,cAAc;YACjB,OAAO,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1E,KAAK,QAAQ,EAAE,CAAC;YACd,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YAC1D,OAAO,MAAM,KAAK,SAAS,IAAI,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/nodes.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projection of an agent-device accessibility snapshot onto the contract's
|
|
3
|
+
* `SemanticNode` tree. agent-device hands back a flat list with tree
|
|
4
|
+
* coordinates (`index`, `parentIndex`, `depth`) and platform element types;
|
|
5
|
+
* this module rebuilds the tree, maps the types onto the closed role
|
|
6
|
+
* vocabulary `screen.getByRole` and trace relocation speak, and mints the
|
|
7
|
+
* ids the surface owns.
|
|
8
|
+
*/
|
|
9
|
+
import type { SemanticNode } from '@e2edev/e2e/backend';
|
|
10
|
+
import type { Rect } from './support.ts';
|
|
11
|
+
/** The subset of an agent-device snapshot node this backend reads. */
|
|
12
|
+
export interface RawNode {
|
|
13
|
+
readonly ref?: string;
|
|
14
|
+
readonly index?: number;
|
|
15
|
+
readonly parentIndex?: number;
|
|
16
|
+
readonly depth?: number;
|
|
17
|
+
readonly type?: string;
|
|
18
|
+
readonly role?: string;
|
|
19
|
+
readonly label?: string;
|
|
20
|
+
readonly value?: string;
|
|
21
|
+
readonly identifier?: string;
|
|
22
|
+
readonly rect?: Rect;
|
|
23
|
+
readonly enabled?: boolean;
|
|
24
|
+
readonly selected?: boolean;
|
|
25
|
+
readonly focused?: boolean;
|
|
26
|
+
readonly visibleToUser?: boolean;
|
|
27
|
+
readonly hittable?: boolean;
|
|
28
|
+
readonly appName?: string;
|
|
29
|
+
readonly windowTitle?: string;
|
|
30
|
+
}
|
|
31
|
+
/** One projected node with what the surface needs to act on it and to answer selector terms. */
|
|
32
|
+
export interface ProjectedNode {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
/** agent-device ref without its `@` prefix; empty for a node the runner cannot act on. */
|
|
35
|
+
readonly ref: string;
|
|
36
|
+
/** Platform element type, lower-cased (`text-field`, `cell`, `navigation-bar`). */
|
|
37
|
+
readonly kind: string;
|
|
38
|
+
readonly raw: RawNode;
|
|
39
|
+
readonly node: SemanticNode;
|
|
40
|
+
readonly parent: ProjectedNode | undefined;
|
|
41
|
+
}
|
|
42
|
+
export interface ProjectedSnapshot {
|
|
43
|
+
readonly roots: readonly SemanticNode[];
|
|
44
|
+
/** Every node in document order, parents before children. */
|
|
45
|
+
readonly index: readonly ProjectedNode[];
|
|
46
|
+
readonly viewport: {
|
|
47
|
+
readonly width: number;
|
|
48
|
+
readonly height: number;
|
|
49
|
+
readonly scale: number;
|
|
50
|
+
} | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** One element-type spelling for `NavigationBar`, `navigation-bar`, and `android.widget.NavigationBar` alike. */
|
|
53
|
+
export declare function normalizeKind(type: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Projects one snapshot. `mintId` is called once per node in document order,
|
|
56
|
+
* so the surface's id space stays unique across observations.
|
|
57
|
+
*/
|
|
58
|
+
export declare function projectSnapshot(raw: readonly RawNode[], options: {
|
|
59
|
+
readonly testIdAttribute: string;
|
|
60
|
+
readonly mintId: () => string;
|
|
61
|
+
}): ProjectedSnapshot;
|
|
62
|
+
/**
|
|
63
|
+
* The screen's logical size, read off the application or window node when
|
|
64
|
+
* the platform emits one, else the extent of every rect; undefined for a
|
|
65
|
+
* snapshot with no geometry at all.
|
|
66
|
+
*/
|
|
67
|
+
export declare function viewportOf(raw: readonly RawNode[]): {
|
|
68
|
+
readonly width: number;
|
|
69
|
+
readonly height: number;
|
|
70
|
+
readonly scale: number;
|
|
71
|
+
} | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The visible screen's title: the navigation bar's (iOS) or toolbar's
|
|
74
|
+
* (Android) own label, else the first text inside it, else its identifier
|
|
75
|
+
* (UIKit names the bar after its title). Undefined when the screen has no
|
|
76
|
+
* title bar, which is the honest answer for a launch screen, a full-screen
|
|
77
|
+
* sheet, or Android's Settings home.
|
|
78
|
+
*/
|
|
79
|
+
export declare function screenTitle(snapshot: ProjectedSnapshot): string | undefined;
|
|
80
|
+
/** True when `entry` is a strict descendant of `ancestor`. */
|
|
81
|
+
export declare function isWithin(entry: ProjectedNode, ancestor: ProjectedNode): boolean;
|
|
82
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;A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AAC;CAC5C;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC5G;AA2GD,iHAAiH;AACjH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlD;AAkDD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,OAAO,EAAE,EACvB,OAAO,EAAE;IAAE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,CAAA;CAAE,GAC3E,iBAAiB,CAsEnB;AAOD;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,SAAS,OAAO,EAAE,GACtB;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAazF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAW3E;AAED,8DAA8D;AAC9D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAK/E"}
|
package/dist/nodes.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projection of an agent-device accessibility snapshot onto the contract's
|
|
3
|
+
* `SemanticNode` tree. agent-device hands back a flat list with tree
|
|
4
|
+
* coordinates (`index`, `parentIndex`, `depth`) and platform element types;
|
|
5
|
+
* this module rebuilds the tree, maps the types onto the closed role
|
|
6
|
+
* vocabulary `screen.getByRole` and trace relocation speak, and mints the
|
|
7
|
+
* ids the surface owns.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Platform element types onto the role vocabulary. Anything not listed keeps
|
|
11
|
+
* its lower-cased type as the role, so no information is lost; the map only
|
|
12
|
+
* makes the common controls answer the same `getByRole` a browser does.
|
|
13
|
+
*/
|
|
14
|
+
const ROLE_MAP = {
|
|
15
|
+
button: 'button',
|
|
16
|
+
link: 'link',
|
|
17
|
+
'text-field': 'textbox',
|
|
18
|
+
textfield: 'textbox',
|
|
19
|
+
'search-field': 'textbox',
|
|
20
|
+
'text-view': 'textbox',
|
|
21
|
+
'edit-text': 'textbox',
|
|
22
|
+
'secure-text-field': 'textbox',
|
|
23
|
+
securetextfield: 'textbox',
|
|
24
|
+
switch: 'switch',
|
|
25
|
+
toggle: 'switch',
|
|
26
|
+
checkbox: 'checkbox',
|
|
27
|
+
'check-box': 'checkbox',
|
|
28
|
+
slider: 'slider',
|
|
29
|
+
image: 'image',
|
|
30
|
+
'image-view': 'image',
|
|
31
|
+
'static-text': 'text',
|
|
32
|
+
text: 'text',
|
|
33
|
+
cell: 'listitem',
|
|
34
|
+
'list-item': 'listitem',
|
|
35
|
+
'table-cell': 'listitem',
|
|
36
|
+
'collection-cell': 'listitem',
|
|
37
|
+
tab: 'tab',
|
|
38
|
+
'tab-bar-item': 'tab',
|
|
39
|
+
'tab-bar-button': 'tab',
|
|
40
|
+
'menu-item': 'menuitem',
|
|
41
|
+
'menu-button': 'menuitem',
|
|
42
|
+
alert: 'alert',
|
|
43
|
+
dialog: 'dialog',
|
|
44
|
+
sheet: 'dialog',
|
|
45
|
+
'action-sheet': 'dialog',
|
|
46
|
+
heading: 'heading',
|
|
47
|
+
header: 'heading',
|
|
48
|
+
'navigation-bar': 'navigation',
|
|
49
|
+
'activity-indicator': 'status',
|
|
50
|
+
'progress-indicator': 'status',
|
|
51
|
+
};
|
|
52
|
+
const SECURE_KINDS = new Set(['secure-text-field', 'securetextfield', 'password-field']);
|
|
53
|
+
const CHECKABLE_ROLES = new Set(['switch', 'checkbox']);
|
|
54
|
+
const CHECKED_VALUES = new Set(['1', 'on', 'true', 'checked', 'selected']);
|
|
55
|
+
const UNCHECKED_VALUES = new Set(['0', 'off', 'false', 'unchecked']);
|
|
56
|
+
const SCREEN_KINDS = new Set(['application', 'app', 'window']);
|
|
57
|
+
/**
|
|
58
|
+
* Android view classes onto the role vocabulary, keyed by the simple class
|
|
59
|
+
* name in kebab case. A `TextView` is static text here where an iOS
|
|
60
|
+
* `TextView` is an editor, which is why the two platforms keep separate maps.
|
|
61
|
+
*/
|
|
62
|
+
const ANDROID_ROLE_MAP = {
|
|
63
|
+
'text-view': 'text',
|
|
64
|
+
'edit-text': 'textbox',
|
|
65
|
+
'auto-complete-text-view': 'textbox',
|
|
66
|
+
'text-input-edit-text': 'textbox',
|
|
67
|
+
'search-view': 'textbox',
|
|
68
|
+
button: 'button',
|
|
69
|
+
'image-button': 'button',
|
|
70
|
+
'material-button': 'button',
|
|
71
|
+
'image-view': 'image',
|
|
72
|
+
switch: 'switch',
|
|
73
|
+
'switch-compat': 'switch',
|
|
74
|
+
'switch-material': 'switch',
|
|
75
|
+
'toggle-button': 'switch',
|
|
76
|
+
'check-box': 'checkbox',
|
|
77
|
+
'material-check-box': 'checkbox',
|
|
78
|
+
'radio-button': 'radio',
|
|
79
|
+
'seek-bar': 'slider',
|
|
80
|
+
slider: 'slider',
|
|
81
|
+
spinner: 'combobox',
|
|
82
|
+
'web-view': 'document',
|
|
83
|
+
'recycler-view': 'list',
|
|
84
|
+
'list-view': 'list',
|
|
85
|
+
'grid-view': 'list',
|
|
86
|
+
'scroll-view': 'group',
|
|
87
|
+
'view-group': 'group',
|
|
88
|
+
view: 'group',
|
|
89
|
+
'compose-view': 'group',
|
|
90
|
+
'view-factory-holder': 'group',
|
|
91
|
+
'card-view': 'group',
|
|
92
|
+
};
|
|
93
|
+
/** Identifier suffixes of the view that carries an Android screen's title. */
|
|
94
|
+
const ANDROID_TITLE_IDS = [':id/collapsing_toolbar', ':id/action_bar', ':id/toolbar'];
|
|
95
|
+
/**
|
|
96
|
+
* Platform element type of one raw node as a kebab-case token: XCTest sends
|
|
97
|
+
* `NavigationBar` and `StaticText`, Android sends `android.widget.TextView`;
|
|
98
|
+
* both read as one vocabulary here, the Android package prefix dropped.
|
|
99
|
+
* `role` is the fallback some platforms send instead.
|
|
100
|
+
*/
|
|
101
|
+
function kindOf(raw) {
|
|
102
|
+
return normalizeKind(raw.type ?? raw.role ?? '');
|
|
103
|
+
}
|
|
104
|
+
/** True when a raw type is a qualified Android class name. */
|
|
105
|
+
function isAndroidClass(type) {
|
|
106
|
+
return type !== undefined && type.includes('.');
|
|
107
|
+
}
|
|
108
|
+
/** One element-type spelling for `NavigationBar`, `navigation-bar`, and `android.widget.NavigationBar` alike. */
|
|
109
|
+
export function normalizeKind(type) {
|
|
110
|
+
const simple = type.slice(type.lastIndexOf('.') + 1);
|
|
111
|
+
return simple
|
|
112
|
+
.replaceAll(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
113
|
+
.replaceAll(/[\s_]+/g, '-')
|
|
114
|
+
.toLowerCase();
|
|
115
|
+
}
|
|
116
|
+
/** Contract role for one platform element type. */
|
|
117
|
+
function roleOf(kind, android = false) {
|
|
118
|
+
if (kind === '')
|
|
119
|
+
return undefined;
|
|
120
|
+
if (android)
|
|
121
|
+
return ANDROID_ROLE_MAP[kind] ?? (kind.endsWith('layout') ? 'group' : kind);
|
|
122
|
+
return ROLE_MAP[kind] ?? kind;
|
|
123
|
+
}
|
|
124
|
+
function checkedOf(role, value) {
|
|
125
|
+
if (role === undefined || !CHECKABLE_ROLES.has(role) || value === undefined)
|
|
126
|
+
return undefined;
|
|
127
|
+
const lowered = value.trim().toLowerCase();
|
|
128
|
+
if (CHECKED_VALUES.has(lowered))
|
|
129
|
+
return true;
|
|
130
|
+
if (UNCHECKED_VALUES.has(lowered))
|
|
131
|
+
return false;
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
function stripRef(ref) {
|
|
135
|
+
if (ref === undefined)
|
|
136
|
+
return '';
|
|
137
|
+
return ref.startsWith('@') ? ref.slice(1) : ref;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Parent position of every raw node. `parentIndex` is authoritative when it
|
|
141
|
+
* names a node in the list; otherwise `depth` reconstructs nesting from the
|
|
142
|
+
* document order agent-device emits; a node with neither is a root.
|
|
143
|
+
*/
|
|
144
|
+
function parentPositions(raw) {
|
|
145
|
+
const byIndex = new Map();
|
|
146
|
+
raw.forEach((node, position) => {
|
|
147
|
+
if (typeof node.index === 'number')
|
|
148
|
+
byIndex.set(node.index, position);
|
|
149
|
+
});
|
|
150
|
+
const lastAtDepth = [];
|
|
151
|
+
return raw.map((node, position) => {
|
|
152
|
+
let parent;
|
|
153
|
+
if (typeof node.parentIndex === 'number' && node.parentIndex >= 0) {
|
|
154
|
+
const resolved = byIndex.get(node.parentIndex);
|
|
155
|
+
if (resolved !== undefined && resolved < position)
|
|
156
|
+
parent = resolved;
|
|
157
|
+
}
|
|
158
|
+
if (parent === undefined && typeof node.depth === 'number' && node.depth > 0) {
|
|
159
|
+
parent = lastAtDepth[node.depth - 1];
|
|
160
|
+
}
|
|
161
|
+
if (typeof node.depth === 'number') {
|
|
162
|
+
lastAtDepth[node.depth] = position;
|
|
163
|
+
lastAtDepth.length = node.depth + 1;
|
|
164
|
+
}
|
|
165
|
+
return parent;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Projects one snapshot. `mintId` is called once per node in document order,
|
|
170
|
+
* so the surface's id space stays unique across observations.
|
|
171
|
+
*/
|
|
172
|
+
export function projectSnapshot(raw, options) {
|
|
173
|
+
const parents = parentPositions(raw);
|
|
174
|
+
const children = new Map();
|
|
175
|
+
const roots = [];
|
|
176
|
+
parents.forEach((parent, position) => {
|
|
177
|
+
if (parent === undefined) {
|
|
178
|
+
roots.push(position);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const siblings = children.get(parent);
|
|
182
|
+
if (siblings === undefined)
|
|
183
|
+
children.set(parent, [position]);
|
|
184
|
+
else
|
|
185
|
+
siblings.push(position);
|
|
186
|
+
});
|
|
187
|
+
const index = [];
|
|
188
|
+
const build = (position, parent) => {
|
|
189
|
+
const source = raw[position];
|
|
190
|
+
const id = options.mintId();
|
|
191
|
+
const kind = kindOf(source);
|
|
192
|
+
const role = roleOf(kind, isAndroidClass(source.type));
|
|
193
|
+
const secure = SECURE_KINDS.has(kind);
|
|
194
|
+
const checked = checkedOf(role, source.value);
|
|
195
|
+
const states = {
|
|
196
|
+
...(source.enabled === false ? { disabled: true } : {}),
|
|
197
|
+
...(source.selected === true ? { selected: true } : {}),
|
|
198
|
+
...(source.focused === true ? { focused: true } : {}),
|
|
199
|
+
...(source.visibleToUser === false ? { hidden: true } : {}),
|
|
200
|
+
...(secure ? { secure: true } : {}),
|
|
201
|
+
...(checked === undefined ? {} : { checked }),
|
|
202
|
+
};
|
|
203
|
+
const identifier = source.identifier === undefined || source.identifier === '' ? undefined : source.identifier;
|
|
204
|
+
const projected = { node: undefined };
|
|
205
|
+
const entry = {
|
|
206
|
+
id,
|
|
207
|
+
ref: stripRef(source.ref),
|
|
208
|
+
kind,
|
|
209
|
+
raw: source,
|
|
210
|
+
parent,
|
|
211
|
+
get node() {
|
|
212
|
+
return projected.node;
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
index.push(entry);
|
|
216
|
+
const childNodes = (children.get(position) ?? []).map((child) => build(child, entry));
|
|
217
|
+
const node = {
|
|
218
|
+
ref: { id, revision: '' },
|
|
219
|
+
...(role === undefined ? {} : { role }),
|
|
220
|
+
// A device label is both the node's accessible name and its visible
|
|
221
|
+
// text, so `toHaveText` and `getByText` read the same string; the model
|
|
222
|
+
// rendering elides `text` whenever it equals `name`, so this costs nothing.
|
|
223
|
+
...(source.label === undefined || source.label === '' ? {} : { name: source.label, text: source.label }),
|
|
224
|
+
// A secure field's value is never observed; the tree carries that it is
|
|
225
|
+
// secure, not what it holds. Android echoes a text view's label as its
|
|
226
|
+
// value, which would render every line twice, so an echo is dropped.
|
|
227
|
+
...(secure || source.value === undefined || source.value === '' || source.value === source.label
|
|
228
|
+
? {}
|
|
229
|
+
: { value: source.value }),
|
|
230
|
+
...(secure ? { inputPurpose: 'password' } : {}),
|
|
231
|
+
...(Object.keys(states).length === 0 ? {} : { states }),
|
|
232
|
+
...(identifier === undefined ? {} : { attributes: { [options.testIdAttribute]: identifier } }),
|
|
233
|
+
...(source.rect === undefined ? {} : { rect: { ...source.rect } }),
|
|
234
|
+
// Structural hint for tuned replay policies: an identifier survives relabeling; a label does not anchor.
|
|
235
|
+
...(identifier === undefined ? {} : { selector: `id=${quoteTerm(identifier)}` }),
|
|
236
|
+
...(childNodes.length === 0 ? {} : { children: childNodes }),
|
|
237
|
+
};
|
|
238
|
+
projected.node = node;
|
|
239
|
+
return node;
|
|
240
|
+
};
|
|
241
|
+
const rootNodes = roots.map((position) => build(position, undefined));
|
|
242
|
+
return { roots: rootNodes, index, viewport: viewportOf(raw) };
|
|
243
|
+
}
|
|
244
|
+
/** Quotes one selector term value the way agent-device's parser reads it back. */
|
|
245
|
+
function quoteTerm(value) {
|
|
246
|
+
return /[\s"]/.test(value) ? JSON.stringify(value) : value;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The screen's logical size, read off the application or window node when
|
|
250
|
+
* the platform emits one, else the extent of every rect; undefined for a
|
|
251
|
+
* snapshot with no geometry at all.
|
|
252
|
+
*/
|
|
253
|
+
export function viewportOf(raw) {
|
|
254
|
+
const screen = raw.find((node) => SCREEN_KINDS.has(kindOf(node)) && node.rect !== undefined);
|
|
255
|
+
if (screen?.rect !== undefined && screen.rect.width > 0 && screen.rect.height > 0) {
|
|
256
|
+
return { width: screen.rect.width, height: screen.rect.height, scale: 1 };
|
|
257
|
+
}
|
|
258
|
+
let width = 0;
|
|
259
|
+
let height = 0;
|
|
260
|
+
for (const node of raw) {
|
|
261
|
+
if (node.rect === undefined)
|
|
262
|
+
continue;
|
|
263
|
+
width = Math.max(width, node.rect.x + node.rect.width);
|
|
264
|
+
height = Math.max(height, node.rect.y + node.rect.height);
|
|
265
|
+
}
|
|
266
|
+
return width > 0 && height > 0 ? { width, height, scale: 1 } : undefined;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* The visible screen's title: the navigation bar's (iOS) or toolbar's
|
|
270
|
+
* (Android) own label, else the first text inside it, else its identifier
|
|
271
|
+
* (UIKit names the bar after its title). Undefined when the screen has no
|
|
272
|
+
* title bar, which is the honest answer for a launch screen, a full-screen
|
|
273
|
+
* sheet, or Android's Settings home.
|
|
274
|
+
*/
|
|
275
|
+
export function screenTitle(snapshot) {
|
|
276
|
+
const bar = snapshot.index.find((entry) => entry.kind === 'navigation-bar') ??
|
|
277
|
+
snapshot.index.find((entry) => ANDROID_TITLE_IDS.some((suffix) => entry.raw.identifier?.endsWith(suffix) === true));
|
|
278
|
+
if (bar === undefined)
|
|
279
|
+
return undefined;
|
|
280
|
+
if (bar.raw.label !== undefined && bar.raw.label.trim() !== '')
|
|
281
|
+
return bar.raw.label;
|
|
282
|
+
const text = snapshot.index.find((entry) => entry.node.role === 'text' && entry.raw.label !== undefined && entry.raw.label.trim() !== '' && isWithin(entry, bar));
|
|
283
|
+
if (text !== undefined)
|
|
284
|
+
return text.raw.label;
|
|
285
|
+
return bar.raw.identifier === undefined || bar.raw.identifier.trim() === '' ? undefined : bar.raw.identifier;
|
|
286
|
+
}
|
|
287
|
+
/** True when `entry` is a strict descendant of `ancestor`. */
|
|
288
|
+
export function isWithin(entry, ancestor) {
|
|
289
|
+
for (let current = entry.parent; current !== undefined; current = current.parent) {
|
|
290
|
+
if (current === ancestor)
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.js","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA6CH;;;;GAIG;AACH,MAAM,QAAQ,GAAqC;IACjD,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,SAAS;IACvB,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,SAAS;IACzB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,SAAS;IAC9B,eAAe,EAAE,SAAS;IAC1B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,UAAU;IACxB,iBAAiB,EAAE,UAAU;IAC7B,GAAG,EAAE,KAAK;IACV,cAAc,EAAE,KAAK;IACrB,gBAAgB,EAAE,KAAK;IACvB,WAAW,EAAE,UAAU;IACvB,aAAa,EAAE,UAAU;IACzB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,QAAQ;IACf,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,YAAY;IAC9B,oBAAoB,EAAE,QAAQ;IAC9B,oBAAoB,EAAE,QAAQ;CAC/B,CAAC;AAEF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,mBAAmB,EAAE,iBAAi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CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;AAC/G,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,QAAQ,CAAC,KAAoB,EAAE,QAAuB;IACpE,KAAK,IAAI,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACjF,IAAI,OAAO,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/png.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal PNG codec for masking secure regions in device screenshots: 8-bit
|
|
3
|
+
* RGB or RGBA, non-interlaced, which is what a simulator or emulator
|
|
4
|
+
* screenshot is. Anything else is refused loudly, and the caller withholds
|
|
5
|
+
* the image rather than shipping pixels it could not redact.
|
|
6
|
+
*/
|
|
7
|
+
import type { Rect } from './support.ts';
|
|
8
|
+
export interface DecodedPng {
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
/** 3 for RGB, 4 for RGBA. */
|
|
12
|
+
readonly channels: number;
|
|
13
|
+
/** Row-major samples, `width * channels` per row, mutable. */
|
|
14
|
+
readonly pixels: Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
/** Decodes PNG bytes into mutable samples; throws for formats this codec does not read. */
|
|
17
|
+
export declare function decodePng(bytes: Uint8Array): DecodedPng;
|
|
18
|
+
/** Encodes samples as a PNG with unfiltered rows; size is not the goal, fidelity is. */
|
|
19
|
+
export declare function encodePng(image: DecodedPng): Uint8Array;
|
|
20
|
+
/** Decodes, masks, and re-encodes in one step. */
|
|
21
|
+
export declare function maskPng(bytes: Uint8Array, rects: readonly Rect[]): Uint8Array;
|
|
22
|
+
//# sourceMappingURL=png.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"png.d.ts","sourceRoot":"","sources":["../src/png.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAWD,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAqEvD;AA0BD,wFAAwF;AACxF,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAuBvD;AA0BD,kDAAkD;AAClD,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,UAAU,CAK7E"}
|