@skbkontur/playwright-react-ui-components 1.13.2 → 1.14.0-beta.1
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/AutocompleteAssertions.js +10 -10
- package/build/src/assertions/BaseComponentAssertions.js +11 -11
- package/build/src/assertions/ButtonAssertions.js +9 -9
- package/build/src/assertions/CheckboxAssertions.js +13 -13
- package/build/src/assertions/ComboBoxAssertions.js +17 -111
- package/build/src/assertions/ComponentListAssertions.js +6 -6
- package/build/src/assertions/CurrencyInputAssertions.js +11 -61
- package/build/src/assertions/DateInputAssertions.js +9 -9
- package/build/src/assertions/DatePickerAssertions.js +9 -9
- package/build/src/assertions/DateRangePickerAssertions.js +4 -25
- package/build/src/assertions/DropdownAssertions.js +13 -63
- package/build/src/assertions/DropdownMenuAssertions.js +11 -61
- package/build/src/assertions/FileUploaderAssertions.d.ts +1 -3
- package/build/src/assertions/FileUploaderAssertions.js +5 -22
- package/build/src/assertions/FxInputAssertions.js +11 -14
- package/build/src/assertions/InputAssertions.js +10 -10
- package/build/src/assertions/KebabAssertions.js +7 -58
- package/build/src/assertions/LabelAssertions.js +7 -7
- package/build/src/assertions/LinkAssertions.js +11 -12
- package/build/src/assertions/LoaderAssertions.js +2 -2
- package/build/src/assertions/MenuItemAssertations.js +5 -5
- package/build/src/assertions/PagingAssertions.js +5 -40
- package/build/src/assertions/PortalAssertions.js +3 -3
- package/build/src/assertions/RadioAssertions.js +13 -13
- package/build/src/assertions/RadioGroupAssertions.js +10 -81
- package/build/src/assertions/SelectAssertions.js +15 -64
- package/build/src/assertions/SpinnerAssertions.js +2 -2
- package/build/src/assertions/TabAssertions.js +11 -12
- package/build/src/assertions/TabsAssertions.js +4 -32
- package/build/src/assertions/TextareaAssertions.js +9 -9
- package/build/src/assertions/ToastAssertions.js +2 -2
- package/build/src/assertions/ToggleAssertions.js +11 -11
- package/build/src/assertions/TokenAssertions.js +8 -14
- package/build/src/assertions/TokenInputAssertions.js +8 -28
- package/build/src/assertions/TooltipAssertions.js +5 -5
- package/build/src/components/Autocomplete.d.ts +4 -0
- package/build/src/components/Autocomplete.js +52 -50
- package/build/src/components/BaseComponent.d.ts +4 -0
- package/build/src/components/BaseComponent.js +37 -30
- package/build/src/components/Button.d.ts +4 -0
- package/build/src/components/Button.js +25 -19
- package/build/src/components/Checkbox.d.ts +6 -0
- package/build/src/components/Checkbox.js +28 -36
- package/build/src/components/ComboBox.d.ts +9 -2
- package/build/src/components/ComboBox.js +68 -54
- package/build/src/components/ComponentList.d.ts +6 -3
- package/build/src/components/ComponentList.js +39 -50
- package/build/src/components/CurrencyInput.d.ts +4 -0
- package/build/src/components/CurrencyInput.js +39 -37
- package/build/src/components/DateInput.d.ts +4 -0
- package/build/src/components/DateInput.js +34 -32
- package/build/src/components/DatePicker.d.ts +4 -0
- package/build/src/components/DatePicker.js +35 -33
- package/build/src/components/DateRangePicker.d.ts +2 -0
- package/build/src/components/DateRangePicker.js +14 -10
- package/build/src/components/Dropdown.d.ts +8 -2
- package/build/src/components/Dropdown.js +69 -65
- package/build/src/components/DropdownMenu.d.ts +7 -2
- package/build/src/components/DropdownMenu.js +68 -65
- package/build/src/components/FileUploader.d.ts +3 -1
- package/build/src/components/FileUploader.js +39 -39
- package/build/src/components/FxInput.d.ts +4 -0
- package/build/src/components/FxInput.js +44 -42
- package/build/src/components/Input.d.ts +4 -0
- package/build/src/components/Input.js +37 -35
- package/build/src/components/Kebab.d.ts +6 -2
- package/build/src/components/Kebab.js +50 -48
- package/build/src/components/Label.d.ts +2 -0
- package/build/src/components/Label.js +9 -13
- package/build/src/components/Link.d.ts +4 -0
- package/build/src/components/Link.js +19 -25
- package/build/src/components/Loader.d.ts +2 -0
- package/build/src/components/Loader.js +15 -10
- package/build/src/components/MenuComponent.d.ts +9 -0
- package/build/src/components/MenuComponent.js +78 -0
- package/build/src/components/MenuItem.d.ts +2 -0
- package/build/src/components/MenuItem.js +7 -3
- package/build/src/components/Paging.d.ts +2 -0
- package/build/src/components/Paging.js +59 -52
- package/build/src/components/Portal.d.ts +2 -0
- package/build/src/components/Portal.js +14 -10
- package/build/src/components/Radio.d.ts +6 -0
- package/build/src/components/Radio.js +31 -27
- package/build/src/components/RadioGroup.d.ts +2 -0
- package/build/src/components/RadioGroup.js +51 -47
- package/build/src/components/Select.d.ts +5 -0
- package/build/src/components/Select.js +92 -76
- package/build/src/components/Spinner.d.ts +2 -0
- package/build/src/components/Spinner.js +13 -9
- package/build/src/components/Tab.d.ts +4 -0
- package/build/src/components/Tab.js +17 -27
- package/build/src/components/Textarea.d.ts +4 -0
- package/build/src/components/Textarea.js +33 -39
- package/build/src/components/Toast.d.ts +2 -0
- package/build/src/components/Toast.js +7 -3
- package/build/src/components/Toggle.d.ts +5 -0
- package/build/src/components/Toggle.js +24 -33
- package/build/src/components/Token.d.ts +3 -0
- package/build/src/components/Token.js +14 -9
- package/build/src/components/TokenInput.d.ts +4 -0
- package/build/src/components/TokenInput.js +61 -59
- package/build/src/components/Tooltip.d.ts +2 -0
- package/build/src/components/Tooltip.js +9 -9
- package/build/src/components/index.d.ts +1 -0
- package/build/src/components/index.js +3 -1
- package/build/src/extensions/index.d.ts +1 -0
- package/build/src/extensions/index.js +17 -0
- package/build/src/extensions/mergedExpects.d.ts +5 -0
- package/build/src/extensions/mergedExpects.js +7 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +2 -0
- package/build/src/matchers/component/LocatorSymbols.d.ts +43 -0
- package/build/src/matchers/component/LocatorSymbols.js +13 -0
- package/build/src/matchers/component/toBeActiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeActiveEx.js +56 -0
- package/build/src/matchers/component/toBeAutoEx.d.ts +3 -0
- package/build/src/matchers/component/toBeAutoEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedEx.js +56 -0
- package/build/src/matchers/component/toBeDisabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeDisabledEx.js +172 -0
- package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEmptyEx.js +137 -0
- package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEnabledEx.js +206 -0
- package/build/src/matchers/component/toBeFocusedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeFocusedEx.js +56 -0
- package/build/src/matchers/component/toBeHiddenEx.d.ts +3 -0
- package/build/src/matchers/component/toBeHiddenEx.js +68 -0
- package/build/src/matchers/component/toBeInactiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeInactiveEx.js +56 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedEx.js +56 -0
- package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
- package/build/src/matchers/component/toBeVisibleEx.js +68 -0
- package/build/src/matchers/component/toContainFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainFormattedTextEx.js +55 -0
- package/build/src/matchers/component/toContainItemEx.d.ts +4 -0
- package/build/src/matchers/component/toContainItemEx.js +79 -0
- package/build/src/matchers/component/toContainItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainItemsEx.js +63 -0
- package/build/src/matchers/component/toContainTabsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTabsEx.js +80 -0
- package/build/src/matchers/component/toContainTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTextEx.js +56 -0
- package/build/src/matchers/component/toContainTokensEx.d.ts +4 -0
- package/build/src/matchers/component/toContainTokensEx.js +80 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.d.ts +4 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.js +75 -0
- package/build/src/matchers/component/toContainValueEx.d.ts +3 -0
- package/build/src/matchers/component/toContainValueEx.js +55 -0
- package/build/src/matchers/component/toHaveActivePageEx.d.ts +4 -0
- package/build/src/matchers/component/toHaveActivePageEx.js +78 -0
- package/build/src/matchers/component/toHaveActiveTabEx.d.ts +2 -0
- package/build/src/matchers/component/toHaveActiveTabEx.js +62 -0
- package/build/src/matchers/component/toHaveAttributeEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveAttributeEx.js +62 -0
- package/build/src/matchers/component/toHaveCountEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveCountEx.js +56 -0
- package/build/src/matchers/component/toHaveErrorEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveErrorEx.js +57 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.js +56 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.js +56 -0
- package/build/src/matchers/component/toHaveHrefEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveHrefEx.js +55 -0
- package/build/src/matchers/component/toHaveItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveItemsEx.js +63 -0
- package/build/src/matchers/component/toHavePageCountEx.d.ts +4 -0
- package/build/src/matchers/component/toHavePageCountEx.js +71 -0
- package/build/src/matchers/component/toHaveTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveTextEx.js +56 -0
- package/build/src/matchers/component/toHaveValueEx.d.ts +6 -0
- package/build/src/matchers/component/toHaveValueEx.js +198 -0
- package/build/src/matchers/component/toHaveWarningEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveWarningEx.js +57 -0
- package/build/src/matchers/componentMatchers.d.ts +104 -0
- package/build/src/matchers/componentMatchers.js +83 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +47 -0
- package/build/src/matchers/createAsyncMatcher.js +155 -0
- package/build/src/matchers/formattedMatchers.d.ts +15 -31
- package/build/src/matchers/formattedMatchers.js +19 -15
- package/build/src/matchers/index.d.ts +1 -1
- package/build/src/matchers/index.js +1 -3
- package/build/src/utils/getMarcherResult.d.ts +13 -0
- package/build/src/utils/getMarcherResult.js +13 -0
- package/build/src/utils/index.d.ts +3 -0
- package/build/src/utils/index.js +3 -0
- package/build/src/utils/is.d.ts +3 -0
- package/build/src/utils/is.js +5 -0
- package/build/src/utils/makeMatcher.d.ts +5 -0
- package/build/src/utils/makeMatcher.js +65 -0
- package/build/src/utils/toMatchMessage.d.ts +12 -0
- package/build/src/utils/toMatchMessage.js +78 -0
- package/package.json +1 -1
- package/build/src/matchers/mergedExpects.d.ts +0 -15
- package/build/src/matchers/mergedExpects.js +0 -6
|
@@ -50,12 +50,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a, _b, _c;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Button = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var assertions_1 = require("../assertions");
|
|
58
59
|
var utils_1 = require("../utils");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
/**
|
|
60
62
|
* Button можно использовать как для @skbkontur/react-ui, так и для react
|
|
61
63
|
* Но часть функциональности (проверка на Error / Warning) не будет работать с button из react
|
|
@@ -65,37 +67,40 @@ var Button = /** @class */ (function (_super) {
|
|
|
65
67
|
function Button(rootLocator) {
|
|
66
68
|
var _this = _super.call(this, rootLocator) || this;
|
|
67
69
|
_this.rootLocator = rootLocator;
|
|
70
|
+
_this[_a] = function () { return _this.buttonLocator; };
|
|
71
|
+
_this[_b] = function () { return _this.buttonLocator; };
|
|
72
|
+
_this[_c] = function () { return _this.buttonLocator; };
|
|
68
73
|
// or(rootLocator).Last сделан для кнопки из react (не react-ui)
|
|
69
74
|
_this.buttonLocator = rootLocator.locator('button').or(rootLocator).last();
|
|
70
75
|
return _this;
|
|
71
76
|
}
|
|
72
77
|
Button.prototype.isDisabled = function (options) {
|
|
73
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
-
return __generator(this, function (
|
|
75
|
-
switch (
|
|
79
|
+
return __generator(this, function (_d) {
|
|
80
|
+
switch (_d.label) {
|
|
76
81
|
case 0: return [4 /*yield*/, this.buttonLocator.isDisabled(options)];
|
|
77
|
-
case 1: return [2 /*return*/,
|
|
82
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
78
83
|
}
|
|
79
84
|
});
|
|
80
85
|
});
|
|
81
86
|
};
|
|
82
87
|
Button.prototype.getText = function (options) {
|
|
83
88
|
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
return __generator(this, function (
|
|
85
|
-
switch (
|
|
89
|
+
return __generator(this, function (_d) {
|
|
90
|
+
switch (_d.label) {
|
|
86
91
|
case 0: return [4 /*yield*/, this.buttonLocator.innerText(options)];
|
|
87
|
-
case 1: return [2 /*return*/,
|
|
92
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
88
93
|
}
|
|
89
94
|
});
|
|
90
95
|
});
|
|
91
96
|
};
|
|
92
97
|
Button.prototype.click = function (options) {
|
|
93
98
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
return __generator(this, function (
|
|
95
|
-
switch (
|
|
99
|
+
return __generator(this, function (_d) {
|
|
100
|
+
switch (_d.label) {
|
|
96
101
|
case 0: return [4 /*yield*/, this.buttonLocator.click(options)];
|
|
97
102
|
case 1:
|
|
98
|
-
|
|
103
|
+
_d.sent();
|
|
99
104
|
return [2 /*return*/];
|
|
100
105
|
}
|
|
101
106
|
});
|
|
@@ -103,14 +108,14 @@ var Button = /** @class */ (function (_super) {
|
|
|
103
108
|
};
|
|
104
109
|
Button.prototype.focus = function (options) {
|
|
105
110
|
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
-
return __generator(this, function (
|
|
107
|
-
switch (
|
|
111
|
+
return __generator(this, function (_d) {
|
|
112
|
+
switch (_d.label) {
|
|
108
113
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.buttonLocator).toBeEnabled()];
|
|
109
114
|
case 1:
|
|
110
|
-
|
|
115
|
+
_d.sent();
|
|
111
116
|
return [4 /*yield*/, this.buttonLocator.focus(options)];
|
|
112
117
|
case 2:
|
|
113
|
-
|
|
118
|
+
_d.sent();
|
|
114
119
|
return [2 /*return*/];
|
|
115
120
|
}
|
|
116
121
|
});
|
|
@@ -118,11 +123,11 @@ var Button = /** @class */ (function (_super) {
|
|
|
118
123
|
};
|
|
119
124
|
Button.prototype.blur = function (options) {
|
|
120
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
-
return __generator(this, function (
|
|
122
|
-
switch (
|
|
126
|
+
return __generator(this, function (_d) {
|
|
127
|
+
switch (_d.label) {
|
|
123
128
|
case 0: return [4 /*yield*/, this.buttonLocator.blur(options)];
|
|
124
129
|
case 1:
|
|
125
|
-
|
|
130
|
+
_d.sent();
|
|
126
131
|
return [2 /*return*/];
|
|
127
132
|
}
|
|
128
133
|
});
|
|
@@ -130,10 +135,10 @@ var Button = /** @class */ (function (_super) {
|
|
|
130
135
|
};
|
|
131
136
|
Button.prototype.getTooltip = function (type) {
|
|
132
137
|
return __awaiter(this, void 0, void 0, function () {
|
|
133
|
-
return __generator(this, function (
|
|
134
|
-
switch (
|
|
138
|
+
return __generator(this, function (_d) {
|
|
139
|
+
switch (_d.label) {
|
|
135
140
|
case 0: return [4 /*yield*/, (0, utils_1.getTooltip)(type, this)];
|
|
136
|
-
case 1: return [2 /*return*/,
|
|
141
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
144
|
});
|
|
@@ -144,3 +149,4 @@ var Button = /** @class */ (function (_super) {
|
|
|
144
149
|
return Button;
|
|
145
150
|
}(BaseComponent_1.BaseComponent));
|
|
146
151
|
exports.Button = Button;
|
|
152
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toTextElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -4,9 +4,15 @@ import { CheckboxAssertions } from '../assertions';
|
|
|
4
4
|
import type { TooltipType } from '../utils';
|
|
5
5
|
import type { BlurOptions, FocusOptions, InnerTextOptions, InputValueOptions, IsCheckedOptions, IsDisabledOptions, UncheckOptions } from '../options';
|
|
6
6
|
import type { CheckOptions } from '../options';
|
|
7
|
+
import { toControlElementLocator, toCheckableElementLocator, toFocusableElementLocator, toTextElementLocator, toValueElementLocator } from '../matchers/component/LocatorSymbols';
|
|
7
8
|
export declare class Checkbox extends BaseComponent {
|
|
8
9
|
readonly rootLocator: Locator;
|
|
9
10
|
readonly inputLocator: Locator;
|
|
11
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
12
|
+
readonly [toCheckableElementLocator]: () => Locator;
|
|
13
|
+
readonly [toValueElementLocator]: () => Locator;
|
|
14
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
15
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
10
16
|
constructor(rootLocator: Locator);
|
|
11
17
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
12
18
|
isChecked(options?: IsCheckedOptions): Promise<boolean>;
|
|
@@ -50,58 +50,53 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a, _b, _c, _d, _e;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Checkbox = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var assertions_1 = require("../assertions");
|
|
58
59
|
var utils_1 = require("../utils");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
var Checkbox = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Checkbox, _super);
|
|
61
63
|
function Checkbox(rootLocator) {
|
|
62
64
|
var _this = _super.call(this, rootLocator) || this;
|
|
63
65
|
_this.rootLocator = rootLocator;
|
|
66
|
+
_this[_a] = function () { return _this.inputLocator; };
|
|
67
|
+
_this[_b] = function () { return _this.inputLocator; };
|
|
68
|
+
_this[_c] = function () { return _this.inputLocator; };
|
|
69
|
+
_this[_d] = function () { return _this.rootLocator; };
|
|
70
|
+
_this[_e] = function () { return _this.inputLocator; };
|
|
64
71
|
_this.inputLocator = rootLocator.locator('input');
|
|
65
72
|
return _this;
|
|
66
73
|
}
|
|
67
74
|
Checkbox.prototype.isDisabled = function (options) {
|
|
68
|
-
return
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
return [2 /*return*/, this.inputLocator.isDisabled(options)];
|
|
71
|
-
});
|
|
72
|
-
});
|
|
75
|
+
return this.inputLocator.isDisabled(options);
|
|
73
76
|
};
|
|
74
77
|
Checkbox.prototype.isChecked = function (options) {
|
|
75
|
-
return
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
return [2 /*return*/, this.inputLocator.isChecked(options)];
|
|
78
|
-
});
|
|
79
|
-
});
|
|
78
|
+
return this.inputLocator.isChecked(options);
|
|
80
79
|
};
|
|
81
80
|
Checkbox.prototype.getText = function (options) {
|
|
82
|
-
return
|
|
83
|
-
return __generator(this, function (_a) {
|
|
84
|
-
return [2 /*return*/, this.rootLocator.innerText(options)];
|
|
85
|
-
});
|
|
86
|
-
});
|
|
81
|
+
return this.rootLocator.innerText(options);
|
|
87
82
|
};
|
|
88
83
|
Checkbox.prototype.getValue = function (options) {
|
|
89
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (
|
|
91
|
-
switch (
|
|
85
|
+
return __generator(this, function (_f) {
|
|
86
|
+
switch (_f.label) {
|
|
92
87
|
case 0: return [4 /*yield*/, this.inputLocator.inputValue(options)];
|
|
93
|
-
case 1: return [2 /*return*/,
|
|
88
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
94
89
|
}
|
|
95
90
|
});
|
|
96
91
|
});
|
|
97
92
|
};
|
|
98
93
|
Checkbox.prototype.check = function (options) {
|
|
99
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
return __generator(this, function (
|
|
101
|
-
switch (
|
|
95
|
+
return __generator(this, function (_f) {
|
|
96
|
+
switch (_f.label) {
|
|
102
97
|
case 0: return [4 /*yield*/, this.rootLocator.check(options)];
|
|
103
98
|
case 1:
|
|
104
|
-
|
|
99
|
+
_f.sent();
|
|
105
100
|
return [2 /*return*/];
|
|
106
101
|
}
|
|
107
102
|
});
|
|
@@ -109,11 +104,11 @@ var Checkbox = /** @class */ (function (_super) {
|
|
|
109
104
|
};
|
|
110
105
|
Checkbox.prototype.uncheck = function (options) {
|
|
111
106
|
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
-
return __generator(this, function (
|
|
113
|
-
switch (
|
|
107
|
+
return __generator(this, function (_f) {
|
|
108
|
+
switch (_f.label) {
|
|
114
109
|
case 0: return [4 /*yield*/, this.rootLocator.uncheck(options)];
|
|
115
110
|
case 1:
|
|
116
|
-
|
|
111
|
+
_f.sent();
|
|
117
112
|
return [2 /*return*/];
|
|
118
113
|
}
|
|
119
114
|
});
|
|
@@ -121,14 +116,14 @@ var Checkbox = /** @class */ (function (_super) {
|
|
|
121
116
|
};
|
|
122
117
|
Checkbox.prototype.focus = function (options) {
|
|
123
118
|
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
-
return __generator(this, function (
|
|
125
|
-
switch (
|
|
119
|
+
return __generator(this, function (_f) {
|
|
120
|
+
switch (_f.label) {
|
|
126
121
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
127
122
|
case 1:
|
|
128
|
-
|
|
123
|
+
_f.sent();
|
|
129
124
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
130
125
|
case 2:
|
|
131
|
-
|
|
126
|
+
_f.sent();
|
|
132
127
|
return [2 /*return*/];
|
|
133
128
|
}
|
|
134
129
|
});
|
|
@@ -136,22 +131,18 @@ var Checkbox = /** @class */ (function (_super) {
|
|
|
136
131
|
};
|
|
137
132
|
Checkbox.prototype.blur = function (options) {
|
|
138
133
|
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
-
return __generator(this, function (
|
|
140
|
-
switch (
|
|
134
|
+
return __generator(this, function (_f) {
|
|
135
|
+
switch (_f.label) {
|
|
141
136
|
case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
|
|
142
137
|
case 1:
|
|
143
|
-
|
|
138
|
+
_f.sent();
|
|
144
139
|
return [2 /*return*/];
|
|
145
140
|
}
|
|
146
141
|
});
|
|
147
142
|
});
|
|
148
143
|
};
|
|
149
144
|
Checkbox.prototype.getTooltip = function (type) {
|
|
150
|
-
return
|
|
151
|
-
return __generator(this, function (_a) {
|
|
152
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
153
|
-
});
|
|
154
|
-
});
|
|
145
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
155
146
|
};
|
|
156
147
|
Checkbox.prototype.expect = function () {
|
|
157
148
|
return new assertions_1.CheckboxAssertions(this);
|
|
@@ -159,3 +150,4 @@ var Checkbox = /** @class */ (function (_super) {
|
|
|
159
150
|
return Checkbox;
|
|
160
151
|
}(BaseComponent_1.BaseComponent));
|
|
161
152
|
exports.Checkbox = Checkbox;
|
|
153
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toCheckableElementLocator, _c = LocatorSymbols_1.toValueElementLocator, _d = LocatorSymbols_1.toTextElementLocator, _e = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import type { Locator } from '@playwright/test';
|
|
2
|
-
import { BaseComponent } from './BaseComponent';
|
|
3
2
|
import { ComboBoxAssertions } from '../assertions';
|
|
4
3
|
import type { TooltipType } from '../utils';
|
|
5
4
|
import { ComponentList } from './ComponentList';
|
|
6
5
|
import { MenuItem } from './MenuItem';
|
|
7
6
|
import type { BlurOptions, ClearOptions, ClickOptions, FillOptions, FocusOptions, GetAttributeOptions, IsDisabledOptions } from '../options';
|
|
8
|
-
|
|
7
|
+
import { MenuComponent } from './MenuComponent';
|
|
8
|
+
import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator, toContainItemElementLocator, toItemsElementLocator } from '../matchers/component/LocatorSymbols';
|
|
9
|
+
export declare class ComboBox extends MenuComponent {
|
|
9
10
|
readonly rootLocator: Locator;
|
|
10
11
|
readonly nativeInputLocator: Locator;
|
|
11
12
|
readonly inputLikeTextLocator: Locator;
|
|
12
13
|
private readonly portal;
|
|
14
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
15
|
+
readonly [toValueElementLocator]: () => Promise<Locator>;
|
|
16
|
+
readonly [toItemsElementLocator]: () => Promise<Locator>;
|
|
17
|
+
readonly [toContainItemElementLocator]: () => Promise<Locator>;
|
|
18
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
13
19
|
constructor(rootLocator: Locator);
|
|
20
|
+
private getInputLocator;
|
|
14
21
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
15
22
|
isFocused(options?: GetAttributeOptions): Promise<boolean>;
|
|
16
23
|
getSelectedValue(): Promise<string>;
|
|
@@ -50,6 +50,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a, _b, _c, _d, _e;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.ComboBox = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
@@ -59,53 +60,69 @@ var MenuFooter_1 = require("@skbkontur/react-ui/components/MenuFooter");
|
|
|
59
60
|
var InputLikeText_1 = require("@skbkontur/react-ui/internal/InputLikeText");
|
|
60
61
|
var MenuMessage_1 = require("@skbkontur/react-ui/internal/MenuMessage");
|
|
61
62
|
var Portal_1 = require("./Portal");
|
|
62
|
-
var BaseComponent_1 = require("./BaseComponent");
|
|
63
63
|
var assertions_1 = require("../assertions");
|
|
64
64
|
var utils_1 = require("../utils");
|
|
65
65
|
var ComponentList_1 = require("./ComponentList");
|
|
66
66
|
var MenuItem_1 = require("./MenuItem");
|
|
67
67
|
var dataTidSelector_1 = require("../utils/dataTidSelector");
|
|
68
|
+
var MenuComponent_1 = require("./MenuComponent");
|
|
69
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
68
70
|
var ComboBox = /** @class */ (function (_super) {
|
|
69
71
|
__extends(ComboBox, _super);
|
|
70
72
|
function ComboBox(rootLocator) {
|
|
71
73
|
var _this = _super.call(this, rootLocator) || this;
|
|
72
74
|
_this.rootLocator = rootLocator;
|
|
75
|
+
_this[_a] = function () { return _this.nativeInputLocator; };
|
|
76
|
+
_this[_b] = function () { return _this.getInputLocator(); };
|
|
77
|
+
_this[_c] = function () { return _this.getItemsLocator(); };
|
|
78
|
+
_this[_d] = function () { return _this.getInputLocator(); };
|
|
79
|
+
_this[_e] = function () { return _this.nativeInputLocator; };
|
|
73
80
|
_this.nativeInputLocator = rootLocator.locator('input');
|
|
74
81
|
_this.inputLikeTextLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(InputLikeText_1.InputLikeTextDataTids.input));
|
|
75
82
|
_this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
|
|
76
83
|
return _this;
|
|
77
84
|
}
|
|
85
|
+
ComboBox.prototype.getInputLocator = function () {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
+
return __generator(this, function (_f) {
|
|
88
|
+
switch (_f.label) {
|
|
89
|
+
case 0: return [4 /*yield*/, this.isDisabled()];
|
|
90
|
+
case 1: return [2 /*return*/, !(_f.sent()) ? this.nativeInputLocator : this.inputLikeTextLocator];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
};
|
|
78
95
|
ComboBox.prototype.isDisabled = function (options) {
|
|
79
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
97
|
+
return __generator(this, function (_f) {
|
|
98
|
+
switch (_f.label) {
|
|
82
99
|
case 0: return [4 /*yield*/, this.nativeInputLocator.isDisabled(options)];
|
|
83
|
-
case 1: return [2 /*return*/,
|
|
100
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
84
101
|
}
|
|
85
102
|
});
|
|
86
103
|
});
|
|
87
104
|
};
|
|
88
105
|
ComboBox.prototype.isFocused = function (options) {
|
|
89
106
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (
|
|
91
|
-
switch (
|
|
107
|
+
return __generator(this, function (_f) {
|
|
108
|
+
switch (_f.label) {
|
|
92
109
|
case 0: return [4 /*yield*/, this.nativeInputLocator.getAttribute('type', options)];
|
|
93
|
-
case 1: return [2 /*return*/, (
|
|
110
|
+
case 1: return [2 /*return*/, (_f.sent()) !== 'hidden'];
|
|
94
111
|
}
|
|
95
112
|
});
|
|
96
113
|
});
|
|
97
114
|
};
|
|
98
115
|
ComboBox.prototype.getSelectedValue = function () {
|
|
99
116
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
return __generator(this, function (
|
|
101
|
-
switch (
|
|
117
|
+
return __generator(this, function (_f) {
|
|
118
|
+
switch (_f.label) {
|
|
102
119
|
case 0: return [4 /*yield*/, this.isFocused()];
|
|
103
120
|
case 1:
|
|
104
|
-
if (!
|
|
121
|
+
if (!_f.sent()) return [3 /*break*/, 3];
|
|
105
122
|
return [4 /*yield*/, this.nativeInputLocator.inputValue()];
|
|
106
|
-
case 2: return [2 /*return*/,
|
|
123
|
+
case 2: return [2 /*return*/, _f.sent()];
|
|
107
124
|
case 3: return [4 /*yield*/, this.inputLikeTextLocator.innerText()];
|
|
108
|
-
case 4: return [2 /*return*/,
|
|
125
|
+
case 4: return [2 /*return*/, _f.sent()];
|
|
109
126
|
}
|
|
110
127
|
});
|
|
111
128
|
});
|
|
@@ -117,14 +134,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
117
134
|
ComboBox.prototype.selectFirst = function (value, options) {
|
|
118
135
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
136
|
var items;
|
|
120
|
-
return __generator(this, function (
|
|
121
|
-
switch (
|
|
137
|
+
return __generator(this, function (_f) {
|
|
138
|
+
switch (_f.label) {
|
|
122
139
|
case 0: return [4 /*yield*/, this.getComboBoxMenuItemsLocator(value)];
|
|
123
140
|
case 1:
|
|
124
|
-
items =
|
|
141
|
+
items = _f.sent();
|
|
125
142
|
return [4 /*yield*/, items.first().click(options)];
|
|
126
143
|
case 2:
|
|
127
|
-
|
|
144
|
+
_f.sent();
|
|
128
145
|
return [2 /*return*/];
|
|
129
146
|
}
|
|
130
147
|
});
|
|
@@ -133,17 +150,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
133
150
|
ComboBox.prototype.select = function (value, options) {
|
|
134
151
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
152
|
var items;
|
|
136
|
-
return __generator(this, function (
|
|
137
|
-
switch (
|
|
153
|
+
return __generator(this, function (_f) {
|
|
154
|
+
switch (_f.label) {
|
|
138
155
|
case 0: return [4 /*yield*/, this.getComboBoxMenuItemsLocator(value)];
|
|
139
156
|
case 1:
|
|
140
|
-
items =
|
|
157
|
+
items = _f.sent();
|
|
141
158
|
return [4 /*yield*/, (0, test_1.expect)(items).toHaveCount(1)];
|
|
142
159
|
case 2:
|
|
143
|
-
|
|
160
|
+
_f.sent();
|
|
144
161
|
return [4 /*yield*/, items.click(options)];
|
|
145
162
|
case 3:
|
|
146
|
-
|
|
163
|
+
_f.sent();
|
|
147
164
|
return [2 /*return*/];
|
|
148
165
|
}
|
|
149
166
|
});
|
|
@@ -151,14 +168,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
151
168
|
};
|
|
152
169
|
ComboBox.prototype.fill = function (value, options) {
|
|
153
170
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
return __generator(this, function (
|
|
155
|
-
switch (
|
|
171
|
+
return __generator(this, function (_f) {
|
|
172
|
+
switch (_f.label) {
|
|
156
173
|
case 0: return [4 /*yield*/, this.focus()];
|
|
157
174
|
case 1:
|
|
158
|
-
|
|
175
|
+
_f.sent();
|
|
159
176
|
return [4 /*yield*/, this.nativeInputLocator.fill(value, options)];
|
|
160
177
|
case 2:
|
|
161
|
-
|
|
178
|
+
_f.sent();
|
|
162
179
|
return [2 /*return*/];
|
|
163
180
|
}
|
|
164
181
|
});
|
|
@@ -166,14 +183,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
166
183
|
};
|
|
167
184
|
ComboBox.prototype.clear = function (options) {
|
|
168
185
|
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
return __generator(this, function (
|
|
170
|
-
switch (
|
|
186
|
+
return __generator(this, function (_f) {
|
|
187
|
+
switch (_f.label) {
|
|
171
188
|
case 0: return [4 /*yield*/, this.focus()];
|
|
172
189
|
case 1:
|
|
173
|
-
|
|
190
|
+
_f.sent();
|
|
174
191
|
return [4 /*yield*/, this.nativeInputLocator.clear(options)];
|
|
175
192
|
case 2:
|
|
176
|
-
|
|
193
|
+
_f.sent();
|
|
177
194
|
return [2 /*return*/];
|
|
178
195
|
}
|
|
179
196
|
});
|
|
@@ -181,17 +198,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
181
198
|
};
|
|
182
199
|
ComboBox.prototype.focus = function (options) {
|
|
183
200
|
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
-
return __generator(this, function (
|
|
185
|
-
switch (
|
|
201
|
+
return __generator(this, function (_f) {
|
|
202
|
+
switch (_f.label) {
|
|
186
203
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
187
204
|
case 1:
|
|
188
|
-
|
|
205
|
+
_f.sent();
|
|
189
206
|
return [4 /*yield*/, this.rootLocator
|
|
190
207
|
.locator('input[type="text"]')
|
|
191
208
|
.or(this.rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(InputLikeText_1.InputLikeTextDataTids.root)))
|
|
192
209
|
.focus(options)];
|
|
193
210
|
case 2:
|
|
194
|
-
|
|
211
|
+
_f.sent();
|
|
195
212
|
return [2 /*return*/];
|
|
196
213
|
}
|
|
197
214
|
});
|
|
@@ -199,11 +216,11 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
199
216
|
};
|
|
200
217
|
ComboBox.prototype.blur = function (options) {
|
|
201
218
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
-
return __generator(this, function (
|
|
203
|
-
switch (
|
|
219
|
+
return __generator(this, function (_f) {
|
|
220
|
+
switch (_f.label) {
|
|
204
221
|
case 0: return [4 /*yield*/, this.nativeInputLocator.press('Tab', { timeout: options === null || options === void 0 ? void 0 : options.timeout })];
|
|
205
222
|
case 1:
|
|
206
|
-
|
|
223
|
+
_f.sent();
|
|
207
224
|
return [2 /*return*/];
|
|
208
225
|
}
|
|
209
226
|
});
|
|
@@ -211,28 +228,24 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
211
228
|
};
|
|
212
229
|
ComboBox.prototype.click = function () {
|
|
213
230
|
return __awaiter(this, void 0, void 0, function () {
|
|
214
|
-
return __generator(this, function (
|
|
215
|
-
switch (
|
|
231
|
+
return __generator(this, function (_f) {
|
|
232
|
+
switch (_f.label) {
|
|
216
233
|
case 0:
|
|
217
234
|
// NOTE: rootLocator всегда в состоянии enabled, даже если ComboBox disabled
|
|
218
235
|
return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
219
236
|
case 1:
|
|
220
237
|
// NOTE: rootLocator всегда в состоянии enabled, даже если ComboBox disabled
|
|
221
|
-
|
|
238
|
+
_f.sent();
|
|
222
239
|
return [4 /*yield*/, _super.prototype.click.call(this)];
|
|
223
240
|
case 2:
|
|
224
|
-
|
|
241
|
+
_f.sent();
|
|
225
242
|
return [2 /*return*/];
|
|
226
243
|
}
|
|
227
244
|
});
|
|
228
245
|
});
|
|
229
246
|
};
|
|
230
247
|
ComboBox.prototype.getTooltip = function (type) {
|
|
231
|
-
return
|
|
232
|
-
return __generator(this, function (_a) {
|
|
233
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
234
|
-
});
|
|
235
|
-
});
|
|
248
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
236
249
|
};
|
|
237
250
|
/**
|
|
238
251
|
* Возвращает список меню по data-tid'ам из react-ui:
|
|
@@ -246,17 +259,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
246
259
|
ComboBox.prototype.getMenuItems = function () {
|
|
247
260
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
261
|
var container;
|
|
249
|
-
return __generator(this, function (
|
|
250
|
-
switch (
|
|
262
|
+
return __generator(this, function (_f) {
|
|
263
|
+
switch (_f.label) {
|
|
251
264
|
case 0: return [4 /*yield*/, this.focus()];
|
|
252
265
|
case 1:
|
|
253
|
-
|
|
266
|
+
_f.sent();
|
|
254
267
|
return [4 /*yield*/, this.portal.getContainer()];
|
|
255
268
|
case 2:
|
|
256
|
-
container =
|
|
269
|
+
container = _f.sent();
|
|
257
270
|
return [4 /*yield*/, container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SpinnerDataTids.root)).waitFor({ state: 'hidden' })];
|
|
258
271
|
case 3:
|
|
259
|
-
|
|
272
|
+
_f.sent();
|
|
260
273
|
return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) {
|
|
261
274
|
return locator
|
|
262
275
|
.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root))
|
|
@@ -276,11 +289,11 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
276
289
|
ComboBox.prototype.getComboBoxMenuItemsLocator = function (byText) {
|
|
277
290
|
return __awaiter(this, void 0, void 0, function () {
|
|
278
291
|
var container, items;
|
|
279
|
-
return __generator(this, function (
|
|
280
|
-
switch (
|
|
292
|
+
return __generator(this, function (_f) {
|
|
293
|
+
switch (_f.label) {
|
|
281
294
|
case 0: return [4 /*yield*/, this.portal.getContainer()];
|
|
282
295
|
case 1:
|
|
283
|
-
container =
|
|
296
|
+
container = _f.sent();
|
|
284
297
|
items = container.locator((0, dataTidSelector_1.getDataTidSelector)(CustomComboBox_1.ComboBoxMenuDataTids.item));
|
|
285
298
|
return [2 /*return*/, items.getByText(byText)];
|
|
286
299
|
}
|
|
@@ -288,5 +301,6 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
288
301
|
});
|
|
289
302
|
};
|
|
290
303
|
return ComboBox;
|
|
291
|
-
}(
|
|
304
|
+
}(MenuComponent_1.MenuComponent));
|
|
292
305
|
exports.ComboBox = ComboBox;
|
|
306
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toItemsElementLocator, _d = LocatorSymbols_1.toContainItemElementLocator, _e = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -3,10 +3,13 @@ import { BaseComponent } from './BaseComponent';
|
|
|
3
3
|
import { ComponentListAssertions } from '../assertions';
|
|
4
4
|
import { type TooltipType } from '../utils';
|
|
5
5
|
import type { IsVisibleOptions } from '../options';
|
|
6
|
+
import { toVisibleElementLocator, toValueElementLocator } from '../matchers/component/LocatorSymbols';
|
|
6
7
|
export declare class ComponentList<TItem extends BaseComponent> extends BaseComponent {
|
|
7
8
|
readonly rootLocator: Locator;
|
|
8
9
|
private readonly itemFactory;
|
|
9
10
|
readonly itemsLocator: Locator;
|
|
11
|
+
readonly [toVisibleElementLocator]: () => Locator;
|
|
12
|
+
readonly [toValueElementLocator]: () => Locator;
|
|
10
13
|
constructor(rootLocator: Locator, itemsLocator: (rootLocator: Locator) => Locator, itemFactory: (locator: Locator) => TItem);
|
|
11
14
|
isVisible(options?: IsVisibleOptions): Promise<boolean>;
|
|
12
15
|
/**
|
|
@@ -20,15 +23,15 @@ export declare class ComponentList<TItem extends BaseComponent> extends BaseComp
|
|
|
20
23
|
/**
|
|
21
24
|
* Поведение метода идентично вызову locator.nth(0)
|
|
22
25
|
*/
|
|
23
|
-
getFirstItem():
|
|
26
|
+
getFirstItem(): TItem;
|
|
24
27
|
/**
|
|
25
28
|
* Поведение метода идентично вызову locator.nth(-1)
|
|
26
29
|
*/
|
|
27
|
-
getLastItem():
|
|
30
|
+
getLastItem(): TItem;
|
|
28
31
|
/**
|
|
29
32
|
* Поведение метода идентично вызову locator.nth(index)
|
|
30
33
|
*/
|
|
31
|
-
getItemByIndex(index: number):
|
|
34
|
+
getItemByIndex(index: number): TItem;
|
|
32
35
|
getFirstItemByPredicate(predicate: (item: TItem) => Promise<boolean>): Promise<TItem>;
|
|
33
36
|
getItemsByPredicate(predicate: (item: TItem) => Promise<boolean>): Promise<TItem[]>;
|
|
34
37
|
/**
|