@qontinui/ui-bridge-native 0.6.7 → 0.6.9
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/dist/control/action-executor.d.ts +15 -0
- package/dist/control/action-executor.d.ts.map +1 -1
- package/dist/control/index.js +34 -0
- package/dist/control/index.js.map +1 -1
- package/dist/control/index.mjs +34 -0
- package/dist/control/index.mjs.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +220 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +220 -16
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +203 -16
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +203 -16
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/useUIElement.d.ts +10 -0
- package/dist/react/useUIElement.d.ts.map +1 -1
- package/dist/server/handlers.d.ts.map +1 -1
- package/dist/server/http-server.d.ts.map +1 -1
- package/dist/server/index.js +172 -13
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +172 -13
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/types.d.ts +30 -0
- package/dist/server/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -37,6 +37,16 @@ export interface UseUIElementOptionsBase<T extends NativeElementType = NativeEle
|
|
|
37
37
|
actions?: NativeStandardAction[];
|
|
38
38
|
/** Custom actions */
|
|
39
39
|
customActions?: Record<string, NativeCustomAction>;
|
|
40
|
+
/**
|
|
41
|
+
* Current controlled value for text inputs. When provided, it is threaded
|
|
42
|
+
* into the registered element's `state.value` so a `GET /control/element/:id`
|
|
43
|
+
* (or `/state`) reflects what the user sees — without this, the input
|
|
44
|
+
* registers with `value: undefined` and a bridge read returns null even
|
|
45
|
+
* though the field is populated. Pass the same value you bind to the RN
|
|
46
|
+
* `<TextInput value={...} />` prop; the hook keeps the registry in sync as
|
|
47
|
+
* it changes.
|
|
48
|
+
*/
|
|
49
|
+
value?: string;
|
|
40
50
|
/** Whether to automatically register on mount */
|
|
41
51
|
autoRegister?: boolean;
|
|
42
52
|
/** Callback when state changes */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUIElement.d.ts","sourceRoot":"","sources":["../../src/react/useUIElement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AA4DvB,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IACtF,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IACnD,iDAAiD;IACjD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpD,qDAAqD;IACrD,UAAU,CAAC,EAA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OAAO,CAAC,KAAK,IAAI,CAAC;CACxD;AAED;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,IACtF,mCAAmC,CAAC,CAAC,CAAC,CAAC;AAEzC,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EACnF,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC,GACvC,2BAA2B,CAsB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAQV,oBAAoB,EAKrB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAQV,oBAAoB,EAKrB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAyThF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,CAAC,EAAE;IACP,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,MAAM;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D,GACA,oBAAoB,CAg8BtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EA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;IAIlD;;;;OAIG;IACG,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA4IxF;;OAEG;IACG,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAwB7E;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAetB;;;;OAIG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAa/C;;;OAGG;YACW,oBAAoB;IAwHlC;;;;;;;;;;;OAWG;YACW,sBAAsB;IAmJpC;;;OAGG;YACW,cAAc;IA6E5B;;;;;;;;;;;OAWG;YACW,oBAAoB;IAgClC;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAuDhE;;;;;;;;;;;OAWG;YACW,YAAY;CAuE3B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,oBAAoB,CAEtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG"}
|
package/dist/server/index.js
CHANGED
|
@@ -57,6 +57,11 @@ var UI_BRIDGE_NATIVE_ROUTES = {
|
|
|
57
57
|
path: "/ui-bridge/control/snapshot",
|
|
58
58
|
description: "Get full bridge snapshot"
|
|
59
59
|
},
|
|
60
|
+
DISCOVER: {
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: "/ui-bridge/control/discover",
|
|
63
|
+
description: "Discover elements (alias for snapshot; web/runner parity)"
|
|
64
|
+
},
|
|
60
65
|
PAGE_HEALTH: {
|
|
61
66
|
method: "POST",
|
|
62
67
|
path: "/ui-bridge/control/page-health",
|
|
@@ -184,6 +189,18 @@ var UI_BRIDGE_NATIVE_ROUTES = {
|
|
|
184
189
|
path: "/ui-bridge/control/modal/dismiss/:id",
|
|
185
190
|
description: "Dismiss a modal by id (testHooks)"
|
|
186
191
|
},
|
|
192
|
+
// Observability — last-N ring buffers (always mounted; `installed:false`
|
|
193
|
+
// when the console/network patches are off, i.e. no testHooks).
|
|
194
|
+
CONSOLE_ERRORS: {
|
|
195
|
+
method: "GET",
|
|
196
|
+
path: "/ui-bridge/control/console-errors",
|
|
197
|
+
description: "Last-N captured console.error/console.warn entries"
|
|
198
|
+
},
|
|
199
|
+
NETWORK_REQUESTS: {
|
|
200
|
+
method: "GET",
|
|
201
|
+
path: "/ui-bridge/sdk/network-requests",
|
|
202
|
+
description: "Last-N captured fetch/XHR requests with status + duration"
|
|
203
|
+
},
|
|
187
204
|
// Health
|
|
188
205
|
HEALTH: {
|
|
189
206
|
method: "GET",
|
|
@@ -914,6 +931,35 @@ function diagnosePageHealth(elements, viewport) {
|
|
|
914
931
|
}
|
|
915
932
|
|
|
916
933
|
// src/server/handlers.ts
|
|
934
|
+
function matchElementsByText(registry, text, opts) {
|
|
935
|
+
const needle = text.toLowerCase();
|
|
936
|
+
const contains = (v) => typeof v === "string" && v.toLowerCase().includes(needle);
|
|
937
|
+
let all = registry.getAllElements();
|
|
938
|
+
if (opts?.visibleOnly) {
|
|
939
|
+
all = all.filter((e) => e.getState().visible);
|
|
940
|
+
}
|
|
941
|
+
const scored = [];
|
|
942
|
+
for (const e of all) {
|
|
943
|
+
let rank = Number.POSITIVE_INFINITY;
|
|
944
|
+
if (contains(e.label)) rank = Math.min(rank, 0);
|
|
945
|
+
const ident = e.getIdentifier();
|
|
946
|
+
if (ident) {
|
|
947
|
+
if (contains(ident.testId)) rank = Math.min(rank, 1);
|
|
948
|
+
if (contains(ident.accessibilityLabel)) rank = Math.min(rank, 1);
|
|
949
|
+
if (contains(ident.treePath)) rank = Math.min(rank, 1);
|
|
950
|
+
if (contains(ident.uiId)) rank = Math.min(rank, 1);
|
|
951
|
+
}
|
|
952
|
+
if (rank === Number.POSITIVE_INFINITY) {
|
|
953
|
+
const handlers = extractHandlerNames(e.props);
|
|
954
|
+
if (handlers.some((h) => h.toLowerCase().includes(needle))) rank = 2;
|
|
955
|
+
}
|
|
956
|
+
if (rank !== Number.POSITIVE_INFINITY) {
|
|
957
|
+
scored.push({ rank, element: { id: e.id, type: e.type, label: e.label } });
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
scored.sort((a, b) => a.rank - b.rank);
|
|
961
|
+
return scored.map((s) => s.element);
|
|
962
|
+
}
|
|
917
963
|
async function executeWorkflowStep(step, registry, executor) {
|
|
918
964
|
const startTime = Date.now();
|
|
919
965
|
try {
|
|
@@ -1510,6 +1556,89 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1510
1556
|
const failedCount = results.length - succeededCount;
|
|
1511
1557
|
return success2({ results, succeededCount, failedCount });
|
|
1512
1558
|
},
|
|
1559
|
+
// ========================================================================
|
|
1560
|
+
// App-agnostic interaction parity (cross-platform `/control/page/*`)
|
|
1561
|
+
//
|
|
1562
|
+
// Mirrors the web/runner convenience endpoints so the SAME contract drives
|
|
1563
|
+
// mobile. Text/label interactions compose `executor.find` (registry-based
|
|
1564
|
+
// discovery) + `executor.executeAction` (press/type). Selector-only
|
|
1565
|
+
// variants have no React-Native analog and return NOT_SUPPORTED — the
|
|
1566
|
+
// mobile bridge's snapshot + `/control/find` (testID / accessibilityLabel)
|
|
1567
|
+
// cover what a selector would on web.
|
|
1568
|
+
// ========================================================================
|
|
1569
|
+
clickByText: async (ctx) => {
|
|
1570
|
+
const body = ctx.body;
|
|
1571
|
+
const text = typeof body?.text === "string" ? body.text.trim() : "";
|
|
1572
|
+
if (!text) {
|
|
1573
|
+
return error2("text is required and must not be empty", "INVALID_REQUEST");
|
|
1574
|
+
}
|
|
1575
|
+
const match = matchElementsByText(registry, text, { visibleOnly: body?.visibleOnly })[0];
|
|
1576
|
+
if (!match) {
|
|
1577
|
+
return error2(`No element found with text "${text}"`, "ELEMENT_NOT_FOUND");
|
|
1578
|
+
}
|
|
1579
|
+
const response = await executor.executeAction(match.id, { action: "press" });
|
|
1580
|
+
if (!response.success) {
|
|
1581
|
+
return error2(response.error || "Press failed", "ACTION_FAILED");
|
|
1582
|
+
}
|
|
1583
|
+
return success2({
|
|
1584
|
+
clicked: true,
|
|
1585
|
+
element: { id: match.id, type: match.type, label: match.label }
|
|
1586
|
+
});
|
|
1587
|
+
},
|
|
1588
|
+
clickBySelector: async () => {
|
|
1589
|
+
return error2(
|
|
1590
|
+
"clickBySelector is not supported on native platform \u2014 React Native has no CSS-selector DOM. Use clickByText, or /control/find with testIdPattern/accessibilityLabelPattern then /control/element/:id/action.",
|
|
1591
|
+
"NOT_SUPPORTED"
|
|
1592
|
+
);
|
|
1593
|
+
},
|
|
1594
|
+
typeInto: async (ctx) => {
|
|
1595
|
+
const body = ctx.body;
|
|
1596
|
+
const label = typeof body?.label === "string" ? body.label.trim() : "";
|
|
1597
|
+
if (!label) {
|
|
1598
|
+
return error2(
|
|
1599
|
+
"label is required on native (selector-based typeInto is web-only)",
|
|
1600
|
+
"INVALID_REQUEST"
|
|
1601
|
+
);
|
|
1602
|
+
}
|
|
1603
|
+
const text = typeof body?.text === "string" ? body.text : "";
|
|
1604
|
+
const match = matchElementsByText(registry, label, { visibleOnly: body?.visibleOnly })[0];
|
|
1605
|
+
if (!match) {
|
|
1606
|
+
return error2(`No input found for label "${label}"`, "ELEMENT_NOT_FOUND");
|
|
1607
|
+
}
|
|
1608
|
+
const response = await executor.executeAction(match.id, {
|
|
1609
|
+
action: "type",
|
|
1610
|
+
params: { text, clear: body?.clear === true }
|
|
1611
|
+
});
|
|
1612
|
+
if (!response.success) {
|
|
1613
|
+
return error2(response.error || "Type failed", "ACTION_FAILED");
|
|
1614
|
+
}
|
|
1615
|
+
return success2({
|
|
1616
|
+
typed: true,
|
|
1617
|
+
element: { id: match.id, type: match.type, label: match.label }
|
|
1618
|
+
});
|
|
1619
|
+
},
|
|
1620
|
+
readValue: async () => {
|
|
1621
|
+
return error2(
|
|
1622
|
+
"readValue is not supported on native platform \u2014 React Native has no CSS-selector DOM. Use /control/element/:id/state to read an element value.",
|
|
1623
|
+
"NOT_SUPPORTED"
|
|
1624
|
+
);
|
|
1625
|
+
},
|
|
1626
|
+
findByText: async (ctx) => {
|
|
1627
|
+
const body = ctx.body;
|
|
1628
|
+
const text = typeof body?.text === "string" ? body.text.trim() : "";
|
|
1629
|
+
if (!text) {
|
|
1630
|
+
return error2("text is required and must not be empty", "INVALID_REQUEST");
|
|
1631
|
+
}
|
|
1632
|
+
const matches = matchElementsByText(registry, text, { visibleOnly: body?.visibleOnly });
|
|
1633
|
+
return success2(
|
|
1634
|
+
matches.map((el, index) => ({
|
|
1635
|
+
index,
|
|
1636
|
+
id: el.id,
|
|
1637
|
+
type: el.type,
|
|
1638
|
+
label: el.label
|
|
1639
|
+
}))
|
|
1640
|
+
);
|
|
1641
|
+
},
|
|
1513
1642
|
// Coord-based tap
|
|
1514
1643
|
//
|
|
1515
1644
|
// Synthesizes a press at the given screen coordinates by scanning the
|
|
@@ -1604,7 +1733,8 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1604
1733
|
return success2({
|
|
1605
1734
|
entries: [],
|
|
1606
1735
|
count: 0,
|
|
1607
|
-
bufferSize: 0
|
|
1736
|
+
bufferSize: 0,
|
|
1737
|
+
installed: false
|
|
1608
1738
|
});
|
|
1609
1739
|
}
|
|
1610
1740
|
const entries = buf.entries({
|
|
@@ -1614,7 +1744,8 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1614
1744
|
return success2({
|
|
1615
1745
|
entries,
|
|
1616
1746
|
count: entries.length,
|
|
1617
|
-
bufferSize: buf.size()
|
|
1747
|
+
bufferSize: buf.size(),
|
|
1748
|
+
installed: buf.isInstalled()
|
|
1618
1749
|
});
|
|
1619
1750
|
},
|
|
1620
1751
|
getNetworkRequests: async (ctx) => {
|
|
@@ -1625,7 +1756,8 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1625
1756
|
return success2({
|
|
1626
1757
|
entries: [],
|
|
1627
1758
|
count: 0,
|
|
1628
|
-
bufferSize: 0
|
|
1759
|
+
bufferSize: 0,
|
|
1760
|
+
installed: false
|
|
1629
1761
|
});
|
|
1630
1762
|
}
|
|
1631
1763
|
const entries = buf.entries({
|
|
@@ -1635,7 +1767,8 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1635
1767
|
return success2({
|
|
1636
1768
|
entries,
|
|
1637
1769
|
count: entries.length,
|
|
1638
|
-
bufferSize: buf.size()
|
|
1770
|
+
bufferSize: buf.size(),
|
|
1771
|
+
installed: buf.isInstalled()
|
|
1639
1772
|
});
|
|
1640
1773
|
},
|
|
1641
1774
|
// Test hooks — modal stack manipulation
|
|
@@ -2054,7 +2187,10 @@ var WS_ROUTES = [
|
|
|
2054
2187
|
// same handler at both paths to keep agents portable across platforms.
|
|
2055
2188
|
{ pattern: "ai/find", handler: "find", httpMethods: ["POST"] },
|
|
2056
2189
|
{ pattern: "control/snapshot", handler: "getSnapshot", httpMethods: ["GET"] },
|
|
2057
|
-
|
|
2190
|
+
// Discovery alias — web/runner parity with `POST /control/discover` (a
|
|
2191
|
+
// legacy alias for snapshot/find). Mounted on HTTP (GET+POST) so mobile
|
|
2192
|
+
// doesn't 404 where web returns 200; delegates to the snapshot handler.
|
|
2193
|
+
{ pattern: "control/discover", handler: "getSnapshot", httpMethods: ["GET", "POST"] },
|
|
2058
2194
|
// Page health — accepts both GET and POST so the canonical skill invocation
|
|
2059
2195
|
// (`POST .../control/page-health` with an empty body) and ad-hoc curls both
|
|
2060
2196
|
// work without a body-shape gotcha.
|
|
@@ -2116,6 +2252,17 @@ var WS_ROUTES = [
|
|
|
2116
2252
|
// Coord-based tap — synthesizes a press at the given screen coords by
|
|
2117
2253
|
// matching against registered elements' layout rects.
|
|
2118
2254
|
{ pattern: "control/tap", handler: "tapAt", httpMethods: ["POST"] },
|
|
2255
|
+
// App-agnostic interaction parity — mirrors the web/runner convenience
|
|
2256
|
+
// endpoints (`/control/page/click-by-text` etc.) so the SAME cross-platform
|
|
2257
|
+
// contract drives mobile. Text/label-based interactions compose
|
|
2258
|
+
// `executor.find` + `executor.executeAction` over the registry; the
|
|
2259
|
+
// DOM-selector-only variants (`click-by-selector`, `read-value`) have no RN
|
|
2260
|
+
// analog and return a structured NOT_SUPPORTED envelope.
|
|
2261
|
+
{ pattern: "control/page/click-by-text", handler: "clickByText", httpMethods: ["POST"] },
|
|
2262
|
+
{ pattern: "control/page/click-by-selector", handler: "clickBySelector", httpMethods: ["POST"] },
|
|
2263
|
+
{ pattern: "control/page/type-into", handler: "typeInto", httpMethods: ["POST"] },
|
|
2264
|
+
{ pattern: "control/page/read-value", handler: "readValue", httpMethods: ["POST"] },
|
|
2265
|
+
{ pattern: "control/page/find-by-text", handler: "findByText", httpMethods: ["POST"] },
|
|
2119
2266
|
// Test hooks — gated behind `features.testHooks`. Let external runners
|
|
2120
2267
|
// drive the ModalDetector over HTTP so tests can flip `snapshot.modalStack`
|
|
2121
2268
|
// without mounting React components.
|
|
@@ -2137,19 +2284,26 @@ var WS_ROUTES = [
|
|
|
2137
2284
|
httpMethods: ["POST"],
|
|
2138
2285
|
requiresTestHooks: true
|
|
2139
2286
|
},
|
|
2140
|
-
// Observability — last-N console errors + network requests.
|
|
2141
|
-
//
|
|
2287
|
+
// Observability — last-N console errors + network requests.
|
|
2288
|
+
//
|
|
2289
|
+
// Always mounted (not testHooks-gated) so they return a schema-valid 200
|
|
2290
|
+
// on every build instead of a 404 that agents can't distinguish from a
|
|
2291
|
+
// missing route. The INVASIVE part — monkey-patching `console.error` /
|
|
2292
|
+
// `fetch` / `XMLHttpRequest` — stays gated behind `testHooks` (see
|
|
2293
|
+
// NativeUIBridgeServer.start → buffer.install()). When the patches aren't
|
|
2294
|
+
// installed the handlers report `installed: false` + empty entries, so
|
|
2295
|
+
// production builds expose the contract without observing real users'
|
|
2296
|
+
// console/network traffic. Set `features.testHooks` (typically on
|
|
2297
|
+
// `__DEV__`) to populate the buffers with live data.
|
|
2142
2298
|
{
|
|
2143
2299
|
pattern: "control/console-errors",
|
|
2144
2300
|
handler: "getConsoleErrors",
|
|
2145
|
-
httpMethods: ["GET"]
|
|
2146
|
-
requiresTestHooks: true
|
|
2301
|
+
httpMethods: ["GET"]
|
|
2147
2302
|
},
|
|
2148
2303
|
{
|
|
2149
2304
|
pattern: "sdk/network-requests",
|
|
2150
2305
|
handler: "getNetworkRequests",
|
|
2151
|
-
httpMethods: ["GET"]
|
|
2152
|
-
requiresTestHooks: true
|
|
2306
|
+
httpMethods: ["GET"]
|
|
2153
2307
|
}
|
|
2154
2308
|
];
|
|
2155
2309
|
var HANDLER_DESCRIPTIONS = {
|
|
@@ -2191,8 +2345,13 @@ var HANDLER_DESCRIPTIONS = {
|
|
|
2191
2345
|
aiChangeBufferEnable: "STUB \u2014 runner-only; mobile returns NOT_SUPPORTED. Use WS event subscriptions for change notifications.",
|
|
2192
2346
|
aiWaitForElement: "STUB \u2014 runner-only; mobile returns NOT_SUPPORTED. Use the WS waitForElement / waitForCondition JSON-RPC methods.",
|
|
2193
2347
|
tapAt: "Synthesize a press at given screen coords by matching registered element layout rects: body { x, y, action? }",
|
|
2194
|
-
|
|
2195
|
-
|
|
2348
|
+
clickByText: "App-agnostic: press the first element matching free-text (label/accessibilityLabel/testID): body { text, visibleOnly? }",
|
|
2349
|
+
clickBySelector: "STUB \u2014 selector-based; NOT_SUPPORTED on native (no DOM). Use clickByText or /control/find + /control/element/:id/action.",
|
|
2350
|
+
typeInto: "App-agnostic: type into the input matching a label: body { label, text, clear?, visibleOnly? }. (selector form is web-only)",
|
|
2351
|
+
readValue: "STUB \u2014 selector-based; NOT_SUPPORTED on native (no DOM). Use /control/element/:id/state to read a value.",
|
|
2352
|
+
findByText: "App-agnostic: list elements matching free-text (no press): body { text, visibleOnly? }",
|
|
2353
|
+
getConsoleErrors: "Last-N console.error/console.warn entries; ?since=<ms>&limit=<n>. `installed:false` when capture is off (no testHooks) \u2014 entries empty but schema-valid.",
|
|
2354
|
+
getNetworkRequests: "Last-N fetch/XHR entries with status + duration; ?since=<ms>&limit=<n>. `installed:false` when capture is off (no testHooks) \u2014 entries empty but schema-valid.",
|
|
2196
2355
|
pushModal: "TEST HOOK \u2014 push a modal onto the snapshot.modalStack via the registry ModalDetector",
|
|
2197
2356
|
dismissModal: "TEST HOOK \u2014 dismiss a modal by id from the snapshot.modalStack via the registry ModalDetector",
|
|
2198
2357
|
keepAwake: "TEST HOOK \u2014 keep the device screen awake via the injected keepAwakeProvider: body { enabled: boolean, durationMs?: number }"
|