@atomic-testing/playwright 0.87.0 → 0.89.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/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { TestEngine, byCssSelector, dateUtil, defaultWaitForOption, interactorUtil, locatorUtil, timingUtil } from "@atomic-testing/core";
2
- import { expect, test } from "@playwright/test";
1
+ import { ElementNotFoundError, TestEngine, byCssSelector, dateUtil, defaultWaitForOption, interactorUtil, locatorUtil, timingUtil } from "@atomic-testing/core";
3
2
  //#region src/PlaywrightInteractor.ts
4
3
  /**
5
4
  * Implementation of the {@link Interactor} interface using Playwright.
@@ -12,14 +11,138 @@ var PlaywrightInteractor = class PlaywrightInteractor {
12
11
  this.page = page;
13
12
  }
14
13
  /**
14
+ * Run a Playwright mutation and normalize a "locator matched nothing" failure
15
+ * into {@link ElementNotFoundError}, so a missing element throws the same error
16
+ * class here as it does in `DOMInteractor`, regardless of environment (the
17
+ * unified contract ratified in ADR-006).
18
+ *
19
+ * Playwright auto-waits for actionability and then throws its own
20
+ * `TimeoutError`. We translate that to `ElementNotFoundError` ONLY when the
21
+ * element genuinely does not exist (count 0) and otherwise rethrow the original
22
+ * error — preserving Playwright's auto-wait for an element that exists but is
23
+ * briefly not actionable (covered, disabled, animating). The trade-off is that
24
+ * a truly-missing element waits out the page's action timeout before throwing;
25
+ * bound it with `page.setDefaultTimeout` when fast failure matters.
26
+ *
27
+ * @param locator - Locator the mutation targets
28
+ * @param action - Method name used in the error message (e.g. `'click'`)
29
+ * @param run - The Playwright action to execute
30
+ * @throws {ElementNotFoundError} If the action fails and the element is absent
31
+ */
32
+ async runMutation(locator, action, run) {
33
+ try {
34
+ return await run();
35
+ } catch (e) {
36
+ if (await this.exists(locator) === false) throw new ElementNotFoundError(locator, action);
37
+ throw e;
38
+ }
39
+ }
40
+ /**
15
41
  * Select the given option values on a `<select>` element.
16
42
  *
17
43
  * @param locator - Locator to the `<select>` element.
18
44
  * @param values - Values to select.
45
+ * @throws {ElementNotFoundError} If the element is not found
19
46
  */
