@allwright.dev/core 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/bootstrap.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/locator.d.ts +9 -1
- package/dist/locator.js +20 -0
- package/dist/page.d.ts +9 -1
- package/dist/page.js +63 -0
- package/dist/types.d.ts +58 -1
- package/package.json +1 -1
- package/proto/core/v1/context.proto +41 -0
- package/proto/surfaces/web/v1/web.proto +9 -0
package/README.md
CHANGED
|
@@ -79,3 +79,36 @@ suites:
|
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The TypeScript package exports `findConfigFile()`, `loadConfigFile()`, `resolveConfig()`, and `launchConfiguredBrowser()` so runner packages can consume the same config model without inventing language-specific config files.
|
|
82
|
+
|
|
83
|
+
### Iframes
|
|
84
|
+
|
|
85
|
+
An iframe resolves to a normal `Page`, including nested and cross-origin frames:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
const frame = await page.locator("#checkout-frame").Frame({ timeoutMs: 10_000 });
|
|
89
|
+
await frame.locator("input[name=email]").fill("buyer@example.com");
|
|
90
|
+
const nested = await frame.locator("iframe").frame({ timeoutMs: 5_000 });
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`Frame()` and `frame()` are aliases. The timeout covers finding exactly one iframe,
|
|
94
|
+
resolving its browsing context, and waiting for a fully loaded document with 200 ms
|
|
95
|
+
without DOM mutations. The default is 10 seconds. Closing the frame page releases
|
|
96
|
+
its session; it does not remove the iframe or close the parent tab. Resolve a new
|
|
97
|
+
frame page after the iframe is replaced.
|
|
98
|
+
|
|
99
|
+
### Read page and element state
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
const url = await page.url();
|
|
103
|
+
const value = await page.locator('input, textarea').inputValue();
|
|
104
|
+
const options = await page.locator('select').selectedOptions(); // [{ value, label, index }]
|
|
105
|
+
const selectedText = await page.locator('textarea').selectedText();
|
|
106
|
+
const checked = await page.locator('input[type=checkbox]').isChecked();
|
|
107
|
+
const text = await page.locator('h1').innerText(); // { selector, text, note }
|
|
108
|
+
const attribute = await page.locator('a').getAttribute('href');
|
|
109
|
+
const box = await page.locator('button').boundingBox(); // { x, y, width, height }
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Element reads also have page methods such as `page.inputValue(selector, options)` and accept `timeoutMs`. Reads use the first locator match and work in frame pages. `inputValue` reads the live property of an input, textarea, or select. `selectedOptions` supports native selects (including multiple selections) and ARIA combobox/listbox options marked `aria-selected="true"`. `selectedText` returns the textbox's selected substring, an empty string for a caret, or `null` for input types without selection support. `isChecked` supports native checkbox/radio and ARIA checked controls; ARIA mixed state returns false.
|
|
113
|
+
|
|
114
|
+
Missing attributes return `null` (an empty attribute remains `""`). Bounding boxes use CSS pixels relative to the page/frame viewport and return `null` for hidden or zero-area elements. Missing elements and incompatible control types raise errors. Use `textContent()` for raw text or `innerText()` for rendered text.
|
package/dist/bootstrap.js
CHANGED
|
@@ -12,7 +12,7 @@ const ALLWRIGHT_HOME_ENV_VAR = "ALLWRIGHT_HOME";
|
|
|
12
12
|
const ALLWRIGHT_REPOSITORY_ENV_VAR = "ALLWRIGHT_REPOSITORY";
|
|
13
13
|
const ALLWRIGHT_VERSION_ENV_VAR = "ALLWRIGHT_VERSION";
|
|
14
14
|
const DEFAULT_RELEASE_REPOSITORY = "allwright-dev/allwright";
|
|
15
|
-
const DEFAULT_RELEASE_VERSION = "0.1.
|
|
15
|
+
const DEFAULT_RELEASE_VERSION = "0.1.14";
|
|
16
16
|
const STARTUP_TIMEOUT_MS = 20_000;
|
|
17
17
|
const PING_TIMEOUT_MS = 1_000;
|
|
18
18
|
const PROTO_ROOT = fileURLToPath(new URL("../proto/", import.meta.url));
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { PageImpl } from "./page.js";
|
|
|
5
5
|
import { setServerAddr, shutdown } from "./runtime.js";
|
|
6
6
|
import type { Browser, BrowserKind, BrowserType, LaunchOptions, Page, FileChooser, Download, HookType, ResolveConfigOptions, ResolvedAllwrightConfig } from "./types.js";
|
|
7
7
|
export { findConfigFile, loadConfigFile, resolveConfig, setServerAddr, shutdown };
|
|
8
|
-
export type { AccessibilitySnapshotOptions, AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, Hook, HookType, FileChooser, Download, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, Locator, LocatorInfo, MobileSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
|
|
8
|
+
export type { CapturedOption, BoundingBox, AccessibilitySnapshotOptions, AllwrightConfig, Browser, BrowserInfo, BrowserKind, BrowserType, Hook, HookType, FileChooser, Download, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, LaunchOptions, MobileAndroidConnectOptions, MobileAndroidDevice, MobileAndroidLaunchOptions, MobileAndroidLocator, MobileAndroidApp, Locator, LocatorInfo, MobileSurfaceNamespace, NavigateResult, Page, PageInfo, PressOptions, PressResult, ResolveConfigOptions, ResolvedAllwrightConfig, RetryConfig, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult, } from "./types.js";
|
|
9
9
|
export declare const chromium: BrowserType;
|
|
10
10
|
export declare const firefox: BrowserType;
|
|
11
11
|
export declare const hooks: {
|
package/dist/locator.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { WebLocatorBuilders, type LocatorFilterOptions } from "./web-locators.js";
|
|
2
|
-
import type { ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, Locator, LocatorInfo, Page, PressOptions, PressResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
|
|
2
|
+
import type { BoundingBox, CapturedOption, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, HighlightOptions, HighlightResult, Locator, LocatorInfo, Page, PressOptions, PressResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
|
|
3
3
|
export declare class LocatorImpl extends WebLocatorBuilders implements Locator {
|
|
4
4
|
readonly page: Page;
|
|
5
5
|
readonly selector: string;
|
|
6
6
|
constructor(input: LocatorInfo);
|
|
7
|
+
frame(options?: CommandOptions): Promise<Page>;
|
|
8
|
+
Frame(options?: CommandOptions): Promise<Page>;
|
|
7
9
|
click(options?: CommandOptions): Promise<ClickResult>;
|
|
8
10
|
count(options?: CommandOptions): Promise<CountResult>;
|
|
9
11
|
highlight(options?: HighlightOptions): Promise<HighlightResult>;
|
|
@@ -11,6 +13,12 @@ export declare class LocatorImpl extends WebLocatorBuilders implements Locator {
|
|
|
11
13
|
fill(value: string, options?: CommandOptions): Promise<FillResult>;
|
|
12
14
|
hover(options?: CommandOptions): Promise<ElementResult>;
|
|
13
15
|
press(key: string, options?: PressOptions): Promise<PressResult>;
|
|
16
|
+
inputValue(options?: CommandOptions): Promise<string>;
|
|
17
|
+
selectedOptions(options?: CommandOptions): Promise<CapturedOption[]>;
|
|
18
|
+
selectedText(options?: CommandOptions): Promise<string | null>;
|
|
19
|
+
isChecked(options?: CommandOptions): Promise<boolean>;
|
|
20
|
+
getAttribute(name: string, options?: CommandOptions): Promise<string | null>;
|
|
21
|
+
boundingBox(options?: CommandOptions): Promise<BoundingBox | null>;
|
|
14
22
|
textContent(options?: CommandOptions): Promise<TextResult>;
|
|
15
23
|
innerText(options?: CommandOptions): Promise<TextResult>;
|
|
16
24
|
waitFor(options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
|
package/dist/locator.js
CHANGED
|
@@ -8,6 +8,8 @@ export class LocatorImpl extends WebLocatorBuilders {
|
|
|
8
8
|
this.page = input.page;
|
|
9
9
|
this.selector = input.selector;
|
|
10
10
|
}
|
|
11
|
+
frame(options = {}) { return this.page.frame(this.selector, options); }
|
|
12
|
+
Frame(options = {}) { return this.frame(options); }
|
|
11
13
|
async click(options = {}) {
|
|
12
14
|
return this.page.click(this.selector, options);
|
|
13
15
|
}
|
|
@@ -29,6 +31,24 @@ export class LocatorImpl extends WebLocatorBuilders {
|
|
|
29
31
|
async press(key, options = {}) {
|
|
30
32
|
return this.page.press(this.selector, key, options);
|
|
31
33
|
}
|
|
34
|
+
async inputValue(options = {}) {
|
|
35
|
+
return this.page.inputValue(this.selector, options);
|
|
36
|
+
}
|
|
37
|
+
async selectedOptions(options = {}) {
|
|
38
|
+
return this.page.selectedOptions(this.selector, options);
|
|
39
|
+
}
|
|
40
|
+
async selectedText(options = {}) {
|
|
41
|
+
return this.page.selectedText(this.selector, options);
|
|
42
|
+
}
|
|
43
|
+
async isChecked(options = {}) {
|
|
44
|
+
return this.page.isChecked(this.selector, options);
|
|
45
|
+
}
|
|
46
|
+
async getAttribute(name, options = {}) {
|
|
47
|
+
return this.page.getAttribute(this.selector, name, options);
|
|
48
|
+
}
|
|
49
|
+
async boundingBox(options = {}) {
|
|
50
|
+
return this.page.boundingBox(this.selector, options);
|
|
51
|
+
}
|
|
32
52
|
async textContent(options = {}) {
|
|
33
53
|
return this.page.textContent(this.selector, options);
|
|
34
54
|
}
|
package/dist/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebLocatorBuilders, type LocatorFilterOptions } from "./web-locators.js";
|
|
2
|
-
import type { AccessibilitySnapshotOptions, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, FileChooser, Download, HighlightOptions, HighlightResult, Hook, HookType, Locator, NavigateResult, Page, PageInfo, PressOptions, PressResult, RuntimeClient, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
|
|
2
|
+
import type { BoundingBox, CapturedOption, AccessibilitySnapshotOptions, ClickResult, CommandOptions, CountResult, ElementResult, FillResult, FileChooser, Download, HighlightOptions, HighlightResult, Hook, HookType, Locator, NavigateResult, Page, PageInfo, PressOptions, PressResult, RuntimeClient, ScreenshotOptions, ScreenshotResult, TextResult, WaitForSelectorOptions, WaitForSelectorResult } from "./types.js";
|
|
3
3
|
export declare class PageImpl extends WebLocatorBuilders implements Page {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(input: PageInfo & {
|
|
@@ -8,6 +8,7 @@ export declare class PageImpl extends WebLocatorBuilders implements Page {
|
|
|
8
8
|
});
|
|
9
9
|
readonly sessionId: string;
|
|
10
10
|
readonly browserSessionId: string;
|
|
11
|
+
frame(selector: string, options?: CommandOptions): Promise<Page>;
|
|
11
12
|
registerHook<T>(type: HookType<T>): Promise<Hook<T>>;
|
|
12
13
|
setFileChooserFiles(fileChooserId: string, files: string[], options?: CommandOptions): Promise<void>;
|
|
13
14
|
saveDownload(downloadId: string, path: string, options?: CommandOptions): Promise<void>;
|
|
@@ -20,6 +21,13 @@ export declare class PageImpl extends WebLocatorBuilders implements Page {
|
|
|
20
21
|
fill(selector: string, value: string, options?: CommandOptions): Promise<FillResult>;
|
|
21
22
|
hover(selector: string, options?: CommandOptions): Promise<ElementResult>;
|
|
22
23
|
press(selector: string, key: string, options?: PressOptions): Promise<PressResult>;
|
|
24
|
+
url(options?: CommandOptions): Promise<string>;
|
|
25
|
+
inputValue(selector: string, options?: CommandOptions): Promise<string>;
|
|
26
|
+
selectedOptions(selector: string, options?: CommandOptions): Promise<CapturedOption[]>;
|
|
27
|
+
selectedText(selector: string, options?: CommandOptions): Promise<string | null>;
|
|
28
|
+
isChecked(selector: string, options?: CommandOptions): Promise<boolean>;
|
|
29
|
+
getAttribute(selector: string, name: string, options?: CommandOptions): Promise<string | null>;
|
|
30
|
+
boundingBox(selector: string, options?: CommandOptions): Promise<BoundingBox | null>;
|
|
23
31
|
textContent(selector: string, options?: CommandOptions): Promise<TextResult>;
|
|
24
32
|
innerText(selector: string, options?: CommandOptions): Promise<TextResult>;
|
|
25
33
|
waitForSelector(selector: string, options?: WaitForSelectorOptions): Promise<WaitForSelectorResult>;
|
package/dist/page.js
CHANGED
|
@@ -24,6 +24,23 @@ export class PageImpl extends WebLocatorBuilders {
|
|
|
24
24
|
}
|
|
25
25
|
sessionId;
|
|
26
26
|
browserSessionId;
|
|
27
|
+
async frame(selector, options = {}) {
|
|
28
|
+
const handle = await this.#getHandle();
|
|
29
|
+
this.#ensureOpen(handle);
|
|
30
|
+
handle.stream.write({ surfaceSessionId: this.browserSessionId, contextSessionId: this.sessionId,
|
|
31
|
+
resolveFrame: { cssSelector: normalizeSelectorForTransport(selector), retryOptions: options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : undefined } });
|
|
32
|
+
while (true) {
|
|
33
|
+
const event = await handle.queue.next();
|
|
34
|
+
if (event.frameResolved?.contextSessionId)
|
|
35
|
+
return this.#createPage(event.frameResolved.contextSessionId);
|
|
36
|
+
if (event.error?.message)
|
|
37
|
+
throw formatActionError("resolve frame", event.error.message, selector);
|
|
38
|
+
if (event.closed) {
|
|
39
|
+
handle.closed = true;
|
|
40
|
+
throw new Error("page closed while resolving frame");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
27
44
|
async registerHook(type) {
|
|
28
45
|
if (type.name !== "newPage" && type.name !== "fileChooser" && type.name !== "download") {
|
|
29
46
|
throw formatActionError("register hook", `unsupported hook type: ${type.name}`);
|
|
@@ -459,6 +476,52 @@ export class PageImpl extends WebLocatorBuilders {
|
|
|
459
476
|
}
|
|
460
477
|
}
|
|
461
478
|
}
|
|
479
|
+
async #capture(kind, selector, attributeName, options) {
|
|
480
|
+
const handle = await this.#getHandle();
|
|
481
|
+
this.#ensureOpen(handle);
|
|
482
|
+
handle.stream.write({ surfaceSessionId: this.browserSessionId, contextSessionId: this.sessionId,
|
|
483
|
+
capture: { kind, cssSelector: selector ? normalizeSelectorForTransport(selector) : "", attributeName,
|
|
484
|
+
retryOptions: options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : undefined } });
|
|
485
|
+
while (true) {
|
|
486
|
+
const event = await handle.queue.next();
|
|
487
|
+
if (event.captureResolved)
|
|
488
|
+
return event.captureResolved;
|
|
489
|
+
if (event.error)
|
|
490
|
+
throw formatActionError("capture", event.error.message ?? "capture failed", selector);
|
|
491
|
+
if (event.closed) {
|
|
492
|
+
handle.closed = true;
|
|
493
|
+
throw new Error("page session closed while capturing");
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
async url(options = {}) {
|
|
498
|
+
const r = await this.#capture("CAPTURE_KIND_URL", "", "", options);
|
|
499
|
+
return r.value ?? "";
|
|
500
|
+
}
|
|
501
|
+
async inputValue(selector, options = {}) {
|
|
502
|
+
const r = await this.#capture("CAPTURE_KIND_INPUT_VALUE", selector, "", options);
|
|
503
|
+
return r.value ?? "";
|
|
504
|
+
}
|
|
505
|
+
async selectedOptions(selector, options = {}) {
|
|
506
|
+
const r = await this.#capture("CAPTURE_KIND_SELECTED_OPTIONS", selector, "", options);
|
|
507
|
+
return r.selectedOptions ?? [];
|
|
508
|
+
}
|
|
509
|
+
async selectedText(selector, options = {}) {
|
|
510
|
+
const r = await this.#capture("CAPTURE_KIND_SELECTED_TEXT", selector, "", options);
|
|
511
|
+
return r.value ?? null;
|
|
512
|
+
}
|
|
513
|
+
async isChecked(selector, options = {}) {
|
|
514
|
+
const r = await this.#capture("CAPTURE_KIND_CHECKED", selector, "", options);
|
|
515
|
+
return r.checked ?? false;
|
|
516
|
+
}
|
|
517
|
+
async getAttribute(selector, name, options = {}) {
|
|
518
|
+
const r = await this.#capture("CAPTURE_KIND_ATTRIBUTE", selector, name, options);
|
|
519
|
+
return r.value ?? null;
|
|
520
|
+
}
|
|
521
|
+
async boundingBox(selector, options = {}) {
|
|
522
|
+
const r = await this.#capture("CAPTURE_KIND_BOUNDING_BOX", selector, "", options);
|
|
523
|
+
return r.boundingBox ?? null;
|
|
524
|
+
}
|
|
462
525
|
async textContent(selector, options = {}) {
|
|
463
526
|
return this.#readText(selector, options, true);
|
|
464
527
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -133,6 +133,14 @@ export interface Browser extends BrowserInfo {
|
|
|
133
133
|
browserInfo(): BrowserInfo;
|
|
134
134
|
}
|
|
135
135
|
export interface Page extends PageInfo, WebLocators {
|
|
136
|
+
url(options?: CommandOptions): Promise<string>;
|
|
137
|
+
inputValue(selector: string, options?: CommandOptions): Promise<string>;
|
|
138
|
+
selectedOptions(selector: string, options?: CommandOptions): Promise<CapturedOption[]>;
|
|
139
|
+
selectedText(selector: string, options?: CommandOptions): Promise<string | null>;
|
|
140
|
+
isChecked(selector: string, options?: CommandOptions): Promise<boolean>;
|
|
141
|
+
getAttribute(selector: string, name: string, options?: CommandOptions): Promise<string | null>;
|
|
142
|
+
boundingBox(selector: string, options?: CommandOptions): Promise<BoundingBox | null>;
|
|
143
|
+
frame(selector: string, options?: CommandOptions): Promise<Page>;
|
|
136
144
|
registerHook<T>(type: HookType<T>): Promise<Hook<T>>;
|
|
137
145
|
accessibilitySnapshot(options?: AccessibilitySnapshotOptions): Promise<string>;
|
|
138
146
|
locator(selector: string, options?: LocatorFilterOptions): Locator;
|
|
@@ -206,6 +214,14 @@ export interface MobileSurfaceNamespace {
|
|
|
206
214
|
};
|
|
207
215
|
}
|
|
208
216
|
export interface Locator extends WebLocators {
|
|
217
|
+
inputValue(options?: CommandOptions): Promise<string>;
|
|
218
|
+
selectedOptions(options?: CommandOptions): Promise<CapturedOption[]>;
|
|
219
|
+
selectedText(options?: CommandOptions): Promise<string | null>;
|
|
220
|
+
isChecked(options?: CommandOptions): Promise<boolean>;
|
|
221
|
+
getAttribute(name: string, options?: CommandOptions): Promise<string | null>;
|
|
222
|
+
boundingBox(options?: CommandOptions): Promise<BoundingBox | null>;
|
|
223
|
+
frame(options?: CommandOptions): Promise<Page>;
|
|
224
|
+
Frame(options?: CommandOptions): Promise<Page>;
|
|
209
225
|
not(other: Locator): Locator;
|
|
210
226
|
filter(options?: LocatorFilterOptions): Locator;
|
|
211
227
|
nth(index: number): Locator;
|
|
@@ -374,6 +390,10 @@ export interface SurfaceSessionEvent {
|
|
|
374
390
|
};
|
|
375
391
|
}
|
|
376
392
|
export interface ContextSessionEvent {
|
|
393
|
+
captureResolved?: CaptureResult;
|
|
394
|
+
frameResolved?: {
|
|
395
|
+
contextSessionId?: string;
|
|
396
|
+
};
|
|
377
397
|
accessibilitySnapshotCaptured?: {
|
|
378
398
|
snapshot?: string;
|
|
379
399
|
format?: string;
|
|
@@ -809,7 +829,27 @@ export interface CloseContextRequest {
|
|
|
809
829
|
close: Record<string, never>;
|
|
810
830
|
}
|
|
811
831
|
export type SurfaceSessionRequest = LaunchBrowserRequest | LaunchChromeRequest | OpenContextRequest | ConnectMobileRequest | LaunchAppRequest | SurfacePingRequest | CloseSurfaceRequest;
|
|
812
|
-
export type ContextSessionRequest =
|
|
832
|
+
export type ContextSessionRequest = {
|
|
833
|
+
surfaceSessionId: string;
|
|
834
|
+
contextSessionId: string;
|
|
835
|
+
capture: {
|
|
836
|
+
kind: string;
|
|
837
|
+
cssSelector: string;
|
|
838
|
+
attributeName: string;
|
|
839
|
+
retryOptions?: {
|
|
840
|
+
timeoutMs: number;
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
} | {
|
|
844
|
+
surfaceSessionId: string;
|
|
845
|
+
contextSessionId: string;
|
|
846
|
+
resolveFrame: {
|
|
847
|
+
cssSelector: string;
|
|
848
|
+
retryOptions?: {
|
|
849
|
+
timeoutMs: number;
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
} | ContextPingRequest | RegisterHookRequest | WaitForHookRequest | SetFileChooserFilesRequest | SaveDownloadRequest | UploadFileChunkRequest | ReadFileChunkRequest | SetMobileFileChooserFilesRequest | SaveMobileDownloadRequest | NavigateRequest | ClickRequest | CountRequest | HighlightRequest | FocusRequest | FillRequest | HoverRequest | PressRequest | TextContentRequest | InnerTextRequest | WaitForSelectorRequest | AccessibilitySnapshotRequest | ScreenshotRequest | CloseContextRequest;
|
|
813
853
|
export type SurfaceSessionStream = grpc.ClientDuplexStream<SurfaceSessionRequest, SurfaceSessionEvent>;
|
|
814
854
|
export type ContextSessionStream = grpc.ClientDuplexStream<ContextSessionRequest, ContextSessionEvent>;
|
|
815
855
|
export interface EngineServiceClientShape {
|
|
@@ -851,3 +891,20 @@ export declare class EventQueue<T> {
|
|
|
851
891
|
fail(error: Error): void;
|
|
852
892
|
next(): Promise<T>;
|
|
853
893
|
}
|
|
894
|
+
export interface CapturedOption {
|
|
895
|
+
value: string;
|
|
896
|
+
label: string;
|
|
897
|
+
index: number;
|
|
898
|
+
}
|
|
899
|
+
export interface BoundingBox {
|
|
900
|
+
x: number;
|
|
901
|
+
y: number;
|
|
902
|
+
width: number;
|
|
903
|
+
height: number;
|
|
904
|
+
}
|
|
905
|
+
export interface CaptureResult {
|
|
906
|
+
value?: string;
|
|
907
|
+
checked?: boolean;
|
|
908
|
+
selectedOptions?: CapturedOption[];
|
|
909
|
+
boundingBox?: BoundingBox;
|
|
910
|
+
}
|
package/package.json
CHANGED
|
@@ -37,6 +37,8 @@ message ContextSessionCommand {
|
|
|
37
37
|
ReadFileChunkCommand read_file_chunk = 23;
|
|
38
38
|
SetMobileFileChooserFilesCommand set_mobile_file_chooser_files = 24;
|
|
39
39
|
SaveMobileDownloadCommand save_mobile_download = 25;
|
|
40
|
+
ResolveFrameCommand resolve_frame = 26;
|
|
41
|
+
CaptureCommand capture = 27;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -76,6 +78,8 @@ message ContextSessionEvent {
|
|
|
76
78
|
FileChunkEvent file_chunk = 25;
|
|
77
79
|
MobileFileChooserFilesSetEvent mobile_file_chooser_files_set = 26;
|
|
78
80
|
MobileDownloadSavedEvent mobile_download_saved = 27;
|
|
81
|
+
FrameResolvedEvent frame_resolved = 28;
|
|
82
|
+
CaptureResolvedEvent capture_resolved = 29;
|
|
79
83
|
}
|
|
80
84
|
}
|
|
81
85
|
|
|
@@ -309,3 +313,40 @@ message AccessibilitySnapshotCapturedEvent {
|
|
|
309
313
|
string snapshot = 1;
|
|
310
314
|
string format = 2;
|
|
311
315
|
}
|
|
316
|
+
|
|
317
|
+
// Read-only web inspection. Element reads use the first locator match.
|
|
318
|
+
enum CaptureKind {
|
|
319
|
+
CAPTURE_KIND_UNSPECIFIED = 0;
|
|
320
|
+
CAPTURE_KIND_URL = 1;
|
|
321
|
+
CAPTURE_KIND_INPUT_VALUE = 2;
|
|
322
|
+
CAPTURE_KIND_SELECTED_OPTIONS = 3;
|
|
323
|
+
CAPTURE_KIND_SELECTED_TEXT = 4;
|
|
324
|
+
CAPTURE_KIND_CHECKED = 5;
|
|
325
|
+
CAPTURE_KIND_ATTRIBUTE = 6;
|
|
326
|
+
CAPTURE_KIND_BOUNDING_BOX = 7;
|
|
327
|
+
}
|
|
328
|
+
message CaptureCommand {
|
|
329
|
+
CaptureKind kind = 1;
|
|
330
|
+
string css_selector = 2;
|
|
331
|
+
string attribute_name = 3;
|
|
332
|
+
optional CommandRetryOptions retry_options = 4;
|
|
333
|
+
}
|
|
334
|
+
message CapturedOption {
|
|
335
|
+
string value = 1;
|
|
336
|
+
string label = 2;
|
|
337
|
+
uint32 index = 3;
|
|
338
|
+
}
|
|
339
|
+
message BoundingBox {
|
|
340
|
+
double x = 1;
|
|
341
|
+
double y = 2;
|
|
342
|
+
double width = 3;
|
|
343
|
+
double height = 4;
|
|
344
|
+
}
|
|
345
|
+
message CaptureResolvedEvent {
|
|
346
|
+
// Absent for a missing attribute or unsupported text selection.
|
|
347
|
+
optional string value = 1;
|
|
348
|
+
optional bool checked = 2;
|
|
349
|
+
repeated CapturedOption selected_options = 3;
|
|
350
|
+
// Viewport coordinates in CSS pixels, absent for an element without a visible box.
|
|
351
|
+
optional BoundingBox bounding_box = 4;
|
|
352
|
+
}
|
|
@@ -88,3 +88,12 @@ message DownloadSavedEvent {
|
|
|
88
88
|
uint64 size = 4;
|
|
89
89
|
string note = 5;
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
// Resolve an iframe locator to a page after its document has loaded and settled.
|
|
93
|
+
message ResolveFrameCommand {
|
|
94
|
+
string css_selector = 1;
|
|
95
|
+
optional CommandRetryOptions retry_options = 2;
|
|
96
|
+
}
|
|
97
|
+
message FrameResolvedEvent {
|
|
98
|
+
string context_session_id = 1;
|
|
99
|
+
}
|