@atomic-testing/playwright 0.58.0 → 0.60.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.
@@ -0,0 +1,102 @@
1
+ import { ClickOption, CssProperty, EnterTextOption, FocusOption, HoverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, Optional, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
2
+ import { Page } from "@playwright/test";
3
+ import { E2eTestInterface, E2eTestRunEnvironmentFixture, TestFrameworkMapper } from "@atomic-testing/test-runner";
4
+
5
+ //#region src/createTestEngine.d.ts
6
+
7
+ /**
8
+ * Create a {@link TestEngine} instance backed by Playwright.
9
+ *
10
+ * @param page - Playwright page used for interaction.
11
+ * @param partDefinitions - Scene part definitions describing the scene
12
+ * structure for the engine.
13
+ * @returns A configured {@link TestEngine} ready for use.
14
+ */
15
+ declare function createTestEngine<T extends ScenePart>(page: Page, partDefinitions: T): TestEngine<T>;
16
+ //#endregion
17
+ //#region src/PlaywrightInteractor.d.ts
18
+ /**
19
+ * Implementation of the {@link Interactor} interface using Playwright.
20
+ */
21
+ declare class PlaywrightInteractor implements Interactor {
22
+ readonly page: Page;
23
+ /**
24
+ * @param page - Playwright page instance used to drive the browser.
25
+ */
26
+ constructor(page: Page);
27
+ /**
28
+ * Select the given option values on a `<select>` element.
29
+ *
30
+ * @param locator - Locator to the `<select>` element.
31
+ * @param values - Values to select.
32
+ */
33
+ selectOptionValue(locator: PartLocator, values: string[]): Promise<void>;
34
+ /**
35
+ * Get the value of an `<input>` element.
36
+ *
37
+ * @param locator - Locator pointing to the input element.
38
+ * @returns The current value of the input or `undefined` if not present.
39
+ */
40
+ getInputValue(locator: PartLocator): Promise<Optional<string>>;
41
+ /**
42
+ * Retrieve the values of selected options within a `<select>` element.
43
+ *
44
+ * @param locator - Locator to the `<select>` element.
45
+ * @returns Array of selected option values or `undefined` when no option is selected.
46
+ */
47
+ getSelectValues(locator: PartLocator): Promise<Optional<readonly string[]>>;
48
+ getSelectLabels(locator: PartLocator): Promise<Optional<readonly string[]>>;
49
+ getStyleValue(locator: PartLocator, propertyName: CssProperty): Promise<Optional<string>>;
50
+ enterText(locator: PartLocator, text: string, option?: Optional<Partial<EnterTextOption>>): Promise<void>;
51
+ click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void>;
52
+ hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void>;
53
+ mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void>;
54
+ mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void>;
55
+ mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void>;
56
+ mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void>;
57
+ mouseOut(locator: PartLocator, _option?: Partial<MouseOutOption>): Promise<void>;
58
+ mouseEnter(locator: PartLocator, _option?: Partial<MouseEnterOption>): Promise<void>;
59
+ mouseLeave(locator: PartLocator, _option?: Partial<MouseLeaveOption>): Promise<void>;
60
+ focus(locator: PartLocator, _option: Partial<FocusOption>): Promise<void>;
61
+ wait(ms: number): Promise<void>;
62
+ waitUntilComponentState(locator: PartLocator, option?: Partial<Readonly<WaitForOption>>): Promise<void>;
63
+ waitUntil<T>(option: WaitUntilOption<T>): Promise<T>;
64
+ getAttribute(locator: PartLocator, name: string, isMultiple: true): Promise<readonly string[]>;
65
+ getAttribute(locator: PartLocator, name: string, isMultiple: false): Promise<Optional<string>>;
66
+ getAttribute(locator: PartLocator, name: string): Promise<Optional<string>>;
67
+ getText(locator: PartLocator): Promise<Optional<string>>;
68
+ exists(locator: PartLocator): Promise<boolean>;
69
+ isChecked(locator: PartLocator): Promise<boolean>;
70
+ isDisabled(locator: PartLocator): Promise<boolean>;
71
+ isReadonly(locator: PartLocator): Promise<boolean>;
72
+ isVisible(locator: PartLocator): Promise<boolean>;
73
+ hasCssClass(locator: PartLocator, className: string): Promise<boolean>;
74
+ hasAttribute(locator: PartLocator, name: string): Promise<boolean>;
75
+ innerHTML(locator: PartLocator): Promise<string>;
76
+ clone(): Interactor;
77
+ }
78
+ //#endregion
79
+ //#region src/testRunnerAdapter.d.ts
80
+ /**
81
+ * Navigate the current Playwright page to the provided URL.
82
+ *
83
+ * @param url - Destination URL to load.
84
+ * @param fixture - Optional test fixture supplying the Playwright page.
85
+ */
86
+ declare function goto(url: string): Promise<void>;
87
+ declare function goto(url: string, fixture: E2eTestRunEnvironmentFixture): Promise<void>;
88
+ /**
89
+ * Create a {@link TestEngine} bound to the Playwright page in the given fixture.
90
+ *
91
+ * @param scenePart - Scene definition to drive.
92
+ * @param fixture - Fixture providing the Playwright page.
93
+ */
94
+ declare function playwrightGetTestEngine<T extends ScenePart>(scenePart: T, fixture: E2eTestRunEnvironmentFixture): TestEngine<T>;
95
+ declare const playWrightTestFrameworkMapper: TestFrameworkMapper;
96
+ /**
97
+ * Get a typed interface for running end-to-end tests with Playwright.
98
+ */
99
+ declare function getTestRunnerInterface<T extends ScenePart>(): E2eTestInterface<T>;
100
+ //#endregion
101
+ export { PlaywrightInteractor, createTestEngine, getTestRunnerInterface, goto, playWrightTestFrameworkMapper, playwrightGetTestEngine };
102
+ //# sourceMappingURL=index.d.mts.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,102 @@
1
- export { createTestEngine } from './createTestEngine';
2
- export { PlaywrightInteractor } from './PlaywrightInteractor';
3
- export * from './testRunnerAdapter';
1
+ import { ClickOption, CssProperty, EnterTextOption, FocusOption, HoverOption, Interactor, MouseDownOption, MouseEnterOption, MouseLeaveOption, MouseMoveOption, MouseOutOption, MouseUpOption, Optional, PartLocator, ScenePart, TestEngine, WaitForOption, WaitUntilOption } from "@atomic-testing/core";
2
+ import { Page } from "@playwright/test";
3
+ import { E2eTestInterface, E2eTestRunEnvironmentFixture, TestFrameworkMapper } from "@atomic-testing/test-runner";
4
+
5
+ //#region src/createTestEngine.d.ts
6
+
7
+ /**
8
+ * Create a {@link TestEngine} instance backed by Playwright.
9
+ *
10
+ * @param page - Playwright page used for interaction.
11
+ * @param partDefinitions - Scene part definitions describing the scene
12
+ * structure for the engine.
13
+ * @returns A configured {@link TestEngine} ready for use.
14
+ */
15
+ declare function createTestEngine<T extends ScenePart>(page: Page, partDefinitions: T): TestEngine<T>;
16
+ //#endregion
17
+ //#region src/PlaywrightInteractor.d.ts
18
+ /**
19
+ * Implementation of the {@link Interactor} interface using Playwright.
20
+ */
21
+ declare class PlaywrightInteractor implements Interactor {
22
+ readonly page: Page;
23
+ /**
24
+ * @param page - Playwright page instance used to drive the browser.
25
+ */
26
+ constructor(page: Page);
27
+ /**
28
+ * Select the given option values on a `<select>` element.
29
+ *
30
+ * @param locator - Locator to the `<select>` element.
31
+ * @param values - Values to select.
32
+ */
33
+ selectOptionValue(locator: PartLocator, values: string[]): Promise<void>;
34
+ /**
35
+ * Get the value of an `<input>` element.
36
+ *
37
+ * @param locator - Locator pointing to the input element.
38
+ * @returns The current value of the input or `undefined` if not present.
39
+ */
40
+ getInputValue(locator: PartLocator): Promise<Optional<string>>;
41
+ /**
42
+ * Retrieve the values of selected options within a `<select>` element.
43
+ *
44
+ * @param locator - Locator to the `<select>` element.
45
+ * @returns Array of selected option values or `undefined` when no option is selected.
46
+ */
47
+ getSelectValues(locator: PartLocator): Promise<Optional<readonly string[]>>;
48
+ getSelectLabels(locator: PartLocator): Promise<Optional<readonly string[]>>;
49
+ getStyleValue(locator: PartLocator, propertyName: CssProperty): Promise<Optional<string>>;
50
+ enterText(locator: PartLocator, text: string, option?: Optional<Partial<EnterTextOption>>): Promise<void>;
51
+ click(locator: PartLocator, option?: Partial<ClickOption>): Promise<void>;
52
+ hover(locator: PartLocator, option?: Partial<HoverOption>): Promise<void>;
53
+ mouseMove(locator: PartLocator, option?: Partial<MouseMoveOption>): Promise<void>;
54
+ mouseDown(locator: PartLocator, option?: Partial<MouseDownOption>): Promise<void>;
55
+ mouseUp(locator: PartLocator, option?: Partial<MouseUpOption>): Promise<void>;
56
+ mouseOver(locator: PartLocator, option?: Partial<HoverOption>): Promise<void>;
57
+ mouseOut(locator: PartLocator, _option?: Partial<MouseOutOption>): Promise<void>;
58
+ mouseEnter(locator: PartLocator, _option?: Partial<MouseEnterOption>): Promise<void>;
59
+ mouseLeave(locator: PartLocator, _option?: Partial<MouseLeaveOption>): Promise<void>;
60
+ focus(locator: PartLocator, _option: Partial<FocusOption>): Promise<void>;
61
+ wait(ms: number): Promise<void>;
62
+ waitUntilComponentState(locator: PartLocator, option?: Partial<Readonly<WaitForOption>>): Promise<void>;
63
+ waitUntil<T>(option: WaitUntilOption<T>): Promise<T>;
64
+ getAttribute(locator: PartLocator, name: string, isMultiple: true): Promise<readonly string[]>;
65
+ getAttribute(locator: PartLocator, name: string, isMultiple: false): Promise<Optional<string>>;
66
+ getAttribute(locator: PartLocator, name: string): Promise<Optional<string>>;
67
+ getText(locator: PartLocator): Promise<Optional<string>>;
68
+ exists(locator: PartLocator): Promise<boolean>;
69
+ isChecked(locator: PartLocator): Promise<boolean>;
70
+ isDisabled(locator: PartLocator): Promise<boolean>;
71
+ isReadonly(locator: PartLocator): Promise<boolean>;
72
+ isVisible(locator: PartLocator): Promise<boolean>;
73
+ hasCssClass(locator: PartLocator, className: string): Promise<boolean>;
74
+ hasAttribute(locator: PartLocator, name: string): Promise<boolean>;
75
+ innerHTML(locator: PartLocator): Promise<string>;
76
+ clone(): Interactor;
77
+ }
78
+ //#endregion
79
+ //#region src/testRunnerAdapter.d.ts
80
+ /**
81
+ * Navigate the current Playwright page to the provided URL.
82
+ *
83
+ * @param url - Destination URL to load.
84
+ * @param fixture - Optional test fixture supplying the Playwright page.
85
+ */
86
+ declare function goto(url: string): Promise<void>;
87
+ declare function goto(url: string, fixture: E2eTestRunEnvironmentFixture): Promise<void>;
88
+ /**
89
+ * Create a {@link TestEngine} bound to the Playwright page in the given fixture.
90
+ *
91
+ * @param scenePart - Scene definition to drive.
92
+ * @param fixture - Fixture providing the Playwright page.
93
+ */
94
+ declare function playwrightGetTestEngine<T extends ScenePart>(scenePart: T, fixture: E2eTestRunEnvironmentFixture): TestEngine<T>;
95
+ declare const playWrightTestFrameworkMapper: TestFrameworkMapper;
96
+ /**
97
+ * Get a typed interface for running end-to-end tests with Playwright.
98
+ */
99
+ declare function getTestRunnerInterface<T extends ScenePart>(): E2eTestInterface<T>;
100
+ //#endregion
101
+ export { PlaywrightInteractor, createTestEngine, getTestRunnerInterface, goto, playWrightTestFrameworkMapper, playwrightGetTestEngine };
102
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,23 +1,288 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
15
17
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.PlaywrightInteractor = exports.createTestEngine = void 0;
18
- var createTestEngine_1 = require("./createTestEngine");
19
- Object.defineProperty(exports, "createTestEngine", { enumerable: true, get: function () { return createTestEngine_1.createTestEngine; } });
20
- var PlaywrightInteractor_1 = require("./PlaywrightInteractor");
21
- Object.defineProperty(exports, "PlaywrightInteractor", { enumerable: true, get: function () { return PlaywrightInteractor_1.PlaywrightInteractor; } });
22
- __exportStar(require("./testRunnerAdapter"), exports);
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ const __atomic_testing_core = __toESM(require("@atomic-testing/core"));
25
+ const __playwright_test = __toESM(require("@playwright/test"));
26
+
27
+ //#region src/PlaywrightInteractor.ts
28
+ /**
29
+ * Implementation of the {@link Interactor} interface using Playwright.
30
+ */
31
+ var PlaywrightInteractor = class PlaywrightInteractor {
32
+ /**
33
+ * @param page - Playwright page instance used to drive the browser.
34
+ */
35
+ constructor(page) {
36
+ this.page = page;
37
+ }
38
+ /**
39
+ * Select the given option values on a `<select>` element.
40
+ *
41
+ * @param locator - Locator to the `<select>` element.
42
+ * @param values - Values to select.
43
+ */
44
+ async selectOptionValue(locator, values) {
45
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
46
+ await this.page.locator(cssLocator).selectOption(values);
47
+ }
48
+ /**
49
+ * Get the value of an `<input>` element.
50
+ *
51
+ * @param locator - Locator pointing to the input element.
52
+ * @returns The current value of the input or `undefined` if not present.
53
+ */
54
+ async getInputValue(locator) {
55
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
56
+ return this.page.locator(cssLocator).inputValue();
57
+ }
58
+ /**
59
+ * Retrieve the values of selected options within a `<select>` element.
60
+ *
61
+ * @param locator - Locator to the `<select>` element.
62
+ * @returns Array of selected option values or `undefined` when no option is selected.
63
+ */
64
+ async getSelectValues(locator) {
65
+ const optionLocator = (0, __atomic_testing_core.byCssSelector)("option:checked");
66
+ const selectedOptionLocator = __atomic_testing_core.locatorUtil.append(locator, optionLocator);
67
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(selectedOptionLocator, this);
68
+ const allOptions = await this.page.locator(cssLocator).all();
69
+ const values = [];
70
+ for (const option of allOptions) {
71
+ const value = await option.getAttribute("value");
72
+ if (value != null) values.push(value);
73
+ }
74
+ return values;
75
+ }
76
+ async getSelectLabels(locator) {
77
+ const optionLocator = (0, __atomic_testing_core.byCssSelector)("option:checked");
78
+ const selectedOptionLocator = __atomic_testing_core.locatorUtil.append(locator, optionLocator);
79
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(selectedOptionLocator, this);
80
+ const allOptions = await this.page.locator(cssLocator).all();
81
+ const labels = [];
82
+ for (const option of allOptions) {
83
+ const label = await option.textContent();
84
+ if (label != null) labels.push(label);
85
+ }
86
+ return labels;
87
+ }
88
+ async getStyleValue(locator, propertyName) {
89
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
90
+ const elLocator = this.page.locator(cssLocator);
91
+ const value = await elLocator.evaluate((element, prop) => {
92
+ return window.getComputedStyle(element).getPropertyValue(prop);
93
+ }, propertyName);
94
+ return value;
95
+ }
96
+ async enterText(locator, text, option) {
97
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
98
+ if (!option?.append) await this.page.locator(cssLocator).clear();
99
+ const type = await this.getAttribute(locator, "type") ?? "";
100
+ if (__atomic_testing_core.dateUtil.isHtmlDateInputType(type)) {
101
+ const result = __atomic_testing_core.dateUtil.validateHtmlDateInput(type, text);
102
+ if (!result.valid) throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
103
+ }
104
+ await this.page.locator(cssLocator).fill(text);
105
+ }
106
+ async click(locator, option) {
107
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
108
+ await this.page.locator(cssLocator).click({ position: option?.position });
109
+ }
110
+ async hover(locator, option) {
111
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
112
+ await this.page.locator(cssLocator).hover({ position: option?.position });
113
+ }
114
+ async mouseMove(locator, option) {
115
+ await this.hover(locator, { position: option?.position });
116
+ await this.page.mouse.move(0, 0);
117
+ }
118
+ async mouseDown(locator, option) {
119
+ await this.hover(locator, { position: option?.position });
120
+ await this.page.mouse.down();
121
+ }
122
+ async mouseUp(locator, option) {
123
+ await this.hover(locator, { position: option?.position });
124
+ await this.page.mouse.up();
125
+ }
126
+ async mouseOver(locator, option) {
127
+ return this.hover(locator, option);
128
+ }
129
+ async mouseOut(locator, _option) {
130
+ await this.hover(locator, { position: {
131
+ x: 0,
132
+ y: 0
133
+ } });
134
+ await this.page.mouse.move(-10, -10);
135
+ }
136
+ async mouseEnter(locator, _option) {
137
+ return this.hover(locator);
138
+ }
139
+ async mouseLeave(locator, _option) {
140
+ return this.mouseOut(locator);
141
+ }
142
+ async focus(locator, _option) {
143
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
144
+ return this.page.focus(cssLocator);
145
+ }
146
+ wait(ms) {
147
+ return __atomic_testing_core.timingUtil.wait(ms);
148
+ }
149
+ async waitUntilComponentState(locator, option = __atomic_testing_core.defaultWaitForOption) {
150
+ return __atomic_testing_core.interactorUtil.interactorWaitUtil(locator, this, option);
151
+ }
152
+ waitUntil(option) {
153
+ return __atomic_testing_core.timingUtil.waitUntil(option);
154
+ }
155
+ async getAttribute(locator, name, isMultiple) {
156
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
157
+ const elLocator = this.page.locator(cssLocator);
158
+ if (isMultiple) {
159
+ const locators = await elLocator.all();
160
+ const values = [];
161
+ for (const locator$1 of locators) {
162
+ const value$1 = await locator$1.getAttribute(name);
163
+ if (value$1 != null) values.push(value$1);
164
+ }
165
+ return values;
166
+ }
167
+ const value = await elLocator.getAttribute(name);
168
+ return value ?? void 0;
169
+ }
170
+ async getText(locator) {
171
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
172
+ const text = await this.page.locator(cssLocator).textContent();
173
+ return text ?? void 0;
174
+ }
175
+ async exists(locator) {
176
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
177
+ const count = await this.page.locator(cssLocator).count();
178
+ return count > 0;
179
+ }
180
+ async isChecked(locator) {
181
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
182
+ const checked = await this.page.locator(cssLocator).isChecked();
183
+ return checked;
184
+ }
185
+ async isDisabled(locator) {
186
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
187
+ const isDisabled = await this.page.locator(cssLocator).isDisabled();
188
+ return isDisabled;
189
+ }
190
+ async isReadonly(locator) {
191
+ const readonly = await this.getAttribute(locator, "readonly");
192
+ return readonly != null;
193
+ }
194
+ async isVisible(locator) {
195
+ const exists = await this.exists(locator);
196
+ if (!exists) return false;
197
+ async function checkCssVisibility(prop, invisibleValue, interactor) {
198
+ try {
199
+ const value = await interactor.getStyleValue(locator, prop);
200
+ return value !== invisibleValue;
201
+ } catch (e) {
202
+ if (await interactor.exists(locator) === false) return false;
203
+ throw e;
204
+ }
205
+ }
206
+ if (await checkCssVisibility("opacity", "0", this) === false) return false;
207
+ if (await checkCssVisibility("visibility", "hidden", this) === false) return false;
208
+ if (await checkCssVisibility("display", "none", this) === false) return false;
209
+ return true;
210
+ }
211
+ async hasCssClass(locator, className) {
212
+ const classNames = await this.getAttribute(locator, "class");
213
+ if (classNames == null) return false;
214
+ const names = classNames.split(/\s+/);
215
+ return names.includes(className);
216
+ }
217
+ async hasAttribute(locator, name) {
218
+ const attrValue = await this.getAttribute(locator, name);
219
+ return attrValue != null;
220
+ }
221
+ async innerHTML(locator) {
222
+ const cssLocator = await __atomic_testing_core.locatorUtil.toCssSelector(locator, this);
223
+ return this.page.locator(cssLocator).innerHTML();
224
+ }
225
+ clone() {
226
+ return new PlaywrightInteractor(this.page);
227
+ }
228
+ };
229
+
230
+ //#endregion
231
+ //#region src/createTestEngine.ts
232
+ /**
233
+ * Create a {@link TestEngine} instance backed by Playwright.
234
+ *
235
+ * @param page - Playwright page used for interaction.
236
+ * @param partDefinitions - Scene part definitions describing the scene
237
+ * structure for the engine.
238
+ * @returns A configured {@link TestEngine} ready for use.
239
+ */
240
+ function createTestEngine(page, partDefinitions) {
241
+ const engine = new __atomic_testing_core.TestEngine([], new PlaywrightInteractor(page), { parts: partDefinitions });
242
+ return engine;
243
+ }
244
+
245
+ //#endregion
246
+ //#region src/testRunnerAdapter.ts
247
+ async function goto(url, fixture) {
248
+ const page = fixture.page;
249
+ await page.goto(url);
250
+ }
251
+ /**
252
+ * Create a {@link TestEngine} bound to the Playwright page in the given fixture.
253
+ *
254
+ * @param scenePart - Scene definition to drive.
255
+ * @param fixture - Fixture providing the Playwright page.
256
+ */
257
+ function playwrightGetTestEngine(scenePart, fixture) {
258
+ const page = fixture.page;
259
+ return createTestEngine(page, scenePart);
260
+ }
261
+ const playWrightTestFrameworkMapper = {
262
+ assertEqual: (a, b) => (0, __playwright_test.expect)(a).toEqual(b),
263
+ describe: __playwright_test.test.describe,
264
+ beforeEach: __playwright_test.test.beforeEach,
265
+ afterEach: __playwright_test.test.afterEach,
266
+ beforeAll: __playwright_test.test.beforeAll,
267
+ afterAll: __playwright_test.test.afterAll,
268
+ test: __playwright_test.test,
269
+ it: __playwright_test.test
270
+ };
271
+ /**
272
+ * Get a typed interface for running end-to-end tests with Playwright.
273
+ */
274
+ function getTestRunnerInterface() {
275
+ return {
276
+ getTestEngine: playwrightGetTestEngine,
277
+ goto
278
+ };
279
+ }
280
+
281
+ //#endregion
282
+ exports.PlaywrightInteractor = PlaywrightInteractor;
283
+ exports.createTestEngine = createTestEngine;
284
+ exports.getTestRunnerInterface = getTestRunnerInterface;
285
+ exports.goto = goto;
286
+ exports.playWrightTestFrameworkMapper = playWrightTestFrameworkMapper;
287
+ exports.playwrightGetTestEngine = playwrightGetTestEngine;
23
288
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,sDAAoC"}
1
+ {"version":3,"file":"index.js","names":["page: Page","locator: PartLocator","values: string[]","optionLocator: PartLocator","labels: string[]","propertyName: CssProperty","text: string","option?: Optional<Partial<EnterTextOption>>","option?: Partial<ClickOption>","option?: Partial<HoverOption>","option?: Partial<MouseMoveOption>","option?: Partial<MouseDownOption>","option?: Partial<MouseUpOption>","_option?: Partial<MouseOutOption>","_option?: Partial<MouseEnterOption>","_option?: Partial<MouseLeaveOption>","_option: Partial<FocusOption>","ms: number","option: Partial<Readonly<WaitForOption>>","defaultWaitForOption","option: WaitUntilOption<T>","name: string","isMultiple?: boolean","locator","value","prop: CssProperty","invisibleValue: string","interactor: PlaywrightInteractor","className: string","page: Page","partDefinitions: T","TestEngine","url: string","fixture?: E2eTestRunEnvironmentFixture","scenePart: T","fixture: E2eTestRunEnvironmentFixture","playWrightTestFrameworkMapper: TestFrameworkMapper","test"],"sources":["../src/PlaywrightInteractor.ts","../src/createTestEngine.ts","../src/testRunnerAdapter.ts"],"sourcesContent":["import {\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 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 await this.hover(locator, {\n position: {\n x: 0,\n y: 0,\n },\n });\n await this.page.mouse.move(-10, -10);\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 return this.mouseOut(locator);\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 //#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>(\n page: Page,\n partDefinitions: T,\n): 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/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\nexport const playWrightTestFrameworkMapper: TestFrameworkMapper = {\n assertEqual: (a, b) => expect(a).toEqual(b),\n // @ts-expect-error - expect type is not compatible with the type of the test framework\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 - expect type is not compatible with the type of the test framework\n test: test,\n\n // @ts-expect-error - expect type is not compatible with the type of the test framework\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,uBAAb,MAAa,qBAA2C;;;;CAItD,YAA4BA,MAAY;EAAZ;CAAc;;;;;;;CAQ1C,MAAM,kBAAkBC,SAAsBC,QAAiC;EAC7E,MAAM,aAAa,MAAM,kCAAY,cAAc,SAAS,KAAK;AACjE,QAAM,KAAK,KAAK,QAAQ,WAAW,CAAC,aAAa,OAAO;CACzD;;;;;;;CAQD,MAAM,cAAcD,SAAiD;EACnE,MAAM,aAAa,MAAM,kCAAY,cAAc,SAAS,KAAK;AACjE,SAAO,KAAK,KAAK,QAAQ,WAAW,CAAC,YAAY;CAClD;;;;;;;CAQD,MAAM,gBAAgBA,SAA4D;EAChF,MAAME,gBAA6B,yCAAc,iBAAiB;EAClE,MAAM,wBAAwB,kCAAY,OAAO,SAAS,cAAc;EACxE,MAAM,aAAa,MAAM,kCAAY,cAAc,uBAAuB,KAAK;EAC/E,MAAM,aAAa,MAAM,KAAK,KAAK,QAAQ,WAAW,CAAC,KAAK;EAC5D,MAAMD,SAAmB,CAAE;AAC3B,OAAK,MAAM,UAAU,YAAY;GAC/B,MAAM,QAAQ,MAAM,OAAO,aAAa,QAAQ;AAChD,OAAI,SAAS,KACX,QAAO,KAAK,MAAM;EAErB;AACD,SAAO;CACR;CAED,MAAM,gBAAgBD,SAA4D;EAChF,MAAME,gBAA6B,yCAAc,iBAAiB;EAClE,MAAM,wBAAwB,kCAAY,OAAO,SAAS,cAAc;EACxE,MAAM,aAAa,MAAM,kCAAY,cAAc,uBAAuB,KAAK;EAC/E,MAAM,aAAa,MAAM,KAAK,KAAK,QAAQ,WAAW,CAAC,KAAK;EAC5D,MAAMC,SAAmB,CAAE;AAC3B,OAAK,MAAM,UAAU,YAAY;GAC/B,M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