20
47
  async selectOptionValue(locator, values) {
21
48
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
22
- await this.page.locator(cssLocator).selectOption(values);
49
+ await this.runMutation(locator, "selectOptionValue", () => this.page.locator(cssLocator).selectOption(values));
50
+ }
51
+ /**
52
+ * Set the selected files on a `<input type="file">` element.
53
+ *
54
+ * Playwright's native `setInputFiles` reads the given paths from disk and
55
+ * populates the input's `FileList`, firing the change event — the only way to
56
+ * fill a file input, whose value cannot be set programmatically.
57
+ *
58
+ * @param locator - Locator of the `<input type="file">` element
59
+ * @param files - One or more filesystem paths to upload
60
+ * @throws {ElementNotFoundError} If the element is not found
61
+ */
62
+ async setInputFiles(locator, files) {
63
+ const cssLocator = await locatorUtil.toCssSelector(locator, this);
64
+ await this.runMutation(locator, "setInputFiles", () => this.page.locator(cssLocator).setInputFiles(files));
65
+ }
66
+ /**
67
+ * Scroll the located element into view, no-op if already visible.
68
+ *
69
+ * Delegates to Playwright's `scrollIntoViewIfNeeded`, which performs a real
70
+ * layout-aware scroll in the browser.
71
+ *
72
+ * @param locator - Locator of the element to scroll into view
73
+ * @throws {ElementNotFoundError} If the element is not found
74
+ */
75
+ async scrollIntoView(locator) {
76
+ const css = await locatorUtil.toCssSelector(locator, this);
77
+ await this.runMutation(locator, "scrollIntoView", () => this.page.locator(css).scrollIntoViewIfNeeded());
78
+ }
79
+ /**
80
+ * Scroll the located element by the given pixel delta.
81
+ *
82
+ * The scroll is performed by evaluating `el.scrollBy(dx, dy)` on the element
83
+ * itself rather than `page.mouse.wheel`. A wheel event scrolls whatever sits
84
+ * under the pointer and is non-deterministic across chromium/firefox/webkit,
85
+ * whereas evaluating `scrollBy` on the resolved element scrolls exactly that
86
+ * element. This is a deliberate deviation from ADR 0001's per-engine table
87
+ * (which lists `page.mouse.wheel`), taking the alternative the step-5 prompt
88
+ * permits ("or evaluate el.scrollBy") for cross-browser determinism.
89
+ *
90
+ * @param locator - Locator of the scrollable element
91
+ * @param delta - Pixel offset to scroll by
92
+ * @throws {ElementNotFoundError} If the element is not found
93
+ */
94
+ async scrollBy(locator, delta) {
95
+ const css = await locatorUtil.toCssSelector(locator, this);
96
+ await this.runMutation(locator, "scrollBy", () => this.page.locator(css).evaluate((el, d) => el.scrollBy(d.x, d.y), {
97
+ x: delta.x,
98
+ y: delta.y
99
+ }));
100
+ }
101
+ /**
102
+ * Drag the source element and drop it onto the target element.
103
+ *
104
+ * Delegates to Playwright's native `Locator.dragTo`, which performs a real,
105
+ * layout-aware drag gesture in the browser.
106
+ *
107
+ * @param source - Locator of the element to drag
108
+ * @param target - Locator of the drop target
109
+ * @throws {ElementNotFoundError} If either the source or target is not found
110
+ */
111
+ async dragTo(source, target) {
112
+ const srcCss = await locatorUtil.toCssSelector(source, this);
113
+ const tgtCss = await locatorUtil.toCssSelector(target, this);
114
+ try {
115
+ await this.page.locator(srcCss).dragTo(this.page.locator(tgtCss));
116
+ } catch (e) {
117
+ if (await this.exists(source) === false) throw new ElementNotFoundError(source, "dragTo");
118
+ if (await this.exists(target) === false) throw new ElementNotFoundError(target, "dragTo");
119
+ throw e;
120
+ }
121
+ }
122
+ /**
123
+ * Drag the located element by the given pixel delta from its center.
124
+ *
125
+ * The gesture is a single uninterrupted `move → down → move → up` sequence
126
+ * computed from the element's center. It deliberately does NOT reuse
127
+ * {@link mouseMove}/{@link mouseDown} — `mouseMove` resets the pointer with
128
+ * `page.mouse.move(0, 0)` after hovering, which would corrupt the drag path
129
+ * (see ADR 0001, option 5). The center comes from {@link getBoundingRect},
130
+ * which throws `ElementNotFoundError` when the element has no box, so this
131
+ * shares that "element not found" contract instead of re-deriving the box +
132
+ * guard here.
133
+ *
134
+ * @param locator - Locator of the element to drag
135
+ * @param delta - Pixel offset to drag by
136
+ * @throws {ElementNotFoundError} If the element has no bounding box
137
+ */
138
+ async drag(locator, delta) {
139
+ const rect = await this.getBoundingRect(locator);
140
+ const cx = rect.x + rect.width / 2;
141
+ const cy = rect.y + rect.height / 2;
142
+ await this.page.mouse.move(cx, cy);
143
+ await this.page.mouse.down();
144
+ await this.page.mouse.move(cx + delta.x, cy + delta.y, { steps: 8 });
145
+ await this.page.mouse.up();
23
146
  }
24
147
  /**
25
148
  * Get the value of an `<input>` element.
@@ -69,65 +192,105 @@ var PlaywrightInteractor = class PlaywrightInteractor {
69
192
  }
70
193
  async enterText(locator, text, option) {
71
194
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
72
- if (!option?.append) await this.page.locator(cssLocator).clear();
73
- const type = await this.getAttribute(locator, "type") ?? "";
74
- if (dateUtil.isHtmlDateInputType(type)) {
75
- const result = dateUtil.validateHtmlDateInput(type, text);
76
- if (!result.valid) throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
77
- }
78
- await this.page.locator(cssLocator).fill(text);
195
+ await this.runMutation(locator, "enterText", async () => {
196
+ if (!option?.append) await this.page.locator(cssLocator).clear();
197
+ const type = await this.getAttribute(locator, "type") ?? "";
198
+ if (dateUtil.isHtmlDateInputType(type)) {
199
+ const result = dateUtil.validateHtmlDateInput(type, text);
200
+ if (!result.valid) throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
201
+ }
202
+ await this.page.locator(cssLocator).fill(text);
203
+ });
204
+ }
205
+ async setRangeValue(locator, value) {
206
+ const cssLocator = await locatorUtil.toCssSelector(locator, this);
207
+ await this.runMutation(locator, "setRangeValue", () => this.page.locator(cssLocator).evaluate((el, nextValue) => {
208
+ const input = el;
209
+ (Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(input, nextValue);
210
+ input.dispatchEvent(new Event("input", { bubbles: true }));
211
+ input.dispatchEvent(new Event("change", { bubbles: true }));
212
+ }, String(value)));
79
213
  }
80
214
  async click(locator, option) {
81
215
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
82
- await this.page.locator(cssLocator).click({ position: option?.position });
216
+ await this.runMutation(locator, "click", () => this.page.locator(cssLocator).click({ position: option?.position }));
217
+ }
218
+ /**
219
+ * Dispatch a right-click on the located element to open its context menu.
220
+ *
221
+ * Delegates to Playwright's native right-button click, which fires a real
222
+ * `contextmenu` event in the browser.
223
+ *
224
+ * @param locator - Locator of the element to right-click
225
+ * @throws {ElementNotFoundError} If the element is not found
226
+ */
227
+ async contextMenu(locator) {
228
+ const css = await locatorUtil.toCssSelector(locator, this);
229
+ await this.runMutation(locator, "contextMenu", () => this.page.locator(css).click({ button: "right" }));
83
230
  }
