@e2e-dev/web 0.11.0 → 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.
Files changed (128) hide show
  1. package/dist/.build.json +1 -1
  2. package/dist/actions.d.ts +0 -1
  3. package/dist/actions.js +0 -1
  4. package/dist/attempt-session.d.ts +0 -1
  5. package/dist/attempt-session.js +0 -1
  6. package/dist/browser-connection.d.ts +0 -1
  7. package/dist/browser-connection.js +0 -1
  8. package/dist/browser.d.ts +0 -1
  9. package/dist/browser.js +9 -3
  10. package/dist/capture-scope.d.ts +0 -1
  11. package/dist/capture-scope.js +0 -1
  12. package/dist/cdp-recovery.d.ts +0 -1
  13. package/dist/cdp-recovery.js +0 -1
  14. package/dist/cdp-selectors.d.ts +0 -1
  15. package/dist/cdp-selectors.js +0 -1
  16. package/dist/closed-shadow.d.ts +0 -1
  17. package/dist/closed-shadow.js +0 -1
  18. package/dist/dialogs.d.ts +0 -1
  19. package/dist/dialogs.js +0 -1
  20. package/dist/downloads.d.ts +0 -1
  21. package/dist/downloads.js +0 -1
  22. package/dist/engine.d.ts +0 -1
  23. package/dist/engine.js +0 -1
  24. package/dist/evaluation.d.ts +0 -1
  25. package/dist/evaluation.js +0 -1
  26. package/dist/in-page/read-semantics.d.ts +3 -6
  27. package/dist/in-page/read-semantics.js +33 -15
  28. package/dist/index.d.ts +0 -1
  29. package/dist/index.js +0 -1
  30. package/dist/install.d.ts +0 -1
  31. package/dist/install.js +0 -1
  32. package/dist/label-selector.d.ts +0 -1
  33. package/dist/label-selector.js +0 -1
  34. package/dist/locators.d.ts +0 -1
  35. package/dist/locators.js +0 -1
  36. package/dist/observation-capture.d.ts +0 -1
  37. package/dist/observation-capture.js +0 -1
  38. package/dist/observation.d.ts +0 -1
  39. package/dist/observation.js +0 -1
  40. package/dist/observe.d.ts +0 -1
  41. package/dist/observe.js +0 -1
  42. package/dist/operation-budget.d.ts +0 -1
  43. package/dist/operation-budget.js +0 -1
  44. package/dist/protected-app.d.ts +0 -1
  45. package/dist/protected-app.js +1 -2
  46. package/dist/provider-video.d.ts +0 -1
  47. package/dist/provider-video.js +0 -1
  48. package/dist/provider.d.ts +0 -1
  49. package/dist/provider.js +0 -1
  50. package/dist/read-node.d.ts +8 -43
  51. package/dist/read-node.js +7 -22
  52. package/dist/read-selector.d.ts +51 -0
  53. package/dist/read-selector.js +69 -0
  54. package/dist/refs.d.ts +0 -1
  55. package/dist/refs.js +0 -1
  56. package/dist/route-pattern.d.ts +0 -1
  57. package/dist/route-pattern.js +0 -1
  58. package/dist/selector-engines.d.ts +0 -1
  59. package/dist/selector-engines.js +2 -1
  60. package/dist/support.d.ts +0 -1
  61. package/dist/support.js +0 -1
  62. package/dist/surface.d.ts +0 -1
  63. package/dist/surface.js +18 -23
  64. package/dist/video.d.ts +0 -1
  65. package/dist/video.js +0 -1
  66. package/package.json +8 -6
  67. package/dist/actions.d.ts.map +0 -1
  68. package/dist/actions.js.map +0 -1
  69. package/dist/attempt-session.d.ts.map +0 -1
  70. package/dist/attempt-session.js.map +0 -1
  71. package/dist/browser-connection.d.ts.map +0 -1
  72. package/dist/browser-connection.js.map +0 -1
  73. package/dist/browser.d.ts.map +0 -1
  74. package/dist/browser.js.map +0 -1
  75. package/dist/capture-scope.d.ts.map +0 -1
  76. package/dist/capture-scope.js.map +0 -1
  77. package/dist/cdp-recovery.d.ts.map +0 -1
  78. package/dist/cdp-recovery.js.map +0 -1
  79. package/dist/cdp-selectors.d.ts.map +0 -1
  80. package/dist/cdp-selectors.js.map +0 -1
  81. package/dist/closed-shadow.d.ts.map +0 -1
  82. package/dist/closed-shadow.js.map +0 -1
  83. package/dist/dialogs.d.ts.map +0 -1
  84. package/dist/dialogs.js.map +0 -1
  85. package/dist/downloads.d.ts.map +0 -1
  86. package/dist/downloads.js.map +0 -1
  87. package/dist/engine.d.ts.map +0 -1
  88. package/dist/engine.js.map +0 -1
  89. package/dist/evaluation.d.ts.map +0 -1
  90. package/dist/evaluation.js.map +0 -1
  91. package/dist/in-page/read-semantics.d.ts.map +0 -1
  92. package/dist/in-page/read-semantics.js.map +0 -1
  93. package/dist/index.d.ts.map +0 -1
  94. package/dist/index.js.map +0 -1
  95. package/dist/install.d.ts.map +0 -1
  96. package/dist/install.js.map +0 -1
  97. package/dist/label-selector.d.ts.map +0 -1
  98. package/dist/label-selector.js.map +0 -1
  99. package/dist/locators.d.ts.map +0 -1
  100. package/dist/locators.js.map +0 -1
  101. package/dist/observation-capture.d.ts.map +0 -1
  102. package/dist/observation-capture.js.map +0 -1
  103. package/dist/observation.d.ts.map +0 -1
  104. package/dist/observation.js.map +0 -1
  105. package/dist/observe.d.ts.map +0 -1
  106. package/dist/observe.js.map +0 -1
  107. package/dist/operation-budget.d.ts.map +0 -1
  108. package/dist/operation-budget.js.map +0 -1
  109. package/dist/protected-app.d.ts.map +0 -1
  110. package/dist/protected-app.js.map +0 -1
  111. package/dist/provider-video.d.ts.map +0 -1
  112. package/dist/provider-video.js.map +0 -1
  113. package/dist/provider.d.ts.map +0 -1
  114. package/dist/provider.js.map +0 -1
  115. package/dist/read-node.d.ts.map +0 -1
  116. package/dist/read-node.js.map +0 -1
  117. package/dist/refs.d.ts.map +0 -1
  118. package/dist/refs.js.map +0 -1
  119. package/dist/route-pattern.d.ts.map +0 -1
  120. package/dist/route-pattern.js.map +0 -1
  121. package/dist/selector-engines.d.ts.map +0 -1
  122. package/dist/selector-engines.js.map +0 -1
  123. package/dist/support.d.ts.map +0 -1
  124. package/dist/support.js.map +0 -1
  125. package/dist/surface.d.ts.map +0 -1
  126. package/dist/surface.js.map +0 -1
  127. package/dist/video.d.ts.map +0 -1
  128. package/dist/video.js.map +0 -1
