@e2e-dev/web 0.11.1 → 0.11.2
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/.build.json +1 -1
- package/dist/actions.d.ts +0 -1
- package/dist/actions.js +0 -1
- package/dist/attempt-session.d.ts +0 -1
- package/dist/attempt-session.js +0 -1
- package/dist/browser-connection.d.ts +0 -1
- package/dist/browser-connection.js +0 -1
- package/dist/browser.d.ts +0 -1
- package/dist/browser.js +9 -3
- package/dist/capture-scope.d.ts +0 -1
- package/dist/capture-scope.js +0 -1
- package/dist/cdp-recovery.d.ts +0 -1
- package/dist/cdp-recovery.js +0 -1
- package/dist/cdp-selectors.d.ts +0 -1
- package/dist/cdp-selectors.js +0 -1
- package/dist/closed-shadow.d.ts +0 -1
- package/dist/closed-shadow.js +0 -1
- package/dist/dialogs.d.ts +0 -1
- package/dist/dialogs.js +0 -1
- package/dist/downloads.d.ts +0 -1
- package/dist/downloads.js +0 -1
- package/dist/engine.d.ts +0 -1
- package/dist/engine.js +0 -1
- package/dist/evaluation.d.ts +0 -1
- package/dist/evaluation.js +0 -1
- package/dist/in-page/read-semantics.d.ts +3 -6
- package/dist/in-page/read-semantics.js +33 -15
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/install.d.ts +0 -1
- package/dist/install.js +0 -1
- package/dist/label-selector.d.ts +0 -1
- package/dist/label-selector.js +0 -1
- package/dist/locators.d.ts +0 -1
- package/dist/locators.js +0 -1
- package/dist/observation-capture.d.ts +0 -1
- package/dist/observation-capture.js +0 -1
- package/dist/observation.d.ts +0 -1
- package/dist/observation.js +0 -1
- package/dist/observe.d.ts +0 -1
- package/dist/observe.js +0 -1
- package/dist/operation-budget.d.ts +0 -1
- package/dist/operation-budget.js +0 -1
- package/dist/protected-app.d.ts +0 -1
- package/dist/protected-app.js +1 -2
- package/dist/provider-video.d.ts +0 -1
- package/dist/provider-video.js +0 -1
- package/dist/provider.d.ts +0 -1
- package/dist/provider.js +0 -1
- package/dist/read-node.d.ts +8 -43
- package/dist/read-node.js +7 -22
- package/dist/read-selector.d.ts +51 -0
- package/dist/read-selector.js +69 -0
- package/dist/refs.d.ts +0 -1
- package/dist/refs.js +0 -1
- package/dist/route-pattern.d.ts +0 -1
- package/dist/route-pattern.js +0 -1
- package/dist/selector-engines.d.ts +0 -1
- package/dist/selector-engines.js +2 -1
- package/dist/support.d.ts +0 -1
- package/dist/support.js +0 -1
- package/dist/surface.d.ts +0 -1
- package/dist/surface.js +18 -23
- package/dist/video.d.ts +0 -1
- package/dist/video.js +0 -1
- package/package.json +2 -2
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js.map +0 -1
- package/dist/attempt-session.d.ts.map +0 -1
- package/dist/attempt-session.js.map +0 -1
- package/dist/browser-connection.d.ts.map +0 -1
- package/dist/browser-connection.js.map +0 -1
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js.map +0 -1
- package/dist/capture-scope.d.ts.map +0 -1
- package/dist/capture-scope.js.map +0 -1
- package/dist/cdp-recovery.d.ts.map +0 -1
- package/dist/cdp-recovery.js.map +0 -1
- package/dist/cdp-selectors.d.ts.map +0 -1
- package/dist/cdp-selectors.js.map +0 -1
- package/dist/closed-shadow.d.ts.map +0 -1
- package/dist/closed-shadow.js.map +0 -1
- package/dist/dialogs.d.ts.map +0 -1
- package/dist/dialogs.js.map +0 -1
- package/dist/downloads.d.ts.map +0 -1
- package/dist/downloads.js.map +0 -1
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js.map +0 -1
- package/dist/evaluation.d.ts.map +0 -1
- package/dist/evaluation.js.map +0 -1
- package/dist/in-page/read-semantics.d.ts.map +0 -1
- package/dist/in-page/read-semantics.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js.map +0 -1
- package/dist/label-selector.d.ts.map +0 -1
- package/dist/label-selector.js.map +0 -1
- package/dist/locators.d.ts.map +0 -1
- package/dist/locators.js.map +0 -1
- package/dist/observation-capture.d.ts.map +0 -1
- package/dist/observation-capture.js.map +0 -1
- package/dist/observation.d.ts.map +0 -1
- package/dist/observation.js.map +0 -1
- package/dist/observe.d.ts.map +0 -1
- package/dist/observe.js.map +0 -1
- package/dist/operation-budget.d.ts.map +0 -1
- package/dist/operation-budget.js.map +0 -1
- package/dist/protected-app.d.ts.map +0 -1
- package/dist/protected-app.js.map +0 -1
- package/dist/provider-video.d.ts.map +0 -1
- package/dist/provider-video.js.map +0 -1
- package/dist/provider.d.ts.map +0 -1
- package/dist/provider.js.map +0 -1
- package/dist/read-node.d.ts.map +0 -1
- package/dist/read-node.js.map +0 -1
- package/dist/refs.d.ts.map +0 -1
- package/dist/refs.js.map +0 -1
- package/dist/route-pattern.d.ts.map +0 -1
- package/dist/route-pattern.js.map +0 -1
- package/dist/selector-engines.d.ts.map +0 -1
- package/dist/selector-engines.js.map +0 -1
- package/dist/support.d.ts.map +0 -1
- package/dist/support.js.map +0 -1
- package/dist/surface.d.ts.map +0 -1
- package/dist/surface.js.map +0 -1
- package/dist/video.d.ts.map +0 -1
- package/dist/video.js.map +0 -1
package/dist/.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.11.
|
|
1
|
+
{"version":"0.11.2"}
|
package/dist/actions.d.ts
CHANGED
package/dist/actions.js
CHANGED
package/dist/attempt-session.js
CHANGED
|
@@ -31,4 +31,3 @@ export declare function browserType(name: BrowserName): typeof chromium;
|
|
|
31
31
|
* detaches the CDP session without killing the remote process the host owns.
|
|
32
32
|
*/
|
|
33
33
|
export declare function connectCdp(endpoint: string, timeoutMs: number): Promise<Browser>;
|
|
34
|
-
//# sourceMappingURL=browser-connection.d.ts.map
|
|
@@ -94,4 +94,3 @@ function registerSelectorEngines() {
|
|
|
94
94
|
selectorEngines ??= Promise.all(SELECTOR_ENGINES.map(({ name, source }) => selectors.register(name, new Function(`return ${source};`)()))).then(() => undefined);
|
|
95
95
|
return selectorEngines;
|
|
96
96
|
}
|
|
97
|
-
//# sourceMappingURL=browser-connection.js.map
|
package/dist/browser.d.ts
CHANGED
|
@@ -197,4 +197,3 @@ export interface Browser extends Expectable<BrowserExpectation> {
|
|
|
197
197
|
}
|
|
198
198
|
/** Builds the `browser` fixture for one attempt over the shared surface. */
|
|
199
199
|
export declare function createBrowserFixture(surface: PlaywrightSurface, context: EngineFixtureContext): Browser;
|
|
200
|
-
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* never re-implemented here: `context.app.resolveUrl` is the one place that
|
|
12
12
|
* says which URLs a test may open.
|
|
13
13
|
*/
|
|
14
|
-
import { Deadline, describePattern, EngineError, matchesText, pollCondition, TestError, toTextPattern, urlMatches, validateJsonValue, } from 'e2e/engine';
|
|
14
|
+
import { Deadline, describePattern, EngineError, matchesText, pollCondition, rejectUnknownOptions, TestError, toTextPattern, urlMatches, validateJsonValue, } from 'e2e/engine';
|
|
15
15
|
import { saveDownloadsTo, saveFromBrowser, saveLocally } from './downloads.js';
|
|
16
16
|
import { isTestErrorCode, message as causeMessage, translatePwError } from './support.js';
|
|
17
17
|
import { compileEvaluation } from './evaluation.js';
|
|
@@ -85,7 +85,10 @@ export function createBrowserFixture(surface, context) {
|
|
|
85
85
|
url: currentUrl,
|
|
86
86
|
title: currentTitle,
|
|
87
87
|
// The same poll as `expect(browser).toHaveURL`, exposed as a wait.
|
|
88
|
-
waitForURL: (url, options) =>
|
|
88
|
+
waitForURL: (url, options) => {
|
|
89
|
+
rejectUnknownOptions('browser.waitForURL', options, ['timeout']);
|
|
90
|
+
return expectation.toHaveURL(url, options);
|
|
91
|
+
},
|
|
89
92
|
locator: (selector) => context.locator({ kind: 'selector', selector: requireSelector('browser.locator', selector) }),
|
|
90
93
|
frameLocator: (selector) => frameScreen(context, [requireSelector('browser.frameLocator', selector)]),
|
|
91
94
|
async evaluate(fn, arg) {
|
|
@@ -333,20 +336,24 @@ function createBrowserExpectation(deps, negated = false) {
|
|
|
333
336
|
onTimeout: async () => new TestError('ASSERTION_FAILED', `expect.${negated ? 'not.' : ''}${api} failed\nexpected: ${negated ? 'not ' : ''}${label}\nobserved: ${await observed()}`),
|
|
334
337
|
});
|
|
335
338
|
};
|
|
339
|
+
const validate = (api, options) => rejectUnknownOptions(`expect.${negated ? 'not.' : ''}${api}`, options, ['timeout']);
|
|
336
340
|
return {
|
|
337
341
|
get not() {
|
|
338
342
|
return createBrowserExpectation(deps, !negated);
|
|
339
343
|
},
|
|
340
344
|
toHaveURL(expected, options) {
|
|
345
|
+
validate('toHaveURL', options);
|
|
341
346
|
const label = typeof expected === 'string' ? expected : String(expected);
|
|
342
347
|
const target = deps.baseHref();
|
|
343
348
|
return poll('toHaveURL', `URL ${label}`, async () => urlMatches(await deps.currentUrl(), expected, target), async () => `URL ${await deps.currentUrl()}`, options?.timeout);
|
|
344
349
|
},
|
|
345
350
|
toHaveTitle(expected, options) {
|
|
351
|
+
validate('toHaveTitle', options);
|
|
346
352
|
const pattern = toTextPattern(expected, { exact: true });
|
|
347
353
|
return poll('toHaveTitle', `title ${describePattern(pattern)}`, async () => matchesText(await deps.currentTitle(), pattern), async () => `title ${JSON.stringify(await deps.currentTitle())}`, options?.timeout);
|
|
348
354
|
},
|
|
349
355
|
toHaveClass(target, expected, options) {
|
|
356
|
+
validate('toHaveClass', options);
|
|
350
357
|
const pattern = toTextPattern(expected, { exact: true });
|
|
351
358
|
return poll('toHaveClass', `class ${describePattern(pattern)}`, async () => {
|
|
352
359
|
try {
|
|
@@ -395,4 +402,3 @@ function frameScreen(context, frames) {
|
|
|
395
402
|
frameLocator: (selector) => frameScreen(context, [...frames, requireSelector('frameLocator', selector)]),
|
|
396
403
|
});
|
|
397
404
|
}
|
|
398
|
-
//# sourceMappingURL=browser.js.map
|
package/dist/capture-scope.d.ts
CHANGED
package/dist/capture-scope.js
CHANGED
package/dist/cdp-recovery.d.ts
CHANGED
package/dist/cdp-recovery.js
CHANGED
package/dist/cdp-selectors.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ import { type ConnectionBudget } from './operation-budget.ts';
|
|
|
12
12
|
export declare function registerCdpSelectors(context: BrowserContext, budget: ConnectionBudget): Promise<void>;
|
|
13
13
|
/** Existing closed roots cannot be recovered if their document loaded without the tracking hook. */
|
|
14
14
|
export declare function requireCdpShadowTracking(page: Page, budget: ConnectionBudget): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=cdp-selectors.d.ts.map
|
package/dist/cdp-selectors.js
CHANGED
|
@@ -49,4 +49,3 @@ export async function requireCdpShadowTracking(page, budget) {
|
|
|
49
49
|
throw new EngineError('ENGINE_FAILURE', 'CDP recovery failed: closed shadow root tracking is unavailable after a document changed while disconnected; locators and secure-field masks need it', { retryable: false });
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
//# sourceMappingURL=cdp-selectors.js.map
|
package/dist/closed-shadow.d.ts
CHANGED
package/dist/closed-shadow.js
CHANGED
|
@@ -139,4 +139,3 @@ export const CLOSED_SHADOW_SELECTOR_ENGINES = [
|
|
|
139
139
|
{ name: CLOSED_SHADOW_SELECTOR_ENGINE, source: CLOSED_SHADOW_SELECTOR_ENGINE_SOURCE },
|
|
140
140
|
{ name: SEARCH_ROOTS_SELECTOR_ENGINE, source: SEARCH_ROOTS_SELECTOR_ENGINE_SOURCE },
|
|
141
141
|
];
|
|
142
|
-
//# sourceMappingURL=closed-shadow.js.map
|
package/dist/dialogs.d.ts
CHANGED
package/dist/dialogs.js
CHANGED
package/dist/downloads.d.ts
CHANGED
package/dist/downloads.js
CHANGED
package/dist/engine.d.ts
CHANGED
|
@@ -23,4 +23,3 @@ export interface PlaywrightLiveSurface {
|
|
|
23
23
|
/** The live surface of a handle this module created, or undefined for any other engine. */
|
|
24
24
|
export declare function surfaceOf(engine: EngineHandle): PlaywrightLiveSurface | undefined;
|
|
25
25
|
export declare function web(options?: WebOptions): EngineHandle;
|
|
26
|
-
//# sourceMappingURL=engine.d.ts.map
|
package/dist/engine.js
CHANGED
package/dist/evaluation.d.ts
CHANGED
package/dist/evaluation.js
CHANGED
|
@@ -10,11 +10,9 @@ import type { SemanticMode, SemanticResult } from '../read-node.ts';
|
|
|
10
10
|
* Serialized into the page by Playwright. Must stay self-contained: no outer
|
|
11
11
|
* captures beyond its two arguments.
|
|
12
12
|
*
|
|
13
|
-
* `mode.kind === 'node'` reads exactly one element for locator reads
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* replaced, and what such a node reports (no boxes, so hidden) describes
|
|
17
|
-
* nothing on screen.
|
|
13
|
+
* `mode.kind === 'node'` reads exactly one element for locator reads, in
|
|
14
|
+
* the selector engine's task that found it (`read-selector.ts`,
|
|
15
|
+
* `label-selector.ts`), so the element is always in its document.
|
|
18
16
|
* `mode.kind === 'tree'` walks the subtree for one agent observation and
|
|
19
17
|
* returns live element handles aligned with the flattened node list. The two
|
|
20
18
|
* modes also project nodes differently; those differences are data (see
|
|
@@ -25,4 +23,3 @@ export declare const readSemanticsFunction: <Mode extends SemanticMode>(element:
|
|
|
25
23
|
secureFieldSelector: string;
|
|
26
24
|
mode: Mode;
|
|
27
25
|
}) => SemanticResult<Mode>;
|
|
28
|
-
//# sourceMappingURL=read-semantics.d.ts.map
|
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
* Serialized into the page by Playwright. Must stay self-contained: no outer
|
|
10
10
|
* captures beyond its two arguments.
|
|
11
11
|
*
|
|
12
|
-
* `mode.kind === 'node'` reads exactly one element for locator reads
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* replaced, and what such a node reports (no boxes, so hidden) describes
|
|
16
|
-
* nothing on screen.
|
|
12
|
+
* `mode.kind === 'node'` reads exactly one element for locator reads, in
|
|
13
|
+
* the selector engine's task that found it (`read-selector.ts`,
|
|
14
|
+
* `label-selector.ts`), so the element is always in its document.
|
|
17
15
|
* `mode.kind === 'tree'` walks the subtree for one agent observation and
|
|
18
16
|
* returns live element handles aligned with the flattened node list. The two
|
|
19
17
|
* modes also project nodes differently; those differences are data (see
|
|
@@ -148,6 +146,10 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
148
146
|
return 'textbox';
|
|
149
147
|
case 'img':
|
|
150
148
|
return el.getAttribute('alt') === '' ? 'presentation' : 'image';
|
|
149
|
+
// An inline icon is a picture whether or not anything names it, as
|
|
150
|
+
// Playwright reads it; Chrome ignores an unnamed one.
|
|
151
|
+
case 'svg':
|
|
152
|
+
return 'image';
|
|
151
153
|
case 'nav':
|
|
152
154
|
return 'navigation';
|
|
153
155
|
case 'main':
|
|
@@ -355,6 +357,24 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
355
357
|
const alt = named ? el.getAttribute('alt') : null;
|
|
356
358
|
return alt !== null && alt.trim() !== '' ? alt.trim() : null;
|
|
357
359
|
};
|
|
360
|
+
/**
|
|
361
|
+
* The `<title>` child an SVG element is named by (SVG-AAM), as Playwright
|
|
362
|
+
* reads it: `<svg><title>Close</title></svg>` is the image "Close". An svg
|
|
363
|
+
* marked `presentation` or `none` takes no name of its own from it, though
|
|
364
|
+
* the title still names a link or button around it.
|
|
365
|
+
*/
|
|
366
|
+
const svgTitleOf = (el) => {
|
|
367
|
+
if (!(el instanceof SVGElement))
|
|
368
|
+
return null;
|
|
369
|
+
const title = Array.from(el.children).find((child) => child instanceof SVGTitleElement);
|
|
370
|
+
const text = (title?.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
371
|
+
return text === '' ? null : text;
|
|
372
|
+
};
|
|
373
|
+
/** True for an element whose role removes its semantics: `presentation` or `none`. */
|
|
374
|
+
const isPresentational = (el) => {
|
|
375
|
+
const role = implicitRole(el);
|
|
376
|
+
return role === 'presentation' || role === 'none';
|
|
377
|
+
};
|
|
358
378
|
/**
|
|
359
379
|
* True for a referenced target accname 2A reads whole: hidden itself, or
|
|
360
380
|
* under an `aria-hidden` ancestor, which excludes it from the tree as
|
|
@@ -428,9 +448,9 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
428
448
|
const ariaLabel = el.getAttribute('aria-label');
|
|
429
449
|
if (ariaLabel !== null && ariaLabel.trim() !== '')
|
|
430
450
|
return ariaLabel.trim();
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
-
return
|
|
451
|
+
const alternative = altOf(el) ?? svgTitleOf(el);
|
|
452
|
+
if (alternative !== null)
|
|
453
|
+
return alternative;
|
|
434
454
|
if (NAME_OPAQUE_TAGS.has(el.tagName))
|
|
435
455
|
return '';
|
|
436
456
|
const content = childrenNameOf(el, walk);
|
|
@@ -584,9 +604,9 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
584
604
|
if (joined !== '')
|
|
585
605
|
return joined;
|
|
586
606
|
}
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
607
|
+
const alternative = altOf(el) ?? (isPresentational(el) ? null : svgTitleOf(el));
|
|
608
|
+
if (alternative !== null)
|
|
609
|
+
return alternative;
|
|
590
610
|
const captionTag = NAMING_CHILD_TAGS[el.tagName.toLowerCase()];
|
|
591
611
|
if (captionTag !== undefined) {
|
|
592
612
|
const caption = Array.from(el.children).find((child) => child.tagName.toLowerCase() === captionTag);
|
|
@@ -1154,7 +1174,7 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
1154
1174
|
// The conditional return type resolves per call site; inside the body the
|
|
1155
1175
|
// discriminant narrows the value but not the generic, hence the two casts.
|
|
1156
1176
|
if (options.mode.kind === 'node') {
|
|
1157
|
-
return
|
|
1177
|
+
return describe(element);
|
|
1158
1178
|
}
|
|
1159
1179
|
const maxNodes = options.mode.maxNodes;
|
|
1160
1180
|
const nodes = [];
|
|
@@ -1187,8 +1207,7 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
1187
1207
|
const isInteresting = (el) => {
|
|
1188
1208
|
if (el.hasAttribute(options.testIdAttribute))
|
|
1189
1209
|
return true;
|
|
1190
|
-
|
|
1191
|
-
if (role !== null && role !== 'presentation' && role !== 'none')
|
|
1210
|
+
if (implicitRole(el) !== null && !isPresentational(el))
|
|
1192
1211
|
return true;
|
|
1193
1212
|
if (accessibleName(el) !== null)
|
|
1194
1213
|
return true;
|
|
@@ -1284,4 +1303,3 @@ export const readSemanticsFunction = (element, options) => {
|
|
|
1284
1303
|
walk(child, 0);
|
|
1285
1304
|
return { nodes, elements, ids, truncated };
|
|
1286
1305
|
};
|
|
1287
|
-
//# sourceMappingURL=read-semantics.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -28,4 +28,3 @@ export declare const describe: {
|
|
|
28
28
|
}>) => void, afterEach: (fn: import("e2e").TestHookFn<import("e2e").TestFixtures & {
|
|
29
29
|
browser: Browser;
|
|
30
30
|
}>) => void, beforeAll: (fn: import("e2e").SuiteHookFn) => void, afterAll: (fn: import("e2e").SuiteHookFn) => void;
|
|
31
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -13,4 +13,3 @@ export { web, surfaceOf } from './engine.js';
|
|
|
13
13
|
export const test = base.extend();
|
|
14
14
|
/** `describe` and the hooks, the same functions as `test.describe` and `test.beforeEach`, typed with the `browser` fixture. */
|
|
15
15
|
export const { describe, beforeEach, afterEach, beforeAll, afterAll } = test;
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/install.d.ts
CHANGED
package/dist/install.js
CHANGED
package/dist/label-selector.d.ts
CHANGED
package/dist/label-selector.js
CHANGED
package/dist/locators.d.ts
CHANGED
|
@@ -73,4 +73,3 @@ export declare function applyPostSteps<T>(matches: readonly T[], steps: readonly
|
|
|
73
73
|
/** Returns every frame selector along an expression, outermost first. */
|
|
74
74
|
export declare function frameSelectors(expression: LocatorExpression): string[];
|
|
75
75
|
export {};
|
|
76
|
-
//# sourceMappingURL=locators.d.ts.map
|
package/dist/locators.js
CHANGED
|
@@ -9,4 +9,3 @@ interface CaptureSettings {
|
|
|
9
9
|
/** Captures under one deadline, retaining no refs from a failed or abandoned document. */
|
|
10
10
|
export declare function captureObservation(page: Page, refs: RefRegistry, settings: CaptureSettings, operation: OperationContext, options: EngineObserveOptions | undefined): Promise<CapturedObservation>;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=observation-capture.d.ts.map
|
package/dist/observation.d.ts
CHANGED
|
@@ -60,4 +60,3 @@ export interface CapturedDocument {
|
|
|
60
60
|
*/
|
|
61
61
|
export declare function captureDocument(deps: CaptureDeps, host: DocumentHost, options: CaptureOptions): Promise<CapturedDocument>;
|
|
62
62
|
export declare function toSemanticNode(ref: NodeRef, raw: RawNodeData, children?: readonly SemanticNode[], framePath?: readonly string[]): SemanticNode;
|
|
63
|
-
//# sourceMappingURL=observation.d.ts.map
|
package/dist/observation.js
CHANGED
package/dist/observe.d.ts
CHANGED
package/dist/observe.js
CHANGED
|
@@ -8,4 +8,3 @@ export interface ConnectionBudget {
|
|
|
8
8
|
export declare function connectionAbort(signal: AbortSignal, label: string): EngineError;
|
|
9
9
|
/** Bounds the entire transition, aborts abandoned work, and never grants a fresh dispatch budget. */
|
|
10
10
|
export declare function withConnectionBudget<T>(budget: ConnectionBudget, label: string, work: (remaining: () => ConnectionBudget) => Promise<T>): Promise<T>;
|
|
11
|
-
//# sourceMappingURL=operation-budget.d.ts.map
|
package/dist/operation-budget.js
CHANGED
package/dist/protected-app.d.ts
CHANGED
|
@@ -33,4 +33,3 @@ export declare function installSiteHeaders(context: BrowserContext, site: string
|
|
|
33
33
|
* echoes its request headers shows that, not the password.
|
|
34
34
|
*/
|
|
35
35
|
export declare function httpCredentials(basicAuth: WebBasicAuth, resolveSecret: (secret: Secret, options?: ResolveSecretOptions) => Promise<string>): Promise<PlaywrightHttpCredential>;
|
|
36
|
-
//# sourceMappingURL=protected-app.d.ts.map
|
package/dist/protected-app.js
CHANGED
|
@@ -46,7 +46,6 @@ export async function httpCredentials(basicAuth, resolveSecret) {
|
|
|
46
46
|
*/
|
|
47
47
|
function basicCredentials(username, password) {
|
|
48
48
|
const encoded = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');
|
|
49
|
-
const unpadded = encoded.replace(
|
|
49
|
+
const unpadded = encoded.replace(/={1,2}$/, '');
|
|
50
50
|
return unpadded === encoded ? [encoded] : [encoded, unpadded];
|
|
51
51
|
}
|
|
52
|
-
//# sourceMappingURL=protected-app.js.map
|
package/dist/provider-video.d.ts
CHANGED
package/dist/provider-video.js
CHANGED
package/dist/provider.d.ts
CHANGED
package/dist/provider.js
CHANGED
package/dist/read-node.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The wire types of the in-page semantic reader and the
|
|
3
|
-
* assembled from its source for
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The wire types of the in-page semantic reader and the document walk
|
|
3
|
+
* assembled from its source for page.evaluate. The reader itself lives in
|
|
4
|
+
* `in-page/read-semantics.ts`; it is serialized into the page, so the page
|
|
5
|
+
* function here is built from its source with `new Function` and stays free
|
|
6
|
+
* of module-scope captures. Locator reads run it inside the selector engines
|
|
7
|
+
* (`read-selector.ts`, `label-selector.ts`).
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* The one definition of a secure field.
|
|
@@ -94,27 +95,10 @@ export type SemanticMode = {
|
|
|
94
95
|
/** Cuts each node's text at this length; the caller owns the contract value. */
|
|
95
96
|
textLimit: number;
|
|
96
97
|
};
|
|
97
|
-
/**
|
|
98
|
-
* What a node read reports for an element no longer in its document. A
|
|
99
|
-
* detached element has no boxes, so everything else it would report (hidden,
|
|
100
|
-
* no labels) describes nothing on screen; its current value is still its own.
|
|
101
|
-
*/
|
|
102
|
-
export interface DetachedNodeData {
|
|
103
|
-
readonly detached: true;
|
|
104
|
-
readonly value: string | null;
|
|
105
|
-
}
|
|
106
98
|
/** Result of one read, selected by the mode discriminant. */
|
|
107
99
|
export type SemanticResult<Mode extends SemanticMode> = Mode extends {
|
|
108
100
|
kind: 'node';
|
|
109
|
-
} ? RawNodeData
|
|
110
|
-
/** Options for a single-node read, shared by `evaluate` and `evaluateAll` callers. */
|
|
111
|
-
interface NodeReadOptions {
|
|
112
|
-
readonly testIdAttribute: string;
|
|
113
|
-
readonly secureFieldSelector: string;
|
|
114
|
-
readonly mode: {
|
|
115
|
-
readonly kind: 'node';
|
|
116
|
-
};
|
|
117
|
-
}
|
|
101
|
+
} ? RawNodeData : RawObservation;
|
|
118
102
|
/** Options for one document's tree walk. */
|
|
119
103
|
interface TreeReadOptions {
|
|
120
104
|
readonly testIdAttribute: string;
|
|
@@ -125,28 +109,9 @@ interface TreeReadOptions {
|
|
|
125
109
|
}
|
|
126
110
|
/**
|
|
127
111
|
* Walks a whole document from its root element in one in-page call. Built
|
|
128
|
-
* from the reader's source
|
|
112
|
+
* from the reader's source, so the caller
|
|
129
113
|
* evaluates it directly on a page or frame instead of first resolving a
|
|
130
114
|
* `:root` locator - one fewer protocol round trip per document per capture.
|
|
131
115
|
*/
|
|
132
116
|
export declare const readDocumentSemanticsFunction: (options: TreeReadOptions) => RawObservation;
|
|
133
|
-
/**
|
|
134
|
-
* Reads every matched element in one in-page round trip. A page function
|
|
135
|
-
* cannot close over module scope, so the batch function is assembled from the
|
|
136
|
-
* reader's own source (the same source `evaluate` sends) and is a
|
|
137
|
-
* self-contained function Playwright serializes and calls with the elements.
|
|
138
|
-
*/
|
|
139
|
-
export declare const readManySemanticsFunction: (elements: Element[], options: NodeReadOptions) => (RawNodeData | DetachedNodeData)[];
|
|
140
|
-
/**
|
|
141
|
-
* Reads every handle the caller already holds in one round trip, so what is
|
|
142
|
-
* read and what is later acted on are the same elements by construction rather
|
|
143
|
-
* than by a second lookup. Evaluated on the first handle so the read runs in
|
|
144
|
-
* the frame the handles belong to; `page.evaluate` would reject handles taken
|
|
145
|
-
* inside an iframe.
|
|
146
|
-
*/
|
|
147
|
-
export declare const readHandlesSemanticsFunction: (first: Element, arg: {
|
|
148
|
-
elements: Element[];
|
|
149
|
-
options: NodeReadOptions;
|
|
150
|
-
}) => (RawNodeData | DetachedNodeData)[];
|
|
151
117
|
export {};
|
|
152
|
-
//# sourceMappingURL=read-node.d.ts.map
|
package/dist/read-node.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The wire types of the in-page semantic reader and the
|
|
3
|
-
* assembled from its source for
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* The wire types of the in-page semantic reader and the document walk
|
|
3
|
+
* assembled from its source for page.evaluate. The reader itself lives in
|
|
4
|
+
* `in-page/read-semantics.ts`; it is serialized into the page, so the page
|
|
5
|
+
* function here is built from its source with `new Function` and stays free
|
|
6
|
+
* of module-scope captures. Locator reads run it inside the selector engines
|
|
7
|
+
* (`read-selector.ts`, `label-selector.ts`).
|
|
7
8
|
*/
|
|
8
9
|
import { readSemanticsFunction } from './in-page/read-semantics.js';
|
|
9
10
|
/**
|
|
@@ -19,24 +20,8 @@ import { readSemanticsFunction } from './in-page/read-semantics.js';
|
|
|
19
20
|
export const SECURE_FIELD_SELECTOR = 'input[type="password" i]';
|
|
20
21
|
/**
|
|
21
22
|
* Walks a whole document from its root element in one in-page call. Built
|
|
22
|
-
* from the reader's source
|
|
23
|
+
* from the reader's source, so the caller
|
|
23
24
|
* evaluates it directly on a page or frame instead of first resolving a
|
|
24
25
|
* `:root` locator - one fewer protocol round trip per document per capture.
|
|
25
26
|
*/
|
|
26
27
|
export const readDocumentSemanticsFunction = new Function('options', `return (${readSemanticsFunction.toString()})(document.documentElement, options);`);
|
|
27
|
-
/**
|
|
28
|
-
* Reads every matched element in one in-page round trip. A page function
|
|
29
|
-
* cannot close over module scope, so the batch function is assembled from the
|
|
30
|
-
* reader's own source (the same source `evaluate` sends) and is a
|
|
31
|
-
* self-contained function Playwright serializes and calls with the elements.
|
|
32
|
-
*/
|
|
33
|
-
export const readManySemanticsFunction = new Function('elements', 'options', `return elements.map((element) => (${readSemanticsFunction.toString()})(element, options));`);
|
|
34
|
-
/**
|
|
35
|
-
* Reads every handle the caller already holds in one round trip, so what is
|
|
36
|
-
* read and what is later acted on are the same elements by construction rather
|
|
37
|
-
* than by a second lookup. Evaluated on the first handle so the read runs in
|
|
38
|
-
* the frame the handles belong to; `page.evaluate` would reject handles taken
|
|
39
|
-
* inside an iframe.
|
|
40
|
-
*/
|
|
41
|
-
export const readHandlesSemanticsFunction = new Function('_first', 'arg', `return arg.elements.map((element) => (${readSemanticsFunction.toString()})(element, arg.options));`);
|
|
42
|
-
//# sourceMappingURL=read-node.js.map
|