84
231
  async hover(locator, option) {
85
232
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
86
- await this.page.locator(cssLocator).hover({ position: option?.position });
233
+ await this.runMutation(locator, "hover", () => this.page.locator(cssLocator).hover({ position: option?.position }));
87
234
  }
88
235
  async mouseMove(locator, option) {
89
- await this.hover(locator, { position: option?.position });
90
- await this.page.mouse.move(0, 0);
236
+ await this.runMutation(locator, "mouseMove", async () => {
237
+ await this.hover(locator, { position: option?.position });
238
+ await this.page.mouse.move(0, 0);
239
+ });
91
240
  }
92
241
  async mouseDown(locator, option) {
93
- await this.hover(locator, { position: option?.position });
94
- await this.page.mouse.down();
242
+ await this.runMutation(locator, "mouseDown", async () => {
243
+ await this.hover(locator, { position: option?.position });
244
+ await this.page.mouse.down();
245
+ });
95
246
  }
96
247
  async mouseUp(locator, option) {
97
- await this.hover(locator, { position: option?.position });
98
- await this.page.mouse.up();
248
+ await this.runMutation(locator, "mouseUp", async () => {
249
+ await this.hover(locator, { position: option?.position });
250
+ await this.page.mouse.up();
251
+ });
99
252
  }
100
253
  async mouseOver(locator, option) {
101
- return this.hover(locator, option);
254
+ await this.runMutation(locator, "mouseOver", () => this.hover(locator, option));
102
255
  }
103
256
  async mouseOut(locator, _option) {
104
257
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
105
- await this.page.locator(cssLocator).hover();
106
- await this.page.locator(cssLocator).dispatchEvent("mouseout");
258
+ await this.runMutation(locator, "mouseOut", async () => {
259
+ await this.page.locator(cssLocator).hover();
260
+ await this.page.locator(cssLocator).dispatchEvent("mouseout");
261
+ });
107
262
  }
108
263
  async mouseEnter(locator, _option) {
109
- return this.hover(locator);
264
+ await this.runMutation(locator, "mouseEnter", () => this.hover(locator));
110
265
  }
111
266
  async mouseLeave(locator, _option) {
112
267
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
113
- await this.page.locator(cssLocator).hover();
114
- await this.page.locator(cssLocator).dispatchEvent("mouseout");
268
+ await this.runMutation(locator, "mouseLeave", async () => {
269
+ await this.page.locator(cssLocator).hover();
270
+ await this.page.locator(cssLocator).dispatchEvent("mouseout");
271
+ });
115
272
  }
116
273
  async focus(locator, _option) {
117
274
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
118
- return this.page.focus(cssLocator);
275
+ await this.runMutation(locator, "focus", () => this.page.focus(cssLocator));
119
276
  }
120
277
  async blur(locator, _option) {
121
278
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
122
- await this.page.locator(cssLocator).blur();
279
+ await this.runMutation(locator, "blur", () => this.page.locator(cssLocator).blur());
123
280
  }