package/dist/.build.json CHANGED
@@ -1 +1 @@
1
- {"version":"0.11.0"}
1
+ {"version":"0.11.2"}
package/dist/actions.d.ts CHANGED
@@ -20,4 +20,3 @@ export declare function dispatchPointerAction(page: Page, at: ViewportPoint, act
20
20
  * committed, or an engine fault.
21
21
  */
22
22
  export declare function classifyActionError(rawCause: unknown, action: LocatorAction): Error;
23
- //# sourceMappingURL=actions.d.ts.map
package/dist/actions.js CHANGED
@@ -191,4 +191,3 @@ export function classifyActionError(rawCause, action) {
191
191
  }
192
192
  return new EngineError('ENGINE_FAILURE', text, { retryable: false, cause });
193
193
  }
194
- //# sourceMappingURL=actions.js.map
@@ -109,4 +109,3 @@ export declare class AttemptSession {
109
109
  private finalize;
110
110
  }
111
111
  export {};
112
- //# sourceMappingURL=attempt-session.d.ts.map
@@ -345,4 +345,3 @@ export class AttemptSession {
345
345
  }
346
346
  }
347
347
  }
348
- //# sourceMappingURL=attempt-session.js.map
@@ -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) => expectation.toHaveURL(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
@@ -18,4 +18,3 @@ export declare class CaptureScope {
18
18
  /** Refuses further work after cancellation, expiry, or completion. */
19
19
  check(): void;
20
20
  }
21
- //# sourceMappingURL=capture-scope.d.ts.map
@@ -58,4 +58,3 @@ export class CaptureScope {
58
58
  function captureTimeout() {
59
59
  return new EngineError('OPERATION_TIMEOUT', 'observation capture timed out', { retryable: false });
60
60
  }
61
- //# sourceMappingURL=capture-scope.js.map
@@ -26,4 +26,3 @@ export declare function attachPersistent(resolve: CdpEndpointResolver, budget: C
26
26
  readonly identity: PersistentIdentity;
27
27
  }>;
28
28
  export {};
29
- //# sourceMappingURL=cdp-recovery.d.ts.map
@@ -81,4 +81,3 @@ export async function attachPersistent(resolve, budget, previous) {
81
81
  signal.removeEventListener('abort', detach);
82
82
  }
83
83
  }
84
- //# sourceMappingURL=cdp-recovery.js.map
@@ -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
@@ -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
@@ -61,4 +61,3 @@ export declare const CLOSED_SHADOW_SELECTOR_ENGINES: readonly {
61
61
  readonly name: string;
62
62
  readonly source: string;
63
63
  }[];
64
- //# sourceMappingURL=closed-shadow.d.ts.map
@@ -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
@@ -35,4 +35,3 @@ export declare class DialogRouter {
35
35
  dispatch(dialog: PwDialog): Promise<void>;
36
36
  private route;
37
37
  }
38
- //# sourceMappingURL=dialogs.d.ts.map
package/dist/dialogs.js CHANGED
@@ -84,4 +84,3 @@ export class DialogRouter {
84
84
  }
85
85
  }
