browser-debugger-cli 0.6.5 → 0.6.6
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/commands/dom/a11y.d.ts.map +1 -1
- package/dist/commands/dom/a11y.js +33 -5
- package/dist/commands/dom/a11y.js.map +1 -1
- package/dist/commands/dom/formFillHelpers.d.ts +68 -2
- package/dist/commands/dom/formFillHelpers.d.ts.map +1 -1
- package/dist/commands/dom/formFillHelpers.js +211 -65
- package/dist/commands/dom/formFillHelpers.js.map +1 -1
- package/dist/commands/dom/formInteraction.d.ts.map +1 -1
- package/dist/commands/dom/formInteraction.js +128 -15
- package/dist/commands/dom/formInteraction.js.map +1 -1
- package/dist/commands/dom/helpers.d.ts +61 -2
- package/dist/commands/dom/helpers.d.ts.map +1 -1
- package/dist/commands/dom/helpers.js +103 -0
- package/dist/commands/dom/helpers.js.map +1 -1
- package/dist/commands/dom/index.d.ts.map +1 -1
- package/dist/commands/dom/index.js +62 -15
- package/dist/commands/dom/index.js.map +1 -1
- package/dist/commands/dom/keyMapping.d.ts +62 -0
- package/dist/commands/dom/keyMapping.d.ts.map +1 -0
- package/dist/commands/dom/keyMapping.js +118 -0
- package/dist/commands/dom/keyMapping.js.map +1 -0
- package/dist/commands/dom/reactEventHelpers.d.ts +9 -4
- package/dist/commands/dom/reactEventHelpers.d.ts.map +1 -1
- package/dist/commands/dom/reactEventHelpers.js +52 -10
- package/dist/commands/dom/reactEventHelpers.js.map +1 -1
- package/dist/commands/peek.d.ts.map +1 -1
- package/dist/commands/peek.js +17 -8
- package/dist/commands/peek.js.map +1 -1
- package/dist/constants.d.ts +5 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -2
- package/dist/constants.js.map +1 -1
- package/dist/ipc/__tests__/jsonl.unit.test.js +5 -5
- package/dist/ipc/__tests__/jsonl.unit.test.js.map +1 -1
- package/dist/types/dom.d.ts +9 -0
- package/dist/types/dom.d.ts.map +1 -1
- package/dist/ui/formatters/a11y.d.ts +19 -0
- package/dist/ui/formatters/a11y.d.ts.map +1 -1
- package/dist/ui/formatters/a11y.js +60 -0
- package/dist/ui/formatters/a11y.js.map +1 -1
- package/dist/ui/formatters/preview.d.ts +4 -0
- package/dist/ui/formatters/preview.d.ts.map +1 -1
- package/dist/ui/formatters/preview.js +24 -4
- package/dist/ui/formatters/preview.js.map +1 -1
- package/dist/ui/formatters/sessionFormatters.d.ts.map +1 -1
- package/dist/ui/formatters/sessionFormatters.js +2 -0
- package/dist/ui/formatters/sessionFormatters.js.map +1 -1
- package/dist/utils/decisionTrees.d.ts.map +1 -1
- package/dist/utils/decisionTrees.js +5 -0
- package/dist/utils/decisionTrees.js.map +1 -1
- package/dist/utils/taskMappings.d.ts.map +1 -1
- package/dist/utils/taskMappings.js +5 -0
- package/dist/utils/taskMappings.js.map +1 -1
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +15 -2
- package/dist/utils/url.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../../src/commands/dom/a11y.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../../src/commands/dom/a11y.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmOzC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA0D1D"}
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Uses IPC/callCDP pattern for consistency with other DOM commands.
|
|
10
10
|
*/
|
|
11
|
+
import { getDomContext } from '../../commands/dom/helpers.js';
|
|
11
12
|
import { runCommand } from '../../commands/shared/CommandRunner.js';
|
|
12
13
|
import { jsonOption } from '../../commands/shared/commonOptions.js';
|
|
13
14
|
import { collectA11yTree, queryA11yTree, parseQueryPattern, resolveA11yNode, } from '../../telemetry/a11y.js';
|
|
14
15
|
import { CommandError } from '../../ui/errors/index.js';
|
|
15
|
-
import { formatA11yTree, formatA11yQueryResult,
|
|
16
|
+
import { formatA11yTree, formatA11yQueryResult, formatA11yNodeWithContext, } from '../../ui/formatters/a11y.js';
|
|
16
17
|
import { elementNotFoundError } from '../../ui/messages/errors.js';
|
|
17
18
|
import { EXIT_CODES } from '../../utils/exitCodes.js';
|
|
18
19
|
/**
|
|
@@ -104,6 +105,7 @@ async function getCachedNodeByIndex(index) {
|
|
|
104
105
|
* Gets accessibility properties for a DOM element by CSS selector or numeric index.
|
|
105
106
|
* Supports index-based access from query results (e.g., "bdg dom a11y describe 0").
|
|
106
107
|
* Useful for understanding how an element is exposed to assistive technologies.
|
|
108
|
+
* Includes DOM context (tag, classes, text preview) when a11y data is sparse.
|
|
107
109
|
*
|
|
108
110
|
* @param selectorOrIndex - CSS selector (e.g., "button.submit") or numeric index from query results
|
|
109
111
|
* @param options - Command options
|
|
@@ -120,10 +122,12 @@ async function handleA11yDescribe(selectorOrIndex, options) {
|
|
|
120
122
|
const isNumericIndex = /^\d+$/.test(selectorOrIndex);
|
|
121
123
|
await runCommand(async () => {
|
|
122
124
|
let node;
|
|
125
|
+
let nodeId;
|
|
123
126
|
if (isNumericIndex) {
|
|
124
127
|
const index = parseInt(selectorOrIndex, 10);
|
|
125
128
|
const targetNode = await getCachedNodeByIndex(index);
|
|
126
|
-
|
|
129
|
+
nodeId = targetNode.nodeId;
|
|
130
|
+
node = await resolveA11yNode('', nodeId);
|
|
127
131
|
}
|
|
128
132
|
else {
|
|
129
133
|
node = await resolveA11yNode(selectorOrIndex);
|
|
@@ -131,8 +135,13 @@ async function handleA11yDescribe(selectorOrIndex, options) {
|
|
|
131
135
|
if (!node) {
|
|
132
136
|
throw new CommandError(elementNotFoundError(selectorOrIndex), {}, EXIT_CODES.RESOURCE_NOT_FOUND);
|
|
133
137
|
}
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
let domContext = null;
|
|
139
|
+
const domNodeId = node.backendDOMNodeId ?? nodeId;
|
|
140
|
+
if (domNodeId) {
|
|
141
|
+
domContext = await getDomContext(domNodeId);
|
|
142
|
+
}
|
|
143
|
+
return { success: true, data: { node, domContext } };
|
|
144
|
+
}, options, formatA11yNodeWithContext);
|
|
136
145
|
}
|
|
137
146
|
/**
|
|
138
147
|
* Register accessibility commands under 'bdg dom a11y'
|
|
@@ -142,7 +151,26 @@ async function handleA11yDescribe(selectorOrIndex, options) {
|
|
|
142
151
|
export function registerA11yCommands(domCmd) {
|
|
143
152
|
const a11y = domCmd
|
|
144
153
|
.command('a11y')
|
|
145
|
-
.description('Accessibility tree inspection and semantic queries')
|
|
154
|
+
.description('Accessibility tree inspection and semantic queries')
|
|
155
|
+
.argument('[search]', 'Quick search: index (describe), pattern with ":" (query), or name search')
|
|
156
|
+
.addOption(jsonOption)
|
|
157
|
+
.action(async (search, options) => {
|
|
158
|
+
if (!search) {
|
|
159
|
+
a11y.help();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const isNumericIndex = /^\d+$/.test(search);
|
|
163
|
+
const isPatternQuery = search.includes(':') || search.includes('=');
|
|
164
|
+
if (isNumericIndex) {
|
|
165
|
+
await handleA11yDescribe(search, options);
|
|
166
|
+
}
|
|
167
|
+
else if (isPatternQuery) {
|
|
168
|
+
await handleA11yQuery(search, options);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
await handleA11yQuery(`name:*${search}*`, options);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
146
174
|
a11y
|
|
147
175
|
.command('tree')
|
|
148
176
|
.description('Dump full accessibility tree (filters ignored nodes)')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a11y.js","sourceRoot":"","sources":["../../../src/commands/dom/a11y.ts"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YAC1B,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,CAAC,SAAS,MAAM,GAAG,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,IAAI;SACD,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,sDAAsD,CAAC;SACnE,SAAS,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,KAAK,EAAE,OAAwB,EAAE,EAAE;QACzC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IAEL,IAAI;SACD,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,iFAAiF,CAAC;SAC9F,QAAQ,CACP,WAAW,EACX,0FAA0F,CAC3F;SACA,SAAS,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAAyB,EAAE,EAAE;QAC3D,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEL,IAAI;SACD,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,wDAAwD,CAAC;SACrE,QAAQ,CACP,mBAAmB,EACnB,0EAA0E,CAC3E;SACA,SAAS,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,KAAK,EAAE,eAAuB,EAAE,OAA4B,EAAE,EAAE;QACtE,MAAM,kBAAkB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { type FillOptions, type FillResult, type ClickResult } from './reactEven
|
|
|
9
9
|
* @param cdp - CDP connection
|
|
10
10
|
* @param selector - CSS selector for the element
|
|
11
11
|
* @param value - Value to fill
|
|
12
|
-
* @param options - Fill options
|
|
12
|
+
* @param options - Fill options including optional index for multiple matches
|
|
13
13
|
* @returns Promise resolving to fill result
|
|
14
14
|
*
|
|
15
15
|
* @throws CommandError When element operations fail
|
|
@@ -28,7 +28,7 @@ export declare function fillElement(cdp: CDPConnection, selector: string, value:
|
|
|
28
28
|
*
|
|
29
29
|
* @param cdp - CDP connection
|
|
30
30
|
* @param selector - CSS selector for the element
|
|
31
|
-
* @param options - Click options
|
|
31
|
+
* @param options - Click options including optional index for multiple matches
|
|
32
32
|
* @returns Promise resolving to click result
|
|
33
33
|
*
|
|
34
34
|
* @throws CommandError When element operations fail
|
|
@@ -44,4 +44,70 @@ export declare function fillElement(cdp: CDPConnection, selector: string, value:
|
|
|
44
44
|
export declare function clickElement(cdp: CDPConnection, selector: string, options?: {
|
|
45
45
|
index?: number;
|
|
46
46
|
}): Promise<ClickResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Wait for page to stabilize after an action (click, fill, etc.).
|
|
49
|
+
*
|
|
50
|
+
* This is a lightweight stability check designed for post-action waiting:
|
|
51
|
+
* - Waits for network to be idle for 150ms
|
|
52
|
+
* - Times out after 2s to avoid hanging
|
|
53
|
+
* - Does not block on slow background requests
|
|
54
|
+
*
|
|
55
|
+
* @param cdp - CDP connection
|
|
56
|
+
* @returns Promise that resolves when stable or timeout reached
|
|
57
|
+
*
|
|
58
|
+
* @remarks
|
|
59
|
+
* This is intentionally less strict than page readiness on initial load.
|
|
60
|
+
* It's designed to catch immediate reactions to user actions (AJAX, re-renders)
|
|
61
|
+
* without waiting for unrelated background activity.
|
|
62
|
+
*/
|
|
63
|
+
export declare function waitForActionStability(cdp: CDPConnection): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Options for pressing a key on an element.
|
|
66
|
+
*/
|
|
67
|
+
export interface PressKeyOptions {
|
|
68
|
+
/** Element index if selector matches multiple (1-based) */
|
|
69
|
+
index?: number;
|
|
70
|
+
/** Number of times to press the key (default: 1) */
|
|
71
|
+
times?: number;
|
|
72
|
+
/** Comma-separated modifier keys (shift, ctrl, alt, meta) */
|
|
73
|
+
modifiers?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Result of pressing a key.
|
|
77
|
+
*/
|
|
78
|
+
export interface PressKeyResult {
|
|
79
|
+
success: boolean;
|
|
80
|
+
error?: string;
|
|
81
|
+
selector?: string;
|
|
82
|
+
key?: string;
|
|
83
|
+
times?: number;
|
|
84
|
+
modifiers?: number;
|
|
85
|
+
elementType?: string | undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Press a key on an element.
|
|
89
|
+
*
|
|
90
|
+
* Focuses the element first, then dispatches keyDown and keyUp events via CDP.
|
|
91
|
+
*
|
|
92
|
+
* @param cdp - CDP connection
|
|
93
|
+
* @param selector - CSS selector for the element
|
|
94
|
+
* @param keyName - Key name (e.g., "Enter", "Tab", "a")
|
|
95
|
+
* @param options - Press key options
|
|
96
|
+
* @returns Promise resolving to press key result
|
|
97
|
+
*
|
|
98
|
+
* @throws CommandError When element or key operations fail
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // Press Enter on a todo input
|
|
103
|
+
* const result = await pressKeyElement(cdp, '.new-todo', 'Enter');
|
|
104
|
+
*
|
|
105
|
+
* // Press Tab 3 times with Shift held
|
|
106
|
+
* const result = await pressKeyElement(cdp, 'input', 'Tab', {
|
|
107
|
+
* times: 3,
|
|
108
|
+
* modifiers: 'shift'
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare function pressKeyElement(cdp: CDPConnection, selector: string, keyName: string, options?: PressKeyOptions): Promise<PressKeyResult>;
|
|
47
113
|
//# sourceMappingURL=formFillHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formFillHelpers.d.ts","sourceRoot":"","sources":["../../../src/commands/dom/formFillHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":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ClC;AAqCD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,cAAc,CAAC,CAuEzB"}
|
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
* Form interaction helpers for filling inputs, clicking buttons, etc.
|
|
3
3
|
*/
|
|
4
4
|
import { CommandError } from '../../ui/errors/index.js';
|
|
5
|
+
import { createLogger } from '../../ui/logging/index.js';
|
|
5
6
|
import { EXIT_CODES } from '../../utils/exitCodes.js';
|
|
6
|
-
import {
|
|
7
|
+
import { getKeyDefinition, parseModifiers } from './keyMapping.js';
|
|
8
|
+
import { REACT_FILL_SCRIPT, CLICK_ELEMENT_SCRIPT, } from './reactEventHelpers.js';
|
|
9
|
+
const log = createLogger('dom');
|
|
10
|
+
/** Network idle threshold for post-action stability (ms) */
|
|
11
|
+
const ACTION_NETWORK_IDLE_MS = 150;
|
|
12
|
+
/** Maximum time to wait for post-action stability (ms) */
|
|
13
|
+
const ACTION_STABILITY_TIMEOUT_MS = 2000;
|
|
14
|
+
/** Check interval for stability polling (ms) */
|
|
15
|
+
const STABILITY_CHECK_INTERVAL_MS = 50;
|
|
7
16
|
/**
|
|
8
17
|
* Format exception details into a user-friendly error message with troubleshooting hints.
|
|
9
18
|
*
|
|
@@ -36,7 +45,7 @@ function formatScriptExecutionError(exceptionDetails, selector, operationType =
|
|
|
36
45
|
* @param cdp - CDP connection
|
|
37
46
|
* @param selector - CSS selector for the element
|
|
38
47
|
* @param value - Value to fill
|
|
39
|
-
* @param options - Fill options
|
|
48
|
+
* @param options - Fill options including optional index for multiple matches
|
|
40
49
|
* @returns Promise resolving to fill result
|
|
41
50
|
*
|
|
42
51
|
* @throws CommandError When element operations fail
|
|
@@ -50,18 +59,11 @@ function formatScriptExecutionError(exceptionDetails, selector, operationType =
|
|
|
50
59
|
* ```
|
|
51
60
|
*/
|
|
52
61
|
export async function fillElement(cdp, selector, value, options = {}) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
if (!indexResult.uniqueSelector) {
|
|
60
|
-
throw new CommandError('Failed to resolve unique selector for element index', { note: 'Element index resolution returned no unique selector' }, EXIT_CODES.SOFTWARE_ERROR);
|
|
61
|
-
}
|
|
62
|
-
targetSelector = indexResult.uniqueSelector;
|
|
63
|
-
}
|
|
64
|
-
const expression = `(${REACT_FILL_SCRIPT})('${escapeSelectorForJS(targetSelector)}', '${escapeValueForJS(value)}', ${JSON.stringify({ blur: options.blur ?? true })})`;
|
|
62
|
+
const scriptOptions = {
|
|
63
|
+
blur: options.blur ?? true,
|
|
64
|
+
index: options.index,
|
|
65
|
+
};
|
|
66
|
+
const expression = `(${REACT_FILL_SCRIPT})('${escapeSelectorForJS(selector)}', '${escapeValueForJS(value)}', ${JSON.stringify(scriptOptions)})`;
|
|
65
67
|
try {
|
|
66
68
|
const response = await cdp.send('Runtime.evaluate', {
|
|
67
69
|
expression,
|
|
@@ -91,7 +93,7 @@ export async function fillElement(cdp, selector, value, options = {}) {
|
|
|
91
93
|
*
|
|
92
94
|
* @param cdp - CDP connection
|
|
93
95
|
* @param selector - CSS selector for the element
|
|
94
|
-
* @param options - Click options
|
|
96
|
+
* @param options - Click options including optional index for multiple matches
|
|
95
97
|
* @returns Promise resolving to click result
|
|
96
98
|
*
|
|
97
99
|
* @throws CommandError When element operations fail
|
|
@@ -105,18 +107,8 @@ export async function fillElement(cdp, selector, value, options = {}) {
|
|
|
105
107
|
* ```
|
|
106
108
|
*/
|
|
107
109
|
export async function clickElement(cdp, selector, options = {}) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const indexResult = await getElementByIndex(cdp, selector, options.index);
|
|
111
|
-
if (!indexResult.success) {
|
|
112
|
-
return indexResult;
|
|
113
|
-
}
|
|
114
|
-
if (!indexResult.uniqueSelector) {
|
|
115
|
-
throw new CommandError('Failed to resolve unique selector for element index', { note: 'Element index resolution returned no unique selector' }, EXIT_CODES.SOFTWARE_ERROR);
|
|
116
|
-
}
|
|
117
|
-
targetSelector = indexResult.uniqueSelector;
|
|
118
|
-
}
|
|
119
|
-
const expression = `(${CLICK_ELEMENT_SCRIPT})('${escapeSelectorForJS(targetSelector)}')`;
|
|
110
|
+
const indexArg = options.index ?? 'null';
|
|
111
|
+
const expression = `(${CLICK_ELEMENT_SCRIPT})('${escapeSelectorForJS(selector)}', ${indexArg})`;
|
|
120
112
|
try {
|
|
121
113
|
const response = await cdp.send('Runtime.evaluate', {
|
|
122
114
|
expression,
|
|
@@ -125,7 +117,7 @@ export async function clickElement(cdp, selector, options = {}) {
|
|
|
125
117
|
});
|
|
126
118
|
const cdpResponse = response;
|
|
127
119
|
if (cdpResponse.exceptionDetails) {
|
|
128
|
-
const errorMessage = formatScriptExecutionError(cdpResponse.exceptionDetails, selector);
|
|
120
|
+
const errorMessage = formatScriptExecutionError(cdpResponse.exceptionDetails, selector, 'click');
|
|
129
121
|
throw new CommandError(errorMessage, {}, EXIT_CODES.SOFTWARE_ERROR);
|
|
130
122
|
}
|
|
131
123
|
if (cdpResponse.result?.value) {
|
|
@@ -142,63 +134,217 @@ export async function clickElement(cdp, selector, options = {}) {
|
|
|
142
134
|
}
|
|
143
135
|
}
|
|
144
136
|
/**
|
|
145
|
-
*
|
|
137
|
+
* Escape CSS selector for safe inclusion in JavaScript single-quoted string.
|
|
138
|
+
* Uses JSON.stringify for special characters, then escapes single quotes
|
|
139
|
+
* since the expression wrapper uses single quotes.
|
|
146
140
|
*
|
|
147
|
-
* @param
|
|
148
|
-
* @
|
|
149
|
-
* @param index - Element index (1-based)
|
|
150
|
-
* @returns Promise resolving to element info
|
|
141
|
+
* @param selector - CSS selector to escape
|
|
142
|
+
* @returns Escaped selector safe for single-quoted JS string
|
|
151
143
|
*
|
|
152
|
-
* @
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
function escapeSelectorForJS(selector) {
|
|
147
|
+
return JSON.stringify(selector).slice(1, -1).replace(/'/g, "\\'");
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Escape value for safe inclusion in JavaScript single-quoted string.
|
|
151
|
+
* Uses JSON.stringify for special characters, then escapes single quotes
|
|
152
|
+
* since the expression wrapper uses single quotes.
|
|
153
|
+
*
|
|
154
|
+
* @param value - Value to escape
|
|
155
|
+
* @returns Escaped value safe for single-quoted JS string
|
|
153
156
|
*
|
|
154
157
|
* @internal
|
|
155
158
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
function escapeValueForJS(value) {
|
|
160
|
+
return JSON.stringify(value).slice(1, -1).replace(/'/g, "\\'");
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Wait for page to stabilize after an action (click, fill, etc.).
|
|
164
|
+
*
|
|
165
|
+
* This is a lightweight stability check designed for post-action waiting:
|
|
166
|
+
* - Waits for network to be idle for 150ms
|
|
167
|
+
* - Times out after 2s to avoid hanging
|
|
168
|
+
* - Does not block on slow background requests
|
|
169
|
+
*
|
|
170
|
+
* @param cdp - CDP connection
|
|
171
|
+
* @returns Promise that resolves when stable or timeout reached
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* This is intentionally less strict than page readiness on initial load.
|
|
175
|
+
* It's designed to catch immediate reactions to user actions (AJAX, re-renders)
|
|
176
|
+
* without waiting for unrelated background activity.
|
|
177
|
+
*/
|
|
178
|
+
export async function waitForActionStability(cdp) {
|
|
179
|
+
const deadline = Date.now() + ACTION_STABILITY_TIMEOUT_MS;
|
|
180
|
+
let activeRequests = 0;
|
|
181
|
+
let lastActivity = Date.now();
|
|
182
|
+
const requestHandler = () => {
|
|
183
|
+
activeRequests++;
|
|
184
|
+
lastActivity = Date.now();
|
|
185
|
+
};
|
|
186
|
+
const finishHandler = () => {
|
|
187
|
+
activeRequests--;
|
|
188
|
+
if (activeRequests === 0) {
|
|
189
|
+
lastActivity = Date.now();
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
await cdp.send('Network.enable');
|
|
193
|
+
const cleanupRequest = cdp.on('Network.requestWillBeSent', requestHandler);
|
|
194
|
+
const cleanupFinished = cdp.on('Network.loadingFinished', finishHandler);
|
|
195
|
+
const cleanupFailed = cdp.on('Network.loadingFailed', finishHandler);
|
|
158
196
|
try {
|
|
159
|
-
|
|
160
|
-
|
|
197
|
+
while (Date.now() < deadline) {
|
|
198
|
+
if (activeRequests === 0) {
|
|
199
|
+
const idleTime = Date.now() - lastActivity;
|
|
200
|
+
if (idleTime >= ACTION_NETWORK_IDLE_MS) {
|
|
201
|
+
log.debug(`Network stable after ${idleTime}ms idle`);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
await delay(STABILITY_CHECK_INTERVAL_MS);
|
|
206
|
+
}
|
|
207
|
+
log.debug('Stability timeout reached, proceeding');
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
cleanupRequest();
|
|
211
|
+
cleanupFinished();
|
|
212
|
+
cleanupFailed();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Delay utility.
|
|
217
|
+
*
|
|
218
|
+
* @param ms - Milliseconds to delay
|
|
219
|
+
*/
|
|
220
|
+
function delay(ms) {
|
|
221
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Script to focus an element by selector and optional index.
|
|
225
|
+
*
|
|
226
|
+
* @returns Object with success status and element info
|
|
227
|
+
*/
|
|
228
|
+
const FOCUS_ELEMENT_SCRIPT = `
|
|
229
|
+
(function(selector, index) {
|
|
230
|
+
const allMatches = document.querySelectorAll(selector);
|
|
231
|
+
if (allMatches.length === 0) {
|
|
232
|
+
return { success: false, error: 'No elements found matching selector: ' + selector };
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
let el;
|
|
236
|
+
if (typeof index === 'number' && index > 0) {
|
|
237
|
+
if (index > allMatches.length) {
|
|
238
|
+
return {
|
|
239
|
+
success: false,
|
|
240
|
+
error: 'Index ' + index + ' out of range (found ' + allMatches.length + ' elements)'
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
el = allMatches[index - 1];
|
|
244
|
+
} else {
|
|
245
|
+
el = allMatches[0];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
el.focus();
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
success: true,
|
|
252
|
+
selector: selector,
|
|
253
|
+
elementType: el.tagName.toLowerCase(),
|
|
254
|
+
focused: document.activeElement === el
|
|
255
|
+
};
|
|
256
|
+
})`;
|
|
257
|
+
/**
|
|
258
|
+
* Press a key on an element.
|
|
259
|
+
*
|
|
260
|
+
* Focuses the element first, then dispatches keyDown and keyUp events via CDP.
|
|
261
|
+
*
|
|
262
|
+
* @param cdp - CDP connection
|
|
263
|
+
* @param selector - CSS selector for the element
|
|
264
|
+
* @param keyName - Key name (e.g., "Enter", "Tab", "a")
|
|
265
|
+
* @param options - Press key options
|
|
266
|
+
* @returns Promise resolving to press key result
|
|
267
|
+
*
|
|
268
|
+
* @throws CommandError When element or key operations fail
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* // Press Enter on a todo input
|
|
273
|
+
* const result = await pressKeyElement(cdp, '.new-todo', 'Enter');
|
|
274
|
+
*
|
|
275
|
+
* // Press Tab 3 times with Shift held
|
|
276
|
+
* const result = await pressKeyElement(cdp, 'input', 'Tab', {
|
|
277
|
+
* times: 3,
|
|
278
|
+
* modifiers: 'shift'
|
|
279
|
+
* });
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
export async function pressKeyElement(cdp, selector, keyName, options = {}) {
|
|
283
|
+
const keyDef = getKeyDefinition(keyName);
|
|
284
|
+
if (!keyDef) {
|
|
285
|
+
return {
|
|
286
|
+
success: false,
|
|
287
|
+
error: `Unknown key: "${keyName}". Supported keys: Enter, Tab, Escape, Space, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp, PageDown, F1-F12, a-z, 0-9`,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
const times = options.times ?? 1;
|
|
291
|
+
const modifierFlags = parseModifiers(options.modifiers);
|
|
292
|
+
const indexArg = options.index ?? 'null';
|
|
293
|
+
const focusExpression = `(${FOCUS_ELEMENT_SCRIPT})('${escapeSelectorForJS(selector)}', ${indexArg})`;
|
|
294
|
+
try {
|
|
295
|
+
const focusResponse = await cdp.send('Runtime.evaluate', {
|
|
296
|
+
expression: focusExpression,
|
|
161
297
|
returnByValue: true,
|
|
162
298
|
});
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
throw new CommandError(
|
|
299
|
+
const focusCdpResponse = focusResponse;
|
|
300
|
+
if (focusCdpResponse.exceptionDetails) {
|
|
301
|
+
throw new CommandError(`Failed to focus element: ${focusCdpResponse.exceptionDetails.text}`, { note: `Selector: ${selector}` }, EXIT_CODES.SOFTWARE_ERROR);
|
|
166
302
|
}
|
|
167
|
-
|
|
168
|
-
|
|
303
|
+
const focusResult = focusCdpResponse.result?.value;
|
|
304
|
+
if (!focusResult?.success) {
|
|
305
|
+
return {
|
|
306
|
+
success: false,
|
|
307
|
+
error: focusResult?.error ?? 'Failed to focus element',
|
|
308
|
+
selector,
|
|
309
|
+
};
|
|
169
310
|
}
|
|
170
|
-
|
|
311
|
+
for (let i = 0; i < times; i++) {
|
|
312
|
+
await dispatchKeyEvent(cdp, 'keyDown', keyDef, modifierFlags);
|
|
313
|
+
await dispatchKeyEvent(cdp, 'keyUp', keyDef, modifierFlags);
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
success: true,
|
|
317
|
+
selector,
|
|
318
|
+
key: keyName,
|
|
319
|
+
times,
|
|
320
|
+
modifiers: modifierFlags,
|
|
321
|
+
elementType: focusResult.elementType,
|
|
322
|
+
};
|
|
171
323
|
}
|
|
172
324
|
catch (error) {
|
|
173
325
|
if (error instanceof CommandError) {
|
|
174
326
|
throw error;
|
|
175
327
|
}
|
|
176
328
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
177
|
-
throw new CommandError('Failed to
|
|
329
|
+
throw new CommandError('Failed to press key', { note: errorMessage }, EXIT_CODES.SOFTWARE_ERROR);
|
|
178
330
|
}
|
|
179
331
|
}
|
|
180
332
|
/**
|
|
181
|
-
*
|
|
182
|
-
* Uses JSON.stringify to handle all special characters safely.
|
|
183
|
-
*
|
|
184
|
-
* @param selector - CSS selector to escape
|
|
185
|
-
* @returns Escaped selector (without surrounding quotes)
|
|
186
|
-
*
|
|
187
|
-
* @internal
|
|
188
|
-
*/
|
|
189
|
-
function escapeSelectorForJS(selector) {
|
|
190
|
-
return JSON.stringify(selector).slice(1, -1);
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Escape value for safe inclusion in JavaScript string.
|
|
194
|
-
* Uses JSON.stringify to handle all special characters safely.
|
|
333
|
+
* Dispatch a single key event via CDP Input.dispatchKeyEvent.
|
|
195
334
|
*
|
|
196
|
-
* @param
|
|
197
|
-
* @
|
|
198
|
-
*
|
|
199
|
-
* @
|
|
335
|
+
* @param cdp - CDP connection
|
|
336
|
+
* @param type - Event type (keyDown or keyUp)
|
|
337
|
+
* @param keyDef - Key definition with code, key, and keyCode
|
|
338
|
+
* @param modifiers - Modifier bit flags
|
|
200
339
|
*/
|
|
201
|
-
function
|
|
202
|
-
|
|
340
|
+
async function dispatchKeyEvent(cdp, type, keyDef, modifiers) {
|
|
341
|
+
await cdp.send('Input.dispatchKeyEvent', {
|
|
342
|
+
type,
|
|
343
|
+
code: keyDef.code,
|
|
344
|
+
key: keyDef.key,
|
|
345
|
+
windowsVirtualKeyCode: keyDef.keyCode,
|
|
346
|
+
nativeVirtualKeyCode: keyDef.keyCode,
|
|
347
|
+
modifiers,
|
|
348
|
+
});
|
|
203
349
|
}
|
|
204
350
|
//# sourceMappingURL=formFillHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formFillHelpers.js","sourceRoot":"","sources":["../../../src/commands/dom/formFillHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"formFillHelpers.js","sourceRoot":"","sources":["../../../src/commands/dom/formFillHelpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAsB,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAIrB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AAEhC,4DAA4D;AAC5D,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,0DAA0D;AAC1D,MAAM,2BAA2B,GAAG,IAAI,CAAC;AACzC,gDAAgD;AAChD,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAEvC;;;;;;;GAOG;AACH,SAAS,0BAA0B,CACjC,gBAAmD,EACnD,QAAgB,EAChB,gBAAkC,MAAM;IAExC,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,IAAI,eAAe,CAAC;IAC3D,MAAM,QAAQ,GACZ,gBAAgB,CAAC,UAAU,KAAK,SAAS,IAAI,gBAAgB,CAAC,YAAY,KAAK,SAAS;QACtF,CAAC,CAAC,YAAY,gBAAgB,CAAC,UAAU,GAAG,CAAC,Y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,CAAC;AAED;;;;;;;GAOG;AACH,KAAK,UAAU,gBAAgB,CAC7B,GAAkB,EAClB,IAAyB,EACzB,MAAqB,EACrB,SAAiB;IAEjB,MAAM,GAAG,CAAC,IAAI,CAAC,wBAAwB,EAAE;QACvC,IAAI;QACJ,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,qBAAqB,EAAE,MAAM,CAAC,OAAO;QACrC,oBAAoB,EAAE,MAAM,CAAC,OAAO;QACpC,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formInteraction.d.ts","sourceRoot":"","sources":["../../../src/commands/dom/formInteraction.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"formInteraction.d.ts","sourceRoot":"","sources":["../../../src/commands/dom/formInteraction.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqEzC;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkOtE"}
|