@atomic-testing/playwright 0.88.0 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,3 +12,10 @@ pnpm add @atomic-testing/playwright
12
12
  ```
13
13
 
14
14
  See the [docs](https://atomic-testing.dev/) for configuration and usage details.
15
+
16
+ ## Public API & stability
17
+
18
+ The stable surface of this package is its `.` barrel exports, frozen under
19
+ SemVer and machine-checked by the committed [API Extractor](https://api-extractor.com/)
20
+ report at [`etc/playwright.api.md`](etc/playwright.api.md). Exports tagged `@internal` are
21
+ not part of that guarantee. See the [1.0 API freeze & evolution policy](../../agent-docs/adr/006-1.0-api-freeze-and-evolution.md).
package/dist/index.cjs CHANGED
@@ -1,11 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let _atomic_testing_core = require("@atomic-testing/core");
3
- let _playwright_test = require("@playwright/test");
4
3
  //#region src/PlaywrightInteractor.ts
5
4
  /**
6
5
  * Implementation of the {@link Interactor} interface using Playwright.
7
6
  */
8
- var PlaywrightInteractor = class PlaywrightInteractor {
7
+ var PlaywrightInteractor = class {
9
8
  /**
10
9
  * @param page - Playwright page instance used to drive the browser.
11
10
  */
@@ -13,44 +12,70 @@ var PlaywrightInteractor = class PlaywrightInteractor {
13
12
  this.page = page;
14
13
  }
15
14
  /**
15
+ * Run a Playwright mutation and normalize a "locator matched nothing" failure
16
+ * into {@link ElementNotFoundError}, so a missing element throws the same error
17
+ * class here as it does in `DOMInteractor`, regardless of environment (the
18
+ * unified contract ratified in ADR-006).
19
+ *
20
+ * Playwright auto-waits for actionability and then throws its own
21
+ * `TimeoutError`. We translate that to `ElementNotFoundError` ONLY when the
22
+ * element genuinely does not exist (count 0) and otherwise rethrow the original
23
+ * error — preserving Playwright's auto-wait for an element that exists but is
24
+ * briefly not actionable (covered, disabled, animating). The trade-off is that
25
+ * a truly-missing element waits out the page's action timeout before throwing;
26
+ * bound it with `page.setDefaultTimeout` when fast failure matters.
27
+ *
28
+ * @param locator - Locator the mutation targets
29
+ * @param action - Method name used in the error message (e.g. `'click'`)
30
+ * @param run - The Playwright action to execute
31
+ * @throws {ElementNotFoundError} If the action fails and the element is absent
32
+ */
33
+ async runMutation(locator, action, run) {
34
+ try {
35
+ return await run();
36
+ } catch (e) {
37
+ if (await this.exists(locator) === false) throw new _atomic_testing_core.ElementNotFoundError(locator, action);
38
+ throw e;
39
+ }
40
+ }
41
+ /**
16
42
  * Select the given option values on a `<select>` element.
17
43
  *
18
44
  * @param locator - Locator to the `<select>` element.
19
45
  * @param values - Values to select.
46
+ * @throws {ElementNotFoundError} If the element is not found
20
47
  */
21
48
  async selectOptionValue(locator, values) {
22
49
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
23
- await this.page.locator(cssLocator).selectOption(values);
50
+ await this.runMutation(locator, "selectOptionValue", () => this.page.locator(cssLocator).selectOption(values));
24
51
  }
25
52
  /**
26
53
  * Set the selected files on a `<input type="file">` element.
27
54
  *
28
55
  * Playwright's native `setInputFiles` reads the given paths from disk and
29
56
  * populates the input's `FileList`, firing the change event — the only way to
30
- * fill a file input, whose value cannot be set programmatically. Following
31
- * this layer's convention, no `ElementNotFoundError` is fabricated: a missing
32
- * element surfaces through Playwright's own auto-wait timeout.
57
+ * fill a file input, whose value cannot be set programmatically.
33
58
  *
34
59
  * @param locator - Locator of the `<input type="file">` element
35
60
  * @param files - One or more filesystem paths to upload
61
+ * @throws {ElementNotFoundError} If the element is not found
36
62
  */
37
63
  async setInputFiles(locator, files) {
38
64
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
39
- await this.page.locator(cssLocator).setInputFiles(files);
65
+ await this.runMutation(locator, "setInputFiles", () => this.page.locator(cssLocator).setInputFiles(files));
40
66
  }
41
67
  /**
42
68
  * Scroll the located element into view, no-op if already visible.
43
69
  *
44
70
  * Delegates to Playwright's `scrollIntoViewIfNeeded`, which performs a real
45
- * layout-aware scroll in the browser. Per this layer's convention, no
46
- * `ElementNotFoundError` is fabricated: a missing element surfaces through
47
- * Playwright's own auto-wait timeout.
71
+ * layout-aware scroll in the browser.
48
72
  *
49
73
  * @param locator - Locator of the element to scroll into view
74
+ * @throws {ElementNotFoundError} If the element is not found
50
75
  */
51
76
  async scrollIntoView(locator) {
52
77
  const css = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
53
- await this.page.locator(css).scrollIntoViewIfNeeded();
78
+ await this.runMutation(locator, "scrollIntoView", () => this.page.locator(css).scrollIntoViewIfNeeded());
54
79
  }
55
80
  /**
56
81
  * Scroll the located element by the given pixel delta.
@@ -61,35 +86,39 @@ var PlaywrightInteractor = class PlaywrightInteractor {
61
86
  * whereas evaluating `scrollBy` on the resolved element scrolls exactly that
62
87
  * element. This is a deliberate deviation from ADR 0001's per-engine table
63
88
  * (which lists `page.mouse.wheel`), taking the alternative the step-5 prompt
64
- * permits ("or evaluate el.scrollBy") for cross-browser determinism. As with
65
- * {@link scrollIntoView}, no `ElementNotFoundError` is fabricated; a missing
66
- * element surfaces through Playwright's own auto-wait timeout.
89
+ * permits ("or evaluate el.scrollBy") for cross-browser determinism.
67
90
  *
68
91
  * @param locator - Locator of the scrollable element
69
92
  * @param delta - Pixel offset to scroll by
93
+ * @throws {ElementNotFoundError} If the element is not found
70
94
  */
71
95
  async scrollBy(locator, delta) {
72
96
  const css = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
73
- await this.page.locator(css).evaluate((el, d) => el.scrollBy(d.x, d.y), {
97
+ await this.runMutation(locator, "scrollBy", () => this.page.locator(css).evaluate((el, d) => el.scrollBy(d.x, d.y), {
74
98
  x: delta.x,
75
99
  y: delta.y
76
- });
100
+ }));
77
101
  }
78
102
  /**
79
103
  * Drag the source element and drop it onto the target element.
80
104
  *
81
105
  * Delegates to Playwright's native `Locator.dragTo`, which performs a real,
82
- * layout-aware drag gesture in the browser. Per this layer's convention, no
83
- * `ElementNotFoundError` is fabricated: a missing element surfaces through
84
- * Playwright's own auto-wait timeout.
106
+ * layout-aware drag gesture in the browser.
85
107
  *
86
108
  * @param source - Locator of the element to drag
87
109
  * @param target - Locator of the drop target
110
+ * @throws {ElementNotFoundError} If either the source or target is not found
88
111
  */
89
112
  async dragTo(source, target) {
90
113
  const srcCss = await _atomic_testing_core.locatorUtil.toCssSelector(source, this);
91
114
  const tgtCss = await _atomic_testing_core.locatorUtil.toCssSelector(target, this);
92
- await this.page.locator(srcCss).dragTo(this.page.locator(tgtCss));
115
+ try {
116
+ await this.page.locator(srcCss).dragTo(this.page.locator(tgtCss));
117
+ } catch (e) {
118
+ if (await this.exists(source) === false) throw new _atomic_testing_core.ElementNotFoundError(source, "dragTo");
119
+ if (await this.exists(target) === false) throw new _atomic_testing_core.ElementNotFoundError(target, "dragTo");
120
+ throw e;
121
+ }
93
122
  }
94
123
  /**
95
124
  * Drag the located element by the given pixel delta from its center.
@@ -99,9 +128,9 @@ var PlaywrightInteractor = class PlaywrightInteractor {
99
128
  * {@link mouseMove}/{@link mouseDown} — `mouseMove` resets the pointer with
100
129
  * `page.mouse.move(0, 0)` after hovering, which would corrupt the drag path
101
130
  * (see ADR 0001, option 5). The center comes from {@link getBoundingRect},
102
- * which throws `ElementNotFoundError` when the element has no box
103
- * (detached/invisible) rather than auto-waiting so this shares that
104
- * "element not found" contract instead of re-deriving the box + guard here.
131
+ * which throws `ElementNotFoundError` when the element has no box, so this
132
+ * shares that "element not found" contract instead of re-deriving the box +
133
+ * guard here.
105
134
  *
106
135
  * @param locator - Locator of the element to drag
107
136
  * @param delta - Pixel offset to drag by
@@ -164,71 +193,91 @@ var PlaywrightInteractor = class PlaywrightInteractor {
164
193
  }
165
194
  async enterText(locator, text, option) {
166
195
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
167
- if (!option?.append) await this.page.locator(cssLocator).clear();
168
- const type = await this.getAttribute(locator, "type") ?? "";
169
- if (_atomic_testing_core.dateUtil.isHtmlDateInputType(type)) {
170
- const result = _atomic_testing_core.dateUtil.validateHtmlDateInput(type, text);
171
- if (!result.valid) throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
172
- }
173
- await this.page.locator(cssLocator).fill(text);
196
+ await this.runMutation(locator, "enterText", async () => {
197
+ if (!option?.append) await this.page.locator(cssLocator).clear();
198
+ const type = await this.getAttribute(locator, "type") ?? "";
199
+ if (_atomic_testing_core.dateUtil.isHtmlDateInputType(type)) {
200
+ const result = _atomic_testing_core.dateUtil.validateHtmlDateInput(type, text);
201
+ if (!result.valid) throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
202
+ }
203
+ await this.page.locator(cssLocator).fill(text);
204
+ });
205
+ }
206
+ async setRangeValue(locator, value) {
207
+ const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
208
+ await this.runMutation(locator, "setRangeValue", () => this.page.locator(cssLocator).evaluate((el, nextValue) => {
209
+ const input = el;
210
+ (Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(input, nextValue);
211
+ input.dispatchEvent(new Event("input", { bubbles: true }));
212
+ input.dispatchEvent(new Event("change", { bubbles: true }));
213
+ }, String(value)));
174
214
  }
175
215
  async click(locator, option) {
176
216
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
177
- await this.page.locator(cssLocator).click({ position: option?.position });
217
+ await this.runMutation(locator, "click", () => this.page.locator(cssLocator).click({ position: option?.position }));
178
218
  }
179
219
  /**
180
220
  * Dispatch a right-click on the located element to open its context menu.
181
221
  *
182
222
  * Delegates to Playwright's native right-button click, which fires a real
183
- * `contextmenu` event in the browser. Per this layer's convention, no
184
- * `ElementNotFoundError` is fabricated: a missing element surfaces through
185
- * Playwright's own auto-wait timeout.
223
+ * `contextmenu` event in the browser.
186
224
  *
187
225
  * @param locator - Locator of the element to right-click
226
+ * @throws {ElementNotFoundError} If the element is not found
188
227
  */
189
228
  async contextMenu(locator) {
190
229
  const css = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
191
- await this.page.locator(css).click({ button: "right" });
230
+ await this.runMutation(locator, "contextMenu", () => this.page.locator(css).click({ button: "right" }));
192
231
  }
193
232
  async hover(locator, option) {
194
233
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
195
- await this.page.locator(cssLocator).hover({ position: option?.position });
234
+ await this.runMutation(locator, "hover", () => this.page.locator(cssLocator).hover({ position: option?.position }));
196
235
  }
197
236
  async mouseMove(locator, option) {
198
- await this.hover(locator, { position: option?.position });
199
- await this.page.mouse.move(0, 0);
237
+ await this.runMutation(locator, "mouseMove", async () => {
238
+ await this.hover(locator, { position: option?.position });
239
+ await this.page.mouse.move(0, 0);
240
+ });
200
241
  }
201
242
  async mouseDown(locator, option) {
202
- await this.hover(locator, { position: option?.position });
203
- await this.page.mouse.down();
243
+ await this.runMutation(locator, "mouseDown", async () => {
244
+ await this.hover(locator, { position: option?.position });
245
+ await this.page.mouse.down();
246
+ });
204
247
  }
205
248
  async mouseUp(locator, option) {
206
- await this.hover(locator, { position: option?.position });
207
- await this.page.mouse.up();
249
+ await this.runMutation(locator, "mouseUp", async () => {
250
+ await this.hover(locator, { position: option?.position });
251
+ await this.page.mouse.up();
252
+ });
208
253
  }
209
254
  async mouseOver(locator, option) {
210
- return this.hover(locator, option);
255
+ await this.runMutation(locator, "mouseOver", () => this.hover(locator, option));
211
256
  }
212
257
  async mouseOut(locator, _option) {
213
258
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
214
- await this.page.locator(cssLocator).hover();
215
- await this.page.locator(cssLocator).dispatchEvent("mouseout");
259
+ await this.runMutation(locator, "mouseOut", async () => {
260
+ await this.page.locator(cssLocator).hover();
261
+ await this.page.locator(cssLocator).dispatchEvent("mouseout");
262
+ });
216
263
  }
217
264
  async mouseEnter(locator, _option) {
218
- return this.hover(locator);
265
+ await this.runMutation(locator, "mouseEnter", () => this.hover(locator));
219
266
  }
220
267
  async mouseLeave(locator, _option) {
221
268
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
222
- await this.page.locator(cssLocator).hover();
223
- await this.page.locator(cssLocator).dispatchEvent("mouseout");
269
+ await this.runMutation(locator, "mouseLeave", async () => {
270
+ await this.page.locator(cssLocator).hover();
271
+ await this.page.locator(cssLocator).dispatchEvent("mouseout");
272
+ });
224
273
  }
225
274
  async focus(locator, _option) {
226
275
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
227
- return this.page.focus(cssLocator);
276
+ await this.runMutation(locator, "focus", () => this.page.focus(cssLocator));
228
277
  }
229
278
  async blur(locator, _option) {
230
279
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
231
- await this.page.locator(cssLocator).blur();
280
+ await this.runMutation(locator, "blur", () => this.page.locator(cssLocator).blur());
232
281
  }
233
282
  async pressKey(locator, key, option) {
234
283
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
@@ -238,14 +287,11 @@ var PlaywrightInteractor = class PlaywrightInteractor {
238
287
  if (option?.shift) modifiers.push("Shift");
239
288
  if (option?.meta) modifiers.push("Meta");
240
289
  const chord = modifiers.length > 0 ? `${modifiers.join("+")}+${key}` : key;
241
- await this.page.locator(cssLocator).press(chord);
290
+ await this.runMutation(locator, "pressKey", () => this.page.locator(cssLocator).press(chord));
242
291
  }
243
292
  async activate(locator) {
244
293
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
245
- await this.page.locator(cssLocator).dispatchEvent("click");
246
- }
247
- wait(ms) {
248
- return _atomic_testing_core.timingUtil.wait(ms);
294
+ await this.runMutation(locator, "activate", () => this.page.locator(cssLocator).dispatchEvent("click"));
249
295
  }
250
296
  async waitUntilComponentState(locator, option = _atomic_testing_core.defaultWaitForOption) {
251
297
  return _atomic_testing_core.interactorUtil.interactorWaitUtil(locator, this, option);
@@ -275,9 +321,8 @@ var PlaywrightInteractor = class PlaywrightInteractor {
275
321
  * Get the located element's bounding rectangle.
276
322
  *
277
323
  * `boundingBox()` returns `null` for a detached/invisible element rather than
278
- * auto-waiting, so this is one of the few Playwright methods that throws
279
- * `ElementNotFoundError` — matching the house "element not found" contract
280
- * (ADR 0001).
324
+ * auto-waiting, so this throws `ElementNotFoundError` directly (no auto-wait)
325
+ * — matching the unified "element not found" contract (ADR-006).
281
326
  *
282
327
  * @param locator - Locator of the element to measure
283
328
  * @returns The element's bounding rectangle in CSS pixels
@@ -309,6 +354,13 @@ var PlaywrightInteractor = class PlaywrightInteractor {
309
354
  async isReadonly(locator) {
310
355
  return await this.getAttribute(locator, "readonly") != null;
311
356
  }
357
+ async isRequired(locator) {
358
+ if (await this.getAttribute(locator, "required") != null) return true;
359
+ return await this.getAttribute(locator, "aria-required") === "true";
360
+ }
361
+ async isError(locator) {
362
+ return await this.getAttribute(locator, "aria-invalid") === "true";
363
+ }
312
364
  async isVisible(locator) {
313
365
  if (!await this.exists(locator)) return false;
314
366
  async function checkCssVisibility(prop, invisibleValue, interactor) {
@@ -336,9 +388,6 @@ var PlaywrightInteractor = class PlaywrightInteractor {
336
388
  const cssLocator = await _atomic_testing_core.locatorUtil.toCssSelector(locator, this);
337
389
  return this.page.locator(cssLocator).innerHTML();
338
390
  }
339
- clone() {
340
- return new PlaywrightInteractor(this.page);
341
- }
342
391
  };
343
392
  //#endregion
344
393
  //#region src/createTestEngine.ts
@@ -348,59 +397,16 @@ var PlaywrightInteractor = class PlaywrightInteractor {
348
397
  * @param page - Playwright page used for interaction.
349
398
  * @param partDefinitions - Scene part definitions describing the scene
350
399
  * structure for the engine.
400
+ * @param _option - Reserved for entry-point symmetry with the other adapters;
401
+ * currently ignored. `rootElement` is not applicable to Playwright, which drives
402
+ * a real browser page rather than mounting into a host element.
351
403
  * @returns A configured {@link TestEngine} ready for use.
352
404
  */
353
- function createTestEngine(page, partDefinitions) {
405
+ function createTestEngine(page, partDefinitions, _option) {
354
406
  return new _atomic_testing_core.TestEngine([], new PlaywrightInteractor(page), { parts: partDefinitions });
355
407
  }
356
408
  //#endregion
357
- //#region src/testRunnerAdapter.ts
358
- async function goto(url, fixture) {
359
- await fixture.page.goto(url);
360
- }
361
- /**
362
- * Create a {@link TestEngine} bound to the Playwright page in the given fixture.
363
- *
364
- * @param scenePart - Scene definition to drive.
365
- * @param fixture - Fixture providing the Playwright page.
366
- */
367
- function playwrightGetTestEngine(scenePart, fixture) {
368
- const page = fixture.page;
369
- return createTestEngine(page, scenePart);
370
- }
371
- /**
372
- * Playwright adapter for the TestFrameworkMapper interface.
373
- */
374
- const playWrightTestFrameworkMapper = {
375
- assertEqual: (a, b) => (0, _playwright_test.expect)(a).toEqual(b),
376
- assertNotEqual: (a, b) => (0, _playwright_test.expect)(a).not.toEqual(b),
377
- assertTrue: (value) => (0, _playwright_test.expect)(value).toBe(true),
378
- assertFalse: (value) => (0, _playwright_test.expect)(value).toBe(false),
379
- assertApproxEqual: (actual, expected, tolerance) => (0, _playwright_test.expect)(Math.abs(actual - expected)).toBeLessThanOrEqual(tolerance),
380
- describe: _playwright_test.test.describe,
381
- beforeEach: _playwright_test.test.beforeEach,
382
- afterEach: _playwright_test.test.afterEach,
383
- beforeAll: _playwright_test.test.beforeAll,
384
- afterAll: _playwright_test.test.afterAll,
385
- test: _playwright_test.test,
386
- it: _playwright_test.test,
387
- hasLayout: true
388
- };
389
- /**
390
- * Get a typed interface for running end-to-end tests with Playwright.
391
- */
392
- function getTestRunnerInterface() {
393
- return {
394
- getTestEngine: playwrightGetTestEngine,
395
- goto
396
- };
397
- }
398
- //#endregion
399
409
  exports.PlaywrightInteractor = PlaywrightInteractor;
400
410
  exports.createTestEngine = createTestEngine;
401
- exports.getTestRunnerInterface = getTestRunnerInterface;
402
- exports.goto = goto;
403
- exports.playWrightTestFrameworkMapper = playWrightTestFrameworkMapper;
404
- exports.playwrightGetTestEngine = playwrightGetTestEngine;
405
411
 
406
412
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["locatorUtil","dateUtil","timingUtil","defaultWaitForOption","interactorUtil","ElementNotFoundError","TestEngine","test"],"sources":["../src/PlaywrightInteractor.ts","../src/createTestEngine.ts","../src/testRunnerAdapter.ts"],"sourcesContent":["import {\n BlurOption,\n BoundingRect,\n byCssSelector,\n ClickOption,\n CssProperty,\n dateUtil,\n defaultWaitForOption,\n ElementNotFoundError,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n interactorUtil,\n locatorUtil,\n MouseEnterOption,\n MouseLeaveOption,\n MouseOutOption,\n MouseDownOption,\n MouseMoveOption,\n MouseUpOption,\n Optional,\n PartLocator,\n Point,\n PressKeyOption,\n timingUtil,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { Page } from '@playwright/test';\n\n/**\n * Implementation of the {@link Interactor} interface using Playwright.\n */\nexport class PlaywrightInteractor implements Interactor {\n /**\n * @param page - Playwright page instance used to drive the browser.\n */\n constructor(public readonly page: Page) {}\n\n /**\n * Select the given option values on a `<select>` element.\n *\n * @param locator - Locator to the `<select>` element.\n * @param values - Values to select.\n */\n async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(cssLocator).selectOption(values);\n }\n\n /**\n * Set the selected files on a `<input type=\"file\">` element.\n *\n * Playwright's native `setInputFiles` reads the given paths from disk and\n * populates the input's `FileList`, firing the change event — the only way to\n * fill a file input, whose value cannot be set programmatically. Following\n * this layer's convention, no `ElementNotFoundError` is fabricated: a missing\n * element surfaces through Playwright's own auto-wait timeout.\n *\n * @param locator - Locator of the `<input type=\"file\">` element\n * @param files - One or more filesystem paths to upload\n */\n async setInputFiles(locator: PartLocator, files: string | string[]): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(cssLocator).setInputFiles(files);\n }\n\n /**\n * Scroll the located element into view, no-op if already visible.\n *\n * Delegates to Playwright's `scrollIntoViewIfNeeded`, which performs a real\n * layout-aware scroll in the browser. Per this layer's convention, no\n * `ElementNotFoundError` is fabricated: a missing element surfaces through\n * Playwright's own auto-wait timeout.\n *\n * @param locator - Locator of the element to scroll into view\n */\n async scrollIntoView(locator: PartLocator): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(css).scrollIntoViewIfNeeded();\n }\n\n /**\n * Scroll the located element by the given pixel delta.\n *\n * The scroll is performed by evaluating `el.scrollBy(dx, dy)` on the element\n * itself rather than `page.mouse.wheel`. A wheel event scrolls whatever sits\n * under the pointer and is non-deterministic across chromium/firefox/webkit,\n * whereas evaluating `scrollBy` on the resolved element scrolls exactly that\n * element. This is a deliberate deviation from ADR 0001's per-engine table\n * (which lists `page.mouse.wheel`), taking the alternative the step-5 prompt\n * permits (\"or evaluate el.scrollBy\") for cross-browser determinism. As with\n * {@link scrollIntoView}, no `ElementNotFoundError` is fabricated; a missing\n * element surfaces through Playwright's own auto-wait timeout.\n *\n * @param locator - Locator of the scrollable element\n * @param delta - Pixel offset to scroll by\n */\n async scrollBy(locator: PartLocator, delta: Point): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(css).evaluate((el, d) => el.scrollBy(d.x, d.y), { x: delta.x, y: delta.y });\n }\n\n /**\n * Drag the source element and drop it onto the target element.\n *\n * Delegates to Playwright's native `Locator.dragTo`, which performs a real,\n * layout-aware drag gesture in the browser. Per this layer's convention, no\n * `ElementNotFoundError` is fabricated: a missing element surfaces through\n * Playwright's own auto-wait timeout.\n *\n * @param source - Locator of the element to drag\n * @param target - Locator of the drop target\n */\n async dragTo(source: PartLocator, target: PartLocator): Promise<void> {\n const srcCss = await locatorUtil.toCssSelector(source, this);\n const tgtCss = await locatorUtil.toCssSelector(target, this);\n await this.page.locator(srcCss).dragTo(this.page.locator(tgtCss));\n }\n\n /**\n * Drag the located element by the given pixel delta from its center.\n *\n * The gesture is a single uninterrupted `move → down → move → up` sequence\n * computed from the element's center. It deliberately does NOT reuse\n * {@link mouseMove}/{@link mouseDown} — `mouseMove` resets the pointer with\n * `page.mouse.move(0, 0)` after hovering, which would corrupt the drag path\n * (see ADR 0001, option 5). The center comes from {@link getBoundingRect},\n * which throws `ElementNotFoundError` when the element has no box\n * (detached/invisible) rather than auto-waiting — so this shares that\n * \"element not found\" contract instead of re-deriving the box + guard here.\n *\n * @param locator - Locator of the element to drag\n * @param delta - Pixel offset to drag by\n * @throws {ElementNotFoundError} If the element has no bounding box\n */\n async drag(locator: PartLocator, delta: Point): Promise<void> {\n const rect = await this.getBoundingRect(locator);\n const cx = rect.x + rect.width / 2;\n const cy = rect.y + rect.height / 2;\n await this.page.mouse.move(cx, cy);\n await this.page.mouse.down();\n await this.page.mouse.move(cx + delta.x, cy + delta.y, { steps: 8 });\n await this.page.mouse.up();\n }\n\n /**\n * Get the value of an `<input>` element.\n *\n * @param locator - Locator pointing to the input element.\n * @returns The current value of the input or `undefined` if not present.\n */\n async getInputValue(locator: PartLocator): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n return this.page.locator(cssLocator).inputValue();\n }\n\n /**\n * Retrieve the values of selected options within a `<select>` element.\n *\n * @param locator - Locator to the `<select>` element.\n * @returns Array of selected option values or `undefined` when no option is selected.\n */\n async getSelectValues(locator: PartLocator): Promise<Optional<readonly string[]>> {\n const optionLocator: PartLocator = byCssSelector('option:checked');\n const selectedOptionLocator = locatorUtil.append(locator, optionLocator);\n const cssLocator = await locatorUtil.toCssSelector(selectedOptionLocator, this);\n const allOptions = await this.page.locator(cssLocator).all();\n const values: string[] = [];\n for (const option of allOptions) {\n const value = await option.getAttribute('value');\n if (value != null) {\n values.push(value);\n }\n }\n return values;\n }\n\n async getSelectLabels(locator: PartLocator): Promise<Optional<readonly string[]>> {\n const optionLocator: PartLocator = byCssSelector('option:checked');\n const selectedOptionLocator = locatorUtil.append(locator, optionLocator);\n const cssLocator = await locatorUtil.toCssSelector(selectedOptionLocator, this);\n const allOptions = await this.page.locator(cssLocator).all();\n const labels: string[] = [];\n for (const option of allOptions) {\n const label = await option.textContent();\n if (label != null) {\n labels.push(label);\n }\n }\n return labels;\n }\n\n async getStyleValue(locator: PartLocator, propertyName: CssProperty): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const elLocator = this.page.locator(cssLocator);\n const value = await elLocator.evaluate((element, prop) => {\n return window.getComputedStyle(element).getPropertyValue(prop as string);\n }, propertyName);\n return value;\n }\n\n async enterText(locator: PartLocator, text: string, option?: Optional<Partial<EnterTextOption>>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n if (!option?.append) {\n await this.page.locator(cssLocator).clear();\n }\n\n // If it is a date, time or datetime-local input, validate the date format\n const type = (await this.getAttribute(locator, 'type')) ?? '';\n if (dateUtil.isHtmlDateInputType(type)) {\n const result = dateUtil.validateHtmlDateInput(type, text);\n if (!result.valid) {\n throw new Error(\n `Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`\n );\n }\n }\n await this.page.locator(cssLocator).fill(text);\n }\n\n async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(cssLocator).click({ position: option?.position });\n }\n\n /**\n * Dispatch a right-click on the located element to open its context menu.\n *\n * Delegates to Playwright's native right-button click, which fires a real\n * `contextmenu` event in the browser. Per this layer's convention, no\n * `ElementNotFoundError` is fabricated: a missing element surfaces through\n * Playwright's own auto-wait timeout.\n *\n * @param locator - Locator of the element to right-click\n */\n async contextMenu(locator: PartLocator): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(css).click({ button: 'right' });\n }\n\n async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(cssLocator).hover({ position: option?.position });\n }\n\n async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await this.hover(locator, {\n position: option?.position,\n });\n await this.page.mouse.move(0, 0);\n }\n\n async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await this.hover(locator, {\n position: option?.position,\n });\n await this.page.mouse.down();\n }\n\n async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await this.hover(locator, {\n position: option?.position,\n });\n await this.page.mouse.up();\n }\n\n async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n return this.hover(locator, option);\n }\n\n async mouseOut(locator: PartLocator, _option?: Partial<MouseOutOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // First hover over the element to trigger mouseenter/mouseover\n await this.page.locator(cssLocator).hover();\n // Then dispatch mouseout event directly for cross-browser reliability\n await this.page.locator(cssLocator).dispatchEvent('mouseout');\n }\n\n async mouseEnter(locator: PartLocator, _option?: Partial<MouseEnterOption>): Promise<void> {\n return this.hover(locator);\n }\n\n async mouseLeave(locator: PartLocator, _option?: Partial<MouseLeaveOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // First hover over the element to trigger mouseenter/mouseover\n await this.page.locator(cssLocator).hover();\n // Dispatch mouseout which triggers both mouseout and mouseleave handlers in React\n await this.page.locator(cssLocator).dispatchEvent('mouseout');\n }\n\n async focus(locator: PartLocator, _option?: Partial<FocusOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n return this.page.focus(cssLocator);\n }\n\n async blur(locator: PartLocator, _option?: Partial<BlurOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.page.locator(cssLocator).blur();\n }\n\n async pressKey(locator: PartLocator, key: string, option?: Partial<PressKeyOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // Compose Playwright's chord syntax — modifiers joined to the key by `+`, in\n // Playwright's accepted Control+Alt+Shift+Meta order — so the browser holds\n // those modifiers across the keypress and the event carries ctrlKey/etc.\n const modifiers: string[] = [];\n if (option?.ctrl) {\n modifiers.push('Control');\n }\n if (option?.alt) {\n modifiers.push('Alt');\n }\n if (option?.shift) {\n modifiers.push('Shift');\n }\n if (option?.meta) {\n modifiers.push('Meta');\n }\n const chord = modifiers.length > 0 ? `${modifiers.join('+')}+${key}` : key;\n // locator.press auto-focuses the element, then dispatches a real, trusted\n // KeyboardEvent — the browser equivalent of the DOM focus-first keyDown/keyUp.\n // Caveat: for Shift + a printable key the browser case-folds `event.key`\n // (`Shift+a` → `'A'`) whereas the jsdom path keeps `'a'` — only the modifier\n // flags are delivered identically across engines (see #924).\n await this.page.locator(cssLocator).press(chord);\n }\n\n async activate(locator: PartLocator): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // Geometry-free activation mirrors the mouseout dispatch precedent above: it\n // bypasses hit-testing to actuate a covered or zero-size input that\n // locator.click() (a real geometry hit-test) cannot reach.\n await this.page.locator(cssLocator).dispatchEvent('click');\n }\n\n //#region wait conditions\n wait(ms: number): Promise<void> {\n return timingUtil.wait(ms);\n }\n\n async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n return interactorUtil.interactorWaitUtil(locator, this, option);\n }\n\n waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n return timingUtil.waitUntil(option);\n }\n //#endregion\n\n async getAttribute(locator: PartLocator, name: string, isMultiple: true): Promise<readonly string[]>;\n async getAttribute(locator: PartLocator, name: string, isMultiple: false): Promise<Optional<string>>;\n async getAttribute(locator: PartLocator, name: string): Promise<Optional<string>>;\n async getAttribute(\n locator: PartLocator,\n name: string,\n isMultiple?: boolean\n ): Promise<Optional<string> | readonly string[]> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const elLocator = this.page.locator(cssLocator);\n if (isMultiple) {\n const locators = await elLocator.all();\n const values: string[] = [];\n for (const locator of locators) {\n const value = await locator.getAttribute(name);\n if (value != null) {\n values.push(value);\n }\n }\n return values;\n }\n const value = await elLocator.getAttribute(name);\n return value ?? undefined;\n }\n\n async getText(locator: PartLocator): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const text = await this.page.locator(cssLocator).textContent();\n return text ?? undefined;\n }\n\n /**\n * Get the located element's bounding rectangle.\n *\n * `boundingBox()` returns `null` for a detached/invisible element rather than\n * auto-waiting, so this is one of the few Playwright methods that throws\n * `ElementNotFoundError` — matching the house \"element not found\" contract\n * (ADR 0001).\n *\n * @param locator - Locator of the element to measure\n * @returns The element's bounding rectangle in CSS pixels\n * @throws {ElementNotFoundError} If the element has no bounding box\n */\n async getBoundingRect(locator: PartLocator): Promise<BoundingRect> {\n const css = await locatorUtil.toCssSelector(locator, this);\n const box = await this.page.locator(css).boundingBox();\n if (box == null) {\n throw new ElementNotFoundError(locator, 'getBoundingRect');\n }\n return { x: box.x, y: box.y, width: box.width, height: box.height };\n }\n\n async exists(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const count = await this.page.locator(cssLocator).count();\n return count > 0;\n }\n\n async isChecked(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const checked = await this.page.locator(cssLocator).isChecked();\n return checked;\n }\n\n async isDisabled(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const isDisabled = await this.page.locator(cssLocator).isDisabled();\n return isDisabled;\n }\n\n async isReadonly(locator: PartLocator): Promise<boolean> {\n const readonly = await this.getAttribute(locator, 'readonly');\n return readonly != null;\n }\n\n async isVisible(locator: PartLocator): Promise<boolean> {\n const exists = await this.exists(locator);\n if (!exists) {\n return false;\n }\n\n async function checkCssVisibility(\n prop: CssProperty,\n invisibleValue: string,\n interactor: PlaywrightInteractor\n ): Promise<boolean> {\n try {\n const value = await interactor.getStyleValue(locator, prop);\n return value !== invisibleValue;\n } catch (e) {\n // Element may disappear or detached while being checked because of animation\n // when it happens, an error is thrown. In this case, if indeed the element\n // is not visible, we return false. Otherwise, we re-throw the error.\n if ((await interactor.exists(locator)) === false) {\n return false;\n }\n throw e;\n }\n }\n\n if ((await checkCssVisibility('opacity', '0', this)) === false) {\n return false;\n }\n\n if ((await checkCssVisibility('visibility', 'hidden', this)) === false) {\n return false;\n }\n\n if ((await checkCssVisibility('display', 'none', this)) === false) {\n return false;\n }\n\n return true;\n }\n\n async hasCssClass(locator: PartLocator, className: string): Promise<boolean> {\n const classNames = await this.getAttribute(locator, 'class');\n if (classNames == null) {\n return false;\n }\n\n const names = classNames.split(/\\s+/);\n return names.includes(className);\n }\n\n async hasAttribute(locator: PartLocator, name: string): Promise<boolean> {\n const attrValue = await this.getAttribute(locator, name);\n return attrValue != null;\n }\n\n //#region\n async innerHTML(locator: PartLocator): Promise<string> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n return this.page.locator(cssLocator).innerHTML();\n }\n //#endregion\n\n clone(): Interactor {\n return new PlaywrightInteractor(this.page);\n }\n}\n","import { ScenePart, TestEngine } from '@atomic-testing/core';\nimport { Page } from '@playwright/test';\n\nimport { PlaywrightInteractor } from './PlaywrightInteractor';\n\n/**\n * Create a {@link TestEngine} instance backed by Playwright.\n *\n * @param page - Playwright page used for interaction.\n * @param partDefinitions - Scene part definitions describing the scene\n * structure for the engine.\n * @returns A configured {@link TestEngine} ready for use.\n */\nexport function createTestEngine<T extends ScenePart>(page: Page, partDefinitions: T): TestEngine<T> {\n const engine = new TestEngine([], new PlaywrightInteractor(page), {\n parts: partDefinitions,\n });\n\n return engine;\n}\n","import { ScenePart, TestEngine } from '@atomic-testing/core';\nimport {\n E2eTestInterface,\n E2eTestRunEnvironmentFixture,\n TestFrameworkMapper,\n} from '@atomic-testing/internal-test-runner';\nimport { expect, Page, test } from '@playwright/test';\n\nimport { createTestEngine } from './createTestEngine';\n\n/**\n * Navigate the current Playwright page to the provided URL.\n *\n * @param url - Destination URL to load.\n * @param fixture - Optional test fixture supplying the Playwright page.\n */\nexport async function goto(url: string): Promise<void>;\nexport async function goto(url: string, fixture: E2eTestRunEnvironmentFixture): Promise<void>;\nexport async function goto(url: string, fixture?: E2eTestRunEnvironmentFixture): Promise<void> {\n const page = fixture!.page as Page;\n await page.goto(url);\n}\n\n/**\n * Create a {@link TestEngine} bound to the Playwright page in the given fixture.\n *\n * @param scenePart - Scene definition to drive.\n * @param fixture - Fixture providing the Playwright page.\n */\nexport function playwrightGetTestEngine<T extends ScenePart>(\n scenePart: T,\n fixture: E2eTestRunEnvironmentFixture\n): TestEngine<T> {\n const page = fixture.page as Page;\n return createTestEngine(page, scenePart);\n}\n\n/**\n * Playwright adapter for the TestFrameworkMapper interface.\n */\nexport const playWrightTestFrameworkMapper: TestFrameworkMapper = {\n /*\n * INTENTIONAL @ts-expect-error comments: Playwright's test functions have different type\n * signatures than the normalized TestFrameworkMapper interface. Playwright uses fixture-based\n * callbacks with destructuring ({ page, browser }) while our interface uses a union type for\n * Jest compatibility (done callback or fixture object). The functions are compatible at runtime\n * but TypeScript cannot verify this due to these fundamental signature differences.\n */\n\n assertEqual: (a, b) => expect(a).toEqual(b),\n assertNotEqual: (a, b) => expect(a).not.toEqual(b),\n assertTrue: value => expect(value).toBe(true),\n assertFalse: value => expect(value).toBe(false),\n assertApproxEqual: (actual, expected, tolerance) =>\n expect(Math.abs(actual - expected)).toBeLessThanOrEqual(tolerance),\n // @ts-expect-error - Playwright describe signature differs from TestFrameworkMapper.Describe\n describe: test.describe,\n\n beforeEach: test.beforeEach,\n afterEach: test.afterEach,\n beforeAll: test.beforeAll,\n afterAll: test.afterAll,\n\n // @ts-expect-error - Playwright test signature differs from TestFrameworkMapper.Test\n test: test,\n\n // @ts-expect-error - Playwright test signature differs from TestFrameworkMapper.Test\n it: test,\n\n hasLayout: true,\n};\n\n/**\n * Get a typed interface for running end-to-end tests with Playwright.\n */\nexport function getTestRunnerInterface<T extends ScenePart>(): E2eTestInterface<T> {\n return {\n getTestEngine: playw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,KAAK,GAAG;AACrB;;;;;;;AAQA,SAAgB,wBACd,WACA,SACe;CACf,MAAM,OAAO,QAAQ;CACrB,OAAO,iBAAiB,MAAM,SAAS;AACzC;;;;AAKA,MAAa,gCAAqD;CAShE,cAAc,GAAG,OAAA,GAAA,iBAAA,OAAA,CAAa,CAAC,CAAC,CAAC,QAAQ,CAAC;CAC1C,iBAAiB,GAAG,OAAA,GAAA,iBAAA,OAAA,CAAa,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;CACjD,aAAY,WAAA,GAAA,iBAAA,OAAA,CAAgB,KAAK,CAAC,CAAC,KAAK,IAAI;CAC5C,cAAa,WAAA,GAAA,iBAAA,OAAA,CAAgB,KAAK,CAAC,CAAC,KAAK,KAAK;CAC9C,oBAAoB,QAAQ,UAAU,eAAA,GAAA,iBAAA,OAAA,CAC7B,KAAK,IAAI,SAAS,QAAQ,CAAC,CAAC,CAAC,oBAAoB,SAAS;CAEnE,UAAUC,iBAAAA,KAAK;CAEf,YAAYA,iBAAAA,KAAK;CACjB,WAAWA,iBAAAA,KAAK;CAChB,WAAWA,iBAAAA,KAAK;CAChB,UAAUA,iBAAAA,KAAK;CAGf,MAAMA,iBAAAA;CAGN,IAAIA,iBAAAA;CAEJ,WAAW;AACb;;;;AAKA,SAAgB,yBAAmE;CACjF,OAAO;EACL,eAAe;EACf;CACF;AACF"}
1
+ {"version":3,"file":"index.cjs","names":["ElementNotFoundError","locatorUtil","dateUtil","defaultWaitForOption","interactorUtil","timingUtil","TestEngine"],"sources":["../src/PlaywrightInteractor.ts","../src/createTestEngine.ts"],"sourcesContent":["import {\n BlurOption,\n BoundingRect,\n byCssSelector,\n ClickOption,\n CssProperty,\n dateUtil,\n defaultWaitForOption,\n ElementNotFoundError,\n EnterTextOption,\n FocusOption,\n HoverOption,\n Interactor,\n interactorUtil,\n locatorUtil,\n MouseEnterOption,\n MouseLeaveOption,\n MouseOutOption,\n MouseDownOption,\n MouseMoveOption,\n MouseUpOption,\n Optional,\n PartLocator,\n Point,\n PressKeyOption,\n timingUtil,\n WaitForOption,\n WaitUntilOption,\n} from '@atomic-testing/core';\nimport { Page } from '@playwright/test';\n\n/**\n * Implementation of the {@link Interactor} interface using Playwright.\n */\nexport class PlaywrightInteractor implements Interactor {\n /**\n * @param page - Playwright page instance used to drive the browser.\n */\n constructor(public readonly page: Page) {}\n\n /**\n * Run a Playwright mutation and normalize a \"locator matched nothing\" failure\n * into {@link ElementNotFoundError}, so a missing element throws the same error\n * class here as it does in `DOMInteractor`, regardless of environment (the\n * unified contract ratified in ADR-006).\n *\n * Playwright auto-waits for actionability and then throws its own\n * `TimeoutError`. We translate that to `ElementNotFoundError` ONLY when the\n * element genuinely does not exist (count 0) and otherwise rethrow the original\n * error — preserving Playwright's auto-wait for an element that exists but is\n * briefly not actionable (covered, disabled, animating). The trade-off is that\n * a truly-missing element waits out the page's action timeout before throwing;\n * bound it with `page.setDefaultTimeout` when fast failure matters.\n *\n * @param locator - Locator the mutation targets\n * @param action - Method name used in the error message (e.g. `'click'`)\n * @param run - The Playwright action to execute\n * @throws {ElementNotFoundError} If the action fails and the element is absent\n */\n private async runMutation<T>(locator: PartLocator, action: string, run: () => Promise<T>): Promise<T> {\n try {\n return await run();\n } catch (e) {\n if ((await this.exists(locator)) === false) {\n throw new ElementNotFoundError(locator, action);\n }\n throw e;\n }\n }\n\n /**\n * Select the given option values on a `<select>` element.\n *\n * @param locator - Locator to the `<select>` element.\n * @param values - Values to select.\n * @throws {ElementNotFoundError} If the element is not found\n */\n async selectOptionValue(locator: PartLocator, values: string[]): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'selectOptionValue', () => this.page.locator(cssLocator).selectOption(values));\n }\n\n /**\n * Set the selected files on a `<input type=\"file\">` element.\n *\n * Playwright's native `setInputFiles` reads the given paths from disk and\n * populates the input's `FileList`, firing the change event — the only way to\n * fill a file input, whose value cannot be set programmatically.\n *\n * @param locator - Locator of the `<input type=\"file\">` element\n * @param files - One or more filesystem paths to upload\n * @throws {ElementNotFoundError} If the element is not found\n */\n async setInputFiles(locator: PartLocator, files: string | string[]): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'setInputFiles', () => this.page.locator(cssLocator).setInputFiles(files));\n }\n\n /**\n * Scroll the located element into view, no-op if already visible.\n *\n * Delegates to Playwright's `scrollIntoViewIfNeeded`, which performs a real\n * layout-aware scroll in the browser.\n *\n * @param locator - Locator of the element to scroll into view\n * @throws {ElementNotFoundError} If the element is not found\n */\n async scrollIntoView(locator: PartLocator): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'scrollIntoView', () => this.page.locator(css).scrollIntoViewIfNeeded());\n }\n\n /**\n * Scroll the located element by the given pixel delta.\n *\n * The scroll is performed by evaluating `el.scrollBy(dx, dy)` on the element\n * itself rather than `page.mouse.wheel`. A wheel event scrolls whatever sits\n * under the pointer and is non-deterministic across chromium/firefox/webkit,\n * whereas evaluating `scrollBy` on the resolved element scrolls exactly that\n * element. This is a deliberate deviation from ADR 0001's per-engine table\n * (which lists `page.mouse.wheel`), taking the alternative the step-5 prompt\n * permits (\"or evaluate el.scrollBy\") for cross-browser determinism.\n *\n * @param locator - Locator of the scrollable element\n * @param delta - Pixel offset to scroll by\n * @throws {ElementNotFoundError} If the element is not found\n */\n async scrollBy(locator: PartLocator, delta: Point): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'scrollBy', () =>\n this.page.locator(css).evaluate((el, d) => el.scrollBy(d.x, d.y), { x: delta.x, y: delta.y })\n );\n }\n\n /**\n * Drag the source element and drop it onto the target element.\n *\n * Delegates to Playwright's native `Locator.dragTo`, which performs a real,\n * layout-aware drag gesture in the browser.\n *\n * @param source - Locator of the element to drag\n * @param target - Locator of the drop target\n * @throws {ElementNotFoundError} If either the source or target is not found\n */\n async dragTo(source: PartLocator, target: PartLocator): Promise<void> {\n const srcCss = await locatorUtil.toCssSelector(source, this);\n const tgtCss = await locatorUtil.toCssSelector(target, this);\n try {\n await this.page.locator(srcCss).dragTo(this.page.locator(tgtCss));\n } catch (e) {\n if ((await this.exists(source)) === false) {\n throw new ElementNotFoundError(source, 'dragTo');\n }\n if ((await this.exists(target)) === false) {\n throw new ElementNotFoundError(target, 'dragTo');\n }\n throw e;\n }\n }\n\n /**\n * Drag the located element by the given pixel delta from its center.\n *\n * The gesture is a single uninterrupted `move → down → move → up` sequence\n * computed from the element's center. It deliberately does NOT reuse\n * {@link mouseMove}/{@link mouseDown} — `mouseMove` resets the pointer with\n * `page.mouse.move(0, 0)` after hovering, which would corrupt the drag path\n * (see ADR 0001, option 5). The center comes from {@link getBoundingRect},\n * which throws `ElementNotFoundError` when the element has no box, so this\n * shares that \"element not found\" contract instead of re-deriving the box +\n * guard here.\n *\n * @param locator - Locator of the element to drag\n * @param delta - Pixel offset to drag by\n * @throws {ElementNotFoundError} If the element has no bounding box\n */\n async drag(locator: PartLocator, delta: Point): Promise<void> {\n const rect = await this.getBoundingRect(locator);\n const cx = rect.x + rect.width / 2;\n const cy = rect.y + rect.height / 2;\n await this.page.mouse.move(cx, cy);\n await this.page.mouse.down();\n await this.page.mouse.move(cx + delta.x, cy + delta.y, { steps: 8 });\n await this.page.mouse.up();\n }\n\n /**\n * Get the value of an `<input>` element.\n *\n * @param locator - Locator pointing to the input element.\n * @returns The current value of the input or `undefined` if not present.\n */\n async getInputValue(locator: PartLocator): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n return this.page.locator(cssLocator).inputValue();\n }\n\n /**\n * Retrieve the values of selected options within a `<select>` element.\n *\n * @param locator - Locator to the `<select>` element.\n * @returns Array of selected option values or `undefined` when no option is selected.\n */\n async getSelectValues(locator: PartLocator): Promise<Optional<readonly string[]>> {\n const optionLocator: PartLocator = byCssSelector('option:checked');\n const selectedOptionLocator = locatorUtil.append(locator, optionLocator);\n const cssLocator = await locatorUtil.toCssSelector(selectedOptionLocator, this);\n const allOptions = await this.page.locator(cssLocator).all();\n const values: string[] = [];\n for (const option of allOptions) {\n const value = await option.getAttribute('value');\n if (value != null) {\n values.push(value);\n }\n }\n return values;\n }\n\n async getSelectLabels(locator: PartLocator): Promise<Optional<readonly string[]>> {\n const optionLocator: PartLocator = byCssSelector('option:checked');\n const selectedOptionLocator = locatorUtil.append(locator, optionLocator);\n const cssLocator = await locatorUtil.toCssSelector(selectedOptionLocator, this);\n const allOptions = await this.page.locator(cssLocator).all();\n const labels: string[] = [];\n for (const option of allOptions) {\n const label = await option.textContent();\n if (label != null) {\n labels.push(label);\n }\n }\n return labels;\n }\n\n async getStyleValue(locator: PartLocator, propertyName: CssProperty): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const elLocator = this.page.locator(cssLocator);\n const value = await elLocator.evaluate((element, prop) => {\n return window.getComputedStyle(element).getPropertyValue(prop as string);\n }, propertyName);\n return value;\n }\n\n async enterText(locator: PartLocator, text: string, option?: Optional<Partial<EnterTextOption>>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'enterText', async () => {\n if (!option?.append) {\n await this.page.locator(cssLocator).clear();\n }\n\n // If it is a date, time or datetime-local input, validate the date format\n const type = (await this.getAttribute(locator, 'type')) ?? '';\n if (dateUtil.isHtmlDateInputType(type)) {\n const result = dateUtil.validateHtmlDateInput(type, text);\n if (!result.valid) {\n throw new Error(\n `Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`\n );\n }\n }\n await this.page.locator(cssLocator).fill(text);\n });\n }\n\n async setRangeValue(locator: PartLocator, value: number): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // Playwright's `fill` rejects `<input type=\"range\">` (it is not a fillable\n // text control), so set the value in-page through the native value setter.\n // Calling the prototype setter both sanitizes the value to the input's step\n // (the browser snaps an off-step target to the nearest valid step) and lets\n // React's value tracker observe the change; the dispatched input/change\n // events then drive a controlled component (e.g. MUI Slider) to re-render.\n await this.runMutation(locator, 'setRangeValue', () =>\n this.page.locator(cssLocator).evaluate((el, nextValue) => {\n const input = el as HTMLInputElement;\n const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;\n setter?.call(input, nextValue);\n input.dispatchEvent(new Event('input', { bubbles: true }));\n input.dispatchEvent(new Event('change', { bubbles: true }));\n }, String(value))\n );\n }\n\n async click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'click', () => this.page.locator(cssLocator).click({ position: option?.position }));\n }\n\n /**\n * Dispatch a right-click on the located element to open its context menu.\n *\n * Delegates to Playwright's native right-button click, which fires a real\n * `contextmenu` event in the browser.\n *\n * @param locator - Locator of the element to right-click\n * @throws {ElementNotFoundError} If the element is not found\n */\n async contextMenu(locator: PartLocator): Promise<void> {\n const css = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'contextMenu', () => this.page.locator(css).click({ button: 'right' }));\n }\n\n async hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'hover', () => this.page.locator(cssLocator).hover({ position: option?.position }));\n }\n\n async mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void> {\n await this.runMutation(locator, 'mouseMove', async () => {\n await this.hover(locator, { position: option?.position });\n await this.page.mouse.move(0, 0);\n });\n }\n\n async mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void> {\n await this.runMutation(locator, 'mouseDown', async () => {\n await this.hover(locator, { position: option?.position });\n await this.page.mouse.down();\n });\n }\n\n async mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void> {\n await this.runMutation(locator, 'mouseUp', async () => {\n await this.hover(locator, { position: option?.position });\n await this.page.mouse.up();\n });\n }\n\n async mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void> {\n await this.runMutation(locator, 'mouseOver', () => this.hover(locator, option));\n }\n\n async mouseOut(locator: PartLocator, _option?: Partial<MouseOutOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'mouseOut', async () => {\n // First hover over the element to trigger mouseenter/mouseover\n await this.page.locator(cssLocator).hover();\n // Then dispatch mouseout event directly for cross-browser reliability\n await this.page.locator(cssLocator).dispatchEvent('mouseout');\n });\n }\n\n async mouseEnter(locator: PartLocator, _option?: Partial<MouseEnterOption>): Promise<void> {\n await this.runMutation(locator, 'mouseEnter', () => this.hover(locator));\n }\n\n async mouseLeave(locator: PartLocator, _option?: Partial<MouseLeaveOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'mouseLeave', async () => {\n // First hover over the element to trigger mouseenter/mouseover\n await this.page.locator(cssLocator).hover();\n // Dispatch mouseout which triggers both mouseout and mouseleave handlers in React\n await this.page.locator(cssLocator).dispatchEvent('mouseout');\n });\n }\n\n async focus(locator: PartLocator, _option?: Partial<FocusOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'focus', () => this.page.focus(cssLocator));\n }\n\n async blur(locator: PartLocator, _option?: Partial<BlurOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n await this.runMutation(locator, 'blur', () => this.page.locator(cssLocator).blur());\n }\n\n async pressKey(locator: PartLocator, key: string, option?: Partial<PressKeyOption>): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // Compose Playwright's chord syntax — modifiers joined to the key by `+`, in\n // Playwright's accepted Control+Alt+Shift+Meta order — so the browser holds\n // those modifiers across the keypress and the event carries ctrlKey/etc.\n const modifiers: string[] = [];\n if (option?.ctrl) {\n modifiers.push('Control');\n }\n if (option?.alt) {\n modifiers.push('Alt');\n }\n if (option?.shift) {\n modifiers.push('Shift');\n }\n if (option?.meta) {\n modifiers.push('Meta');\n }\n const chord = modifiers.length > 0 ? `${modifiers.join('+')}+${key}` : key;\n // locator.press auto-focuses the element, then dispatches a real, trusted\n // KeyboardEvent — the browser equivalent of the DOM focus-first keyDown/keyUp.\n // Caveat: for Shift + a printable key the browser case-folds `event.key`\n // (`Shift+a` → `'A'`) whereas the jsdom path keeps `'a'` — only the modifier\n // flags are delivered identically across engines (see #924).\n await this.runMutation(locator, 'pressKey', () => this.page.locator(cssLocator).press(chord));\n }\n\n async activate(locator: PartLocator): Promise<void> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n // Geometry-free activation mirrors the mouseout dispatch precedent above: it\n // bypasses hit-testing to actuate a covered or zero-size input that\n // locator.click() (a real geometry hit-test) cannot reach.\n await this.runMutation(locator, 'activate', () => this.page.locator(cssLocator).dispatchEvent('click'));\n }\n\n //#region wait conditions\n async waitUntilComponentState(\n locator: PartLocator,\n option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n ): Promise<void> {\n return interactorUtil.interactorWaitUtil(locator, this, option);\n }\n\n waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n return timingUtil.waitUntil(option);\n }\n //#endregion\n\n async getAttribute(locator: PartLocator, name: string, isMultiple: true): Promise<readonly string[]>;\n async getAttribute(locator: PartLocator, name: string, isMultiple: false): Promise<Optional<string>>;\n async getAttribute(locator: PartLocator, name: string): Promise<Optional<string>>;\n async getAttribute(\n locator: PartLocator,\n name: string,\n isMultiple?: boolean\n ): Promise<Optional<string> | readonly string[]> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const elLocator = this.page.locator(cssLocator);\n if (isMultiple) {\n const locators = await elLocator.all();\n const values: string[] = [];\n for (const locator of locators) {\n const value = await locator.getAttribute(name);\n if (value != null) {\n values.push(value);\n }\n }\n return values;\n }\n const value = await elLocator.getAttribute(name);\n return value ?? undefined;\n }\n\n async getText(locator: PartLocator): Promise<Optional<string>> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const text = await this.page.locator(cssLocator).textContent();\n return text ?? undefined;\n }\n\n /**\n * Get the located element's bounding rectangle.\n *\n * `boundingBox()` returns `null` for a detached/invisible element rather than\n * auto-waiting, so this throws `ElementNotFoundError` directly (no auto-wait)\n * — matching the unified \"element not found\" contract (ADR-006).\n *\n * @param locator - Locator of the element to measure\n * @returns The element's bounding rectangle in CSS pixels\n * @throws {ElementNotFoundError} If the element has no bounding box\n */\n async getBoundingRect(locator: PartLocator): Promise<BoundingRect> {\n const css = await locatorUtil.toCssSelector(locator, this);\n const box = await this.page.locator(css).boundingBox();\n if (box == null) {\n throw new ElementNotFoundError(locator, 'getBoundingRect');\n }\n return { x: box.x, y: box.y, width: box.width, height: box.height };\n }\n\n async exists(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const count = await this.page.locator(cssLocator).count();\n return count > 0;\n }\n\n async isChecked(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const checked = await this.page.locator(cssLocator).isChecked();\n return checked;\n }\n\n async isDisabled(locator: PartLocator): Promise<boolean> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n const isDisabled = await this.page.locator(cssLocator).isDisabled();\n return isDisabled;\n }\n\n async isReadonly(locator: PartLocator): Promise<boolean> {\n const readonly = await this.getAttribute(locator, 'readonly');\n return readonly != null;\n }\n\n async isRequired(locator: PartLocator): Promise<boolean> {\n const required = await this.getAttribute(locator, 'required');\n if (required != null) {\n return true;\n }\n return (await this.getAttribute(locator, 'aria-required')) === 'true';\n }\n\n async isError(locator: PartLocator): Promise<boolean> {\n return (await this.getAttribute(locator, 'aria-invalid')) === 'true';\n }\n\n async isVisible(locator: PartLocator): Promise<boolean> {\n const exists = await this.exists(locator);\n if (!exists) {\n return false;\n }\n\n async function checkCssVisibility(\n prop: CssProperty,\n invisibleValue: string,\n interactor: PlaywrightInteractor\n ): Promise<boolean> {\n try {\n const value = await interactor.getStyleValue(locator, prop);\n return value !== invisibleValue;\n } catch (e) {\n // Element may disappear or detached while being checked because of animation\n // when it happens, an error is thrown. In this case, if indeed the element\n // is not visible, we return false. Otherwise, we re-throw the error.\n if ((await interactor.exists(locator)) === false) {\n return false;\n }\n throw e;\n }\n }\n\n if ((await checkCssVisibility('opacity', '0', this)) === false) {\n return false;\n }\n\n if ((await checkCssVisibility('visibility', 'hidden', this)) === false) {\n return false;\n }\n\n if ((await checkCssVisibility('display', 'none', this)) === false) {\n return false;\n }\n\n return true;\n }\n\n async hasCssClass(locator: PartLocator, className: string): Promise<boolean> {\n const classNames = await this.getAttribute(locator, 'class');\n if (classNames == null) {\n return false;\n }\n\n const names = classNames.split(/\\s+/);\n return names.includes(className);\n }\n\n async hasAttribute(locator: PartLocator, name: string): Promise<boolean> {\n const attrValue = await this.getAttribute(locator, name);\n return attrValue != null;\n }\n\n //#region\n async innerHTML(locator: PartLocator): Promise<string> {\n const cssLocator = await locatorUtil.toCssSelector(locator, this);\n return this.page.locator(cssLocator).innerHTML();\n }\n //#endregion\n}\n","import { ITestEngineOption, ScenePart, TestEngine } from '@atomic-testing/core';\nimport { Page } from '@playwright/test';\n\nimport { PlaywrightInteractor } from './PlaywrightInteractor';\n\n/**\n * Create a {@link TestEngine} instance backed by Playwright.\n *\n * @param page - Playwright page used for interaction.\n * @param partDefinitions - Scene part definitions describing the scene\n * structure for the engine.\n * @param _option - Reserved for entry-point symmetry with the other adapters;\n * currently ignored. `rootElement` is not applicable to Playwright, which drives\n * a real browser page rather than mounting into a host element.\n * @returns A configured {@link TestEngine} ready for use.\n */\nexport function createTestEngine<T extends ScenePart>(\n page: Page,\n partDefinitions: T,\n _option?: ITestEngineOption\n): TestEngine<T> {\n const engine = new TestEngine([], new PlaywrightInteractor(page), {\n parts: partDefinitions,\n });\n\n return engine;\n}\n"],"mappings":";;;;;;AAkCA,IAAa,uBAAb,MAAwD;;;;CAItD,YAAY,MAA4B;EAAZ,KAAA,OAAA;CAAa;;;;;;;;;;;;;;;;;;;;CAq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