@skbkontur/playwright-react-ui-components 1.13.1 → 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 +25 -3
- package/build/src/components/ComponentList.js +58 -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,41 +50,38 @@ 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.Textarea = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var utils_1 = require("../utils");
|
|
58
59
|
var assertions_1 = require("../assertions");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
var Textarea = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Textarea, _super);
|
|
61
63
|
function Textarea(rootLocator) {
|
|
62
64
|
var _this = _super.call(this, rootLocator) || this;
|
|
63
65
|
_this.rootLocator = rootLocator;
|
|
66
|
+
_this[_a] = function () { return _this.textareaLocator; };
|
|
67
|
+
_this[_b] = function () { return _this.textareaLocator; };
|
|
68
|
+
_this[_c] = function () { return _this.textareaLocator; };
|
|
64
69
|
_this.textareaLocator = rootLocator.locator('textarea').first();
|
|
65
70
|
return _this;
|
|
66
71
|
}
|
|
67
72
|
Textarea.prototype.isDisabled = function (options) {
|
|
68
|
-
return
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
return [2 /*return*/, this.textareaLocator.isDisabled(options)];
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
+
return this.textareaLocator.isDisabled(options);
|
|
73
74
|
};
|
|
74
75
|
Textarea.prototype.getValue = function (options) {
|
|
75
|
-
return
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
return [2 /*return*/, this.textareaLocator.inputValue(options)];
|
|
78
|
-
});
|
|
79
|
-
});
|
|
76
|
+
return this.textareaLocator.inputValue(options);
|
|
80
77
|
};
|
|
81
78
|
Textarea.prototype.fill = function (value, options) {
|
|
82
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
-
return __generator(this, function (
|
|
84
|
-
switch (
|
|
80
|
+
return __generator(this, function (_d) {
|
|
81
|
+
switch (_d.label) {
|
|
85
82
|
case 0: return [4 /*yield*/, this.textareaLocator.fill(value, options)];
|
|
86
83
|
case 1:
|
|
87
|
-
|
|
84
|
+
_d.sent();
|
|
88
85
|
return [2 /*return*/];
|
|
89
86
|
}
|
|
90
87
|
});
|
|
@@ -92,14 +89,14 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
92
89
|
};
|
|
93
90
|
Textarea.prototype.press = function (value, options) {
|
|
94
91
|
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
-
return __generator(this, function (
|
|
96
|
-
switch (
|
|
92
|
+
return __generator(this, function (_d) {
|
|
93
|
+
switch (_d.label) {
|
|
97
94
|
case 0: return [4 /*yield*/, this.focus()];
|
|
98
95
|
case 1:
|
|
99
|
-
|
|
96
|
+
_d.sent();
|
|
100
97
|
return [4 /*yield*/, this.textareaLocator.press(value, options)];
|
|
101
98
|
case 2:
|
|
102
|
-
|
|
99
|
+
_d.sent();
|
|
103
100
|
return [2 /*return*/];
|
|
104
101
|
}
|
|
105
102
|
});
|
|
@@ -107,14 +104,14 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
107
104
|
};
|
|
108
105
|
Textarea.prototype.pressSequentially = function (value, options) {
|
|
109
106
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
return __generator(this, function (
|
|
111
|
-
switch (
|
|
107
|
+
return __generator(this, function (_d) {
|
|
108
|
+
switch (_d.label) {
|
|
112
109
|
case 0: return [4 /*yield*/, this.focus()];
|
|
113
110
|
case 1:
|
|
114
|
-
|
|
111
|
+
_d.sent();
|
|
115
112
|
return [4 /*yield*/, this.textareaLocator.pressSequentially(value, options)];
|
|
116
113
|
case 2:
|
|
117
|
-
|
|
114
|
+
_d.sent();
|
|
118
115
|
return [2 /*return*/];
|
|
119
116
|
}
|
|
120
117
|
});
|
|
@@ -122,11 +119,11 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
122
119
|
};
|
|
123
120
|
Textarea.prototype.clear = function (options) {
|
|
124
121
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
return __generator(this, function (
|
|
126
|
-
switch (
|
|
122
|
+
return __generator(this, function (_d) {
|
|
123
|
+
switch (_d.label) {
|
|
127
124
|
case 0: return [4 /*yield*/, this.textareaLocator.clear(options)];
|
|
128
125
|
case 1:
|
|
129
|
-
|
|
126
|
+
_d.sent();
|
|
130
127
|
return [2 /*return*/];
|
|
131
128
|
}
|
|
132
129
|
});
|
|
@@ -134,14 +131,14 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
134
131
|
};
|
|
135
132
|
Textarea.prototype.focus = function (options) {
|
|
136
133
|
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
-
return __generator(this, function (
|
|
138
|
-
switch (
|
|
134
|
+
return __generator(this, function (_d) {
|
|
135
|
+
switch (_d.label) {
|
|
139
136
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.textareaLocator).toBeEnabled()];
|
|
140
137
|
case 1:
|
|
141
|
-
|
|
138
|
+
_d.sent();
|
|
142
139
|
return [4 /*yield*/, this.textareaLocator.focus(options)];
|
|
143
140
|
case 2:
|
|
144
|
-
|
|
141
|
+
_d.sent();
|
|
145
142
|
return [2 /*return*/];
|
|
146
143
|
}
|
|
147
144
|
});
|
|
@@ -149,11 +146,11 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
149
146
|
};
|
|
150
147
|
Textarea.prototype.blur = function (options) {
|
|
151
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
-
return __generator(this, function (
|
|
153
|
-
switch (
|
|
149
|
+
return __generator(this, function (_d) {
|
|
150
|
+
switch (_d.label) {
|
|
154
151
|
case 0: return [4 /*yield*/, this.textareaLocator.blur(options)];
|
|
155
152
|
case 1:
|
|
156
|
-
|
|
153
|
+
_d.sent();
|
|
157
154
|
return [2 /*return*/];
|
|
158
155
|
}
|
|
159
156
|
});
|
|
@@ -161,22 +158,18 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
161
158
|
};
|
|
162
159
|
Textarea.prototype.click = function (options) {
|
|
163
160
|
return __awaiter(this, void 0, void 0, function () {
|
|
164
|
-
return __generator(this, function (
|
|
165
|
-
switch (
|
|
161
|
+
return __generator(this, function (_d) {
|
|
162
|
+
switch (_d.label) {
|
|
166
163
|
case 0: return [4 /*yield*/, this.textareaLocator.click(options)];
|
|
167
164
|
case 1:
|
|
168
|
-
|
|
165
|
+
_d.sent();
|
|
169
166
|
return [2 /*return*/];
|
|
170
167
|
}
|
|
171
168
|
});
|
|
172
169
|
});
|
|
173
170
|
};
|
|
174
171
|
Textarea.prototype.getTooltip = function (type) {
|
|
175
|
-
return
|
|
176
|
-
return __generator(this, function (_a) {
|
|
177
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
178
|
-
});
|
|
179
|
-
});
|
|
172
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
180
173
|
};
|
|
181
174
|
Textarea.prototype.expect = function () {
|
|
182
175
|
return new assertions_1.TextareaAssertions(this);
|
|
@@ -184,3 +177,4 @@ var Textarea = /** @class */ (function (_super) {
|
|
|
184
177
|
return Textarea;
|
|
185
178
|
}(BaseComponent_1.BaseComponent));
|
|
186
179
|
exports.Textarea = Textarea;
|
|
180
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -2,8 +2,10 @@ import type { Locator } from '@playwright/test';
|
|
|
2
2
|
import { BaseComponent } from './BaseComponent';
|
|
3
3
|
import { ToastAssertions } from '../assertions';
|
|
4
4
|
import type { InnerTextOptions } from '../options';
|
|
5
|
+
import { toTextElementLocator } from '../matchers/component/LocatorSymbols';
|
|
5
6
|
export declare class Toast extends BaseComponent {
|
|
6
7
|
readonly rootLocator: Locator;
|
|
8
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
7
9
|
constructor(rootLocator: Locator);
|
|
8
10
|
getText(options?: InnerTextOptions): Promise<string>;
|
|
9
11
|
expect(): ToastAssertions;
|
|
@@ -50,23 +50,26 @@ 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;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Toast = void 0;
|
|
55
56
|
var BaseComponent_1 = require("./BaseComponent");
|
|
56
57
|
var assertions_1 = require("../assertions");
|
|
58
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
57
59
|
var Toast = /** @class */ (function (_super) {
|
|
58
60
|
__extends(Toast, _super);
|
|
59
61
|
function Toast(rootLocator) {
|
|
60
62
|
var _this = _super.call(this, rootLocator) || this;
|
|
61
63
|
_this.rootLocator = rootLocator;
|
|
64
|
+
_this[_a] = function () { return _this.rootLocator; };
|
|
62
65
|
return _this;
|
|
63
66
|
}
|
|
64
67
|
Toast.prototype.getText = function (options) {
|
|
65
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
-
return __generator(this, function (
|
|
67
|
-
switch (
|
|
69
|
+
return __generator(this, function (_b) {
|
|
70
|
+
switch (_b.label) {
|
|
68
71
|
case 0: return [4 /*yield*/, this.rootLocator.innerText(options)];
|
|
69
|
-
case 1: return [2 /*return*/,
|
|
72
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
75
|
});
|
|
@@ -77,3 +80,4 @@ var Toast = /** @class */ (function (_super) {
|
|
|
77
80
|
return Toast;
|
|
78
81
|
}(BaseComponent_1.BaseComponent));
|
|
79
82
|
exports.Toast = Toast;
|
|
83
|
+
_a = LocatorSymbols_1.toTextElementLocator;
|
|
@@ -3,9 +3,14 @@ import { BaseComponent } from './BaseComponent';
|
|
|
3
3
|
import type { TooltipType } from '../utils';
|
|
4
4
|
import { ToggleAssertions } from '../assertions';
|
|
5
5
|
import type { BlurOptions, CheckOptions, FocusOptions, InnerTextOptions, IsCheckedOptions, IsDisabledOptions, UncheckOptions } from '../options';
|
|
6
|
+
import { toControlElementLocator, toCheckableElementLocator, toFocusableElementLocator, toTextElementLocator } from '../matchers/component/LocatorSymbols';
|
|
6
7
|
export declare class Toggle extends BaseComponent {
|
|
7
8
|
readonly rootLocator: Locator;
|
|
8
9
|
readonly inputLocator: Locator;
|
|
10
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
11
|
+
readonly [toCheckableElementLocator]: () => Locator;
|
|
12
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
13
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
9
14
|
constructor(rootLocator: Locator);
|
|
10
15
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
11
16
|
isChecked(options?: IsCheckedOptions): Promise<boolean>;
|
|
@@ -50,48 +50,42 @@ 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.Toggle = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var utils_1 = require("../utils");
|
|
58
59
|
var assertions_1 = require("../assertions");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
var Toggle = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Toggle, _super);
|
|
61
63
|
function Toggle(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.rootLocator; };
|
|
69
|
+
_this[_d] = function () { return _this.inputLocator; };
|
|
64
70
|
_this.inputLocator = rootLocator.locator('input');
|
|
65
71
|
return _this;
|
|
66
72
|
}
|
|
67
73
|
Toggle.prototype.isDisabled = function (options) {
|
|
68
|
-
return
|
|
69
|
-
return __generator(this, function (_a) {
|
|
70
|
-
return [2 /*return*/, this.inputLocator.isDisabled(options)];
|
|
71
|
-
});
|
|
72
|
-
});
|
|
74
|
+
return this.inputLocator.isDisabled(options);
|
|
73
75
|
};
|
|
74
76
|
Toggle.prototype.isChecked = function (options) {
|
|
75
|
-
return
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
return [2 /*return*/, this.inputLocator.isChecked(options)];
|
|
78
|
-
});
|
|
79
|
-
});
|
|
77
|
+
return this.inputLocator.isChecked(options);
|
|
80
78
|
};
|
|
81
79
|
Toggle.prototype.getText = function (options) {
|
|
82
|
-
return
|
|
83
|
-
return __generator(this, function (_a) {
|
|
84
|
-
return [2 /*return*/, this.rootLocator.innerText(options)];
|
|
85
|
-
});
|
|
86
|
-
});
|
|
80
|
+
return this.rootLocator.innerText(options);
|
|
87
81
|
};
|
|
88
82
|
Toggle.prototype.check = function (options) {
|
|
89
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
-
return __generator(this, function (
|
|
91
|
-
switch (
|
|
84
|
+
return __generator(this, function (_e) {
|
|
85
|
+
switch (_e.label) {
|
|
92
86
|
case 0: return [4 /*yield*/, this.rootLocator.check(options)];
|
|
93
87
|
case 1:
|
|
94
|
-
|
|
88
|
+
_e.sent();
|
|
95
89
|
return [2 /*return*/];
|
|
96
90
|
}
|
|
97
91
|
});
|
|
@@ -99,11 +93,11 @@ var Toggle = /** @class */ (function (_super) {
|
|
|
99
93
|
};
|
|
100
94
|
Toggle.prototype.uncheck = function (options) {
|
|
101
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
return __generator(this, function (
|
|
103
|
-
switch (
|
|
96
|
+
return __generator(this, function (_e) {
|
|
97
|
+
switch (_e.label) {
|
|
104
98
|
case 0: return [4 /*yield*/, this.rootLocator.uncheck(options)];
|
|
105
99
|
case 1:
|
|
106
|
-
|
|
100
|
+
_e.sent();
|
|
107
101
|
return [2 /*return*/];
|
|
108
102
|
}
|
|
109
103
|
});
|
|
@@ -111,14 +105,14 @@ var Toggle = /** @class */ (function (_super) {
|
|
|
111
105
|
};
|
|
112
106
|
Toggle.prototype.focus = function (options) {
|
|
113
107
|
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
-
return __generator(this, function (
|
|
115
|
-
switch (
|
|
108
|
+
return __generator(this, function (_e) {
|
|
109
|
+
switch (_e.label) {
|
|
116
110
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
117
111
|
case 1:
|
|
118
|
-
|
|
112
|
+
_e.sent();
|
|
119
113
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
120
114
|
case 2:
|
|
121
|
-
|
|
115
|
+
_e.sent();
|
|
122
116
|
return [2 /*return*/];
|
|
123
117
|
}
|
|
124
118
|
});
|
|
@@ -126,22 +120,18 @@ var Toggle = /** @class */ (function (_super) {
|
|
|
126
120
|
};
|
|
127
121
|
Toggle.prototype.blur = function (options) {
|
|
128
122
|
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
-
return __generator(this, function (
|
|
130
|
-
switch (
|
|
123
|
+
return __generator(this, function (_e) {
|
|
124
|
+
switch (_e.label) {
|
|
131
125
|
case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
|
|
132
126
|
case 1:
|
|
133
|
-
|
|
127
|
+
_e.sent();
|
|
134
128
|
return [2 /*return*/];
|
|
135
129
|
}
|
|
136
130
|
});
|
|
137
131
|
});
|
|
138
132
|
};
|
|
139
133
|
Toggle.prototype.getTooltip = function (type) {
|
|
140
|
-
return
|
|
141
|
-
return __generator(this, function (_a) {
|
|
142
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
143
|
-
});
|
|
144
|
-
});
|
|
134
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
145
135
|
};
|
|
146
136
|
Toggle.prototype.expect = function () {
|
|
147
137
|
return new assertions_1.ToggleAssertions(this);
|
|
@@ -149,3 +139,4 @@ var Toggle = /** @class */ (function (_super) {
|
|
|
149
139
|
return Toggle;
|
|
150
140
|
}(BaseComponent_1.BaseComponent));
|
|
151
141
|
exports.Toggle = Toggle;
|
|
142
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toCheckableElementLocator, _c = LocatorSymbols_1.toTextElementLocator, _d = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -2,9 +2,12 @@ import type { Locator } from '@playwright/test';
|
|
|
2
2
|
import { BaseComponent } from './BaseComponent';
|
|
3
3
|
import { TokenAssertions } from '../assertions';
|
|
4
4
|
import type { ClickOptions, InnerTextOptions, IsDisabledOptions } from '../options';
|
|
5
|
+
import { toControlElementLocator, toTextElementLocator } from '../matchers/component/LocatorSymbols';
|
|
5
6
|
export declare class Token extends BaseComponent {
|
|
6
7
|
readonly rootLocator: Locator;
|
|
7
8
|
readonly removeIconLocator: Locator;
|
|
9
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
10
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
8
11
|
constructor(rootLocator: Locator);
|
|
9
12
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
10
13
|
getText(options?: InnerTextOptions): Promise<string>;
|
|
@@ -50,49 +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;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Token = void 0;
|
|
55
56
|
var react_ui_1 = require("@skbkontur/react-ui");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var assertions_1 = require("../assertions");
|
|
58
59
|
var dataTidSelector_1 = require("../utils/dataTidSelector");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
var Token = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Token, _super);
|
|
61
63
|
function Token(rootLocator) {
|
|
62
64
|
var _this = _super.call(this, rootLocator) || this;
|
|
63
65
|
_this.rootLocator = rootLocator;
|
|
66
|
+
_this[_a] = function () { return _this.removeIconLocator; };
|
|
67
|
+
_this[_b] = function () { return _this.rootLocator; };
|
|
64
68
|
_this.removeIconLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.TokenDataTids.removeIcon));
|
|
65
69
|
return _this;
|
|
66
70
|
}
|
|
67
71
|
Token.prototype.isDisabled = function (options) {
|
|
68
72
|
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (
|
|
70
|
-
switch (
|
|
73
|
+
return __generator(this, function (_c) {
|
|
74
|
+
switch (_c.label) {
|
|
71
75
|
case 0: return [4 /*yield*/, this.removeIconLocator.isVisible(options)];
|
|
72
76
|
case 1:
|
|
73
77
|
// NOTE: В версии 4.25.2 можно перейти на data-атрибут
|
|
74
|
-
return [2 /*return*/, !(
|
|
78
|
+
return [2 /*return*/, !(_c.sent())];
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
});
|
|
78
82
|
};
|
|
79
83
|
Token.prototype.getText = function (options) {
|
|
80
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
-
return __generator(this, function (
|
|
82
|
-
switch (
|
|
85
|
+
return __generator(this, function (_c) {
|
|
86
|
+
switch (_c.label) {
|
|
83
87
|
case 0: return [4 /*yield*/, this.rootLocator.innerText(options)];
|
|
84
|
-
case 1: return [2 /*return*/,
|
|
88
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
85
89
|
}
|
|
86
90
|
});
|
|
87
91
|
});
|
|
88
92
|
};
|
|
89
93
|
Token.prototype.remove = function (options) {
|
|
90
94
|
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
-
return __generator(this, function (
|
|
92
|
-
switch (
|
|
95
|
+
return __generator(this, function (_c) {
|
|
96
|
+
switch (_c.label) {
|
|
93
97
|
case 0: return [4 /*yield*/, this.removeIconLocator.click(options)];
|
|
94
98
|
case 1:
|
|
95
|
-
|
|
99
|
+
_c.sent();
|
|
96
100
|
return [2 /*return*/];
|
|
97
101
|
}
|
|
98
102
|
});
|
|
@@ -104,3 +108,4 @@ var Token = /** @class */ (function (_super) {
|
|
|
104
108
|
return Token;
|
|
105
109
|
}(BaseComponent_1.BaseComponent));
|
|
106
110
|
exports.Token = Token;
|
|
111
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toTextElementLocator;
|
|
@@ -6,11 +6,15 @@ import type { TooltipType } from '../utils';
|
|
|
6
6
|
import { TokenInputAssertions } from '../assertions';
|
|
7
7
|
import { MenuItem } from './MenuItem';
|
|
8
8
|
import type { BlurOptions, ClickOptions, FillOptions, FocusOptions, IsDisabledOptions } from '../options';
|
|
9
|
+
import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator } from '../matchers/component/LocatorSymbols';
|
|
9
10
|
export declare class TokenInput extends BaseComponent {
|
|
10
11
|
readonly rootLocator: Locator;
|
|
11
12
|
private readonly portal;
|
|
12
13
|
readonly textareaLocator: Locator;
|
|
13
14
|
readonly tokens: ComponentList<Token>;
|
|
15
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
16
|
+
readonly [toValueElementLocator]: () => Locator;
|
|
17
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
14
18
|
constructor(rootLocator: Locator);
|
|
15
19
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
16
20
|
fill(value: string, options?: FillOptions): Promise<void>;
|