browser-debugger-cli 0.8.0 → 0.10.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/README.md +7 -1
- package/dist/cdp/schema.d.ts +4 -1
- package/dist/cdp/schema.js +48 -7
- package/dist/commands/cdp.js +3 -2
- package/dist/commands/cleanup.d.ts +11 -0
- package/dist/commands/cleanup.js +161 -57
- package/dist/commands/console.d.ts +20 -1
- package/dist/commands/console.js +57 -17
- package/dist/commands/details.js +3 -2
- package/dist/commands/dom/DomElementResolver.d.ts +10 -3
- package/dist/commands/dom/DomElementResolver.js +35 -17
- package/dist/commands/dom/a11y.d.ts +10 -0
- package/dist/commands/dom/a11y.js +29 -6
- package/dist/commands/dom/eval.d.ts +3 -1
- package/dist/commands/dom/eval.js +29 -4
- package/dist/commands/dom/form.js +16 -62
- package/dist/commands/dom/formInteraction.js +189 -119
- package/dist/commands/dom/formSummary.d.ts +49 -0
- package/dist/commands/dom/formSummary.js +180 -0
- package/dist/commands/dom/frames.d.ts +2 -1
- package/dist/commands/dom/frames.js +17 -2
- package/dist/commands/dom/get.d.ts +6 -5
- package/dist/commands/dom/get.js +92 -82
- package/dist/commands/dom/helpers/index.d.ts +1 -1
- package/dist/commands/dom/helpers/index.js +1 -1
- package/dist/commands/dom/helpers/keyAttributes.d.ts +20 -0
- package/dist/commands/dom/helpers/keyAttributes.js +54 -0
- package/dist/commands/dom/helpers/query.d.ts +44 -17
- package/dist/commands/dom/helpers/query.js +300 -106
- package/dist/commands/dom/helpers/runElementCommand.d.ts +10 -2
- package/dist/commands/dom/helpers/runElementCommand.js +98 -30
- package/dist/commands/dom/helpers/screenshot.d.ts +4 -1
- package/dist/commands/dom/helpers/screenshot.js +239 -51
- package/dist/commands/dom/index.d.ts +4 -1
- package/dist/commands/dom/index.js +22 -7
- package/dist/commands/dom/inspect.d.ts +15 -0
- package/dist/commands/dom/inspect.js +82 -0
- package/dist/commands/dom/layout.d.ts +14 -0
- package/dist/commands/dom/layout.js +54 -0
- package/dist/commands/dom/listeners.d.ts +5 -1
- package/dist/commands/dom/listeners.js +15 -5
- package/dist/commands/dom/query.js +2 -3
- package/dist/commands/dom/screenshot.d.ts +12 -2
- package/dist/commands/dom/screenshot.js +27 -3
- package/dist/commands/dom/semanticUtils.d.ts +16 -10
- package/dist/commands/dom/semanticUtils.js +53 -16
- package/dist/commands/dom/wait.d.ts +13 -0
- package/dist/commands/dom/wait.js +83 -0
- package/dist/commands/helpJson.js +2 -2
- package/dist/commands/network/list.js +17 -13
- package/dist/commands/optionBehaviors.js +154 -21
- package/dist/commands/page.d.ts +3 -2
- package/dist/commands/page.js +100 -5
- package/dist/commands/peek.js +4 -11
- package/dist/commands/sessions.d.ts +8 -0
- package/dist/commands/sessions.js +19 -0
- package/dist/commands/shared/CommandRunner.js +4 -4
- package/dist/commands/shared/commonOptions.d.ts +4 -0
- package/dist/commands/shared/commonOptions.js +9 -0
- package/dist/commands/shared/dataFetcher.js +2 -2
- package/dist/commands/shared/followMode.d.ts +21 -1
- package/dist/commands/shared/followMode.js +29 -2
- package/dist/commands/shared/handleValidationError.d.ts +2 -2
- package/dist/commands/shared/handleValidationError.js +12 -3
- package/dist/commands/shared/optionTypes.d.ts +61 -5
- package/dist/commands/shared/startHelpers.d.ts +66 -0
- package/dist/commands/shared/startHelpers.js +103 -13
- package/dist/commands/shared/validation.d.ts +14 -2
- package/dist/commands/shared/validation.js +20 -3
- package/dist/commands/start.d.ts +63 -0
- package/dist/commands/start.js +115 -15
- package/dist/commands/status.js +29 -7
- package/dist/commands/stop.js +7 -6
- package/dist/commands/tail.js +4 -11
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands.js +2 -0
- package/dist/connection/chromeIdentity.d.ts +65 -0
- package/dist/connection/chromeIdentity.js +143 -0
- package/dist/connection/launcher/profilePreferences.d.ts +47 -0
- package/dist/connection/launcher/profilePreferences.js +151 -0
- package/dist/connection/launcher.d.ts +21 -2
- package/dist/connection/launcher.js +42 -16
- package/dist/connection/portReservation.d.ts +14 -4
- package/dist/connection/portReservation.js +21 -6
- package/dist/connection/startupExit.d.ts +8 -0
- package/dist/connection/startupExit.js +15 -6
- package/dist/constants.d.ts +6 -2
- package/dist/constants.js +9 -2
- package/dist/daemon/SessionController.js +23 -7
- package/dist/daemon/errors.d.ts +1 -1
- package/dist/daemon/errors.js +1 -1
- package/dist/daemon/launcher.d.ts +10 -2
- package/dist/daemon/launcher.js +8 -7
- package/dist/daemon/server/SocketServer.js +1 -2
- package/dist/daemon/session/Session.d.ts +20 -0
- package/dist/daemon/session/Session.js +80 -9
- package/dist/daemon/session/chromeConnection.d.ts +9 -0
- package/dist/daemon/session/chromeConnection.js +45 -8
- package/dist/daemon/session/commandRegistry.d.ts +14 -1
- package/dist/daemon/session/commandRegistry.js +113 -67
- package/dist/daemon/session/interactions.d.ts +48 -9
- package/dist/daemon/session/interactions.js +46 -9
- package/dist/daemon/session/triggeredRequests.d.ts +67 -0
- package/dist/daemon/session/triggeredRequests.js +157 -0
- package/dist/daemon/session/types.d.ts +5 -1
- package/dist/daemon.js +10630 -3601
- package/dist/errors/messages.d.ts +456 -24
- package/dist/errors/messages.js +862 -67
- package/dist/index.js +6915 -3401
- package/dist/ipc/client.d.ts +21 -1
- package/dist/ipc/client.js +35 -3
- package/dist/ipc/protocol/commands.d.ts +145 -5
- package/dist/ipc/protocol/commands.js +4 -0
- package/dist/ipc/protocol/domTypes.d.ts +291 -7
- package/dist/ipc/protocol/inspectTypes.d.ts +388 -0
- package/dist/ipc/protocol/inspectTypes.js +10 -0
- package/dist/ipc/session/lifecycle.d.ts +8 -1
- package/dist/ipc/session/queries.d.ts +5 -1
- package/dist/ipc/session/types.d.ts +5 -0
- package/dist/ipc/transport/index.d.ts +2 -1
- package/dist/ipc/transport/index.js +2 -2
- package/dist/runtime/dom/actionEffects.d.ts +185 -0
- package/dist/runtime/dom/actionEffects.js +402 -0
- package/dist/runtime/dom/actionEffectsScripts.d.ts +90 -0
- package/dist/runtime/dom/actionEffectsScripts.js +426 -0
- package/dist/runtime/dom/elementGeometry.d.ts +170 -0
- package/dist/runtime/dom/elementGeometry.js +553 -0
- package/dist/runtime/dom/elementInfo.d.ts +103 -0
- package/dist/runtime/dom/elementInfo.js +256 -0
- package/dist/runtime/dom/evalHelpers.d.ts +51 -6
- package/dist/runtime/dom/evalHelpers.js +136 -26
- package/dist/runtime/dom/eventListeners.d.ts +2 -1
- package/dist/runtime/dom/eventListeners.js +184 -47
- package/dist/runtime/dom/formDiscovery.d.ts +1 -1
- package/dist/runtime/dom/formDiscovery.js +116 -16
- package/dist/runtime/dom/formFillHelpers/fill.d.ts +9 -0
- package/dist/runtime/dom/formFillHelpers/fill.js +178 -14
- package/dist/runtime/dom/formFillHelpers/index.d.ts +2 -2
- package/dist/runtime/dom/formFillHelpers/index.js +2 -2
- package/dist/runtime/dom/formFillHelpers/pressKey.js +14 -3
- package/dist/runtime/dom/formFillHelpers/scroll.d.ts +3 -0
- package/dist/runtime/dom/formFillHelpers/scroll.js +60 -18
- package/dist/runtime/dom/formFillHelpers/shared.d.ts +17 -0
- package/dist/runtime/dom/formFillHelpers/shared.js +25 -1
- package/dist/runtime/dom/formFillHelpers/stability.d.ts +20 -6
- package/dist/runtime/dom/formFillHelpers/stability.js +50 -19
- package/dist/runtime/dom/formSubmitHelpers.d.ts +3 -0
- package/dist/runtime/dom/formSubmitHelpers.js +89 -15
- package/dist/runtime/dom/frameLayout.d.ts +60 -0
- package/dist/runtime/dom/frameLayout.js +140 -0
- package/dist/runtime/dom/frameOrigin.d.ts +50 -0
- package/dist/runtime/dom/frameOrigin.js +62 -0
- package/dist/runtime/dom/frameScopedConnection.d.ts +92 -0
- package/dist/runtime/dom/frameScopedConnection.js +252 -0
- package/dist/runtime/dom/frameSelection.d.ts +12 -1
- package/dist/runtime/dom/frameSelection.js +22 -3
- package/dist/runtime/dom/frames.d.ts +61 -5
- package/dist/runtime/dom/frames.js +329 -75
- package/dist/runtime/dom/inspect.d.ts +28 -0
- package/dist/runtime/dom/inspect.js +557 -0
- package/dist/runtime/dom/inspectAllStyles.d.ts +62 -0
- package/dist/runtime/dom/inspectAllStyles.js +385 -0
- package/dist/runtime/dom/inspectCascade.d.ts +94 -0
- package/dist/runtime/dom/inspectCascade.js +371 -0
- package/dist/runtime/dom/inspectCascadeModel.d.ts +39 -0
- package/dist/runtime/dom/inspectCascadeModel.js +232 -0
- package/dist/runtime/dom/inspectHints.d.ts +62 -0
- package/dist/runtime/dom/inspectHints.js +305 -0
- package/dist/runtime/dom/inspectLayoutModel.d.ts +87 -0
- package/dist/runtime/dom/inspectLayoutModel.js +346 -0
- package/dist/runtime/dom/inspectModel.d.ts +74 -0
- package/dist/runtime/dom/inspectModel.js +184 -0
- package/dist/runtime/dom/inspectPaintModel.d.ts +157 -0
- package/dist/runtime/dom/inspectPaintModel.js +461 -0
- package/dist/runtime/dom/inspectRules.d.ts +37 -0
- package/dist/runtime/dom/inspectRules.js +101 -0
- package/dist/runtime/dom/inspectScripts.d.ts +132 -0
- package/dist/runtime/dom/inspectScripts.js +263 -0
- package/dist/runtime/dom/inspectTree.d.ts +40 -0
- package/dist/runtime/dom/inspectTree.js +134 -0
- package/dist/runtime/dom/inspectVariables.d.ts +33 -0
- package/dist/runtime/dom/inspectVariables.js +94 -0
- package/dist/runtime/dom/inspectWhyModel.d.ts +20 -0
- package/dist/runtime/dom/inspectWhyModel.js +134 -0
- package/dist/runtime/dom/layout.d.ts +71 -0
- package/dist/runtime/dom/layout.js +340 -0
- package/dist/runtime/dom/listenerPageScripts.d.ts +72 -0
- package/dist/runtime/dom/listenerPageScripts.js +365 -0
- package/dist/runtime/dom/listenerSummary.d.ts +136 -11
- package/dist/runtime/dom/listenerSummary.js +361 -22
- package/dist/runtime/dom/pageActivity.d.ts +41 -0
- package/dist/runtime/dom/pageActivity.js +123 -0
- package/dist/runtime/dom/reactEventHelpers.d.ts +63 -2
- package/dist/runtime/dom/reactEventHelpers.js +220 -41
- package/dist/runtime/dom/targetNode.d.ts +80 -27
- package/dist/runtime/dom/targetNode.js +249 -33
- package/dist/runtime/dom/wait.d.ts +25 -0
- package/dist/runtime/dom/wait.js +199 -0
- package/dist/runtime/dom/waitCondition.d.ts +71 -0
- package/dist/runtime/dom/waitCondition.js +75 -0
- package/dist/runtime/page/emulation.d.ts +71 -0
- package/dist/runtime/page/emulation.js +117 -0
- package/dist/runtime/page/loadingState.d.ts +36 -0
- package/dist/runtime/page/loadingState.js +86 -0
- package/dist/runtime/page/navigation.d.ts +46 -2
- package/dist/runtime/page/navigation.js +69 -33
- package/dist/session/QueryCacheManager.d.ts +11 -1
- package/dist/session/QueryCacheManager.js +25 -3
- package/dist/session/chromeOwners.d.ts +34 -0
- package/dist/session/chromeOwners.js +51 -0
- package/dist/session/cleanup/staleSession.d.ts +11 -1
- package/dist/session/cleanup/staleSession.js +17 -6
- package/dist/session/cleanup/userCommands.js +2 -4
- package/dist/session/metadata.d.ts +5 -1
- package/dist/session/metadata.js +2 -1
- package/dist/session/paths.d.ts +77 -3
- package/dist/session/paths.js +111 -5
- package/dist/session/port.d.ts +31 -7
- package/dist/session/port.js +50 -43
- package/dist/session/portClaims.d.ts +66 -0
- package/dist/session/portClaims.js +284 -0
- package/dist/session/sessionList.d.ts +58 -0
- package/dist/session/sessionList.js +199 -0
- package/dist/session/sessionName.d.ts +46 -0
- package/dist/session/sessionName.js +97 -0
- package/dist/telemetry/a11y.d.ts +18 -3
- package/dist/telemetry/a11y.js +170 -29
- package/dist/telemetry/console.d.ts +1 -0
- package/dist/telemetry/console.js +100 -5
- package/dist/telemetry/network.js +3 -1
- package/dist/telemetry/requestKinds.d.ts +32 -0
- package/dist/telemetry/requestKinds.js +61 -0
- package/dist/telemetry/requestState.d.ts +31 -0
- package/dist/telemetry/requestState.js +38 -0
- package/dist/types.d.ts +112 -3
- package/dist/ui/formatters/a11y.js +3 -0
- package/dist/ui/formatters/console/chronological.d.ts +8 -0
- package/dist/ui/formatters/console/chronological.js +17 -4
- package/dist/ui/formatters/console/json.js +3 -4
- package/dist/ui/formatters/console/shared.d.ts +12 -0
- package/dist/ui/formatters/console.d.ts +2 -2
- package/dist/ui/formatters/console.js +1 -1
- package/dist/ui/formatters/details.d.ts +8 -0
- package/dist/ui/formatters/details.js +61 -4
- package/dist/ui/formatters/dom.d.ts +27 -14
- package/dist/ui/formatters/dom.js +88 -59
- package/dist/ui/formatters/form.js +29 -18
- package/dist/ui/formatters/inspect.d.ts +39 -0
- package/dist/ui/formatters/inspect.js +596 -0
- package/dist/ui/formatters/keyAttributes.d.ts +19 -0
- package/dist/ui/formatters/keyAttributes.js +84 -0
- package/dist/ui/formatters/layout.d.ts +31 -0
- package/dist/ui/formatters/layout.js +53 -0
- package/dist/ui/formatters/listeners.d.ts +3 -2
- package/dist/ui/formatters/listeners.js +73 -9
- package/dist/ui/formatters/networkHeaders.d.ts +13 -0
- package/dist/ui/formatters/networkHeaders.js +36 -3
- package/dist/ui/formatters/networkList.d.ts +29 -1
- package/dist/ui/formatters/networkList.js +86 -20
- package/dist/ui/formatters/preview.js +2 -1
- package/dist/ui/formatters/requestStatus.d.ts +1 -17
- package/dist/ui/formatters/requestStatus.js +2 -30
- package/dist/ui/formatters/sessions.d.ts +12 -0
- package/dist/ui/formatters/sessions.js +40 -0
- package/dist/ui/formatters/status.d.ts +21 -2
- package/dist/ui/formatters/status.js +47 -10
- package/dist/ui/formatters/triggeredRequests.d.ts +36 -0
- package/dist/ui/formatters/triggeredRequests.js +65 -0
- package/dist/ui/formatting.d.ts +19 -0
- package/dist/ui/formatting.js +31 -36
- package/dist/ui/messages/chrome.d.ts +9 -0
- package/dist/ui/messages/chrome.js +17 -5
- package/dist/ui/messages/commands.d.ts +504 -14
- package/dist/ui/messages/commands.js +835 -21
- package/dist/ui/messages/consoleMessages.d.ts +10 -0
- package/dist/ui/messages/consoleMessages.js +17 -0
- package/dist/ui/messages/hints.js +2 -1
- package/dist/ui/messages/networkMessages.d.ts +14 -0
- package/dist/ui/messages/networkMessages.js +18 -0
- package/dist/ui/messages/preview.js +5 -4
- package/dist/ui/messages/session.d.ts +30 -21
- package/dist/ui/messages/session.js +48 -26
- package/dist/ui/messages/sessionCommand.d.ts +43 -0
- package/dist/ui/messages/sessionCommand.js +52 -0
- package/dist/utils/async.d.ts +17 -0
- package/dist/utils/async.js +36 -0
- package/dist/utils/color.d.ts +84 -0
- package/dist/utils/color.js +376 -0
- package/dist/utils/cssValues.d.ts +109 -0
- package/dist/utils/cssValues.js +236 -0
- package/dist/utils/http.d.ts +22 -1
- package/dist/utils/http.js +28 -9
- package/dist/utils/selectorFilters.d.ts +48 -8
- package/dist/utils/selectorFilters.js +296 -53
- package/dist/utils/shellDetection.d.ts +8 -2
- package/dist/utils/shellDetection.js +120 -33
- package/dist/utils/suggestions.d.ts +26 -0
- package/dist/utils/suggestions.js +73 -0
- package/dist/utils/taskMappings.js +10 -0
- package/dist/utils/url.d.ts +12 -2
- package/dist/utils/url.js +69 -7
- package/package.json +1 -1
- package/dist/ui/formatters/sessionFormatters.d.ts +0 -58
- package/dist/ui/formatters/sessionFormatters.js +0 -121
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Centralized location for reusable error messages with consistent formatting.
|
|
5
5
|
*/
|
|
6
|
-
import type { DomFrame } from '../ipc/protocol/commands.js';
|
|
6
|
+
import type { DomFrame, PendingRequestInfo } from '../ipc/protocol/commands.js';
|
|
7
|
+
import { type WaitCondition, type WaitSnapshot } from '../runtime/dom/waitCondition.js';
|
|
8
|
+
import type { DocumentRequestState, IndexSource } from '../types.js';
|
|
7
9
|
/**
|
|
8
|
-
* Generate "session already running" error message
|
|
10
|
+
* Generate "session already running" error message (commands carry
|
|
11
|
+
* `--session` for a named session).
|
|
9
12
|
*
|
|
10
13
|
* @param pid - Process ID of running session
|
|
11
14
|
* @param duration - Session duration in milliseconds
|
|
@@ -19,8 +22,19 @@ import type { DomFrame } from '../ipc/protocol/commands.js';
|
|
|
19
22
|
* ```
|
|
20
23
|
*/
|
|
21
24
|
export declare function sessionAlreadyRunningError(pid: number, duration: number, targetUrl?: string): string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The daemon's one-line answer to `bdg <url>` while its session runs.
|
|
27
|
+
*
|
|
28
|
+
* @param pid - Daemon PID
|
|
29
|
+
* @returns Message
|
|
30
|
+
*/
|
|
31
|
+
export declare function sessionAlreadyRunningMessage(pid: number): string;
|
|
32
|
+
/**
|
|
33
|
+
* What to do when `bdg <url>` finds the selected session already running.
|
|
34
|
+
*
|
|
35
|
+
* @returns Suggestion
|
|
36
|
+
*/
|
|
37
|
+
export declare function alreadyRunningSuggestion(): string;
|
|
24
38
|
/**
|
|
25
39
|
* Human-readable description of a bdg-launched Chrome (as opposed to one
|
|
26
40
|
* reached via `--chrome-ws-url`). Used in mismatch errors where the active
|
|
@@ -157,6 +171,15 @@ export interface ErrorWithSuggestion {
|
|
|
157
171
|
* Index out of range error.
|
|
158
172
|
*/
|
|
159
173
|
export declare function indexOutOfRangeError(index: number, max: number): ErrorWithSuggestion;
|
|
174
|
+
/** Finding elements by accessible name, quoted for the shell (the name may contain spaces and colons). */
|
|
175
|
+
export declare const A11Y_NAME_QUERY_EXAMPLE = "bdg dom a11y query 'name=\u2026'";
|
|
176
|
+
/**
|
|
177
|
+
* Empty (or blank) selector: the browser rejects it, so it is caught before
|
|
178
|
+
* any page script runs.
|
|
179
|
+
*
|
|
180
|
+
* @returns Message and suggestion
|
|
181
|
+
*/
|
|
182
|
+
export declare function emptySelectorError(): ErrorWithSuggestion;
|
|
160
183
|
/**
|
|
161
184
|
* CSS selector rejected by the browser. Playwright-only syntax (`:text()`,
|
|
162
185
|
* `>>`, `text=`) gets the filters bdg supports instead.
|
|
@@ -167,14 +190,59 @@ export declare function indexOutOfRangeError(index: number, max: number): ErrorW
|
|
|
167
190
|
*/
|
|
168
191
|
export declare function invalidSelectorError(selector: string, detail?: string): ErrorWithSuggestion;
|
|
169
192
|
/**
|
|
170
|
-
* A text or visibility filter (`:has-text()`, `:text-is()`, `:visible`)
|
|
171
|
-
*
|
|
193
|
+
* A text or visibility filter (`:has-text()`, `:text-is()`, `:visible`)
|
|
194
|
+
* inside a pseudo-class other than `:has()`, e.g. `:not(:visible)`.
|
|
172
195
|
*
|
|
173
196
|
* @param selector - Selector as given
|
|
174
197
|
* @param filter - The misplaced filter as written
|
|
175
198
|
* @returns Message and suggestion
|
|
176
199
|
*/
|
|
177
200
|
export declare function misplacedSelectorFilterError(selector: string, filter: string): ErrorWithSuggestion;
|
|
201
|
+
/**
|
|
202
|
+
* A sibling combinator (`+`, `~`) after a filtered compound: the rest of the
|
|
203
|
+
* selector is matched under the filtered element, so only descendant and
|
|
204
|
+
* child combinators can follow it.
|
|
205
|
+
*
|
|
206
|
+
* @param selector - Selector as given
|
|
207
|
+
* @param combinator - The combinator found
|
|
208
|
+
* @returns Message and suggestion
|
|
209
|
+
*/
|
|
210
|
+
export declare function siblingAfterFilterError(selector: string, combinator: string): ErrorWithSuggestion;
|
|
211
|
+
/**
|
|
212
|
+
* A `:has()` with filters whose selector starts with a sibling combinator
|
|
213
|
+
* (`:has(+ a:visible)`): its matches are searched under the element, where
|
|
214
|
+
* siblings are not.
|
|
215
|
+
*
|
|
216
|
+
* @param selector - Selector as given
|
|
217
|
+
* @param combinator - `+` or `~`
|
|
218
|
+
* @returns Message and suggestion
|
|
219
|
+
*/
|
|
220
|
+
export declare function siblingInHasError(selector: string, combinator: string): ErrorWithSuggestion;
|
|
221
|
+
/** How a selector with filters is malformed (before the browser sees it). */
|
|
222
|
+
declare const MALFORMED_SELECTOR_DETAILS: {
|
|
223
|
+
readonly 'empty-in-list': () => string;
|
|
224
|
+
readonly 'leading-combinator': (combinator: string) => string;
|
|
225
|
+
readonly 'trailing-combinator': () => string;
|
|
226
|
+
readonly 'empty-has': () => string;
|
|
227
|
+
readonly 'scope-in-has': () => string;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* A selector with filters that is malformed in a way bdg detects while
|
|
231
|
+
* splitting it (so the error shows the selector as given, not rewritten CSS).
|
|
232
|
+
*
|
|
233
|
+
* @param selector - Selector as given
|
|
234
|
+
* @param problem - What is wrong
|
|
235
|
+
* @param combinator - The combinator, for `leading-combinator`
|
|
236
|
+
* @returns Message and suggestion
|
|
237
|
+
*/
|
|
238
|
+
export declare function malformedSelectorError(selector: string, problem: keyof typeof MALFORMED_SELECTOR_DETAILS, combinator?: string): ErrorWithSuggestion;
|
|
239
|
+
/**
|
|
240
|
+
* `:has-text()` with empty text, which every element would match.
|
|
241
|
+
*
|
|
242
|
+
* @param selector - Selector as given
|
|
243
|
+
* @returns Message and suggestion
|
|
244
|
+
*/
|
|
245
|
+
export declare function emptyTextFilterError(selector: string): ErrorWithSuggestion;
|
|
178
246
|
/**
|
|
179
247
|
* A text filter without its text, e.g. `:has-text` or `:text-is("x"`.
|
|
180
248
|
*
|
|
@@ -214,6 +282,21 @@ export declare function emptyOutputPathError(extension?: string): ErrorWithSugge
|
|
|
214
282
|
* Start options given without the URL to open.
|
|
215
283
|
*/
|
|
216
284
|
export declare function missingStartUrlError(): ErrorWithSuggestion;
|
|
285
|
+
/**
|
|
286
|
+
* `--viewport` given something that is not a width and height.
|
|
287
|
+
*
|
|
288
|
+
* @param value - What was given
|
|
289
|
+
* @param max - Largest side accepted
|
|
290
|
+
*/
|
|
291
|
+
export declare function invalidViewportError(value: string, max: number): ErrorWithSuggestion;
|
|
292
|
+
/**
|
|
293
|
+
* `--color-scheme` given another value than the ones it takes.
|
|
294
|
+
*
|
|
295
|
+
* @param value - What was given
|
|
296
|
+
* @param similar - Close matches
|
|
297
|
+
* @param schemes - Accepted values
|
|
298
|
+
*/
|
|
299
|
+
export declare function invalidColorSchemeError(value: string, similar: string[], schemes: readonly string[]): ErrorWithSuggestion;
|
|
217
300
|
/**
|
|
218
301
|
* `-u` / `--user-data-dir` given something that is not a directory path.
|
|
219
302
|
*
|
|
@@ -221,6 +304,34 @@ export declare function missingStartUrlError(): ErrorWithSuggestion;
|
|
|
221
304
|
* @param reason - Why it cannot be used
|
|
222
305
|
*/
|
|
223
306
|
export declare function invalidUserDataDirError(value: string, reason: string): ErrorWithSuggestion;
|
|
307
|
+
/**
|
|
308
|
+
* A `--session` / `BDG_SESSION` name bdg cannot use as a directory name.
|
|
309
|
+
*
|
|
310
|
+
* @param name - The rejected name
|
|
311
|
+
* @param maxLength - Longest allowed name
|
|
312
|
+
*/
|
|
313
|
+
export declare function invalidSessionNameError(name: string, maxLength: number): ErrorWithSuggestion;
|
|
314
|
+
/**
|
|
315
|
+
* A session name whose daemon socket path would exceed the OS limit.
|
|
316
|
+
*
|
|
317
|
+
* @param name - Session name
|
|
318
|
+
* @param socketPath - Resulting socket path
|
|
319
|
+
* @param max - Longest socket path in bytes
|
|
320
|
+
*/
|
|
321
|
+
export declare function sessionNameSocketTooLongError(name: string, socketPath: string, max: number): ErrorWithSuggestion;
|
|
322
|
+
/**
|
|
323
|
+
* `bdg cleanup --purge` without a named session (the default session's
|
|
324
|
+
* directory holds the named sessions).
|
|
325
|
+
*/
|
|
326
|
+
export declare function purgeNeedsNamedSessionError(): ErrorWithSuggestion;
|
|
327
|
+
/**
|
|
328
|
+
* `bdg cleanup --purge` found the session still holding its directory after
|
|
329
|
+
* cleaning up, so the directory is kept.
|
|
330
|
+
*
|
|
331
|
+
* @param dir - Session directory
|
|
332
|
+
* @param reason - What still holds it
|
|
333
|
+
*/
|
|
334
|
+
export declare function purgeRefusedError(dir: string, reason: string): ErrorWithSuggestion;
|
|
224
335
|
/**
|
|
225
336
|
* The session directory exists but is not a directory.
|
|
226
337
|
*
|
|
@@ -248,6 +359,27 @@ export declare function socketPathTooLongError(socketPath: string, max: number):
|
|
|
248
359
|
* @param secure - Whether a wss: URL was given
|
|
249
360
|
*/
|
|
250
361
|
export declare function externalChromeUnreachableError(endpoint: string, secure: boolean): ErrorWithSuggestion;
|
|
362
|
+
/**
|
|
363
|
+
* Something answers on the `--chrome-ws-url` endpoint, but it is not Chrome's
|
|
364
|
+
* DevTools HTTP endpoint (e.g. a web server on that port).
|
|
365
|
+
*
|
|
366
|
+
* @param endpoint - e.g. http://127.0.0.1:3000
|
|
367
|
+
*/
|
|
368
|
+
export declare function notDevToolsEndpointError(endpoint: string): ErrorWithSuggestion;
|
|
369
|
+
/**
|
|
370
|
+
* Another running bdg session uses the Chrome (or tab) `--chrome-ws-url`
|
|
371
|
+
* points to.
|
|
372
|
+
*
|
|
373
|
+
* @param endpoint - e.g. http://127.0.0.1:9222
|
|
374
|
+
* @param owner - The other session: name (null for a default session),
|
|
375
|
+
* directory, base directory and whether it launched that Chrome
|
|
376
|
+
*/
|
|
377
|
+
export declare function chromeInUseBySessionError(endpoint: string, owner: {
|
|
378
|
+
name: string | null;
|
|
379
|
+
dir: string;
|
|
380
|
+
baseDir: string;
|
|
381
|
+
launched: boolean;
|
|
382
|
+
}): ErrorWithSuggestion;
|
|
251
383
|
/**
|
|
252
384
|
* The page id of a `--chrome-ws-url` page URL does not exist.
|
|
253
385
|
*
|
|
@@ -272,8 +404,9 @@ export declare function chromeWsUrlConflictError(options: string[]): ErrorWithSu
|
|
|
272
404
|
* A numeric index given together with `--index`.
|
|
273
405
|
*
|
|
274
406
|
* @param index - The index argument
|
|
407
|
+
* @param command - The `bdg dom` subcommand it was given to, e.g. "layout"
|
|
275
408
|
*/
|
|
276
|
-
export declare function indexWithIndexOptionError(index: string): ErrorWithSuggestion;
|
|
409
|
+
export declare function indexWithIndexOptionError(index: string, command: string): ErrorWithSuggestion;
|
|
277
410
|
/** Problems with `bdg dom scroll` options, and how to fix each */
|
|
278
411
|
declare const SCROLL_PROBLEMS: {
|
|
279
412
|
readonly 'index-without-selector': readonly ["--index requires a selector", "Use: bdg dom scroll \"selector\" --index 2"];
|
|
@@ -295,8 +428,15 @@ export declare function scrollOptionsError(problem: keyof typeof SCROLL_PROBLEMS
|
|
|
295
428
|
* @param similar - Similar key names
|
|
296
429
|
*/
|
|
297
430
|
export declare function unknownKeyError(keyName: string, similar: string[]): ErrorWithSuggestion;
|
|
298
|
-
/**
|
|
299
|
-
|
|
431
|
+
/**
|
|
432
|
+
* `dom screenshot` given an element both as an argument and as an option,
|
|
433
|
+
* and they differ.
|
|
434
|
+
*
|
|
435
|
+
* @param option - The option and its value, e.g. `--selector #a`
|
|
436
|
+
* @param positional - The element argument
|
|
437
|
+
* @returns Message and suggestion
|
|
438
|
+
*/
|
|
439
|
+
export declare function conflictingTargetError(option: string, positional: string): ErrorWithSuggestion;
|
|
300
440
|
/**
|
|
301
441
|
* Two options given together where one would be ignored.
|
|
302
442
|
*
|
|
@@ -347,35 +487,201 @@ export declare function navigationFailedError(url: string, errorText: string): E
|
|
|
347
487
|
* @param direction - back or forward
|
|
348
488
|
*/
|
|
349
489
|
export declare function noHistoryEntryError(direction: 'back' | 'forward'): ErrorWithSuggestion;
|
|
490
|
+
/** What a submit was still waiting for when its wait ran out */
|
|
491
|
+
export interface SubmitBlockers {
|
|
492
|
+
/** The page request the submit sent, if any */
|
|
493
|
+
document?: DocumentRequestState | undefined;
|
|
494
|
+
/** Requests still running (the longest-running first) */
|
|
495
|
+
pending?: PendingRequestInfo[] | undefined;
|
|
496
|
+
/** All requests still running */
|
|
497
|
+
pendingCount?: number | undefined;
|
|
498
|
+
}
|
|
350
499
|
/**
|
|
351
|
-
* The form was submitted but the wait for its result timed out.
|
|
500
|
+
* The form was submitted but the wait for its result timed out. The message
|
|
501
|
+
* names what it was waiting on: the page request the submit sent (pending,
|
|
502
|
+
* answered with an error, failed; waiting for a navigation, also one that
|
|
503
|
+
* answered), or else the requests still running.
|
|
352
504
|
*
|
|
353
505
|
* @param timeout - Timeout in ms
|
|
354
506
|
* @param waitNavigation - Whether a navigation was awaited
|
|
507
|
+
* @param blockers - The page request and the requests still running
|
|
508
|
+
* @returns e.g. `Form submitted, but timed out after 10000ms waiting for navigation: POST …/authenticate pending for 10s`
|
|
509
|
+
*/
|
|
510
|
+
export declare function submitTimeoutError(timeout: number, waitNavigation: boolean, blockers?: SubmitBlockers): ErrorWithSuggestion;
|
|
511
|
+
/**
|
|
512
|
+
* Warning of a submit whose navigation happened but whose network was still
|
|
513
|
+
* busy when the wait ran out (the new page is there; a slow script or
|
|
514
|
+
* tracker kept loading).
|
|
515
|
+
*
|
|
516
|
+
* @param timeout - Timeout in ms
|
|
517
|
+
* @param pending - Requests still in flight
|
|
518
|
+
* @returns Warning text
|
|
355
519
|
*/
|
|
356
|
-
export declare function
|
|
520
|
+
export declare function submitNetworkBusyWarning(timeout: number, pending: number): string;
|
|
357
521
|
/**
|
|
358
522
|
* No element has the given node id.
|
|
359
523
|
*
|
|
360
524
|
* @param nodeId - Backend node id given with --node-id
|
|
361
525
|
*/
|
|
362
526
|
export declare function nodeIdNotFoundError(nodeId: number): ErrorWithSuggestion;
|
|
527
|
+
/**
|
|
528
|
+
* The list an index refers to, in words.
|
|
529
|
+
*
|
|
530
|
+
* @param source - Where the index comes from
|
|
531
|
+
* @returns e.g. `index 0 of the last dom query "h3"`, `index 2 of the last dom form`
|
|
532
|
+
*/
|
|
533
|
+
export declare function indexSourceText(source: IndexSource): string;
|
|
534
|
+
/** Why an element's cross-origin iframe could not be placed in the page */
|
|
535
|
+
export type FrameMappingProblem = 'no-box' | 'rotated' | 'unreadable';
|
|
536
|
+
/**
|
|
537
|
+
* An element of a cross-origin iframe (from an a11y query) whose iframe
|
|
538
|
+
* could not be placed in the top-level viewport, so a mouse event or layout
|
|
539
|
+
* would land in the wrong place.
|
|
540
|
+
*
|
|
541
|
+
* @param problem - The iframe or element has no box, is rotated or skewed, or could not be read
|
|
542
|
+
* @param detail - Underlying error, if any
|
|
543
|
+
* @returns Message and suggestion
|
|
544
|
+
*/
|
|
545
|
+
export declare function frameMappingError(problem: FrameMappingProblem, detail?: string): ErrorWithSuggestion;
|
|
363
546
|
/**
|
|
364
547
|
* A cached node is gone (page navigated or the element was removed).
|
|
365
548
|
*
|
|
366
|
-
* @param index - Index the user gave
|
|
549
|
+
* @param index - Index the user gave, if any
|
|
550
|
+
* @param source - The list the index refers to, when known
|
|
551
|
+
* @returns Message and suggestion
|
|
552
|
+
*/
|
|
553
|
+
export declare function staleNodeError(index?: number, source?: IndexSource): ErrorWithSuggestion;
|
|
554
|
+
/**
|
|
555
|
+
* An index beyond the cached results.
|
|
556
|
+
*
|
|
557
|
+
* @param source - The index and the list it refers to
|
|
558
|
+
* @param count - Number of cached results
|
|
559
|
+
* @returns Message and suggestion
|
|
367
560
|
*/
|
|
368
|
-
export declare function
|
|
561
|
+
export declare function cachedIndexOutOfRangeError(source: IndexSource, count: number): ErrorWithSuggestion;
|
|
369
562
|
/**
|
|
370
|
-
*
|
|
563
|
+
* Note for a form command (fill, submit) whose index refers to results of
|
|
564
|
+
* another command and hit an element it cannot act on.
|
|
565
|
+
*
|
|
566
|
+
* @param source - The index and the list it refers to
|
|
567
|
+
* @param preview - What the cached element is, e.g. `h3 "Welcome"`
|
|
568
|
+
* @returns e.g. `index 0 refers to the last dom query results ("h3": h3 "Welcome"); run bdg dom form to target form fields by index`
|
|
371
569
|
*/
|
|
372
|
-
export declare function
|
|
373
|
-
/**
|
|
374
|
-
export
|
|
570
|
+
export declare function otherIndexSourceNote(source: IndexSource, preview?: string): string;
|
|
571
|
+
/** What a page holds that selectors cannot search (a cheap page check) */
|
|
572
|
+
export interface UnsearchedContent {
|
|
573
|
+
/** Iframes whose document the page cannot read (cross-origin) */
|
|
574
|
+
crossOriginFrames: boolean;
|
|
575
|
+
/** `<object>`/`<embed>` elements */
|
|
576
|
+
embeds: boolean;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Where selectors do not reach (open shadow roots and same-origin iframes are
|
|
580
|
+
* searched), and how to reach an element in a cross-origin iframe instead.
|
|
581
|
+
* When the page was checked, only what it has is named (nothing when it has
|
|
582
|
+
* neither cross-origin iframes nor embeds; closed shadow roots cannot be
|
|
583
|
+
* detected).
|
|
584
|
+
*
|
|
585
|
+
* @param selector - Selector that matched nothing
|
|
586
|
+
* @param unsearched - What the page holds, when it was checked
|
|
587
|
+
* @returns Note for "not found" suggestions (empty when nothing applies)
|
|
588
|
+
*/
|
|
589
|
+
export declare function unreachableElementsNote(selector: string, unsearched?: UnsearchedContent): string;
|
|
590
|
+
/**
|
|
591
|
+
* "Did you mean" for a selector that is a single id or class.
|
|
592
|
+
*
|
|
593
|
+
* @param kind - Id or class
|
|
594
|
+
* @param names - Similar names on the page
|
|
595
|
+
* @returns e.g. `Did you mean #remove-backpack? (similar id on the page)`; empty without names
|
|
596
|
+
*/
|
|
597
|
+
export declare function similarSelectorsLine(kind: 'id' | 'class', names: string[]): string;
|
|
598
|
+
/**
|
|
599
|
+
* A selector that would have to cross into a shadow root: selectors cannot,
|
|
600
|
+
* but bdg searches open shadow roots on its own.
|
|
601
|
+
*
|
|
602
|
+
* @param host - The compound matching the host, and the selector after it
|
|
603
|
+
* @returns e.g. `mdn-search-modal hosts a shadow root, which a selector cannot cross into; bdg searches open shadow roots itself: use "form"`
|
|
604
|
+
*/
|
|
605
|
+
export declare function shadowBoundaryLine(host: {
|
|
606
|
+
compound: string;
|
|
607
|
+
rest: string;
|
|
608
|
+
}): string;
|
|
609
|
+
/** What the page says about a selector that matched nothing */
|
|
610
|
+
export interface NoMatchContext {
|
|
611
|
+
/** Elements only its `:visible` filters excluded */
|
|
612
|
+
hidden?: number;
|
|
613
|
+
/** The page's `document.readyState`, when known (a hint is added while it loads) */
|
|
614
|
+
readyState?: string;
|
|
615
|
+
/** What the page holds that selectors cannot search, when checked */
|
|
616
|
+
unsearched?: UnsearchedContent;
|
|
617
|
+
/** "Did you mean" line for a single id or class ({@link similarSelectorsLine}) */
|
|
618
|
+
similar?: string;
|
|
619
|
+
/** A leading compound that matches a shadow host, and the selector after it */
|
|
620
|
+
shadowHost?: {
|
|
621
|
+
compound: string;
|
|
622
|
+
rest: string;
|
|
623
|
+
};
|
|
624
|
+
}
|
|
375
625
|
/**
|
|
376
626
|
* No nodes found for selector.
|
|
627
|
+
*
|
|
628
|
+
* @param selector - Selector as given
|
|
629
|
+
* @param context - What the page says about it (hidden matches, readyState, unsearched content, similar names)
|
|
630
|
+
*/
|
|
631
|
+
export declare function noNodesFoundError(selector: string, context?: NoMatchContext): ErrorWithSuggestion;
|
|
632
|
+
/** Why a page scroll moved nothing */
|
|
633
|
+
export interface ScrollNoEffect {
|
|
634
|
+
/** Direction asked for */
|
|
635
|
+
direction: 'up' | 'down' | 'left' | 'right';
|
|
636
|
+
/** The document is no larger than the viewport, the page was at its edge already, or it did not move although it could */
|
|
637
|
+
reason: 'too-small' | 'at-edge' | 'locked';
|
|
638
|
+
/** Viewport size along the axis (px) */
|
|
639
|
+
viewport: number;
|
|
640
|
+
/** The page's `document.readyState` */
|
|
641
|
+
readyState: string;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Warning of `bdg dom scroll` when the page did not move, with the
|
|
645
|
+
* still-loading hint while the document is not complete (it may grow).
|
|
646
|
+
*
|
|
647
|
+
* @param effect - Why nothing scrolled
|
|
648
|
+
* @returns e.g. `Nothing to scroll: the document is no taller than the viewport (993px)`
|
|
649
|
+
*/
|
|
650
|
+
export declare function scrollNoEffectWarning(effect: ScrollNoEffect): string;
|
|
651
|
+
/**
|
|
652
|
+
* Hint for something not found while the page has not finished loading.
|
|
653
|
+
*
|
|
654
|
+
* @param readyState - The page's `document.readyState` (not `complete`)
|
|
655
|
+
* @param selector - Selector that matched nothing, if any
|
|
656
|
+
* @returns e.g. `The page is still loading (document.readyState: loading); wait for the element with: bdg dom wait '#login'`
|
|
657
|
+
*/
|
|
658
|
+
export declare function pageStillLoadingHint(readyState: string, selector?: string): string;
|
|
659
|
+
/**
|
|
660
|
+
* Put the still-loading hint before a "not found" suggestion when the page
|
|
661
|
+
* has not finished loading.
|
|
662
|
+
*
|
|
663
|
+
* @param suggestion - Suggestion of the error
|
|
664
|
+
* @param readyState - The page's `document.readyState`, if known
|
|
665
|
+
* @param selector - Selector that matched nothing, if any
|
|
666
|
+
* @returns The suggestion, with the hint first while the page loads
|
|
667
|
+
*/
|
|
668
|
+
export declare function withLoadingHint(suggestion: string, readyState: string | undefined, selector?: string): string;
|
|
669
|
+
/**
|
|
670
|
+
* `bdg dom wait` without a selector or --load, or with --text/--gone but no selector.
|
|
671
|
+
*
|
|
672
|
+
* @returns Message and suggestion
|
|
673
|
+
*/
|
|
674
|
+
export declare function waitTargetRequiredError(): ErrorWithSuggestion;
|
|
675
|
+
/**
|
|
676
|
+
* `bdg dom wait` that ran out of time: what it waited for and what the page
|
|
677
|
+
* showed last, with a next step that fits.
|
|
678
|
+
*
|
|
679
|
+
* @param condition - What was waited for
|
|
680
|
+
* @param snapshot - Last thing the page reported (none when it never answered)
|
|
681
|
+
* @param timeoutMs - The --timeout
|
|
682
|
+
* @returns Message and suggestion
|
|
377
683
|
*/
|
|
378
|
-
export declare function
|
|
684
|
+
export declare function waitTimeoutError(condition: WaitCondition, snapshot: WaitSnapshot | undefined, timeoutMs: number): ErrorWithSuggestion;
|
|
379
685
|
/**
|
|
380
686
|
* Element not visible/rendered.
|
|
381
687
|
*/
|
|
@@ -418,8 +724,10 @@ export declare function singleFileInputError(count: number): ErrorWithSuggestion
|
|
|
418
724
|
* Unknown field in an a11y query pattern.
|
|
419
725
|
*
|
|
420
726
|
* @param field - The unrecognized key
|
|
727
|
+
* @param similar - A known field it looks like a typo of
|
|
728
|
+
* @param value - The `name=…`/`description=…` field that absorbed it
|
|
421
729
|
*/
|
|
422
|
-
export declare function unknownQueryFieldError(field: string): ErrorWithSuggestion;
|
|
730
|
+
export declare function unknownQueryFieldError(field: string, similar?: string, value?: string): ErrorWithSuggestion;
|
|
423
731
|
/**
|
|
424
732
|
* No a11y nodes matching pattern.
|
|
425
733
|
*/
|
|
@@ -435,6 +743,39 @@ export declare function notInAccessibilityTreeError(target: string, reasons: str
|
|
|
435
743
|
* Fillable element not found.
|
|
436
744
|
*/
|
|
437
745
|
export declare function fillableElementNotFoundError(selector: string): ErrorWithSuggestion;
|
|
746
|
+
/** Appended to the element type when an action went to a label's control. */
|
|
747
|
+
export declare const VIA_LABEL_SUFFIX = " (via label)";
|
|
748
|
+
/** Placeholder for the shell-quoted `name=…` field in {@link LABEL_WITHOUT_CONTROL}. */
|
|
749
|
+
export declare const NAME_QUERY_PLACEHOLDER = "{nameQuery}";
|
|
750
|
+
/**
|
|
751
|
+
* Filling a `<label>` that has no form control (used by the page script,
|
|
752
|
+
* which puts the label's quoted `name=<text>` in place of
|
|
753
|
+
* {@link NAME_QUERY_PLACEHOLDER}).
|
|
754
|
+
*/
|
|
755
|
+
export declare const LABEL_WITHOUT_CONTROL: ErrorWithSuggestion;
|
|
756
|
+
/**
|
|
757
|
+
* Why `dom fill` refused an element (used by the page script, which adds the
|
|
758
|
+
* cause in parentheses, e.g. `The element is read-only (contenteditable="false")`).
|
|
759
|
+
* All are invalid targets (exit 81), like any element that is not fillable.
|
|
760
|
+
*/
|
|
761
|
+
export declare const FILL_REFUSALS: {
|
|
762
|
+
readonly disabled: {
|
|
763
|
+
readonly message: "The element is disabled";
|
|
764
|
+
readonly suggestion: "Enable the field first (it may depend on another input)";
|
|
765
|
+
};
|
|
766
|
+
readonly readOnly: {
|
|
767
|
+
readonly message: "The element is read-only";
|
|
768
|
+
readonly suggestion: "A user cannot change it either; the page has to make it editable first";
|
|
769
|
+
};
|
|
770
|
+
readonly inert: {
|
|
771
|
+
readonly message: "The element is inert";
|
|
772
|
+
readonly suggestion: "The page made it non-interactive (often behind a dialog); close what covers it first";
|
|
773
|
+
};
|
|
774
|
+
readonly notFillable: {
|
|
775
|
+
readonly message: "Element is not fillable";
|
|
776
|
+
readonly suggestion: "Only input, textarea, select, and contenteditable elements can be filled";
|
|
777
|
+
};
|
|
778
|
+
};
|
|
438
779
|
/**
|
|
439
780
|
* Clickable element not found.
|
|
440
781
|
*/
|
|
@@ -443,6 +784,33 @@ export declare function clickableElementNotFoundError(selector: string): ErrorWi
|
|
|
443
784
|
* Click target disappeared between locating and clicking it.
|
|
444
785
|
*/
|
|
445
786
|
export declare function clickTargetDetachedError(selector: string): ErrorWithSuggestion;
|
|
787
|
+
/**
|
|
788
|
+
* A pointer action refused under `--strict` because a real mouse could not
|
|
789
|
+
* reach the element (covered, hidden, zero-size, pointer-events: none).
|
|
790
|
+
*
|
|
791
|
+
* @param target - Selector and element description, as the click located it
|
|
792
|
+
* @param reason - Why the mouse could not reach it, e.g. "covered by another element (div#shield)"
|
|
793
|
+
* @param verb - What was refused, e.g. "click", "hover"
|
|
794
|
+
* @returns Message naming the obstruction, and how to inspect it
|
|
795
|
+
*/
|
|
796
|
+
export declare function unreachableElementError(target: {
|
|
797
|
+
selector: string;
|
|
798
|
+
element?: string | undefined;
|
|
799
|
+
}, reason: string | null | undefined, verb: string): ErrorWithSuggestion;
|
|
800
|
+
/**
|
|
801
|
+
* A mouse press refused under `--strict` because it did not reach the
|
|
802
|
+
* element: it was sent, but landed on another element, or the page never
|
|
803
|
+
* saw it (a browser dialog or bubble captured the input).
|
|
804
|
+
*
|
|
805
|
+
* @param target - Selector and element description, as the click located it
|
|
806
|
+
* @param verb - What was refused, e.g. "click"
|
|
807
|
+
* @param landedOn - The element the press landed on, when the page saw it
|
|
808
|
+
* @returns Message, and how to inspect the page
|
|
809
|
+
*/
|
|
810
|
+
export declare function pressNotReceivedError(target: {
|
|
811
|
+
selector: string;
|
|
812
|
+
element?: string | undefined;
|
|
813
|
+
}, verb: string, landedOn?: string): ErrorWithSuggestion;
|
|
446
814
|
/**
|
|
447
815
|
* Key press failed.
|
|
448
816
|
*/
|
|
@@ -455,12 +823,13 @@ export declare function keyPressFailedError(details: string): ErrorWithSuggestio
|
|
|
455
823
|
*/
|
|
456
824
|
export declare function scriptTimeoutError(timeoutMs: number): ErrorWithSuggestion;
|
|
457
825
|
/**
|
|
458
|
-
* The page was kept busy by a script (e.g. a loop started
|
|
459
|
-
* bdg terminated it.
|
|
826
|
+
* The page (or an iframe) was kept busy by a script (e.g. a loop started
|
|
827
|
+
* from a timer) and bdg terminated it.
|
|
460
828
|
*
|
|
461
829
|
* @param timeoutMs - Time waited
|
|
830
|
+
* @param scope - What was busy: the page, or the iframe a command ran in
|
|
462
831
|
*/
|
|
463
|
-
export declare function pageBusyError(timeoutMs: number): ErrorWithSuggestion;
|
|
832
|
+
export declare function pageBusyError(timeoutMs: number, scope?: 'page' | 'frame', recovered?: boolean): ErrorWithSuggestion;
|
|
464
833
|
/**
|
|
465
834
|
* The page did not answer because a navigation is still waiting for the
|
|
466
835
|
* server (Chrome holds commands for the page until the new document arrives).
|
|
@@ -489,6 +858,13 @@ export declare function emptyFrameError(): ErrorWithSuggestion;
|
|
|
489
858
|
* @param frames - Frames of the page
|
|
490
859
|
*/
|
|
491
860
|
export declare function frameNotFoundError(query: string, frames: DomFrame[]): ErrorWithSuggestion;
|
|
861
|
+
/**
|
|
862
|
+
* A `dom eval --frame` index that names another frame (or none) than when
|
|
863
|
+
* `bdg dom frames` listed it.
|
|
864
|
+
*
|
|
865
|
+
* @param index - Requested index
|
|
866
|
+
*/
|
|
867
|
+
export declare function staleFrameIndexError(index: number): ErrorWithSuggestion;
|
|
492
868
|
/**
|
|
493
869
|
* `dom eval --frame` matching more than one iframe.
|
|
494
870
|
*
|
|
@@ -497,11 +873,40 @@ export declare function frameNotFoundError(query: string, frames: DomFrame[]): E
|
|
|
497
873
|
*/
|
|
498
874
|
export declare function ambiguousFrameError(query: string, candidates: DomFrame[]): ErrorWithSuggestion;
|
|
499
875
|
/**
|
|
500
|
-
* An iframe without a JavaScript context (still loading, or
|
|
876
|
+
* An iframe without a JavaScript context (still loading, or gone).
|
|
501
877
|
*
|
|
502
878
|
* @param url - Frame URL
|
|
503
879
|
*/
|
|
504
880
|
export declare function frameNotReadyError(url: string): ErrorWithSuggestion;
|
|
881
|
+
/**
|
|
882
|
+
* The iframe a `dom eval --frame` script ran in navigated before it finished.
|
|
883
|
+
*
|
|
884
|
+
* @param url - Frame URL when the script started
|
|
885
|
+
*/
|
|
886
|
+
export declare function frameNavigatedDuringEvalError(url: string): ErrorWithSuggestion;
|
|
887
|
+
/**
|
|
888
|
+
* The iframe a `dom eval --frame` script ran in was removed (or vanished
|
|
889
|
+
* before it started).
|
|
890
|
+
*
|
|
891
|
+
* @param url - Frame URL when the script started
|
|
892
|
+
*/
|
|
893
|
+
export declare function frameRemovedDuringEvalError(url: string): ErrorWithSuggestion;
|
|
894
|
+
/**
|
|
895
|
+
* The page (its tab) was closed while a `dom eval` script ran.
|
|
896
|
+
*/
|
|
897
|
+
export declare function pageClosedDuringEvalError(): ErrorWithSuggestion;
|
|
898
|
+
/**
|
|
899
|
+
* The iframe a `dom eval --frame` script ran in went away, and bdg could not
|
|
900
|
+
* tell whether it navigated or was removed.
|
|
901
|
+
*
|
|
902
|
+
* @param url - Frame URL when the script started
|
|
903
|
+
*/
|
|
904
|
+
export declare function frameLostDuringEvalError(url: string): ErrorWithSuggestion;
|
|
905
|
+
/**
|
|
906
|
+
* The page navigated while a `dom eval` script ran (e.g. it set
|
|
907
|
+
* `location.href` and then awaited).
|
|
908
|
+
*/
|
|
909
|
+
export declare function pageNavigatedDuringEvalError(): ErrorWithSuggestion;
|
|
505
910
|
/**
|
|
506
911
|
* Script execution error with shell quote detection.
|
|
507
912
|
*
|
|
@@ -521,6 +926,14 @@ export declare function unexpectedResponseFormatError(context: string): ErrorWit
|
|
|
521
926
|
* Generic operation failure with dynamic error message.
|
|
522
927
|
*/
|
|
523
928
|
export declare function operationFailedError(operation: string, errorMessage: string): ErrorWithSuggestion;
|
|
929
|
+
/**
|
|
930
|
+
* `dom inspect --props` named a property the element has no value for.
|
|
931
|
+
*
|
|
932
|
+
* @param names - Unknown property names
|
|
933
|
+
* @param suggestions - Similar computed property names
|
|
934
|
+
* @returns Message and suggestion
|
|
935
|
+
*/
|
|
936
|
+
export declare function unknownCssPropertyError(names: string[], suggestions: string[]): ErrorWithSuggestion;
|
|
524
937
|
/**
|
|
525
938
|
* The browser does not offer `DOMDebugger.getEventListeners` (non-Chrome
|
|
526
939
|
* targets, or browsers that disable the DOMDebugger domain).
|
|
@@ -536,10 +949,29 @@ export declare function internalError(context: string): ErrorWithSuggestion;
|
|
|
536
949
|
/**
|
|
537
950
|
* No forms found on page.
|
|
538
951
|
*/
|
|
539
|
-
export declare function noFormsFoundError(): ErrorWithSuggestion;
|
|
952
|
+
export declare function noFormsFoundError(readyState?: string): ErrorWithSuggestion;
|
|
953
|
+
/**
|
|
954
|
+
* The form discovery script threw.
|
|
955
|
+
*
|
|
956
|
+
* @param detail - What it threw, e.g. `TypeError: Cannot read properties of null`
|
|
957
|
+
* @param readyState - The page's `document.readyState`, when known
|
|
958
|
+
* @returns Message and suggestion (the still-loading hint while the page loads)
|
|
959
|
+
*/
|
|
960
|
+
export declare function formDiscoveryFailedError(detail: string, readyState?: string): ErrorWithSuggestion;
|
|
540
961
|
/**
|
|
541
962
|
* Form in iframe (cross-origin or same-origin).
|
|
542
963
|
*/
|
|
543
964
|
export declare function formInIframeError(iframeUrl: string, crossOrigin: boolean): ErrorWithSuggestion;
|
|
965
|
+
/**
|
|
966
|
+
* `bdg cdp` when Chrome rejected the call: a missing node, target or
|
|
967
|
+
* frame, or wrong parameters.
|
|
968
|
+
*
|
|
969
|
+
* @param method - CDP method
|
|
970
|
+
* @param message - Chrome's error
|
|
971
|
+
* @returns Message, suggestion, and whether something named was not found
|
|
972
|
+
*/
|
|
973
|
+
export declare function cdpCallError(method: string, message: string): ErrorWithSuggestion & {
|
|
974
|
+
notFound: boolean;
|
|
975
|
+
};
|
|
544
976
|
export {};
|
|
545
977
|
//# sourceMappingURL=messages.d.ts.map
|