@e2edev/web 0.11.0-canary-20260921180210

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 (101) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/README.md +112 -0
  4. package/dist/.build.json +1 -0
  5. package/dist/actions.d.ts +23 -0
  6. package/dist/actions.d.ts.map +1 -0
  7. package/dist/actions.js +174 -0
  8. package/dist/actions.js.map +1 -0
  9. package/dist/attempt-session.d.ts +76 -0
  10. package/dist/attempt-session.d.ts.map +1 -0
  11. package/dist/attempt-session.js +290 -0
  12. package/dist/attempt-session.js.map +1 -0
  13. package/dist/browser-connection.d.ts +34 -0
  14. package/dist/browser-connection.d.ts.map +1 -0
  15. package/dist/browser-connection.js +87 -0
  16. package/dist/browser-connection.js.map +1 -0
  17. package/dist/capture-scope.d.ts +21 -0
  18. package/dist/capture-scope.d.ts.map +1 -0
  19. package/dist/capture-scope.js +61 -0
  20. package/dist/capture-scope.js.map +1 -0
  21. package/dist/cdp-recovery.d.ts +29 -0
  22. package/dist/cdp-recovery.d.ts.map +1 -0
  23. package/dist/cdp-recovery.js +84 -0
  24. package/dist/cdp-recovery.js.map +1 -0
  25. package/dist/cdp-selectors.d.ts +14 -0
  26. package/dist/cdp-selectors.d.ts.map +1 -0
  27. package/dist/cdp-selectors.js +48 -0
  28. package/dist/cdp-selectors.js.map +1 -0
  29. package/dist/dialogs.d.ts +37 -0
  30. package/dist/dialogs.d.ts.map +1 -0
  31. package/dist/dialogs.js +78 -0
  32. package/dist/dialogs.js.map +1 -0
  33. package/dist/engine.d.ts +26 -0
  34. package/dist/engine.d.ts.map +1 -0
  35. package/dist/engine.js +166 -0
  36. package/dist/engine.js.map +1 -0
  37. package/dist/evaluation.d.ts +11 -0
  38. package/dist/evaluation.d.ts.map +1 -0
  39. package/dist/evaluation.js +27 -0
  40. package/dist/evaluation.js.map +1 -0
  41. package/dist/index.d.ts +21 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +14 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/install.d.ts +40 -0
  46. package/dist/install.d.ts.map +1 -0
  47. package/dist/install.js +117 -0
  48. package/dist/install.js.map +1 -0
  49. package/dist/locators.d.ts +74 -0
  50. package/dist/locators.d.ts.map +1 -0
  51. package/dist/locators.js +260 -0
  52. package/dist/locators.js.map +1 -0
  53. package/dist/observation-capture.d.ts +12 -0
  54. package/dist/observation-capture.d.ts.map +1 -0
  55. package/dist/observation-capture.js +93 -0
  56. package/dist/observation-capture.js.map +1 -0
  57. package/dist/observation.d.ts +63 -0
  58. package/dist/observation.d.ts.map +1 -0
  59. package/dist/observation.js +262 -0
  60. package/dist/observation.js.map +1 -0
  61. package/dist/observe.d.ts +51 -0
  62. package/dist/observe.d.ts.map +1 -0
  63. package/dist/observe.js +104 -0
  64. package/dist/observe.js.map +1 -0
  65. package/dist/operation-budget.d.ts +11 -0
  66. package/dist/operation-budget.d.ts.map +1 -0
  67. package/dist/operation-budget.js +40 -0
  68. package/dist/operation-budget.js.map +1 -0
  69. package/dist/protected-app.d.ts +32 -0
  70. package/dist/protected-app.d.ts.map +1 -0
  71. package/dist/protected-app.js +39 -0
  72. package/dist/protected-app.js.map +1 -0
  73. package/dist/read-node.d.ts +170 -0
  74. package/dist/read-node.d.ts.map +1 -0
  75. package/dist/read-node.js +823 -0
  76. package/dist/read-node.js.map +1 -0
  77. package/dist/refs.d.ts +43 -0
  78. package/dist/refs.d.ts.map +1 -0
  79. package/dist/refs.js +85 -0
  80. package/dist/refs.js.map +1 -0
  81. package/dist/route-pattern.d.ts +15 -0
  82. package/dist/route-pattern.d.ts.map +1 -0
  83. package/dist/route-pattern.js +68 -0
  84. package/dist/route-pattern.js.map +1 -0
  85. package/dist/support.d.ts +119 -0
  86. package/dist/support.d.ts.map +1 -0
  87. package/dist/support.js +299 -0
  88. package/dist/support.js.map +1 -0
  89. package/dist/surface.d.ts +257 -0
  90. package/dist/surface.d.ts.map +1 -0
  91. package/dist/surface.js +587 -0
  92. package/dist/surface.js.map +1 -0
  93. package/dist/video.d.ts +59 -0
  94. package/dist/video.d.ts.map +1 -0
  95. package/dist/video.js +115 -0
  96. package/dist/video.js.map +1 -0
  97. package/dist/web.d.ts +191 -0
  98. package/dist/web.d.ts.map +1 -0
  99. package/dist/web.js +354 -0
  100. package/dist/web.js.map +1 -0
  101. package/package.json +67 -0
