@skbkontur/playwright-react-ui-components 1.18.0 → 1.19.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/build/src/assertions/ComponentListAssertions.d.ts +6 -1
- package/build/src/assertions/ComponentListAssertions.js +60 -0
- package/build/src/assertions/FileUploaderAssertions.d.ts +2 -4
- package/build/src/assertions/PagingAssertions.d.ts +2 -2
- package/build/src/assertions/TabsAssertions.d.ts +5 -3
- package/build/src/assertions/TabsAssertions.js +36 -0
- package/build/src/assertions/TokenInputAssertions.d.ts +5 -4
- package/build/src/assertions/TokenInputAssertions.js +36 -0
- package/build/src/components/Autocomplete.js +3 -3
- package/build/src/components/BaseComponent.js +3 -3
- package/build/src/components/Button.d.ts +2 -1
- package/build/src/components/Button.js +35 -1
- package/build/src/components/Checkbox.js +1 -1
- package/build/src/components/ComboBox.d.ts +7 -3
- package/build/src/components/ComboBox.js +21 -19
- package/build/src/components/ComponentList.d.ts +5 -2
- package/build/src/components/ComponentList.js +38 -32
- package/build/src/components/CurrencyInput.js +5 -5
- package/build/src/components/DateInput.js +4 -4
- package/build/src/components/DatePicker.js +5 -5
- package/build/src/components/Dropdown.d.ts +9 -3
- package/build/src/components/Dropdown.js +22 -32
- package/build/src/components/DropdownMenu.d.ts +12 -3
- package/build/src/components/DropdownMenu.js +24 -34
- package/build/src/components/FileUploader.js +6 -19
- package/build/src/components/FxInput.js +4 -4
- package/build/src/components/Input.js +3 -3
- package/build/src/components/Kebab.d.ts +12 -4
- package/build/src/components/Kebab.js +16 -16
- package/build/src/components/Link.js +1 -1
- package/build/src/components/MenuComponent.d.ts +3 -1
- package/build/src/components/Paging.d.ts +4 -4
- package/build/src/components/Paging.js +22 -24
- package/build/src/components/Portal.d.ts +3 -1
- package/build/src/components/Portal.js +5 -5
- package/build/src/components/Radio.js +1 -1
- package/build/src/components/RadioGroup.d.ts +6 -5
- package/build/src/components/RadioGroup.js +12 -36
- package/build/src/components/Select.d.ts +9 -3
- package/build/src/components/Select.js +21 -21
- package/build/src/components/Tab.js +1 -1
- package/build/src/components/Tabs.d.ts +3 -3
- package/build/src/components/Tabs.js +3 -38
- package/build/src/components/Textarea.js +3 -3
- package/build/src/components/Toggle.js +1 -1
- package/build/src/components/Token.d.ts +1 -1
- package/build/src/components/Token.js +2 -2
- package/build/src/components/TokenInput.d.ts +5 -3
- package/build/src/components/TokenInput.js +27 -39
- package/build/src/components/Tooltip.d.ts +3 -1
- package/build/src/components/Tooltip.js +3 -3
- package/build/src/matchers/component/toBeCheckedByIndex.js +9 -10
- package/build/src/matchers/component/toBeCheckedByText.js +9 -10
- package/build/src/matchers/component/toBeUncheckedByIndex.js +9 -10
- package/build/src/matchers/component/toBeUncheckedByText.js +3 -4
- package/build/src/matchers/component/toContainFormattedText.js +2 -3
- package/build/src/matchers/component/toContainItem.d.ts +1 -2
- package/build/src/matchers/component/toContainItem.js +30 -32
- package/build/src/matchers/component/toContainTab.d.ts +3 -0
- package/build/src/matchers/component/toContainTab.js +59 -0
- package/build/src/matchers/component/toContainTabs.d.ts +1 -1
- package/build/src/matchers/component/toContainTabs.js +2 -20
- package/build/src/matchers/component/toContainToken.d.ts +3 -0
- package/build/src/matchers/component/toContainToken.js +59 -0
- package/build/src/matchers/component/toContainTokens.d.ts +2 -2
- package/build/src/matchers/component/toContainTokens.js +2 -20
- package/build/src/matchers/component/toContainUploadedFiles.d.ts +2 -3
- package/build/src/matchers/component/toContainUploadedFiles.js +2 -15
- package/build/src/matchers/component/toHaveActivePage.d.ts +2 -2
- package/build/src/matchers/component/toHaveActivePage.js +5 -21
- package/build/src/matchers/component/toHaveActiveTab.js +9 -10
- package/build/src/matchers/component/toHaveFormattedText.js +2 -3
- package/build/src/matchers/component/toHaveFormattedValue.js +2 -3
- package/build/src/matchers/component/toHaveItemsByPredicate.d.ts +3 -0
- package/build/src/matchers/component/toHaveItemsByPredicate.js +64 -0
- package/build/src/matchers/component/toHaveTabs.d.ts +3 -0
- package/build/src/matchers/component/toHaveTabs.js +62 -0
- package/build/src/matchers/component/toHaveTokens.d.ts +3 -0
- package/build/src/matchers/component/toHaveTokens.js +62 -0
- package/build/src/matchers/componentMatchers.d.ts +14 -8
- package/build/src/matchers/componentMatchers.js +10 -0
- package/build/src/options/LocatorOptions.d.ts +39 -0
- package/package.json +1 -1
|
@@ -105,15 +105,15 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
105
105
|
if (options === void 0) { options = { closedAfterSelect: true }; }
|
|
106
106
|
return __generator(this, function (_c) {
|
|
107
107
|
switch (_c.label) {
|
|
108
|
-
case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
|
|
108
|
+
case 0: return [4 /*yield*/, this.getMenuItemsLocator(text, options)];
|
|
109
109
|
case 1:
|
|
110
110
|
items = _c.sent();
|
|
111
|
-
return [4 /*yield*/, items.first().click()];
|
|
111
|
+
return [4 /*yield*/, items.first().click(options)];
|
|
112
112
|
case 2:
|
|
113
113
|
_c.sent();
|
|
114
114
|
if (!options.closedAfterSelect) return [3 /*break*/, 4];
|
|
115
115
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
116
|
-
return [4 /*yield*/, this.portal.expect().toBeHidden()];
|
|
116
|
+
return [4 /*yield*/, this.portal.expect().toBeHidden(options)];
|
|
117
117
|
case 3:
|
|
118
118
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
119
119
|
_c.sent();
|
|
@@ -129,7 +129,7 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
129
129
|
if (options === void 0) { options = { closedAfterSelect: true }; }
|
|
130
130
|
return __generator(this, function (_c) {
|
|
131
131
|
switch (_c.label) {
|
|
132
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
132
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
133
133
|
case 1:
|
|
134
134
|
container = _c.sent();
|
|
135
135
|
item = container.locator((0, dataTidSelector_1.getDataTidSelector)(dataTid));
|
|
@@ -138,12 +138,12 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
138
138
|
if ((_c.sent()) > 1) {
|
|
139
139
|
throw Error('DataTid должен быть уникальным');
|
|
140
140
|
}
|
|
141
|
-
return [4 /*yield*/, item.click()];
|
|
141
|
+
return [4 /*yield*/, item.click(options)];
|
|
142
142
|
case 3:
|
|
143
143
|
_c.sent();
|
|
144
144
|
if (!options.closedAfterSelect) return [3 /*break*/, 5];
|
|
145
145
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
146
|
-
return [4 /*yield*/, this.portal.expect().toBeHidden()];
|
|
146
|
+
return [4 /*yield*/, this.portal.expect().toBeHidden(options)];
|
|
147
147
|
case 4:
|
|
148
148
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
149
149
|
_c.sent();
|
|
@@ -159,15 +159,15 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
159
159
|
if (options === void 0) { options = { closedAfterSelect: true }; }
|
|
160
160
|
return __generator(this, function (_c) {
|
|
161
161
|
switch (_c.label) {
|
|
162
|
-
case 0: return [4 /*yield*/, this.getMenuItemsLocator()];
|
|
162
|
+
case 0: return [4 /*yield*/, this.getMenuItemsLocator(undefined, options)];
|
|
163
163
|
case 1:
|
|
164
164
|
items = _c.sent();
|
|
165
|
-
return [4 /*yield*/, items.nth(index).click()];
|
|
165
|
+
return [4 /*yield*/, items.nth(index).click(options)];
|
|
166
166
|
case 2:
|
|
167
167
|
_c.sent();
|
|
168
168
|
if (!options.closedAfterSelect) return [3 /*break*/, 4];
|
|
169
169
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
170
|
-
return [4 /*yield*/, this.portal.expect().toBeHidden()];
|
|
170
|
+
return [4 /*yield*/, this.portal.expect().toBeHidden(options)];
|
|
171
171
|
case 3:
|
|
172
172
|
// note: ожидание закрытия меню, чтобы не было гонок
|
|
173
173
|
_c.sent();
|
|
@@ -198,15 +198,17 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
198
198
|
* - MenuHeaderDataTids.root
|
|
199
199
|
* - MenuFooterDataTids.root
|
|
200
200
|
*/
|
|
201
|
-
DropdownMenu.prototype.getMenuItems = function () {
|
|
201
|
+
DropdownMenu.prototype.getMenuItems = function (options) {
|
|
202
202
|
return __awaiter(this, void 0, void 0, function () {
|
|
203
203
|
var container;
|
|
204
204
|
return __generator(this, function (_c) {
|
|
205
205
|
switch (_c.label) {
|
|
206
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
206
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
207
207
|
case 1:
|
|
208
208
|
container = _c.sent();
|
|
209
|
-
return [4 /*yield*/, container
|
|
209
|
+
return [4 /*yield*/, container
|
|
210
|
+
.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SpinnerDataTids.root))
|
|
211
|
+
.waitFor({ state: 'hidden', timeout: options === null || options === void 0 ? void 0 : options.timeout })];
|
|
210
212
|
case 2:
|
|
211
213
|
_c.sent();
|
|
212
214
|
return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) {
|
|
@@ -219,37 +221,25 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
219
221
|
});
|
|
220
222
|
});
|
|
221
223
|
};
|
|
222
|
-
DropdownMenu.prototype.getMenuItemByText = function (text) {
|
|
224
|
+
DropdownMenu.prototype.getMenuItemByText = function (text, options) {
|
|
223
225
|
return __awaiter(this, void 0, void 0, function () {
|
|
224
226
|
var items;
|
|
225
|
-
var _this = this;
|
|
226
227
|
return __generator(this, function (_c) {
|
|
227
228
|
switch (_c.label) {
|
|
228
|
-
case 0: return [4 /*yield*/, this.getMenuItems()];
|
|
229
|
+
case 0: return [4 /*yield*/, this.getMenuItems(options)];
|
|
229
230
|
case 1:
|
|
230
231
|
items = _c.sent();
|
|
231
|
-
return [
|
|
232
|
-
var itemText;
|
|
233
|
-
return __generator(this, function (_c) {
|
|
234
|
-
switch (_c.label) {
|
|
235
|
-
case 0: return [4 /*yield*/, item.getText()];
|
|
236
|
-
case 1:
|
|
237
|
-
itemText = _c.sent();
|
|
238
|
-
return [2 /*return*/, itemText.toLowerCase() === text.toLowerCase()];
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}); })];
|
|
242
|
-
case 2: return [2 /*return*/, _c.sent()];
|
|
232
|
+
return [2 /*return*/, items.filter({ hasText: text }).getFirstItem()];
|
|
243
233
|
}
|
|
244
234
|
});
|
|
245
235
|
});
|
|
246
236
|
};
|
|
247
|
-
DropdownMenu.prototype.getMenuItemByIndex = function (index) {
|
|
237
|
+
DropdownMenu.prototype.getMenuItemByIndex = function (index, options) {
|
|
248
238
|
return __awaiter(this, void 0, void 0, function () {
|
|
249
239
|
var items;
|
|
250
240
|
return __generator(this, function (_c) {
|
|
251
241
|
switch (_c.label) {
|
|
252
|
-
case 0: return [4 /*yield*/, this.getMenuItems()];
|
|
242
|
+
case 0: return [4 /*yield*/, this.getMenuItems(options)];
|
|
253
243
|
case 1:
|
|
254
244
|
items = _c.sent();
|
|
255
245
|
return [2 /*return*/, items.getItemByIndex(index)];
|
|
@@ -260,12 +250,12 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
260
250
|
DropdownMenu.prototype.expect = function () {
|
|
261
251
|
return new assertions_1.DropdownMenuAssertions(this);
|
|
262
252
|
};
|
|
263
|
-
DropdownMenu.prototype.getMenuItemsLocator = function (byText) {
|
|
253
|
+
DropdownMenu.prototype.getMenuItemsLocator = function (byText, options) {
|
|
264
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
265
255
|
var container, items;
|
|
266
256
|
return __generator(this, function (_c) {
|
|
267
257
|
switch (_c.label) {
|
|
268
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
258
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
269
259
|
case 1:
|
|
270
260
|
container = _c.sent();
|
|
271
261
|
items = container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root));
|
|
@@ -274,18 +264,18 @@ var DropdownMenu = /** @class */ (function (_super) {
|
|
|
274
264
|
});
|
|
275
265
|
});
|
|
276
266
|
};
|
|
277
|
-
DropdownMenu.prototype.getPortalContainer = function () {
|
|
267
|
+
DropdownMenu.prototype.getPortalContainer = function (options) {
|
|
278
268
|
return __awaiter(this, void 0, void 0, function () {
|
|
279
269
|
return __generator(this, function (_c) {
|
|
280
270
|
switch (_c.label) {
|
|
281
271
|
case 0: return [4 /*yield*/, this.isMenuOpened()];
|
|
282
272
|
case 1:
|
|
283
273
|
if (!!(_c.sent())) return [3 /*break*/, 3];
|
|
284
|
-
return [4 /*yield*/, this.captionLocator.click()];
|
|
274
|
+
return [4 /*yield*/, this.captionLocator.click(options)];
|
|
285
275
|
case 2:
|
|
286
276
|
_c.sent();
|
|
287
277
|
_c.label = 3;
|
|
288
|
-
case 3: return [2 /*return*/, this.portal.getContainer()];
|
|
278
|
+
case 3: return [2 /*return*/, this.portal.getContainer(options)];
|
|
289
279
|
}
|
|
290
280
|
});
|
|
291
281
|
});
|
|
@@ -119,24 +119,12 @@ var FileUploader = /** @class */ (function (_super) {
|
|
|
119
119
|
FileUploader.prototype.removeFileByName = function (name, options) {
|
|
120
120
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
121
|
var file;
|
|
122
|
-
var _this = this;
|
|
123
122
|
return __generator(this, function (_b) {
|
|
124
123
|
switch (_b.label) {
|
|
125
|
-
case 0:
|
|
126
|
-
|
|
127
|
-
return __generator(this, function (_b) {
|
|
128
|
-
switch (_b.label) {
|
|
129
|
-
case 0: return [4 /*yield*/, file.name.getText()];
|
|
130
|
-
case 1:
|
|
131
|
-
fileName = _b.sent();
|
|
132
|
-
return [2 /*return*/, fileName.toLowerCase() === name.toLowerCase()];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}); })];
|
|
136
|
-
case 1:
|
|
137
|
-
file = _b.sent();
|
|
124
|
+
case 0:
|
|
125
|
+
file = this.files.filter({ hasText: name }).getFirstItem();
|
|
138
126
|
return [4 /*yield*/, file.remove(options)];
|
|
139
|
-
case
|
|
127
|
+
case 1:
|
|
140
128
|
_b.sent();
|
|
141
129
|
return [2 /*return*/];
|
|
142
130
|
}
|
|
@@ -148,11 +136,10 @@ var FileUploader = /** @class */ (function (_super) {
|
|
|
148
136
|
var file;
|
|
149
137
|
return __generator(this, function (_b) {
|
|
150
138
|
switch (_b.label) {
|
|
151
|
-
case 0:
|
|
152
|
-
|
|
153
|
-
file = _b.sent();
|
|
139
|
+
case 0:
|
|
140
|
+
file = this.files.getItemByIndex(index);
|
|
154
141
|
return [4 /*yield*/, file.remove(options)];
|
|
155
|
-
case
|
|
142
|
+
case 1:
|
|
156
143
|
_b.sent();
|
|
157
144
|
return [2 /*return*/];
|
|
158
145
|
}
|
|
@@ -94,10 +94,10 @@ var FxInput = /** @class */ (function (_super) {
|
|
|
94
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
95
95
|
return __generator(this, function (_d) {
|
|
96
96
|
switch (_d.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, this.focus()];
|
|
97
|
+
case 0: return [4 /*yield*/, this.focus(options)];
|
|
98
98
|
case 1:
|
|
99
99
|
_d.sent();
|
|
100
|
-
return [4 /*yield*/, this.clear()];
|
|
100
|
+
return [4 /*yield*/, this.clear(options)];
|
|
101
101
|
case 2:
|
|
102
102
|
_d.sent();
|
|
103
103
|
return [4 /*yield*/, this.inputLocator.fill(value, options)];
|
|
@@ -148,7 +148,7 @@ var FxInput = /** @class */ (function (_super) {
|
|
|
148
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
149
|
return __generator(this, function (_d) {
|
|
150
150
|
switch (_d.label) {
|
|
151
|
-
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
151
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled(options)];
|
|
152
152
|
case 1:
|
|
153
153
|
_d.sent();
|
|
154
154
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
@@ -190,7 +190,7 @@ var FxInput = /** @class */ (function (_super) {
|
|
|
190
190
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
191
|
return __generator(this, function (_d) {
|
|
192
192
|
switch (_d.label) {
|
|
193
|
-
case 0: return [4 /*yield*/, this.waitFor()];
|
|
193
|
+
case 0: return [4 /*yield*/, this.waitFor(options)];
|
|
194
194
|
case 1:
|
|
195
195
|
_d.sent();
|
|
196
196
|
return [4 /*yield*/, this.autoButtonLocator.isVisible(options)];
|
|
@@ -94,10 +94,10 @@ var Input = /** @class */ (function (_super) {
|
|
|
94
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
95
95
|
return __generator(this, function (_d) {
|
|
96
96
|
switch (_d.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, this.focus()];
|
|
97
|
+
case 0: return [4 /*yield*/, this.focus(options)];
|
|
98
98
|
case 1:
|
|
99
99
|
_d.sent();
|
|
100
|
-
return [4 /*yield*/, this.clear()];
|
|
100
|
+
return [4 /*yield*/, this.clear(options)];
|
|
101
101
|
case 2:
|
|
102
102
|
_d.sent();
|
|
103
103
|
return [4 /*yield*/, this.inputLocator.fill(value, options)];
|
|
@@ -148,7 +148,7 @@ var Input = /** @class */ (function (_super) {
|
|
|
148
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
149
|
return __generator(this, function (_d) {
|
|
150
150
|
switch (_d.label) {
|
|
151
|
-
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
151
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled(options)];
|
|
152
152
|
case 1:
|
|
153
153
|
_d.sent();
|
|
154
154
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
@@ -21,12 +21,20 @@ export declare class Kebab extends MenuComponent {
|
|
|
21
21
|
* Возвращает список меню по data-tid'ам из react-ui:
|
|
22
22
|
* - MenuItemDataTids.root
|
|
23
23
|
*/
|
|
24
|
-
getMenuItems(
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
getMenuItems(options?: {
|
|
25
|
+
timeout?: number;
|
|
26
|
+
}): Promise<ComponentList<MenuItem>>;
|
|
27
|
+
getMenuItemByText(text: string, options?: {
|
|
28
|
+
timeout?: number;
|
|
29
|
+
}): Promise<MenuItem>;
|
|
30
|
+
getMenuItemByIndex(index: number, options?: {
|
|
31
|
+
timeout?: number;
|
|
32
|
+
}): Promise<MenuItem>;
|
|
27
33
|
expect(): KebabAssertions;
|
|
28
34
|
private getMenuItemsLocator;
|
|
29
|
-
getPortalContainer(
|
|
35
|
+
getPortalContainer(options?: {
|
|
36
|
+
timeout?: number;
|
|
37
|
+
}): Promise<Locator>;
|
|
30
38
|
}
|
|
31
39
|
/**
|
|
32
40
|
* @deprecated createXXXControl feature for migration from '@skbkontur/react-ui-playwright-controls'
|
|
@@ -91,7 +91,7 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
91
91
|
var item;
|
|
92
92
|
return __generator(this, function (_c) {
|
|
93
93
|
switch (_c.label) {
|
|
94
|
-
case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
|
|
94
|
+
case 0: return [4 /*yield*/, this.getMenuItemsLocator(text, options)];
|
|
95
95
|
case 1:
|
|
96
96
|
item = _c.sent();
|
|
97
97
|
return [4 /*yield*/, item.first().click(options)];
|
|
@@ -107,7 +107,7 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
107
107
|
var items;
|
|
108
108
|
return __generator(this, function (_c) {
|
|
109
109
|
switch (_c.label) {
|
|
110
|
-
case 0: return [4 /*yield*/, this.getMenuItemsLocator()];
|
|
110
|
+
case 0: return [4 /*yield*/, this.getMenuItemsLocator(undefined, options)];
|
|
111
111
|
case 1:
|
|
112
112
|
items = _c.sent();
|
|
113
113
|
return [4 /*yield*/, items.nth(index).click(options)];
|
|
@@ -123,7 +123,7 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
123
123
|
var container, item;
|
|
124
124
|
return __generator(this, function (_c) {
|
|
125
125
|
switch (_c.label) {
|
|
126
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
126
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
127
127
|
case 1:
|
|
128
128
|
container = _c.sent();
|
|
129
129
|
item = container.locator((0, dataTidSelector_1.getDataTidSelector)(dataTid));
|
|
@@ -144,7 +144,7 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
144
144
|
return __awaiter(this, void 0, void 0, function () {
|
|
145
145
|
return __generator(this, function (_c) {
|
|
146
146
|
switch (_c.label) {
|
|
147
|
-
case 0: return [4 /*yield*/, this.expect().toBeEnabled()];
|
|
147
|
+
case 0: return [4 /*yield*/, this.expect().toBeEnabled(options)];
|
|
148
148
|
case 1:
|
|
149
149
|
_c.sent();
|
|
150
150
|
return [4 /*yield*/, this.captionLocator.click(options)];
|
|
@@ -159,12 +159,12 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
159
159
|
* Возвращает список меню по data-tid'ам из react-ui:
|
|
160
160
|
* - MenuItemDataTids.root
|
|
161
161
|
*/
|
|
162
|
-
Kebab.prototype.getMenuItems = function () {
|
|
162
|
+
Kebab.prototype.getMenuItems = function (options) {
|
|
163
163
|
return __awaiter(this, void 0, void 0, function () {
|
|
164
164
|
var container;
|
|
165
165
|
return __generator(this, function (_c) {
|
|
166
166
|
switch (_c.label) {
|
|
167
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
167
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
168
168
|
case 1:
|
|
169
169
|
container = _c.sent();
|
|
170
170
|
return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) { return locator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root)); }, function (locator) { return new MenuItem_1.MenuItem(locator); })];
|
|
@@ -172,20 +172,20 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
172
172
|
});
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
|
-
Kebab.prototype.getMenuItemByText = function (text) {
|
|
175
|
+
Kebab.prototype.getMenuItemByText = function (text, options) {
|
|
176
176
|
return __awaiter(this, void 0, void 0, function () {
|
|
177
177
|
var items;
|
|
178
178
|
var _this = this;
|
|
179
179
|
return __generator(this, function (_c) {
|
|
180
180
|
switch (_c.label) {
|
|
181
|
-
case 0: return [4 /*yield*/, this.getMenuItems()];
|
|
181
|
+
case 0: return [4 /*yield*/, this.getMenuItems(options)];
|
|
182
182
|
case 1:
|
|
183
183
|
items = _c.sent();
|
|
184
184
|
return [4 /*yield*/, items.getFirstItemByPredicate(function (item) { return __awaiter(_this, void 0, void 0, function () {
|
|
185
185
|
var itemText;
|
|
186
186
|
return __generator(this, function (_c) {
|
|
187
187
|
switch (_c.label) {
|
|
188
|
-
case 0: return [4 /*yield*/, item.getText()];
|
|
188
|
+
case 0: return [4 /*yield*/, item.getText(options)];
|
|
189
189
|
case 1:
|
|
190
190
|
itemText = _c.sent();
|
|
191
191
|
return [2 /*return*/, itemText.toLowerCase() === text.toLowerCase()];
|
|
@@ -197,12 +197,12 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
|
-
Kebab.prototype.getMenuItemByIndex = function (index) {
|
|
200
|
+
Kebab.prototype.getMenuItemByIndex = function (index, options) {
|
|
201
201
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
202
|
var items;
|
|
203
203
|
return __generator(this, function (_c) {
|
|
204
204
|
switch (_c.label) {
|
|
205
|
-
case 0: return [4 /*yield*/, this.getMenuItems()];
|
|
205
|
+
case 0: return [4 /*yield*/, this.getMenuItems(options)];
|
|
206
206
|
case 1:
|
|
207
207
|
items = _c.sent();
|
|
208
208
|
return [2 /*return*/, items.getItemByIndex(index)];
|
|
@@ -213,12 +213,12 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
213
213
|
Kebab.prototype.expect = function () {
|
|
214
214
|
return new assertions_1.KebabAssertions(this);
|
|
215
215
|
};
|
|
216
|
-
Kebab.prototype.getMenuItemsLocator = function (byText) {
|
|
216
|
+
Kebab.prototype.getMenuItemsLocator = function (byText, options) {
|
|
217
217
|
return __awaiter(this, void 0, void 0, function () {
|
|
218
218
|
var container, items;
|
|
219
219
|
return __generator(this, function (_c) {
|
|
220
220
|
switch (_c.label) {
|
|
221
|
-
case 0: return [4 /*yield*/, this.getPortalContainer()];
|
|
221
|
+
case 0: return [4 /*yield*/, this.getPortalContainer(options)];
|
|
222
222
|
case 1:
|
|
223
223
|
container = _c.sent();
|
|
224
224
|
items = container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root));
|
|
@@ -227,18 +227,18 @@ var Kebab = /** @class */ (function (_super) {
|
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
229
|
};
|
|
230
|
-
Kebab.prototype.getPortalContainer = function () {
|
|
230
|
+
Kebab.prototype.getPortalContainer = function (options) {
|
|
231
231
|
return __awaiter(this, void 0, void 0, function () {
|
|
232
232
|
return __generator(this, function (_c) {
|
|
233
233
|
switch (_c.label) {
|
|
234
234
|
case 0: return [4 /*yield*/, this.isMenuOpened()];
|
|
235
235
|
case 1:
|
|
236
236
|
if (!!(_c.sent())) return [3 /*break*/, 3];
|
|
237
|
-
return [4 /*yield*/, this.click()];
|
|
237
|
+
return [4 /*yield*/, this.click(options)];
|
|
238
238
|
case 2:
|
|
239
239
|
_c.sent();
|
|
240
240
|
_c.label = 3;
|
|
241
|
-
case 3: return [2 /*return*/, this.portal.getContainer()];
|
|
241
|
+
case 3: return [2 /*return*/, this.portal.getContainer(options)];
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
});
|
|
@@ -90,7 +90,7 @@ var Link = /** @class */ (function (_super) {
|
|
|
90
90
|
return __awaiter(this, void 0, void 0, function () {
|
|
91
91
|
return __generator(this, function (_d) {
|
|
92
92
|
switch (_d.label) {
|
|
93
|
-
case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).not.toHaveAttribute(utils_1.DataVisualState.Disabled)];
|
|
93
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).not.toHaveAttribute(utils_1.DataVisualState.Disabled, options)];
|
|
94
94
|
case 1:
|
|
95
95
|
_d.sent();
|
|
96
96
|
return [4 /*yield*/, this.rootLocator.focus(options)];
|
|
@@ -5,6 +5,8 @@ import type { MenuItem } from './MenuItem';
|
|
|
5
5
|
export declare abstract class MenuComponent extends BaseComponent {
|
|
6
6
|
readonly [toItemsElementLocator]: () => Promise<import("playwright-core").Locator>;
|
|
7
7
|
readonly [toContainItemElementLocator]: () => import("playwright-core").Locator;
|
|
8
|
-
abstract getMenuItems(
|
|
8
|
+
abstract getMenuItems(options?: {
|
|
9
|
+
timeout?: number;
|
|
10
|
+
}): Promise<ComponentList<MenuItem>>;
|
|
9
11
|
getItemsLocator(): Promise<import("playwright-core").Locator>;
|
|
10
12
|
}
|
|
@@ -3,7 +3,7 @@ import { BaseComponent } from './BaseComponent';
|
|
|
3
3
|
import { Label } from './Label';
|
|
4
4
|
import { ComponentList } from './ComponentList';
|
|
5
5
|
import { PagingAssertions } from '../assertions';
|
|
6
|
-
import type { GetAttributeOptions } from '../options';
|
|
6
|
+
import type { ClickOptions, GetAttributeOptions } from '../options';
|
|
7
7
|
import { toControlElementLocator } from '../matchers/component/LocatorSymbols';
|
|
8
8
|
export declare class Paging extends BaseComponent {
|
|
9
9
|
private readonly nextPage;
|
|
@@ -12,10 +12,10 @@ export declare class Paging extends BaseComponent {
|
|
|
12
12
|
constructor(rootLocator: Locator);
|
|
13
13
|
isDisabled(options?: GetAttributeOptions): Promise<boolean>;
|
|
14
14
|
getPagesCount(): Promise<number>;
|
|
15
|
-
goToPage(pageNumber: number): Promise<void>;
|
|
16
|
-
goToLastPage(): Promise<void>;
|
|
15
|
+
goToPage(pageNumber: number, options?: ClickOptions): Promise<void>;
|
|
16
|
+
goToLastPage(options?: ClickOptions): Promise<void>;
|
|
17
17
|
getActivePageNumber(): Promise<number>;
|
|
18
|
-
goToNextPage(): Promise<void>;
|
|
18
|
+
goToNextPage(options?: ClickOptions): Promise<void>;
|
|
19
19
|
expect(): PagingAssertions;
|
|
20
20
|
private checkPageConstraint;
|
|
21
21
|
}
|
|
@@ -86,23 +86,22 @@ var Paging = /** @class */ (function (_super) {
|
|
|
86
86
|
var lastPage, _b;
|
|
87
87
|
return __generator(this, function (_c) {
|
|
88
88
|
switch (_c.label) {
|
|
89
|
-
case 0:
|
|
89
|
+
case 0:
|
|
90
|
+
lastPage = this.pages.getLastItem();
|
|
91
|
+
_c.label = 1;
|
|
90
92
|
case 1:
|
|
91
|
-
|
|
92
|
-
_c.label = 2;
|
|
93
|
-
case 2:
|
|
94
|
-
_c.trys.push([2, 4, , 5]);
|
|
93
|
+
_c.trys.push([1, 3, , 4]);
|
|
95
94
|
return [4 /*yield*/, lastPage.getNumber()];
|
|
96
|
-
case
|
|
97
|
-
case
|
|
95
|
+
case 2: return [2 /*return*/, _c.sent()];
|
|
96
|
+
case 3:
|
|
98
97
|
_b = _c.sent();
|
|
99
98
|
throw new Error('Не удалось получить количество страниц');
|
|
100
|
-
case
|
|
99
|
+
case 4: return [2 /*return*/];
|
|
101
100
|
}
|
|
102
101
|
});
|
|
103
102
|
});
|
|
104
103
|
};
|
|
105
|
-
Paging.prototype.goToPage = function (pageNumber) {
|
|
104
|
+
Paging.prototype.goToPage = function (pageNumber, options) {
|
|
106
105
|
return __awaiter(this, void 0, void 0, function () {
|
|
107
106
|
var page, _b;
|
|
108
107
|
var _this = this;
|
|
@@ -122,7 +121,7 @@ var Paging = /** @class */ (function (_super) {
|
|
|
122
121
|
}); }); })];
|
|
123
122
|
case 3:
|
|
124
123
|
page = _c.sent();
|
|
125
|
-
return [4 /*yield*/, page.click()];
|
|
124
|
+
return [4 /*yield*/, page.click(options)];
|
|
126
125
|
case 4:
|
|
127
126
|
_c.sent();
|
|
128
127
|
return [3 /*break*/, 6];
|
|
@@ -134,31 +133,30 @@ var Paging = /** @class */ (function (_super) {
|
|
|
134
133
|
});
|
|
135
134
|
});
|
|
136
135
|
};
|
|
137
|
-
Paging.prototype.goToLastPage = function () {
|
|
136
|
+
Paging.prototype.goToLastPage = function (options) {
|
|
138
137
|
return __awaiter(this, void 0, void 0, function () {
|
|
139
138
|
var lastPage, lastPageNumber, _b;
|
|
140
139
|
return __generator(this, function (_c) {
|
|
141
140
|
switch (_c.label) {
|
|
142
|
-
case 0:
|
|
141
|
+
case 0:
|
|
142
|
+
lastPage = this.pages.getLastItem();
|
|
143
|
+
_c.label = 1;
|
|
143
144
|
case 1:
|
|
144
|
-
|
|
145
|
-
_c.label = 2;
|
|
146
|
-
case 2:
|
|
147
|
-
_c.trys.push([2, 6, , 7]);
|
|
145
|
+
_c.trys.push([1, 5, , 6]);
|
|
148
146
|
return [4 /*yield*/, lastPage.getNumber()];
|
|
149
|
-
case
|
|
147
|
+
case 2:
|
|
150
148
|
lastPageNumber = _c.sent();
|
|
151
149
|
return [4 /*yield*/, this.checkPageConstraint(lastPageNumber)];
|
|
150
|
+
case 3:
|
|
151
|
+
_c.sent();
|
|
152
|
+
return [4 /*yield*/, lastPage.click(options)];
|
|
152
153
|
case 4:
|
|
153
154
|
_c.sent();
|
|
154
|
-
return [
|
|
155
|
+
return [3 /*break*/, 6];
|
|
155
156
|
case 5:
|
|
156
|
-
_c.sent();
|
|
157
|
-
return [3 /*break*/, 7];
|
|
158
|
-
case 6:
|
|
159
157
|
_b = _c.sent();
|
|
160
158
|
throw new Error('Не удалось получить номер последней страницы');
|
|
161
|
-
case
|
|
159
|
+
case 6: return [2 /*return*/];
|
|
162
160
|
}
|
|
163
161
|
});
|
|
164
162
|
});
|
|
@@ -183,7 +181,7 @@ var Paging = /** @class */ (function (_super) {
|
|
|
183
181
|
});
|
|
184
182
|
});
|
|
185
183
|
};
|
|
186
|
-
Paging.prototype.goToNextPage = function () {
|
|
184
|
+
Paging.prototype.goToNextPage = function (options) {
|
|
187
185
|
return __awaiter(this, void 0, void 0, function () {
|
|
188
186
|
return __generator(this, function (_b) {
|
|
189
187
|
switch (_b.label) {
|
|
@@ -192,7 +190,7 @@ var Paging = /** @class */ (function (_super) {
|
|
|
192
190
|
if (_b.sent()) {
|
|
193
191
|
throw new Error('Нельзя перейти на следующую страницу. Текущая страница последняя');
|
|
194
192
|
}
|
|
195
|
-
return [4 /*yield*/, this.nextPage.click()];
|
|
193
|
+
return [4 /*yield*/, this.nextPage.click(options)];
|
|
196
194
|
case 2:
|
|
197
195
|
_b.sent();
|
|
198
196
|
return [2 /*return*/];
|
|
@@ -7,7 +7,9 @@ export declare class Portal extends BaseComponent {
|
|
|
7
7
|
readonly [toVisibleElementLocator]: () => Locator;
|
|
8
8
|
constructor(rootLocator: Locator);
|
|
9
9
|
isVisible(): Promise<boolean>;
|
|
10
|
-
getContainer(
|
|
10
|
+
getContainer(options?: {
|
|
11
|
+
timeout?: number;
|
|
12
|
+
}): Promise<Locator>;
|
|
11
13
|
private getContainerId;
|
|
12
14
|
expect(): PortalAssertions;
|
|
13
15
|
}
|
|
@@ -76,12 +76,12 @@ var Portal = /** @class */ (function (_super) {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
Portal.prototype.getContainer = function () {
|
|
79
|
+
Portal.prototype.getContainer = function (options) {
|
|
80
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
81
|
var containerId;
|
|
82
82
|
return __generator(this, function (_b) {
|
|
83
83
|
switch (_b.label) {
|
|
84
|
-
case 0: return [4 /*yield*/, this.getContainerId()];
|
|
84
|
+
case 0: return [4 /*yield*/, this.getContainerId(options)];
|
|
85
85
|
case 1:
|
|
86
86
|
containerId = _b.sent();
|
|
87
87
|
return [2 /*return*/, this.page.locator("[data-rendered-container-id='".concat(containerId, "']"))];
|
|
@@ -89,15 +89,15 @@ var Portal = /** @class */ (function (_super) {
|
|
|
89
89
|
});
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
-
Portal.prototype.getContainerId = function () {
|
|
92
|
+
Portal.prototype.getContainerId = function (options) {
|
|
93
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
94
|
var containerId;
|
|
95
95
|
return __generator(this, function (_b) {
|
|
96
96
|
switch (_b.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).toHaveCount(1)];
|
|
97
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).toHaveCount(1, options)];
|
|
98
98
|
case 1:
|
|
99
99
|
_b.sent();
|
|
100
|
-
return [4 /*yield*/, this.getAttribute('data-render-container-id')];
|
|
100
|
+
return [4 /*yield*/, this.getAttribute('data-render-container-id', options)];
|
|
101
101
|
case 2:
|
|
102
102
|
containerId = _b.sent();
|
|
103
103
|
if (containerId == null) {
|
|
@@ -126,7 +126,7 @@ var Radio = /** @class */ (function (_super) {
|
|
|
126
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
127
127
|
return __generator(this, function (_f) {
|
|
128
128
|
switch (_f.label) {
|
|
129
|
-
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
129
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled(options)];
|
|
130
130
|
case 1:
|
|
131
131
|
_f.sent();
|
|
132
132
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
@@ -4,6 +4,7 @@ import { BaseComponent } from './BaseComponent';
|
|
|
4
4
|
import { Radio } from './Radio';
|
|
5
5
|
import { type TooltipType } from '../utils';
|
|
6
6
|
import { toControlElementLocator } from '../matchers/component/LocatorSymbols';
|
|
7
|
+
import type { CheckOptions } from '../options';
|
|
7
8
|
export declare class RadioGroup extends BaseComponent {
|
|
8
9
|
readonly rootLocator: Locator;
|
|
9
10
|
private readonly list;
|
|
@@ -11,13 +12,13 @@ export declare class RadioGroup extends BaseComponent {
|
|
|
11
12
|
constructor(rootLocator: Locator);
|
|
12
13
|
getItems(): Promise<Radio[]>;
|
|
13
14
|
isDisabled(): Promise<boolean>;
|
|
14
|
-
checkByValue(value: string | RegExp): Promise<void>;
|
|
15
|
-
checkByIndex(index: number): Promise<void>;
|
|
16
|
-
checkByText(text: string | RegExp): Promise<void>;
|
|
15
|
+
checkByValue(value: string | RegExp, options?: CheckOptions): Promise<void>;
|
|
16
|
+
checkByIndex(index: number, options?: CheckOptions): Promise<void>;
|
|
17
|
+
checkByText(text: string | RegExp, options?: CheckOptions): Promise<void>;
|
|
17
18
|
getCheckedRadio(): Promise<Radio>;
|
|
18
19
|
getByValue(value: string | RegExp): Promise<Radio>;
|
|
19
|
-
getByIndex(index: number):
|
|
20
|
-
getByText(text: string | RegExp):
|
|
20
|
+
getByIndex(index: number): Radio;
|
|
21
|
+
getByText(text: string | RegExp): Radio;
|
|
21
22
|
getTooltip(type: TooltipType): Promise<import("./Tooltip").Tooltip>;
|
|
22
23
|
expect(): RadioGroupAssertions;
|
|
23
24
|
}
|