@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.
- package/dist/index.d.mts +102 -0
- package/dist/index.d.ts +102 -3
- package/dist/index.js +286 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +260 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +7 -6
- package/src/PlaywrightInteractor.ts +27 -1
- package/src/createTestEngine.ts +12 -1
- package/src/testRunnerAdapter.ts +21 -2
- package/dist/PlaywrightInteractor.d.ts +0 -39
- package/dist/PlaywrightInteractor.js +0 -287
- package/dist/PlaywrightInteractor.js.map +0 -1
- package/dist/createTestEngine.d.ts +0 -3
- package/dist/createTestEngine.js +0 -12
- package/dist/createTestEngine.js.map +0 -1
- package/dist/testRunnerAdapter.d.ts +0 -7
- package/dist/testRunnerAdapter.js +0 -47
- package/dist/testRunnerAdapter.js.map +0 -1
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PlaywrightInteractor = void 0;
|
|
13
|
-
const core_1 = require("@atomic-testing/core");
|
|
14
|
-
class PlaywrightInteractor {
|
|
15
|
-
constructor(page) {
|
|
16
|
-
this.page = page;
|
|
17
|
-
}
|
|
18
|
-
selectOptionValue(locator, values) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
21
|
-
yield this.page.locator(cssLocator).selectOption(values);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
getInputValue(locator) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
27
|
-
return this.page.locator(cssLocator).inputValue();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
getSelectValues(locator) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const optionLocator = (0, core_1.byCssSelector)('option:checked');
|
|
33
|
-
const selectedOptionLocator = core_1.locatorUtil.append(locator, optionLocator);
|
|
34
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(selectedOptionLocator, this);
|
|
35
|
-
const allOptions = yield this.page.locator(cssLocator).all();
|
|
36
|
-
const values = [];
|
|
37
|
-
for (const option of allOptions) {
|
|
38
|
-
const value = yield option.getAttribute('value');
|
|
39
|
-
if (value != null) {
|
|
40
|
-
values.push(value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return values;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
getSelectLabels(locator) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const optionLocator = (0, core_1.byCssSelector)('option:checked');
|
|
49
|
-
const selectedOptionLocator = core_1.locatorUtil.append(locator, optionLocator);
|
|
50
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(selectedOptionLocator, this);
|
|
51
|
-
const allOptions = yield this.page.locator(cssLocator).all();
|
|
52
|
-
const labels = [];
|
|
53
|
-
for (const option of allOptions) {
|
|
54
|
-
const label = yield option.textContent();
|
|
55
|
-
if (label != null) {
|
|
56
|
-
labels.push(label);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return labels;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
getStyleValue(locator, propertyName) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
65
|
-
const elLocator = this.page.locator(cssLocator);
|
|
66
|
-
const value = yield elLocator.evaluate((element, prop) => {
|
|
67
|
-
return window.getComputedStyle(element).getPropertyValue(prop);
|
|
68
|
-
}, propertyName);
|
|
69
|
-
return value;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
enterText(locator, text, option) {
|
|
73
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
var _a;
|
|
75
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
76
|
-
if (!(option === null || option === void 0 ? void 0 : option.append)) {
|
|
77
|
-
yield this.page.locator(cssLocator).clear();
|
|
78
|
-
}
|
|
79
|
-
// If it is a date, time or datetime-local input, validate the date format
|
|
80
|
-
const type = (_a = (yield this.getAttribute(locator, 'type'))) !== null && _a !== void 0 ? _a : '';
|
|
81
|
-
if (core_1.dateUtil.isHtmlDateInputType(type)) {
|
|
82
|
-
const result = core_1.dateUtil.validateHtmlDateInput(type, text);
|
|
83
|
-
if (!result.valid) {
|
|
84
|
-
throw new Error(`Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
yield this.page.locator(cssLocator).fill(text);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
click(locator, option) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
93
|
-
yield this.page.locator(cssLocator).click({ position: option === null || option === void 0 ? void 0 : option.position });
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
hover(locator, option) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
99
|
-
yield this.page.locator(cssLocator).hover({ position: option === null || option === void 0 ? void 0 : option.position });
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
mouseMove(locator, option) {
|
|
103
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
yield this.hover(locator, {
|
|
105
|
-
position: option === null || option === void 0 ? void 0 : option.position,
|
|
106
|
-
});
|
|
107
|
-
yield this.page.mouse.move(0, 0);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
mouseDown(locator, option) {
|
|
111
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
yield this.hover(locator, {
|
|
113
|
-
position: option === null || option === void 0 ? void 0 : option.position,
|
|
114
|
-
});
|
|
115
|
-
yield this.page.mouse.down();
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
mouseUp(locator, option) {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
yield this.hover(locator, {
|
|
121
|
-
position: option === null || option === void 0 ? void 0 : option.position,
|
|
122
|
-
});
|
|
123
|
-
yield this.page.mouse.up();
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
mouseOver(locator, option) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
return this.hover(locator, option);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
mouseOut(locator, _option) {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
yield this.hover(locator, {
|
|
134
|
-
position: {
|
|
135
|
-
x: 0,
|
|
136
|
-
y: 0,
|
|
137
|
-
},
|
|
138
|
-
});
|
|
139
|
-
yield this.page.mouse.move(-10, -10);
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
mouseEnter(locator, _option) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
return this.hover(locator);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
mouseLeave(locator, _option) {
|
|
148
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
return this.mouseOut(locator);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
focus(locator, _option) {
|
|
153
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
155
|
-
return this.page.focus(cssLocator);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
//#region wait conditions
|
|
159
|
-
wait(ms) {
|
|
160
|
-
return core_1.timingUtil.wait(ms);
|
|
161
|
-
}
|
|
162
|
-
waitUntilComponentState(locator_1) {
|
|
163
|
-
return __awaiter(this, arguments, void 0, function* (locator, option = core_1.defaultWaitForOption) {
|
|
164
|
-
return core_1.interactorUtil.interactorWaitUtil(locator, this, option);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
waitUntil(option) {
|
|
168
|
-
return core_1.timingUtil.waitUntil(option);
|
|
169
|
-
}
|
|
170
|
-
getAttribute(locator, name, isMultiple) {
|
|
171
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
173
|
-
const elLocator = this.page.locator(cssLocator);
|
|
174
|
-
if (isMultiple) {
|
|
175
|
-
const locators = yield elLocator.all();
|
|
176
|
-
const values = [];
|
|
177
|
-
for (const locator of locators) {
|
|
178
|
-
const value = yield locator.getAttribute(name);
|
|
179
|
-
if (value != null) {
|
|
180
|
-
values.push(value);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return values;
|
|
184
|
-
}
|
|
185
|
-
const value = yield elLocator.getAttribute(name);
|
|
186
|
-
return value !== null && value !== void 0 ? value : undefined;
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
getText(locator) {
|
|
190
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
192
|
-
const text = yield this.page.locator(cssLocator).textContent();
|
|
193
|
-
return text !== null && text !== void 0 ? text : undefined;
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
exists(locator) {
|
|
197
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
199
|
-
const count = yield this.page.locator(cssLocator).count();
|
|
200
|
-
return count > 0;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
isChecked(locator) {
|
|
204
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
206
|
-
const checked = yield this.page.locator(cssLocator).isChecked();
|
|
207
|
-
return checked;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
isDisabled(locator) {
|
|
211
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
213
|
-
const isDisabled = yield this.page.locator(cssLocator).isDisabled();
|
|
214
|
-
return isDisabled;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
isReadonly(locator) {
|
|
218
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
-
const readonly = yield this.getAttribute(locator, 'readonly');
|
|
220
|
-
return readonly != null;
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
isVisible(locator) {
|
|
224
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
const exists = yield this.exists(locator);
|
|
226
|
-
if (!exists) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
function checkCssVisibility(prop, invisibleValue, interactor) {
|
|
230
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
try {
|
|
232
|
-
const value = yield interactor.getStyleValue(locator, prop);
|
|
233
|
-
return value !== invisibleValue;
|
|
234
|
-
}
|
|
235
|
-
catch (e) {
|
|
236
|
-
// Element may disappear or detached while being checked because of animation
|
|
237
|
-
// when it happens, an error is thrown. In this case, if indeed the element
|
|
238
|
-
// is not visible, we return false. Otherwise, we re-throw the error.
|
|
239
|
-
if ((yield interactor.exists(locator)) === false) {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
throw e;
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
if ((yield checkCssVisibility('opacity', '0', this)) === false) {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
if ((yield checkCssVisibility('visibility', 'hidden', this)) === false) {
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
if ((yield checkCssVisibility('display', 'none', this)) === false) {
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
return true;
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
hasCssClass(locator, className) {
|
|
259
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
const classNames = yield this.getAttribute(locator, 'class');
|
|
261
|
-
if (classNames == null) {
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
const names = classNames.split(/\s+/);
|
|
265
|
-
return names.includes(className);
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
hasAttribute(locator, name) {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
const attrValue = yield this.getAttribute(locator, name);
|
|
271
|
-
return attrValue != null;
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
//#region
|
|
275
|
-
innerHTML(locator) {
|
|
276
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
277
|
-
const cssLocator = yield core_1.locatorUtil.toCssSelector(locator, this);
|
|
278
|
-
return this.page.locator(cssLocator).innerHTML();
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
//#endregion
|
|
282
|
-
clone() {
|
|
283
|
-
return new PlaywrightInteractor(this.page);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
exports.PlaywrightInteractor = PlaywrightInteractor;
|
|
287
|
-
//# sourceMappingURL=PlaywrightInteractor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightInteractor.js","sourceRoot":"","sources":["../src/PlaywrightInteractor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAoB8B;AAI9B,MAAa,oBAAoB;IAC/B,YAA4B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAEpC,iBAAiB,CAAC,OAAoB,EAAE,MAAgB;;YAC5D,MAAM,UAAU,GAAG,MAAM,kBAAW,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAClE,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC3D,CAAC;KAAA;IAEK,aAAa,CAAC,OAAoB;;YACtC,MAAM,UAAU,GAAG,MAAM,kBAAW,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,UAAU,EAAE,CAAC;QACpD,CAAC;KAAA;IAEK,eAAe,CAAC,OAAoB;;YACxC,MAAM,aAAa,GAAgB,IAAA,oBAAa,EAAC,gBAAgB,CAAC,CAAC;YACnE,MAAM,qBAAqB,GAAG,kBAAW,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACzE,MAAM,UAAU,GAAG,MAAM,kBAAW,CAAC,aAAa,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;YAChF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC;YAC7D,MAAM,MAAM,GAAa,EAAE,CAAC;YAC5B,KAAK,MAAM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GAAG,MAAM,kBAAW,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC;QACnD,CAAC;KAAA;IACD,YAAY;IAEZ,KAAK;QACH,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AAzQD,oDAyQC"}
|
package/dist/createTestEngine.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTestEngine = createTestEngine;
|
|
4
|
-
const core_1 = require("@atomic-testing/core");
|
|
5
|
-
const PlaywrightInteractor_1 = require("./PlaywrightInteractor");
|
|
6
|
-
function createTestEngine(page, partDefinitions) {
|
|
7
|
-
const engine = new core_1.TestEngine([], new PlaywrightInteractor_1.PlaywrightInteractor(page), {
|
|
8
|
-
parts: partDefinitions,
|
|
9
|
-
});
|
|
10
|
-
return engine;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=createTestEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTestEngine.js","sourceRoot":"","sources":["../src/createTestEngine.ts"],"names":[],"mappings":";;AAKA,4CAMC;AAXD,+CAA6D;AAG7D,iEAA8D;AAE9D,SAAgB,gBAAgB,CAAsB,IAAU,EAAE,eAAkB;IAClF,MAAM,MAAM,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAE,IAAI,2CAAoB,CAAC,IAAI,CAAC,EAAE;QAChE,KAAK,EAAE,eAAe;KACvB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ScenePart, TestEngine } from '@atomic-testing/core';
|
|
2
|
-
import { E2eTestInterface, E2eTestRunEnvironmentFixture, TestFrameworkMapper } from '@atomic-testing/test-runner';
|
|
3
|
-
export declare function goto(url: string): Promise<void>;
|
|
4
|
-
export declare function goto(url: string, fixture: E2eTestRunEnvironmentFixture): Promise<void>;
|
|
5
|
-
export declare function playwrightGetTestEngine<T extends ScenePart>(scenePart: T, fixture: E2eTestRunEnvironmentFixture): TestEngine<T>;
|
|
6
|
-
export declare const playWrightTestFrameworkMapper: TestFrameworkMapper;
|
|
7
|
-
export declare function getTestRunnerInterface<T extends ScenePart>(): E2eTestInterface<T>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.playWrightTestFrameworkMapper = void 0;
|
|
13
|
-
exports.goto = goto;
|
|
14
|
-
exports.playwrightGetTestEngine = playwrightGetTestEngine;
|
|
15
|
-
exports.getTestRunnerInterface = getTestRunnerInterface;
|
|
16
|
-
const test_1 = require("@playwright/test");
|
|
17
|
-
const createTestEngine_1 = require("./createTestEngine");
|
|
18
|
-
function goto(url, fixture) {
|
|
19
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
const page = fixture.page;
|
|
21
|
-
yield page.goto(url);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function playwrightGetTestEngine(scenePart, fixture) {
|
|
25
|
-
const page = fixture.page;
|
|
26
|
-
return (0, createTestEngine_1.createTestEngine)(page, scenePart);
|
|
27
|
-
}
|
|
28
|
-
exports.playWrightTestFrameworkMapper = {
|
|
29
|
-
assertEqual: (a, b) => (0, test_1.expect)(a).toEqual(b),
|
|
30
|
-
// @ts-expect-error - expect type is not compatible with the type of the test framework
|
|
31
|
-
describe: test_1.test.describe,
|
|
32
|
-
beforeEach: test_1.test.beforeEach,
|
|
33
|
-
afterEach: test_1.test.afterEach,
|
|
34
|
-
beforeAll: test_1.test.beforeAll,
|
|
35
|
-
afterAll: test_1.test.afterAll,
|
|
36
|
-
// @ts-expect-error - expect type is not compatible with the type of the test framework
|
|
37
|
-
test: test_1.test,
|
|
38
|
-
// @ts-expect-error - expect type is not compatible with the type of the test framework
|
|
39
|
-
it: test_1.test,
|
|
40
|
-
};
|
|
41
|
-
function getTestRunnerInterface() {
|
|
42
|
-
return {
|
|
43
|
-
getTestEngine: playwrightGetTestEngine,
|
|
44
|
-
goto,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=testRunnerAdapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testRunnerAdapter.js","sourceRoot":"","sources":["../src/testRunnerAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,oBAGC;AAED,0DAMC;AAmBD,wDAKC;AAzCD,2CAAsD;AAEtD,yDAAsD;AAItD,SAAsB,IAAI,CAAC,GAAW,EAAE,OAAsC;;QAC5E,MAAM,IAAI,GAAG,OAAQ,CAAC,IAAY,CAAC;QACnC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;CAAA;AAED,SAAgB,uBAAuB,CACrC,SAAY,EACZ,OAAqC;IAErC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAY,CAAC;IAClC,OAAO,IAAA,mCAAgB,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC3C,CAAC;AAEY,QAAA,6BAA6B,GAAwB;IAChE,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAA,aAAM,EAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,uFAAuF;IACvF,QAAQ,EAAE,WAAI,CAAC,QAAQ;IAEvB,UAAU,EAAE,WAAI,CAAC,UAAU;IAC3B,SAAS,EAAE,WAAI,CAAC,SAAS;IACzB,SAAS,EAAE,WAAI,CAAC,SAAS;IACzB,QAAQ,EAAE,WAAI,CAAC,QAAQ;IAEvB,uFAAuF;IACvF,IAAI,EAAE,WAAI;IAEV,uFAAuF;IACvF,EAAE,EAAE,WAAI;CACT,CAAC;AAEF,SAAgB,sBAAsB;IACpC,OAAO;QACL,aAAa,EAAE,uBAAuB;QACtC,IAAI;KACL,CAAC;AACJ,CAAC"}
|