124
- async pressKey(locator, key, _option) {
281
+ async pressKey(locator, key, option) {
125
282
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
126
- await this.page.locator(cssLocator).press(key);
283
+ const modifiers = [];
284
+ if (option?.ctrl) modifiers.push("Control");
285
+ if (option?.alt) modifiers.push("Alt");
286
+ if (option?.shift) modifiers.push("Shift");
287
+ if (option?.meta) modifiers.push("Meta");
288
+ const chord = modifiers.length > 0 ? `${modifiers.join("+")}+${key}` : key;
289
+ await this.runMutation(locator, "pressKey", () => this.page.locator(cssLocator).press(chord));
127
290
  }
128
291
  async activate(locator) {
129
292
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
130
- await this.page.locator(cssLocator).dispatchEvent("click");
293
+ await this.runMutation(locator, "activate", () => this.page.locator(cssLocator).dispatchEvent("click"));
131
294
  }
132
295
  wait(ms) {
133
296
  return timingUtil.wait(ms);
@@ -156,6 +319,28 @@ var PlaywrightInteractor = class PlaywrightInteractor {
156
319
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
157
320
  return await this.page.locator(cssLocator).textContent() ?? void 0;
158
321
  }
322
+ /**
323
+ * Get the located element's bounding rectangle.
324
+ *
325
+ * `boundingBox()` returns `null` for a detached/invisible element rather than
326
+ * auto-waiting, so this throws `ElementNotFoundError` directly (no auto-wait)
327
+ * — matching the unified "element not found" contract (ADR-006).
328
+ *
329
+ * @param locator - Locator of the element to measure
330
+ * @returns The element's bounding rectangle in CSS pixels
331
+ * @throws {ElementNotFoundError} If the element has no bounding box
332
+ */
333
+ async getBoundingRect(locator) {
334
+ const css = await locatorUtil.toCssSelector(locator, this);
335
+ const box = await this.page.locator(css).boundingBox();
336
+ if (box == null) throw new ElementNotFoundError(locator, "getBoundingRect");
337
+ return {
338
+ x: box.x,
339
+ y: box.y,
340
+ width: box.width,
341
+ height: box.height
342
+ };
343
+ }
159
344
  async exists(locator) {
160
345
  const cssLocator = await locatorUtil.toCssSelector(locator, this);
161
346
  return await this.page.locator(cssLocator).count() > 0;
@@ -216,47 +401,6 @@ function createTestEngine(page, partDefinitions) {
216
401
  return new TestEngine([], new PlaywrightInteractor(page), { parts: partDefinitions });
217
402
  }
218
403
  //#endregion
219
- //#region src/testRunnerAdapter.ts
220
- async function goto(url, fixture) {
221
- await fixture.page.goto(url);
222
- }
223
- /**
224
- * Create a {@link TestEngine} bound to the Playwright page in the given fixture.
225
- *
226
- * @param scenePart - Scene definition to drive.
227
- * @param fixture - Fixture providing the Playwright page.
228
- */
229
- function playwrightGetTestEngine(scenePart, fixture) {
230
- const page = fixture.page;
231
- return createTestEngine(page, scenePart);
232
- }
233
- /**
234
- * Playwright adapter for the TestFrameworkMapper interface.
235
- */
236
- const playWrightTestFrameworkMapper = {
237
- assertEqual: (a, b) => expect(a).toEqual(b),
238
- assertNotEqual: (a, b) => expect(a).not.toEqual(b),
239
- assertTrue: (value) => expect(value).toBe(true),
240
- assertFalse: (value) => expect(value).toBe(false),
241
- assertApproxEqual: (actual, expected, tolerance) => expect(Math.abs(actual - expected)).toBeLessThanOrEqual(tolerance),
242
- describe: test.describe,
243
- beforeEach: test.beforeEach,
244
- afterEach: test.afterEach,
245
- beforeAll: test.beforeAll,
246
- afterAll: test.afterAll,
247
- test,
248
- it: test
249
- };
250
- /**
251
- * Get a typed interface for running end-to-end tests with Playwright.
252
- */
253
- function getTestRunnerInterface() {
254
- return {
255
- getTestEngine: playwrightGetTestEngine,
256
- goto
257
- };
258
- }
259
- //#endregion
260
- export { PlaywrightInteractor, createTestEngine, getTestRunnerInterface, goto, playWrightTestFrameworkMapper, playwrightGetTestEngine };
404
+ export { PlaywrightInteractor, createTestEngine };
261
405
 
262
406
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/PlaywrightInteractor.ts","../src/createTestEngine.ts","../src/testRunnerAdapter.ts"],"sourcesContent":["import {\n BlurOption,\n byCssSelector,\n ClickOption,\n CssProperty,\n dateUtil,\n defaultWaitForOption,\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 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 * 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 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 // locator.press auto-focuses the element, then dispatches a real, trusted\n // KeyboardEvent — the browser equivalent of the DOM focus-first keyDown/keyUp.\n await this.page.locator(cssLocator).press(key);\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 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\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: playwrightGetTestEngine,\n goto,\n };\n}\n"],"mappings":";;;;;;AA+BA,IAAa,uBAAb,MAAa,qBAA2C;;;;CAItD,YAAY,MAA4B;EAAZ,KAAA,OAAA;CAAa;;;;;;;CAQzC,MAAM,kBAAkB,SAAsB,QAAiC;EAC7E,MAAM,aAAa,MAAM,YAAY,cAAc,SAAS,IAAI;EAChE,MAAM,KAAK,KAAK,QAAQ,UAAU,CAAC,CAAC,aAAa,MAAM;CACzD;;;;;;;CAQA,MAAM,cAAc,SAAiD;EACnE,MAAM,aAAa,MAAM,YAAY,cAAc,SAAS,IAAI;EAChE,OAAO,KAAK,KAAK,QAAQ,UAAU,CA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CAC5C,cAAa,UAAS,OAAO,KAAK,CAAC,CAAC,KAAK,KAAK;CAC9C,oBAAoB,QAAQ,UAAU,cACpC,OAAO,KAAK,IAAI,SAAS,QAAQ,CAAC,CAAC,CAAC,oBAAoB,SAAS;CAEnE,UAAU,KAAK;CAEf,YAAY,KAAK;CACjB,WAAW,KAAK;CAChB,WAAW,KAAK;CAChB,UAAU,KAAK;CAGT;CAGN,IAAI;AACN;;;;AAKA,SAAgB,yBAAmE;CACjF,OAAO;EACL,eAAe;EACf;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"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 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 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 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"],"mappings":";;;;;AAkCA,IAAa,uBAAb,MAAa,qBAA2C;;;;CAItD,YAAY,MAA4B;EAAZ,KAAA,OAAA;CAAa;;;;;;;;;;;;;;;;;;;;CAqBzC,MAAc,YAAe,SAAsB,QAAgB,KAAmC;EACpG,IAAI;GACF,OAAO,MAAM,IAAI;EACnB,SAAS,GAAG;GACV,IAAK,MAAM,KAAK,OAAO,OAAO,MAAO,OACnC,MAAM,IAAI,qBAAqB,SAAS,MAAM;GAEhD,MAAM;EACR;CACF;;;;;;;;CASA,MAAM,kBAAkB,SAAsB,QAAiC;EAC7E,MAAM,aAAa,MAAM,YAAY,cAAc,SAAS,IAAI;EAChE,MAAM,KAAK,YAAY,SAAS,2BAA2B,KAAK,KAAK,QAAQ,UAAU,CAAC,CAAC,aAAa,MAAM,CAAC;CAC/G;;;;;;;;;;;;CAaA,MAAM,cAAc,SAAsB,OAAyC;EACjF,MAAM,aAAa,MAAM,YAAY,cAAc,SAAS,IAAI;EAChE,MAAM,KAAK,YAAY,SAAS,uBAAuB,KAAK,KAAK,QAAQ,UAAU,CAAC,CAAC,cAAc,KAAK,CAAC;CAC3G;;;;;;;;;;CAWA,MAAM,eAAe,SAAqC;EACxD,MAAM,MAAM,MAAM,YAAY,cAAc,SAAS,IAAI;EACzD,MAAM,KAAK,YAAY,SAAS,wBAAwB,KAAK,KAAK,QAAQ,GAAG,CAAC,CAAC,uBAAuB,CAAC;CACzG;;;;;;;;;;;;;;;;CAiBA,MAAM,SAAS,SAA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U;CACjD;CAGA,QAAoB;EAClB,OAAO,IAAI,qBAAqB,KAAK,IAAI;CAC3C;AACF;;;;;;;;;;;AC/hBA,SAAgB,iBAAsC,MAAY,iBAAmC;CAKnG,OAAO,IAJY,WAAW,CAAC,GAAG,IAAI,qBAAqB,IAAI,GAAG,EAChE,OAAO,gBACT,CAEY;AACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomic-testing/playwright",
3
- "version": "0.87.0",
3
+ "version": "0.89.0",
4
4
  "description": "Atomic Testing Playwright Adapter",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -25,14 +25,14 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@atomic-testing/core": "0.87.0",
29
- "@atomic-testing/internal-test-runner": "0.87.0"
28
+ "@atomic-testing/core": "0.89.0"
30
29
  },
31
30
  "peerDependencies": {
32
31
  "@playwright/test": ">=1.50.0"
33
32
  },
34
33
  "scripts": {
35
34
  "build": "tsdown",
36
- "check:type": "tsgo --noEmit"
35
+ "check:type": "tsgo --noEmit",
36
+ "check:api": "api-extractor run"
37
37
  }
38
38
  }