@@ -0,0 +1,587 @@
1
+ /**
2
+ * The Playwright surface: one browser per worker, one browser context per
3
+ * attempt, and the page every engine member delegates to. This is the closure
4
+ * state behind `web()`; the engine hooks in `engine.ts` and the `web`
5
+ * fixture in `web.ts` are thin delegates onto it. Action dispatch lives in
6
+ * `actions.ts` and tree capture in `observation.ts`. `AttemptSession` owns
7
+ * the attempt's live binding, recovery, references, and recordings.
8
+ */
9
+ import { mkdirSync } from 'node:fs';
10
+ import path from 'node:path';
11
+ import { EngineError, raceAbort, withinCleanupBudget, } from 'e2e/engine';
12
+ import { matchesText } from 'e2e/engine';
13
+ import { classifyActionError, dispatchLocatorAction, dispatchPointerAction } from './actions.js';
14
+ import { BrowserConnection, connectCdp } from './browser-connection.js';
15
+ import { AttemptSession } from './attempt-session.js';
16
+ import { DialogRouter } from './dialogs.js';
17
+ import { ensureBrowsersInstalled } from './install.js';
18
+ import { applyPostSteps, frameSelectors, projectExpression } from './locators.js';
19
+ import { ROOT_NODE_ID, toSemanticNode } from './observation.js';
20
+ import { captureObservation } from './observation-capture.js';
21
+ import { maskOptions, secureFieldMasks } from './observe.js';
22
+ import { connectionAbort } from './operation-budget.js';
23
+ import { CLOSED_SHADOW_ROOTS_INIT_SCRIPT, readHandlesSemanticsFunction, readManySemanticsFunction, SECURE_FIELD_SELECTOR, } from './read-node.js';
24
+ import { httpCredentials, installSiteHeaders, lowercaseNames } from './protected-app.js';
25
+ import { RefRegistry } from './refs.js';
26
+ import { cancelled, DEFAULT_VIEWPORT, ErrorLatch, invalidState, message, navigationStaleOr, performViewportSwipe, sanitizeFilename, staleOr, translatePwError, } from './support.js';
27
+ /** Browser launch budget when the harness init budget is not otherwise expressed. */
28
+ const BROWSER_LAUNCH_TIMEOUT_MS = 60_000;
29
+ const STATE_FORMAT = 'playwright-storage-state';
30
+ /** Default budget Playwright applies to context operations that carry no explicit timeout. */
31
+ const CONTEXT_DEFAULT_TIMEOUT_MS = 30_000;
32
+ /** True for the storage-state object shape; a string (a file path) or anything else is refused. */
33
+ function isStorageState(data) {
34
+ return (typeof data === 'object' &&
35
+ data !== null &&
36
+ Array.isArray(data.cookies) &&
37
+ Array.isArray(data.origins));
38
+ }
39
+ /** The test-id attribute when the options name none. */
40
+ const DEFAULT_TEST_ID_ATTRIBUTE = 'data-testid';
41
+ export class PlaywrightSurface {
42
+ /**
43
+ * Errors raised where nobody awaits them (dialog routing, route handlers)
44
+ * wait here and fail the next step that enters the surface.
45
+ */
46
+ latch = new ErrorLatch();
47
+ dialogs = new DialogRouter(this.latch);
48
+ browserName;
49
+ connection = new BrowserConnection();
50
+ connect;
51
+ session;
52
+ usedContexts = new Set();
53
+ viewport;
54
+ /** Injected request headers, names lowercased so they replace the browser's own of the same name. */
55
+ headers;
56
+ basicAuth;
57
+ testIdAttribute;
58
+ app = {};
59
+ headed = false;
60
+ artifactsDir = '';
61
+ artifactCounter = 0;
62
+ /**
63
+ * Attempt-scoped network routes. Registered on the
64
+ * context, not a page, so they cover every page the attempt opens - the
65
+ * first navigation included - and re-applied to each context the attempt
66
+ * replaces on `reset` or session restore.
67
+ */
68
+ routes = [];
69
+ constructor(options) {
70
+ this.browserName = options.browser ?? 'chromium';
71
+ this.connect = options.connect;
72
+ this.viewport = options.viewport ?? DEFAULT_VIEWPORT;
73
+ this.headers = options.headers === undefined ? undefined : lowercaseNames(options.headers);
74
+ this.basicAuth = options.basicAuth;
75
+ this.testIdAttribute = options.testIdAttribute ?? DEFAULT_TEST_ID_ATTRIBUTE;
76
+ }
77
+ // --- lifecycle ---
78
+ /**
79
+ * Installs the browser on first run, once per run before any worker.
80
+ * A CDP attach uses the remote's browser, so only a local launch needs the
81
+ * browser here. The download narrates through `info.log` and is bounded by
82
+ * the run's interrupt alone, never by a launch budget.
83
+ */
84
+ async prepare(info) {
85
+ if (this.connect !== undefined)
86
+ return;
87
+ await ensureBrowsersInstalled([this.browserName], { env: info.env, signal: info.signal, log: info.log });
88
+ }
89
+ /** Provisions the shared browser once per worker: a local launch, or a CDP attach. */
90
+ async init(info) {
91
+ this.app = info.app;
92
+ this.headed = info.headed;
93
+ // The browser was installed in `prepare`; a launch or attach is the one
94
+ // boot step left that can outlive a launch budget, and it honours the
95
+ // init signal.
96
+ if (this.connect?.reconnectEndpoint === undefined)
97
+ await this.acquireBrowser(info.signal);
98
+ }
99
+ /**
100
+ * Provisions the shared browser through the shared connection — a launch, or a CDP attach
101
+ * via the connector — bounded by `signal`. Checked before the endpoint is
102
+ * resolved: a cancelled caller must never provision a remote session it will
103
+ * not use.
104
+ */
105
+ async acquireBrowser(signal) {
106
+ const verb = this.connect === undefined ? 'launch' : 'connect';
107
+ if (signal.aborted)
108
+ throw cancelled(`browser ${verb} cancelled`);
109
+ try {
110
+ return await raceAbort(this.connection.acquire(this.browserName, this.headed, BROWSER_LAUNCH_TIMEOUT_MS, this.connector(signal)), signal, `browser ${verb}`);
111
+ }
112
+ catch (cause) {
113
+ if (cause instanceof EngineError)
114
+ throw cause;
115
+ throw new EngineError('ENGINE_FAILURE', `browser ${verb} failed: ${message(cause)}`, {
116
+ retryable: false,
117
+ cause,
118
+ });
119
+ }
120
+ }
121
+ /**
122
+ * Builds the connection's connector when attaching over CDP; undefined for a local
123
+ * launch. The connector honours `signal` at every await: the resolver
124
+ * receives it, the endpoint is not used once aborted, and a browser that
125
+ * connects after cancellation is detached at once rather than cached — the
126
+ * host's session is never held by an init or attempt that already gave up.
127
+ */
128
+ connector(signal) {
129
+ const connect = this.connect;
130
+ if (connect === undefined)
131
+ return undefined;
132
+ return async () => {
133
+ const endpoint = await connect.cdpEndpoint(signal);
134
+ if (signal.aborted)
135
+ throw cancelled('browser connect cancelled');
136
+ if (typeof endpoint !== 'string' || endpoint.trim() === '') {
137
+ throw new EngineError('ENGINE_FAILURE', 'connect.cdpEndpoint resolved to an empty CDP endpoint', {
138
+ retryable: false,
139
+ });
140
+ }
141
+ const browser = await connectCdp(endpoint, BROWSER_LAUNCH_TIMEOUT_MS);
142
+ if (signal.aborted) {
143
+ await browser.close().catch(() => undefined);
144
+ throw cancelled('browser connect cancelled');
145
+ }
146
+ return browser;
147
+ };
148
+ }
149
+ /** Opens one attempt owner before setup starts, so cleanup can cancel pending attachment. */
150
+ async startAttempt(context) {
151
+ if (this.session !== undefined)
152
+ throw invalidState('an attempt is already running');
153
+ this.artifactsDir = context.artifactsDir;
154
+ this.artifactCounter = 0;
155
+ const routes = [];
156
+ this.latch = new ErrorLatch();
157
+ const dialogs = new DialogRouter(this.latch);
158
+ this.routes = routes;
159
+ this.dialogs = dialogs;
160
+ const credentials = httpCredentials(this.basicAuth);
161
+ const connect = this.connect;
162
+ const session = new AttemptSession({
163
+ artifactsDir: context.artifactsDir,
164
+ viewport: this.viewport,
165
+ acquire: (signal) => this.acquireBrowser(signal),
166
+ contextOptions: {
167
+ viewport: this.viewport,
168
+ acceptDownloads: true,
169
+ ...(credentials === undefined ? {} : { httpCredentials: credentials }),
170
+ ...(this.headers === undefined ? {} : { serviceWorkers: 'block' }),
171
+ },
172
+ configure: async (target) => {
173
+ await target.addInitScript(CLOSED_SHADOW_ROOTS_INIT_SCRIPT);
174
+ target.setDefaultTimeout(CONTEXT_DEFAULT_TIMEOUT_MS);
175
+ target.on('dialog', (dialog) => { void dialogs.dispatch(dialog); });
176
+ await installSiteHeaders(target, this.app.site, this.headers);
177
+ for (const stored of routes)
178
+ await target.route(stored.predicate, stored.handler);
179
+ },
180
+ ...(connect?.reconnectEndpoint === undefined ? {} : { persistent: {
181
+ provision: connect.cdpEndpoint, reconnect: connect.reconnectEndpoint, usedContexts: this.usedContexts,
182
+ } }),
183
+ });
184
+ this.session = session;
185
+ await session.start(context.signal);
186
+ }
187
+ /** Retires the owner before awaiting cleanup; late work cannot reach the next attempt. */
188
+ async endAttempt(context) {
189
+ const session = this.session;
190
+ this.session = undefined;
191
+ if (session !== undefined)
192
+ await session.close(context);
193
+ }
194
+ /** Releases attempt resources and the worker's shared browser process. */
195
+ async dispose(context) {
196
+ await this.endAttempt(context);
197
+ await withinCleanupBudget(this.connection.dispose(), context);
198
+ }
199
+ /** Returns the active attempt, including its connection generation and references. */
200
+ requireSession() {
201
+ if (this.session === undefined)
202
+ throw invalidState('no attempt is running');
203
+ return this.session;
204
+ }
205
+ // --- network routes shared with the web fixture ---
206
+ /** Registers one attempt-scoped route on the current context. */
207
+ async route(predicate, handler) {
208
+ const context = this.requireContext();
209
+ this.routes.push({ predicate, handler });
210
+ await context.route(predicate, handler);
211
+ }
212
+ /** Removes one registered route from the attempt and the current context. */
213
+ async unroute(predicate, handler) {
214
+ const context = this.requireContext();
215
+ const index = this.routes.findIndex((stored) => stored.predicate === predicate && stored.handler === handler);
216
+ if (index !== -1)
217
+ this.routes.splice(index, 1);
218
+ await context.unroute(predicate, handler);
219
+ }
220
+ // --- page access shared with the web fixture ---
221
+ requirePage() {
222
+ this.latch.throwPending();
223
+ const page = this.requireSession().current().page;
224
+ if (page === null || page.isClosed())
225
+ throw invalidState('no app page is open; call app.open() or web.goto() first');
226
+ return page;
227
+ }
228
+ requireContext() {
229
+ this.latch.throwPending();
230
+ return this.requireSession().current().context;
231
+ }
232
+ /** Creates the active page through the attempt's sole binding owner. */
233
+ ensurePage() {
234
+ return this.requireSession().ensurePage();
235
+ }
236
+ /**
237
+ * The single entry of every operation: rethrows an error latched on an
238
+ * unawaited path, refuses a cancelled operation, races `fn` against the
239
+ * operation signal so an abort mid-call surfaces as `CANCELLED` instead of
240
+ * waiting out Playwright, and translates raw errors at the contract
241
+ * boundary. `translate` overrides the default translation for operations
242
+ * with a documented retryable failure mode.
243
+ */
244
+ async guard(operation, label, fn, translate = translatePwError) {
245
+ this.latch.throwPending();
246
+ try {
247
+ return this.session === undefined
248
+ ? await raceAbort(() => fn(operation), operation.signal, label)
249
+ : await this.session.run(operation, label, fn);
250
+ }
251
+ catch (cause) {
252
+ throw translate(cause, label);
253
+ }
254
+ }
255
+ // --- steering: the session hooks ---
256
+ /** Opens one URL the harness resolved; the attempt's page is created on first use. */
257
+ open(url, operation) {
258
+ return this.guard(operation, 'navigation', async (currentOperation) => {
259
+ const page = await this.ensurePage();
260
+ await page.goto(url, { waitUntil: 'load', timeout: currentOperation.timeoutMs });
261
+ });
262
+ }
263
+ back(operation) {
264
+ return this.guard(operation, 'navigation', async (currentOperation) => {
265
+ await this.requirePage().goBack({ waitUntil: 'load', timeout: currentOperation.timeoutMs });
266
+ });
267
+ }
268
+ /** Restarts the document while retaining this attempt's context and storage. */
269
+ restart(operation) {
270
+ return this.guard(operation, 'restart', () => this.requireSession().restart());
271
+ }
272
+ /** Replaces the context with a clean one and opens its blank page. */
273
+ reset(operation) {
274
+ return this.guard(operation, 'state reset', async (currentOperation) => {
275
+ const session = this.requireSession();
276
+ await session.replace(undefined, currentOperation);
277
+ await session.ensurePage();
278
+ });
279
+ }
280
+ // --- location tier ---
281
+ /**
282
+ * Resolves one expression to every node it currently matches, fully read,
283
+ * in one in-page round trip. A `displayValue` query is filtered here by the
284
+ * value each element reported, so no per-node calls are needed; any
285
+ * `first`/`last`/`nth` on such a query then selects among those matches, and
286
+ * a filter placed after a position is checked on the selected element. A
287
+ * `visible` query drops the candidates whose hidden state the same read
288
+ * reported before either of those, so a position is among shown matches.
289
+ */
290
+ locate(expression, operation) {
291
+ return this.guard(operation, 'locate', async (currentOperation) => {
292
+ const session = this.requireSession();
293
+ const token = session.token();
294
+ const refs = session.refs;
295
+ const page = this.requirePage();
296
+ await this.validateFrames(expression);
297
+ const projected = projectExpression(page, expression, this.testIdAttribute);
298
+ const { displayValue, name, steps } = projected;
299
+ const readOptions = {
300
+ testIdAttribute: this.testIdAttribute,
301
+ secureFieldSelector: SECURE_FIELD_SELECTOR,
302
+ mode: { kind: 'node' },
303
+ };
304
+ // A predicate-filtered match is one element among many candidates, and the candidate
305
+ // list is broad (every labelable control, every input with a value). Re-resolving it
306
+ // by position at action time would act on a neighbor whenever the page inserted or
307
+ // removed an element in between, so such matches are pinned to element handles: the
308
+ // handles are taken first and the semantics are read from those very handles, so what
309
+ // was read and what is acted on are one set of elements by construction.
310
+ const handles = displayValue !== null || name !== null
311
+ ? (await projected.locator.elementHandles())
312
+ : null;
313
+ const first = handles?.[0];
314
+ const raws = handles === null
315
+ ? await projected.locator.evaluateAll(readManySemanticsFunction, readOptions)
316
+ : first === undefined
317
+ ? []
318
+ : await first.evaluate(readHandlesSemanticsFunction, { elements: handles, options: readOptions });
319
+ const candidates = raws
320
+ .map((raw, index) => ({ raw, index }))
321
+ .filter(({ raw }) => !(projected.visible && raw.states.hidden));
322
+ // An exact label query matches any of the control's labels as the engine's reader names
323
+ // them, so text a label marks aria-hidden (a required-field marker) never hides a field,
324
+ // and an aria-label override or a second label does not either.
325
+ const predicate = displayValue !== null
326
+ ? (raw) => matchesText(raw.value ?? '', displayValue)
327
+ : name !== null
328
+ ? (raw) => raw.labels !== null && raw.labels.some((label) => matchesText(label, name))
329
+ : null;
330
+ const matches = predicate === null
331
+ ? candidates
332
+ : await applyPostSteps(candidates.filter(({ raw }) => predicate(raw)), steps,
333
+ // A filter after a position runs on that one element alone.
334
+ async ({ index }, options) => (await projected.locator.nth(index).filter(options).count()) > 0);
335
+ if (currentOperation.signal.aborted) {
336
+ for (const handle of handles ?? [])
337
+ void handle.dispose().catch(() => undefined);
338
+ throw cancelled('locate cancelled');
339
+ }
340
+ try {
341
+ session.check(token);
342
+ }
343
+ catch (cause) {
344
+ for (const handle of handles ?? [])
345
+ void handle.dispose().catch(() => undefined);
346
+ throw cause;
347
+ }
348
+ if (handles !== null) {
349
+ // Only the matches keep their handles; the rest would otherwise live until the page goes.
350
+ const kept = new Set(matches.map(({ index }) => index));
351
+ for (const [index, handle] of handles.entries()) {
352
+ if (!kept.has(index))
353
+ void handle.dispose().catch(() => undefined);
354
+ }
355
+ }
356
+ return matches.map(({ raw, index }) => {
357
+ const pinned = handles?.[index];
358
+ // A single match keeps the strict locator, so a ref that turns
359
+ // ambiguous between locate and perform fails loud instead of acting
360
+ // on whichever element is first.
361
+ const locator = raws.length === 1 ? projected.locator : projected.locator.nth(index);
362
+ const id = refs.storeLocated(pinned === undefined ? { kind: 'locator', locator } : { kind: 'element', element: pinned });
363
+ return toSemanticNode({ id, revision: '' }, raw);
364
+ });
365
+ }, staleOr);
366
+ }
367
+ /**
368
+ * One action on a located or observed node. A `swipe` on the observation
369
+ * root is the viewport swipe: a wheel gesture sized by the viewport, with no
370
+ * element resolved behind it, so it needs only the page. Every other action
371
+ * on the root acts on the document element the root stands for.
372
+ */
373
+ perform(ref, action, operation) {
374
+ return this.guard(operation, action.kind, (currentOperation) => {
375
+ const page = this.requirePage();
376
+ if (action.kind === 'swipe' && ref.id === ROOT_NODE_ID) {
377
+ this.requireSession().requireObservation();
378
+ return performViewportSwipe(page, action.direction, action.momentum ?? 'none');
379
+ }
380
+ return dispatchLocatorAction(this.requireSession().refs.lookup(ref), action, currentOperation.timeoutMs, (other) => this.requireSession().refs.lookup(other));
381
+ }, (cause) => classifyActionError(cause, action));
382
+ }
383
+ /** One pointer action at a viewport point in CSS pixels, with nothing resolved behind it; see `dispatchPointerAction`. */
384
+ performAt(point, action, operation) {
385
+ return this.guard(operation, `${action.kind} at point`, () => {
386
+ this.requireSession().requireObservation();
387
+ return dispatchPointerAction(this.requirePage(), point, action);
388
+ });
389
+ }
390
+ /**
391
+ * Types into whatever holds focus. Keystrokes into a document body are
392
+ * accepted by the browser and lost, so the focused element is checked for
393
+ * editability first and the call refuses rather than "typing" into nothing.
394
+ * `replace` clears with select-all and delete: the only locator-free clear,
395
+ * scoped by the browser to the whole editing host, so it is opt-in.
396
+ */
397
+ typeText(text, options, operation) {
398
+ return this.guard(operation, 'keyboard.type', async (currentOperation) => {
399
+ const session = this.requireSession();
400
+ session.requireObservation();
401
+ const token = session.token();
402
+ const page = this.requirePage();
403
+ /** A delayed focus read or key must not continue input into a retired connection. */
404
+ const checkpoint = () => {
405
+ if (currentOperation.signal.aborted)
406
+ throw connectionAbort(currentOperation.signal, 'keyboard.type');
407
+ session.check(token);
408
+ };
409
+ await this.requireEditableFocus(page);
410
+ checkpoint();
411
+ if (options.replace) {
412
+ await page.keyboard.press('ControlOrMeta+A');
413
+ checkpoint();
414
+ await page.keyboard.press('Delete');
415
+ checkpoint();
416
+ }
417
+ await page.keyboard.type(text);
418
+ });
419
+ }
420
+ /** Sends one key to whatever holds focus, in the contract's key grammar Playwright shares. */
421
+ pressKey(key, operation) {
422
+ return this.guard(operation, 'keyboard.press', () => {
423
+ this.requireSession().requireObservation();
424
+ return this.requirePage().keyboard.press(key);
425
+ });
426
+ }
427
+ /**
428
+ * Refuses focused typing when nothing that takes keystrokes has focus, in
429
+ * any frame of the page. Text fields and contenteditable hosts take them;
430
+ * so does any other focusable element the app made focusable (a canvas, a
431
+ * widget with a tabindex and its own key handling), because focusing it is
432
+ * how the app opted into keys. Focus on the body, a button, a link, a
433
+ * select, or a non-text input means the keystrokes would be discarded.
434
+ */
435
+ async requireEditableFocus(page) {
436
+ const editable = await Promise.all(page.frames().map((frame) => frame
437
+ .evaluate(() => {
438
+ const active = document.activeElement;
439
+ if (active === null || active === document.body || active === document.documentElement)
440
+ return false;
441
+ if (active instanceof HTMLInputElement) {
442
+ return !active.disabled && !active.readOnly && !['button', 'submit', 'reset', 'checkbox', 'radio', 'file', 'image', 'range', 'color'].includes(active.type);
443
+ }
444
+ if (active instanceof HTMLTextAreaElement)
445
+ return !active.disabled && !active.readOnly;
446
+ if (active instanceof HTMLSelectElement || active instanceof HTMLButtonElement || active instanceof HTMLAnchorElement) {
447
+ return false;
448
+ }
449
+ return true;
450
+ })
451
+ .catch(() => false)));
452
+ if (!editable.some(Boolean)) {
453
+ throw new EngineError('NOT_ACTIONABLE', 'nothing that takes keystrokes has focus: the typed text would reach no field. Tap the field first, or type into a listed input by id.', { retryable: false });
454
+ }
455
+ }
456
+ async validateFrames(expression) {
457
+ const page = this.requirePage();
458
+ for (const selector of frameSelectors(expression)) {
459
+ let count;
460
+ try {
461
+ count = await page.locator(selector).count();
462
+ }
463
+ catch (cause) {
464
+ throw translatePwError(cause, 'frame resolution');
465
+ }
466
+ if (count === 0) {
467
+ throw new EngineError('FRAME_NOT_FOUND', `no frame matches ${selector}`, {
468
+ retryable: true,
469
+ });
470
+ }
471
+ if (count > 1) {
472
+ throw new EngineError('FRAME_AMBIGUOUS', `${count} frames match ${selector}`, {
473
+ retryable: false,
474
+ });
475
+ }
476
+ }
477
+ }
478
+ // --- artifacts ---
479
+ /**
480
+ * Reserves one artifact path under the attempt directory: a per-attempt
481
+ * counter keeps names unique, the label keeps them readable.
482
+ */
483
+ artifactPath(folder, label, extension) {
484
+ this.artifactCounter += 1;
485
+ const name = `${String(this.artifactCounter).padStart(3, '0')}${label === undefined ? '' : `-${sanitizeFilename(label)}`}${extension}`;
486
+ const relative = path.posix.join(folder, name);
487
+ const absolute = path.join(this.artifactsDir, relative);
488
+ mkdirSync(path.dirname(absolute), { recursive: true });
489
+ return { relative, absolute };
490
+ }
491
+ /** Redacted at the source: secure fields in every frame are masked, as in observation pixels. */
492
+ screenshot(label, operation) {
493
+ return this.guard(operation, 'screenshot', async (currentOperation) => {
494
+ const page = this.requirePage();
495
+ const { relative, absolute } = this.artifactPath('screenshots', label, '.png');
496
+ await page.screenshot({
497
+ path: absolute,
498
+ timeout: currentOperation.timeoutMs,
499
+ ...maskOptions(secureFieldMasks(page)),
500
+ });
501
+ return relative;
502
+ });
503
+ }
504
+ /** Starts tracing the current attempt. */
505
+ startTrace(operation) {
506
+ return this.guard(operation, 'trace', () => this.requireSession().startTrace());
507
+ }
508
+ /** Returns every trace segment finalized by the current attempt. */
509
+ stopTrace(operation) {
510
+ return this.requireSession().collectTrace(operation);
511
+ }
512
+ /** Starts the attempt's video before a trace chooses its screencast dimensions. */
513
+ startVideo(operation) {
514
+ return this.guard(operation, 'video', () => this.requireSession().startVideo());
515
+ }
516
+ /** Finishes the attempt's recording and returns its finalized segments. */
517
+ stopVideo(operation) {
518
+ return this.requireSession().collectVideo(operation);
519
+ }
520
+ // --- state ---
521
+ captureState(operation) {
522
+ return this.guard(operation, 'state capture', async () => {
523
+ const storageState = await this.requireContext().storageState({ indexedDB: true });
524
+ return { format: STATE_FORMAT, version: 1, data: storageState };
525
+ });
526
+ }
527
+ /** Replaces the attempt's context with one seeded from the snapshot. */
528
+ restoreState(state, operation) {
529
+ return this.guard(operation, 'state restore', async (currentOperation) => {
530
+ if (state.format !== STATE_FORMAT || state.version !== 1) {
531
+ throw new EngineError('INVALID_STATE', `unsupported state format ${state.format}@${String(state.version)}`, { retryable: false });
532
+ }
533
+ // A string here would be read by Playwright as a file path; a session
534
+ // envelope must never be able to point the browser at the filesystem.
535
+ if (!isStorageState(state.data)) {
536
+ throw new EngineError('INVALID_STATE', 'state data must be a storage-state object', {
537
+ retryable: false,
538
+ });
539
+ }
540
+ await this.requireSession().replace(state.data, currentOperation);
541
+ });
542
+ }
543
+ // --- observation ---
544
+ /**
545
+ * Captures one atomic semantic observation. Secure fields are masked in the
546
+ * page before the tree leaves the engine, and every node keeps a live
547
+ * element handle valid until the next observation replaces the generation.
548
+ *
549
+ * With `options.pixels`, masked viewport pixels are captured alongside the
550
+ * tree rather than after it, so the image and the node geometry describe the
551
+ * page as closely in time as two engine calls can.
552
+ */
553
+ observe(operation, options) {
554
+ // A capture that lost its document to a navigation reads as a stale node:
555
+ // nothing was dispatched, so the runner re-observes the new document
556
+ // within the same deadline instead of failing the call.
557
+ return this.guard(operation, 'observe', (currentOperation) => this.captureObservation(currentOperation, options), navigationStaleOr);
558
+ }
559
+ /** Captures privately, then publishes only into the page and ref generation that requested it. */
560
+ async captureObservation(operation, options) {
561
+ const session = this.requireSession();
562
+ const token = session.token();
563
+ const refs = session.refs;
564
+ const page = this.requirePage();
565
+ const capture = refs.beginCapture();
566
+ const captured = await captureObservation(page, refs, {
567
+ testIdAttribute: this.testIdAttribute, site: this.app.site,
568
+ }, operation, options);
569
+ const { snapshot, generation } = captured;
570
+ try {
571
+ if (operation.signal.aborted)
572
+ throw cancelled('observe cancelled');
573
+ session.check(token);
574
+ if (this.requirePage() !== page) {
575
+ throw new EngineError('NODE_STALE', 'observation page was replaced', { retryable: true });
576
+ }
577
+ refs.publish(capture, captured);
578
+ session.observedGeneration(token);
579
+ return snapshot;
580
+ }
581
+ catch (cause) {
582
+ RefRegistry.dispose(generation);
583
+ throw cause;
584
+ }
585
+ }
586
+ }
587
+ //# sourceMappingURL=surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../src/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,WAAW,EACX,SAAS,EACT,mBAAmB,GAmBpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAoB,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OA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