@skbkontur/playwright-react-ui-components 1.13.2 → 1.14.0-beta.2
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 +8 -2
- package/build/src/components/ComboBox.js +67 -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 +7 -2
- package/build/src/components/Dropdown.js +68 -65
- package/build/src/components/DropdownMenu.d.ts +6 -2
- package/build/src/components/DropdownMenu.js +67 -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 +5 -2
- package/build/src/components/Kebab.js +49 -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 +10 -0
- package/build/src/components/MenuComponent.js +79 -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/toBeActiveTab.d.ts +3 -0
- package/build/src/matchers/component/toBeActiveTab.js +56 -0
- package/build/src/matchers/component/toBeAutoMode.d.ts +3 -0
- package/build/src/matchers/component/toBeAutoMode.js +62 -0
- package/build/src/matchers/component/toBeCheckedByIndex.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByIndex.js +62 -0
- package/build/src/matchers/component/toBeCheckedByText.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByText.js +62 -0
- package/build/src/matchers/component/toBeCheckedByValue.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByValue.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 +171 -0
- package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEmptyEx.js +136 -0
- package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEnabledEx.js +196 -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 +67 -0
- package/build/src/matchers/component/toBeInactiveTab.d.ts +3 -0
- package/build/src/matchers/component/toBeInactiveTab.js +56 -0
- package/build/src/matchers/component/toBeUnchecked.d.ts +3 -0
- package/build/src/matchers/component/toBeUnchecked.js +56 -0
- package/build/src/matchers/component/toBeUncheckedByIndex.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByIndex.js +62 -0
- package/build/src/matchers/component/toBeUncheckedByText.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByText.js +57 -0
- package/build/src/matchers/component/toBeUncheckedByValue.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByValue.js +57 -0
- package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
- package/build/src/matchers/component/toBeVisibleEx.js +67 -0
- package/build/src/matchers/component/toContainFormattedText.d.ts +3 -0
- package/build/src/matchers/component/toContainFormattedText.js +55 -0
- package/build/src/matchers/component/toContainItem.d.ts +4 -0
- package/build/src/matchers/component/toContainItem.js +78 -0
- package/build/src/matchers/component/toContainItems.d.ts +3 -0
- package/build/src/matchers/component/toContainItems.js +63 -0
- package/build/src/matchers/component/toContainSelectValue.d.ts +3 -0
- package/build/src/matchers/component/toContainSelectValue.js +55 -0
- package/build/src/matchers/component/toContainTabs.d.ts +3 -0
- package/build/src/matchers/component/toContainTabs.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/toContainTokens.d.ts +4 -0
- package/build/src/matchers/component/toContainTokens.js +80 -0
- package/build/src/matchers/component/toContainUploadedFiles.d.ts +4 -0
- package/build/src/matchers/component/toContainUploadedFiles.js +75 -0
- package/build/src/matchers/component/toHaveActivePage.d.ts +4 -0
- package/build/src/matchers/component/toHaveActivePage.js +78 -0
- package/build/src/matchers/component/toHaveActiveTab.d.ts +2 -0
- package/build/src/matchers/component/toHaveActiveTab.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/toHaveError.d.ts +3 -0
- package/build/src/matchers/component/toHaveError.js +57 -0
- package/build/src/matchers/component/toHaveFormattedText.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedText.js +56 -0
- package/build/src/matchers/component/toHaveFormattedValue.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedValue.js +56 -0
- package/build/src/matchers/component/toHaveHref.d.ts +3 -0
- package/build/src/matchers/component/toHaveHref.js +55 -0
- package/build/src/matchers/component/toHaveItems.d.ts +3 -0
- package/build/src/matchers/component/toHaveItems.js +63 -0
- package/build/src/matchers/component/toHavePageCount.d.ts +4 -0
- package/build/src/matchers/component/toHavePageCount.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 +197 -0
- package/build/src/matchers/component/toHaveWarning.d.ts +3 -0
- package/build/src/matchers/component/toHaveWarning.js +57 -0
- package/build/src/matchers/componentMatchers.d.ts +104 -0
- package/build/src/matchers/componentMatchers.js +89 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +72 -0
- package/build/src/matchers/createAsyncMatcher.js +180 -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/makeMatcher.d.ts +5 -0
- package/build/src/utils/makeMatcher.js +65 -0
- package/build/src/utils/toMatchMessage.d.ts +23 -0
- package/build/src/utils/toMatchMessage.js +89 -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,22 @@
|
|
|
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, 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 [toFocusableElementLocator]: () => Locator;
|
|
13
18
|
constructor(rootLocator: Locator);
|
|
19
|
+
private getInputLocator;
|
|
14
20
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
15
21
|
isFocused(options?: GetAttributeOptions): Promise<boolean>;
|
|
16
22
|
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;
|
|
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,68 @@ 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.nativeInputLocator; };
|
|
73
79
|
_this.nativeInputLocator = rootLocator.locator('input');
|
|
74
80
|
_this.inputLikeTextLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(InputLikeText_1.InputLikeTextDataTids.input));
|
|
75
81
|
_this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
|
|
76
82
|
return _this;
|
|
77
83
|
}
|
|
84
|
+
ComboBox.prototype.getInputLocator = function () {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
return __generator(this, function (_e) {
|
|
87
|
+
switch (_e.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, this.isDisabled()];
|
|
89
|
+
case 1: return [2 /*return*/, !(_e.sent()) ? this.nativeInputLocator : this.inputLikeTextLocator];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
78
94
|
ComboBox.prototype.isDisabled = function (options) {
|
|
79
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
96
|
+
return __generator(this, function (_e) {
|
|
97
|
+
switch (_e.label) {
|
|
82
98
|
case 0: return [4 /*yield*/, this.nativeInputLocator.isDisabled(options)];
|
|
83
|
-
case 1: return [2 /*return*/,
|
|
99
|
+
case 1: return [2 /*return*/, _e.sent()];
|
|
84
100
|
}
|
|
85
101
|
});
|
|
86
102
|
});
|
|
87
103
|
};
|
|
88
104
|
ComboBox.prototype.isFocused = function (options) {
|
|
89
105
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (
|
|
91
|
-
switch (
|
|
106
|
+
return __generator(this, function (_e) {
|
|
107
|
+
switch (_e.label) {
|
|
92
108
|
case 0: return [4 /*yield*/, this.nativeInputLocator.getAttribute('type', options)];
|
|
93
|
-
case 1: return [2 /*return*/, (
|
|
109
|
+
case 1: return [2 /*return*/, (_e.sent()) !== 'hidden'];
|
|
94
110
|
}
|
|
95
111
|
});
|
|
96
112
|
});
|
|
97
113
|
};
|
|
98
114
|
ComboBox.prototype.getSelectedValue = function () {
|
|
99
115
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
return __generator(this, function (
|
|
101
|
-
switch (
|
|
116
|
+
return __generator(this, function (_e) {
|
|
117
|
+
switch (_e.label) {
|
|
102
118
|
case 0: return [4 /*yield*/, this.isFocused()];
|
|
103
119
|
case 1:
|
|
104
|
-
if (!
|
|
120
|
+
if (!_e.sent()) return [3 /*break*/, 3];
|
|
105
121
|
return [4 /*yield*/, this.nativeInputLocator.inputValue()];
|
|
106
|
-
case 2: return [2 /*return*/,
|
|
122
|
+
case 2: return [2 /*return*/, _e.sent()];
|
|
107
123
|
case 3: return [4 /*yield*/, this.inputLikeTextLocator.innerText()];
|
|
108
|
-
case 4: return [2 /*return*/,
|
|
124
|
+
case 4: return [2 /*return*/, _e.sent()];
|
|
109
125
|
}
|
|
110
126
|
});
|
|
111
127
|
});
|
|
@@ -117,14 +133,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
117
133
|
ComboBox.prototype.selectFirst = function (value, options) {
|
|
118
134
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
135
|
var items;
|
|
120
|
-
return __generator(this, function (
|
|
121
|
-
switch (
|
|
136
|
+
return __generator(this, function (_e) {
|
|
137
|
+
switch (_e.label) {
|
|
122
138
|
case 0: return [4 /*yield*/, this.getComboBoxMenuItemsLocator(value)];
|
|
123
139
|
case 1:
|
|
124
|
-
items =
|
|
140
|
+
items = _e.sent();
|
|
125
141
|
return [4 /*yield*/, items.first().click(options)];
|
|
126
142
|
case 2:
|
|
127
|
-
|
|
143
|
+
_e.sent();
|
|
128
144
|
return [2 /*return*/];
|
|
129
145
|
}
|
|
130
146
|
});
|
|
@@ -133,17 +149,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
133
149
|
ComboBox.prototype.select = function (value, options) {
|
|
134
150
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
151
|
var items;
|
|
136
|
-
return __generator(this, function (
|
|
137
|
-
switch (
|
|
152
|
+
return __generator(this, function (_e) {
|
|
153
|
+
switch (_e.label) {
|
|
138
154
|
case 0: return [4 /*yield*/, this.getComboBoxMenuItemsLocator(value)];
|
|
139
155
|
case 1:
|
|
140
|
-
items =
|
|
156
|
+
items = _e.sent();
|
|
141
157
|
return [4 /*yield*/, (0, test_1.expect)(items).toHaveCount(1)];
|
|
142
158
|
case 2:
|
|
143
|
-
|
|
159
|
+
_e.sent();
|
|
144
160
|
return [4 /*yield*/, items.click(options)];
|
|
145
161
|
case 3:
|
|
146
|
-
|
|
162
|
+
_e.sent();
|
|
147
163
|
return [2 /*return*/];
|
|
148
164
|
}
|
|
149
165
|
});
|
|
@@ -151,14 +167,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
151
167
|
};
|
|
152
168
|
ComboBox.prototype.fill = function (value, options) {
|
|
153
169
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
-
return __generator(this, function (
|
|
155
|
-
switch (
|
|
170
|
+
return __generator(this, function (_e) {
|
|
171
|
+
switch (_e.label) {
|
|
156
172
|
case 0: return [4 /*yield*/, this.focus()];
|
|
157
173
|
case 1:
|
|
158
|
-
|
|
174
|
+
_e.sent();
|
|
159
175
|
return [4 /*yield*/, this.nativeInputLocator.fill(value, options)];
|
|
160
176
|
case 2:
|
|
161
|
-
|
|
177
|
+
_e.sent();
|
|
162
178
|
return [2 /*return*/];
|
|
163
179
|
}
|
|
164
180
|
});
|
|
@@ -166,14 +182,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
166
182
|
};
|
|
167
183
|
ComboBox.prototype.clear = function (options) {
|
|
168
184
|
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
return __generator(this, function (
|
|
170
|
-
switch (
|
|
185
|
+
return __generator(this, function (_e) {
|
|
186
|
+
switch (_e.label) {
|
|
171
187
|
case 0: return [4 /*yield*/, this.focus()];
|
|
172
188
|
case 1:
|
|
173
|
-
|
|
189
|
+
_e.sent();
|
|
174
190
|
return [4 /*yield*/, this.nativeInputLocator.clear(options)];
|
|
175
191
|
case 2:
|
|
176
|
-
|
|
192
|
+
_e.sent();
|
|
177
193
|
return [2 /*return*/];
|
|
178
194
|
}
|
|
179
195
|
});
|
|
@@ -181,17 +197,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
181
197
|
};
|
|
182
198
|
ComboBox.prototype.focus = function (options) {
|
|
183
199
|
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
-
return __generator(this, function (
|
|
185
|
-
switch (
|
|
200
|
+
return __generator(this, function (_e) {
|
|
201
|
+
switch (_e.label) {
|
|
186
202
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
187
203
|
case 1:
|
|
188
|
-
|
|
204
|
+
_e.sent();
|
|
189
205
|
return [4 /*yield*/, this.rootLocator
|
|
190
206
|
.locator('input[type="text"]')
|
|
191
207
|
.or(this.rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(InputLikeText_1.InputLikeTextDataTids.root)))
|
|
192
208
|
.focus(options)];
|
|
193
209
|
case 2:
|
|
194
|
-
|
|
210
|
+
_e.sent();
|
|
195
211
|
return [2 /*return*/];
|
|
196
212
|
}
|
|
197
213
|
});
|
|
@@ -199,11 +215,11 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
199
215
|
};
|
|
200
216
|
ComboBox.prototype.blur = function (options) {
|
|
201
217
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
-
return __generator(this, function (
|
|
203
|
-
switch (
|
|
218
|
+
return __generator(this, function (_e) {
|
|
219
|
+
switch (_e.label) {
|
|
204
220
|
case 0: return [4 /*yield*/, this.nativeInputLocator.press('Tab', { timeout: options === null || options === void 0 ? void 0 : options.timeout })];
|
|
205
221
|
case 1:
|
|
206
|
-
|
|
222
|
+
_e.sent();
|
|
207
223
|
return [2 /*return*/];
|
|
208
224
|
}
|
|
209
225
|
});
|
|
@@ -211,28 +227,24 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
211
227
|
};
|
|
212
228
|
ComboBox.prototype.click = function () {
|
|
213
229
|
return __awaiter(this, void 0, void 0, function () {
|
|
214
|
-
return __generator(this, function (
|
|
215
|
-
switch (
|
|
230
|
+
return __generator(this, function (_e) {
|
|
231
|
+
switch (_e.label) {
|
|
216
232
|
case 0:
|
|
217
233
|
// NOTE: rootLocator всегда в состоянии enabled, даже если ComboBox disabled
|
|
218
234
|
return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
219
235
|
case 1:
|
|
220
236
|
// NOTE: rootLocator всегда в состоянии enabled, даже если ComboBox disabled
|
|
221
|
-
|
|
237
|
+
_e.sent();
|
|
222
238
|
return [4 /*yield*/, _super.prototype.click.call(this)];
|
|
223
239
|
case 2:
|
|
224
|
-
|
|
240
|
+
_e.sent();
|
|
225
241
|
return [2 /*return*/];
|
|
226
242
|
}
|
|
227
243
|
});
|
|
228
244
|
});
|
|
229
245
|
};
|
|
230
246
|
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
|
-
});
|
|
247
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
236
248
|
};
|
|
237
249
|
/**
|
|
238
250
|
* Возвращает список меню по data-tid'ам из react-ui:
|
|
@@ -246,17 +258,17 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
246
258
|
ComboBox.prototype.getMenuItems = function () {
|
|
247
259
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
260
|
var container;
|
|
249
|
-
return __generator(this, function (
|
|
250
|
-
switch (
|
|
261
|
+
return __generator(this, function (_e) {
|
|
262
|
+
switch (_e.label) {
|
|
251
263
|
case 0: return [4 /*yield*/, this.focus()];
|
|
252
264
|
case 1:
|
|
253
|
-
|
|
265
|
+
_e.sent();
|
|
254
266
|
return [4 /*yield*/, this.portal.getContainer()];
|
|
255
267
|
case 2:
|
|
256
|
-
container =
|
|
268
|
+
container = _e.sent();
|
|
257
269
|
return [4 /*yield*/, container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SpinnerDataTids.root)).waitFor({ state: 'hidden' })];
|
|
258
270
|
case 3:
|
|
259
|
-
|
|
271
|
+
_e.sent();
|
|
260
272
|
return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) {
|
|
261
273
|
return locator
|
|
262
274
|
.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root))
|
|
@@ -276,11 +288,11 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
276
288
|
ComboBox.prototype.getComboBoxMenuItemsLocator = function (byText) {
|
|
277
289
|
return __awaiter(this, void 0, void 0, function () {
|
|
278
290
|
var container, items;
|
|
279
|
-
return __generator(this, function (
|
|
280
|
-
switch (
|
|
291
|
+
return __generator(this, function (_e) {
|
|
292
|
+
switch (_e.label) {
|
|
281
293
|
case 0: return [4 /*yield*/, this.portal.getContainer()];
|
|
282
294
|
case 1:
|
|
283
|
-
container =
|
|
295
|
+
container = _e.sent();
|
|
284
296
|
items = container.locator((0, dataTidSelector_1.getDataTidSelector)(CustomComboBox_1.ComboBoxMenuDataTids.item));
|
|
285
297
|
return [2 /*return*/, items.getByText(byText)];
|
|
286
298
|
}
|
|
@@ -288,5 +300,6 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
288
300
|
});
|
|
289
301
|
};
|
|
290
302
|
return ComboBox;
|
|
291
|
-
}(
|
|
303
|
+
}(MenuComponent_1.MenuComponent));
|
|
292
304
|
exports.ComboBox = ComboBox;
|
|
305
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toItemsElementLocator, _d = 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
|
/**
|