86
86
  }
87
- //# sourceMappingURL=dialogs.js.map
@@ -26,4 +26,3 @@ export declare function saveFromBrowser(download: Download, downloads: LeaseDown
26
26
  * save names it.
27
27
  */
28
28
  export declare function saveLocally(download: Download, file: string, unserved: string | undefined): Promise<void>;
29
- //# sourceMappingURL=downloads.d.ts.map
package/dist/downloads.js CHANGED
@@ -71,4 +71,3 @@ export async function saveLocally(download, file, unserved) {
71
71
  throw new EngineError('ENGINE_FAILURE', `download failed: ${message(cause)}; ${unserved}`, { retryable: false, cause });
72
72
  }
73
73
  }
74
- //# sourceMappingURL=downloads.js.map
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
@@ -268,4 +268,3 @@ function ownVersion() {
268
268
  return 'unknown';
269
269
  }
270
270
  }
271
- //# sourceMappingURL=engine.js.map
@@ -15,4 +15,3 @@ type EvaluationResult = {
15
15
  */
16
16
  export declare function compileEvaluation(source: string, hasArgument: boolean): (arg: unknown) => Promise<EvaluationResult>;
17
17
  export {};
18
- //# sourceMappingURL=evaluation.d.ts.map
@@ -32,4 +32,3 @@ export function compileEvaluation(source, hasArgument) {
32
32
  throw new TestError('EVALUATE_FAILED', message(cause), { cause });
33
33
  }
34
34
  }
35
- //# sourceMappingURL=evaluation.js.map
@@ -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. An
14
- * element no longer in its document reads as detached with its value alone:
15
- * a handle taken a moment earlier can point at a node the page has since
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. An
13
- * element no longer in its document reads as detached with its value alone:
14
- * a handle taken a moment earlier can point at a node the page has since
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 alt = altOf(el);
432
- if (alt !== null)
433
- return alt;
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 alt = altOf(el);
588
- if (alt !== null)
589
- return alt;
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 (element.isConnected ? describe(element) : { detached: true, value: describe(element).value });
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
- const role = implicitRole(el);
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
@@ -37,4 +37,3 @@ export interface EnsureBrowsersOptions {
37
37
  * them with a registry lock.
38
38
  */
39
39
  export declare function ensureBrowsersInstalled(names: readonly BrowserName[], options?: EnsureBrowsersOptions): Promise<void>;
40
- //# sourceMappingURL=install.d.ts.map
package/dist/install.js CHANGED
@@ -114,4 +114,3 @@ function runPlaywrightInstall(names, { log, signal, env }) {
114
114
  });
115
115
  });
116
116
  }
117
- //# sourceMappingURL=install.js.map
@@ -34,4 +34,3 @@ export declare function exactLabelSelector(body: ExactLabelSelectorBody): string
34
34
  * page function.
35
35
  */
36
36
  export declare const EXACT_LABEL_SELECTOR_ENGINE_SOURCE: string;
37
- //# sourceMappingURL=label-selector.d.ts.map
@@ -50,4 +50,3 @@ export const EXACT_LABEL_SELECTOR_ENGINE_SOURCE = `() => {${CLOSED_SHADOW_HELPER
50
50
  };
51
51
  return { queryAll, query: (root, selector) => queryAll(root, selector)[0] ?? null };
52
52
  }`;
53
- //# sourceMappingURL=label-selector.js.map
@@ -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
@@ -305,4 +305,3 @@ export function frameSelectors(expression) {
305
305
  return [expression.selector, ...frameSelectors(expression.source)];
306
306
  }
307
307
  }
308
- //# sourceMappingURL=locators.js.map
@@ -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
@@ -90,4 +90,3 @@ export async function captureObservation(page, refs, settings, operation, option
90
90
  accepting = false;
91
91
  }
92
92
  }
93
- //# sourceMappingURL=observation-capture.js.map
@@ -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
@@ -277,4 +277,3 @@ export function toSemanticNode(ref, raw, children = [], framePath = []) {
277
277
  ...(children.length > 0 ? { children } : {}),
278
278
  };
279
279
  }
280
- //# sourceMappingURL=observation.js.map
package/dist/observe.d.ts CHANGED
@@ -48,4 +48,3 @@ export declare function readPngSize(data: Uint8Array): {
48
48
  width: number;
49
49
  height: number;
50
50
  } | null;
51
- //# sourceMappingURL=observe.d.ts.map
package/dist/observe.js CHANGED
@@ -102,4 +102,3 @@ export function readPngSize(data) {
102
102
  return null;
103
103
  return { width, height };
104
104
  }
105
- //# sourceMappingURL=observe.js.map
@@ -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
@@ -37,4 +37,3 @@ export async function withConnectionBudget(budget, label, work) {
37
37
  clearTimeout(timer);
38
38
  }
39
39
  }
40
- //# sourceMappingURL=operation-budget.js.map
@@ -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
@@ -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
@@ -45,4 +45,3 @@ export declare class ProviderVideo implements AttemptVideo {
45
45
  /** Ends one of the provider's recordings as a segment of the attempt. */
46
46
  private stopLease;
47
47
  }
48
- //# sourceMappingURL=provider-video.d.ts.map
@@ -77,4 +77,3 @@ export class ProviderVideo {
77
77
  });
78
78
  }
79
79
  }
80
- //# sourceMappingURL=provider-video.js.map
@@ -250,4 +250,3 @@ export declare class LeasedBrowsers {
250
250
  private release;
251
251
  private releaseContext;
252
252
  }
253
- //# sourceMappingURL=provider.d.ts.map
package/dist/provider.js CHANGED
@@ -442,4 +442,3 @@ export class LeasedBrowsers {
442
442
  return { runId: run.runId, targetName: run.targetName, env: run.env, signal, log: run.log };
443
443
  }
444
444
  }
445
- //# sourceMappingURL=provider.js.map
@@ -1,9 +1,10 @@
1
1
  /**
2
- * The wire types of the in-page semantic reader and the page functions
3
- * assembled from its source for locator.evaluate, locator.evaluateAll, and
4
- * page.evaluate. The reader itself lives in `in-page/read-semantics.ts`; it is
5
- * serialized into the page, so every page function here is built from its
6
- * source with `new Function` and stays free of module-scope captures.
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 | DetachedNodeData : RawObservation;
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 like the batch reader below, so the caller
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 page functions
3
- * assembled from its source for locator.evaluate, locator.evaluateAll, and
4
- * page.evaluate. The reader itself lives in `in-page/read-semantics.ts`; it is
5
- * serialized into the page, so every page function here is built from its
6
- * source with `new Function` and stays free of module-scope captures.
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 like the batch reader below, so the caller
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