@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,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;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.TokenInput = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
@@ -64,11 +65,15 @@ var utils_1 = require("../utils");
|
|
|
64
65
|
var assertions_1 = require("../assertions");
|
|
65
66
|
var MenuItem_1 = require("./MenuItem");
|
|
66
67
|
var dataTidSelector_1 = require("../utils/dataTidSelector");
|
|
68
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
67
69
|
var TokenInput = /** @class */ (function (_super) {
|
|
68
70
|
__extends(TokenInput, _super);
|
|
69
71
|
function TokenInput(rootLocator) {
|
|
70
72
|
var _this = _super.call(this, rootLocator) || this;
|
|
71
73
|
_this.rootLocator = rootLocator;
|
|
74
|
+
_this[_a] = function () { return _this.textareaLocator; };
|
|
75
|
+
_this[_b] = function () { return _this.tokens.itemsLocator; };
|
|
76
|
+
_this[_c] = function () { return _this.textareaLocator; };
|
|
72
77
|
_this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
|
|
73
78
|
_this.textareaLocator = rootLocator.locator('textarea');
|
|
74
79
|
_this.tokens = new ComponentList_1.ComponentList(_this.rootLocator, function (locator) { return locator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.TokenDataTids.root)); }, function (locator) { return new Token_1.Token(locator); });
|
|
@@ -76,21 +81,21 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
76
81
|
}
|
|
77
82
|
TokenInput.prototype.isDisabled = function (options) {
|
|
78
83
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
return __generator(this, function (
|
|
80
|
-
switch (
|
|
84
|
+
return __generator(this, function (_d) {
|
|
85
|
+
switch (_d.label) {
|
|
81
86
|
case 0: return [4 /*yield*/, this.textareaLocator.isDisabled(options)];
|
|
82
|
-
case 1: return [2 /*return*/,
|
|
87
|
+
case 1: return [2 /*return*/, _d.sent()];
|
|
83
88
|
}
|
|
84
89
|
});
|
|
85
90
|
});
|
|
86
91
|
};
|
|
87
92
|
TokenInput.prototype.fill = function (value, options) {
|
|
88
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
return __generator(this, function (
|
|
90
|
-
switch (
|
|
94
|
+
return __generator(this, function (_d) {
|
|
95
|
+
switch (_d.label) {
|
|
91
96
|
case 0: return [4 /*yield*/, this.textareaLocator.fill(value, options)];
|
|
92
97
|
case 1:
|
|
93
|
-
|
|
98
|
+
_d.sent();
|
|
94
99
|
return [2 /*return*/];
|
|
95
100
|
}
|
|
96
101
|
});
|
|
@@ -99,19 +104,19 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
99
104
|
TokenInput.prototype.clear = function (options) {
|
|
100
105
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
106
|
var tokens, i;
|
|
102
|
-
return __generator(this, function (
|
|
103
|
-
switch (
|
|
107
|
+
return __generator(this, function (_d) {
|
|
108
|
+
switch (_d.label) {
|
|
104
109
|
case 0: return [4 /*yield*/, this.tokens.getItems()];
|
|
105
110
|
case 1:
|
|
106
|
-
tokens =
|
|
111
|
+
tokens = _d.sent();
|
|
107
112
|
i = tokens.length - 1;
|
|
108
|
-
|
|
113
|
+
_d.label = 2;
|
|
109
114
|
case 2:
|
|
110
115
|
if (!(i >= 0)) return [3 /*break*/, 5];
|
|
111
116
|
return [4 /*yield*/, tokens[i].remove(options)];
|
|
112
117
|
case 3:
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
_d.sent();
|
|
119
|
+
_d.label = 4;
|
|
115
120
|
case 4:
|
|
116
121
|
i--;
|
|
117
122
|
return [3 /*break*/, 2];
|
|
@@ -124,21 +129,21 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
124
129
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
130
|
var token;
|
|
126
131
|
var _this = this;
|
|
127
|
-
return __generator(this, function (
|
|
128
|
-
switch (
|
|
129
|
-
case 0: return [4 /*yield*/, this.tokens.getFirstItemByPredicate(function (token) { return __awaiter(_this, void 0, void 0, function () { var
|
|
130
|
-
switch (
|
|
132
|
+
return __generator(this, function (_d) {
|
|
133
|
+
switch (_d.label) {
|
|
134
|
+
case 0: return [4 /*yield*/, this.tokens.getFirstItemByPredicate(function (token) { return __awaiter(_this, void 0, void 0, function () { var _d; return __generator(this, function (_e) {
|
|
135
|
+
switch (_e.label) {
|
|
131
136
|
case 0:
|
|
132
|
-
|
|
137
|
+
_d = Boolean;
|
|
133
138
|
return [4 /*yield*/, token.getText()];
|
|
134
|
-
case 1: return [2 /*return*/,
|
|
139
|
+
case 1: return [2 /*return*/, _d.apply(void 0, [(_e.sent()).match(text)])];
|
|
135
140
|
}
|
|
136
141
|
}); }); })];
|
|
137
142
|
case 1:
|
|
138
|
-
token =
|
|
143
|
+
token = _d.sent();
|
|
139
144
|
return [4 /*yield*/, token.remove(options)];
|
|
140
145
|
case 2:
|
|
141
|
-
|
|
146
|
+
_d.sent();
|
|
142
147
|
return [2 /*return*/];
|
|
143
148
|
}
|
|
144
149
|
});
|
|
@@ -147,14 +152,14 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
147
152
|
TokenInput.prototype.removeTokenByIndex = function (index, options) {
|
|
148
153
|
return __awaiter(this, void 0, void 0, function () {
|
|
149
154
|
var token;
|
|
150
|
-
return __generator(this, function (
|
|
151
|
-
switch (
|
|
155
|
+
return __generator(this, function (_d) {
|
|
156
|
+
switch (_d.label) {
|
|
152
157
|
case 0: return [4 /*yield*/, this.tokens.getItemByIndex(index)];
|
|
153
158
|
case 1:
|
|
154
|
-
token =
|
|
159
|
+
token = _d.sent();
|
|
155
160
|
return [4 /*yield*/, token.remove(options)];
|
|
156
161
|
case 2:
|
|
157
|
-
|
|
162
|
+
_d.sent();
|
|
158
163
|
return [2 /*return*/];
|
|
159
164
|
}
|
|
160
165
|
});
|
|
@@ -166,15 +171,15 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
166
171
|
TokenInput.prototype.add = function () {
|
|
167
172
|
return __awaiter(this, arguments, void 0, function (delimiter) {
|
|
168
173
|
if (delimiter === void 0) { delimiter = ','; }
|
|
169
|
-
return __generator(this, function (
|
|
170
|
-
switch (
|
|
174
|
+
return __generator(this, function (_d) {
|
|
175
|
+
switch (_d.label) {
|
|
171
176
|
case 0:
|
|
172
177
|
if (delimiter.length != 1) {
|
|
173
178
|
throw new Error('Разделитель должен состоять из одного символа');
|
|
174
179
|
}
|
|
175
180
|
return [4 /*yield*/, this.textareaLocator.press(delimiter)];
|
|
176
181
|
case 1:
|
|
177
|
-
|
|
182
|
+
_d.sent();
|
|
178
183
|
return [2 /*return*/];
|
|
179
184
|
}
|
|
180
185
|
});
|
|
@@ -187,14 +192,14 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
187
192
|
TokenInput.prototype.selectFirst = function (value, options) {
|
|
188
193
|
return __awaiter(this, void 0, void 0, function () {
|
|
189
194
|
var items;
|
|
190
|
-
return __generator(this, function (
|
|
191
|
-
switch (
|
|
195
|
+
return __generator(this, function (_d) {
|
|
196
|
+
switch (_d.label) {
|
|
192
197
|
case 0: return [4 /*yield*/, this.getMenuItemsLocator(value)];
|
|
193
198
|
case 1:
|
|
194
|
-
items =
|
|
199
|
+
items = _d.sent();
|
|
195
200
|
return [4 /*yield*/, items.first().click(options)];
|
|
196
201
|
case 2:
|
|
197
|
-
|
|
202
|
+
_d.sent();
|
|
198
203
|
return [2 /*return*/];
|
|
199
204
|
}
|
|
200
205
|
});
|
|
@@ -203,17 +208,17 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
203
208
|
TokenInput.prototype.select = function (value, options) {
|
|
204
209
|
return __awaiter(this, void 0, void 0, function () {
|
|
205
210
|
var items;
|
|
206
|
-
return __generator(this, function (
|
|
207
|
-
switch (
|
|
211
|
+
return __generator(this, function (_d) {
|
|
212
|
+
switch (_d.label) {
|
|
208
213
|
case 0: return [4 /*yield*/, this.getMenuItemsLocator(value)];
|
|
209
214
|
case 1:
|
|
210
|
-
items =
|
|
215
|
+
items = _d.sent();
|
|
211
216
|
return [4 /*yield*/, (0, test_1.expect)(items).toHaveCount(1)];
|
|
212
217
|
case 2:
|
|
213
|
-
|
|
218
|
+
_d.sent();
|
|
214
219
|
return [4 /*yield*/, items.click(options)];
|
|
215
220
|
case 3:
|
|
216
|
-
|
|
221
|
+
_d.sent();
|
|
217
222
|
return [2 /*return*/];
|
|
218
223
|
}
|
|
219
224
|
});
|
|
@@ -221,14 +226,14 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
221
226
|
};
|
|
222
227
|
TokenInput.prototype.focus = function (options) {
|
|
223
228
|
return __awaiter(this, void 0, void 0, function () {
|
|
224
|
-
return __generator(this, function (
|
|
225
|
-
switch (
|
|
229
|
+
return __generator(this, function (_d) {
|
|
230
|
+
switch (_d.label) {
|
|
226
231
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.textareaLocator).toBeEnabled()];
|
|
227
232
|
case 1:
|
|
228
|
-
|
|
233
|
+
_d.sent();
|
|
229
234
|
return [4 /*yield*/, this.textareaLocator.focus(options)];
|
|
230
235
|
case 2:
|
|
231
|
-
|
|
236
|
+
_d.sent();
|
|
232
237
|
return [2 /*return*/];
|
|
233
238
|
}
|
|
234
239
|
});
|
|
@@ -236,11 +241,11 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
236
241
|
};
|
|
237
242
|
TokenInput.prototype.blur = function (options) {
|
|
238
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
-
return __generator(this, function (
|
|
240
|
-
switch (
|
|
244
|
+
return __generator(this, function (_d) {
|
|
245
|
+
switch (_d.label) {
|
|
241
246
|
case 0: return [4 /*yield*/, this.textareaLocator.blur(options)];
|
|
242
247
|
case 1:
|
|
243
|
-
|
|
248
|
+
_d.sent();
|
|
244
249
|
return [2 /*return*/];
|
|
245
250
|
}
|
|
246
251
|
});
|
|
@@ -248,22 +253,18 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
248
253
|
};
|
|
249
254
|
TokenInput.prototype.click = function (options) {
|
|
250
255
|
return __awaiter(this, void 0, void 0, function () {
|
|
251
|
-
return __generator(this, function (
|
|
252
|
-
switch (
|
|
256
|
+
return __generator(this, function (_d) {
|
|
257
|
+
switch (_d.label) {
|
|
253
258
|
case 0: return [4 /*yield*/, this.textareaLocator.click(options)];
|
|
254
259
|
case 1:
|
|
255
|
-
|
|
260
|
+
_d.sent();
|
|
256
261
|
return [2 /*return*/];
|
|
257
262
|
}
|
|
258
263
|
});
|
|
259
264
|
});
|
|
260
265
|
};
|
|
261
266
|
TokenInput.prototype.getTooltip = function (type) {
|
|
262
|
-
return
|
|
263
|
-
return __generator(this, function (_a) {
|
|
264
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
267
268
|
};
|
|
268
269
|
/**
|
|
269
270
|
* Возвращает список меню по data-tid'ам из react-ui:
|
|
@@ -275,17 +276,17 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
275
276
|
TokenInput.prototype.getMenuItems = function () {
|
|
276
277
|
return __awaiter(this, void 0, void 0, function () {
|
|
277
278
|
var container;
|
|
278
|
-
return __generator(this, function (
|
|
279
|
-
switch (
|
|
279
|
+
return __generator(this, function (_d) {
|
|
280
|
+
switch (_d.label) {
|
|
280
281
|
case 0: return [4 /*yield*/, this.focus()];
|
|
281
282
|
case 1:
|
|
282
|
-
|
|
283
|
+
_d.sent();
|
|
283
284
|
return [4 /*yield*/, this.portal.getContainer()];
|
|
284
285
|
case 2:
|
|
285
|
-
container =
|
|
286
|
+
container = _d.sent();
|
|
286
287
|
return [4 /*yield*/, container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SpinnerDataTids.root)).waitFor({ state: 'hidden' })];
|
|
287
288
|
case 3:
|
|
288
|
-
|
|
289
|
+
_d.sent();
|
|
289
290
|
return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) {
|
|
290
291
|
return locator
|
|
291
292
|
.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root))
|
|
@@ -303,11 +304,11 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
303
304
|
TokenInput.prototype.getMenuItemsLocator = function (byText) {
|
|
304
305
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
306
|
var container, items;
|
|
306
|
-
return __generator(this, function (
|
|
307
|
-
switch (
|
|
307
|
+
return __generator(this, function (_d) {
|
|
308
|
+
switch (_d.label) {
|
|
308
309
|
case 0: return [4 /*yield*/, this.portal.getContainer()];
|
|
309
310
|
case 1:
|
|
310
|
-
container =
|
|
311
|
+
container = _d.sent();
|
|
311
312
|
items = container.locator((0, dataTidSelector_1.getDataTidSelector)(CustomComboBox_1.ComboBoxMenuDataTids.item));
|
|
312
313
|
return [2 /*return*/, items.getByText(byText)];
|
|
313
314
|
}
|
|
@@ -317,3 +318,4 @@ var TokenInput = /** @class */ (function (_super) {
|
|
|
317
318
|
return TokenInput;
|
|
318
319
|
}(BaseComponent_1.BaseComponent));
|
|
319
320
|
exports.TokenInput = TokenInput;
|
|
321
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -2,10 +2,12 @@ import type { Locator } from '@playwright/test';
|
|
|
2
2
|
import { BaseComponent } from './BaseComponent';
|
|
3
3
|
import { TooltipAssertions } from '../assertions';
|
|
4
4
|
import type { InnerTextOptions } from '../options';
|
|
5
|
+
import { toTextElementLocator } from '../matchers/component/LocatorSymbols';
|
|
5
6
|
export declare class Tooltip extends BaseComponent {
|
|
6
7
|
readonly rootLocator: Locator;
|
|
7
8
|
private readonly closeLocator;
|
|
8
9
|
private readonly contentLocator;
|
|
10
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
9
11
|
constructor(rootLocator: Locator);
|
|
10
12
|
getText(options?: InnerTextOptions): Promise<string>;
|
|
11
13
|
getContent(): Locator;
|
|
@@ -50,41 +50,40 @@ 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.Tooltip = void 0;
|
|
55
56
|
var Tooltip_1 = require("@skbkontur/react-ui/components/Tooltip");
|
|
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 Tooltip = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Tooltip, _super);
|
|
61
63
|
function Tooltip(rootLocator) {
|
|
62
64
|
var _this = _super.call(this, rootLocator) || this;
|
|
63
65
|
_this.rootLocator = rootLocator;
|
|
66
|
+
_this[_a] = function () { return _this.contentLocator; };
|
|
64
67
|
_this.contentLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(Tooltip_1.TooltipDataTids.content));
|
|
65
68
|
_this.closeLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(Tooltip_1.TooltipDataTids.crossIcon));
|
|
66
69
|
return _this;
|
|
67
70
|
}
|
|
68
71
|
Tooltip.prototype.getText = function (options) {
|
|
69
|
-
return
|
|
70
|
-
return __generator(this, function (_a) {
|
|
71
|
-
return [2 /*return*/, this.contentLocator.innerText(options)];
|
|
72
|
-
});
|
|
73
|
-
});
|
|
72
|
+
return this.contentLocator.innerText(options);
|
|
74
73
|
};
|
|
75
74
|
Tooltip.prototype.getContent = function () {
|
|
76
75
|
return this.contentLocator;
|
|
77
76
|
};
|
|
78
77
|
Tooltip.prototype.close = function () {
|
|
79
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
-
return __generator(this, function (
|
|
81
|
-
switch (
|
|
79
|
+
return __generator(this, function (_b) {
|
|
80
|
+
switch (_b.label) {
|
|
82
81
|
case 0: return [4 /*yield*/, this.closeLocator.click()];
|
|
83
82
|
case 1:
|
|
84
|
-
|
|
83
|
+
_b.sent();
|
|
85
84
|
return [4 /*yield*/, this.waitFor({ state: 'hidden' })];
|
|
86
85
|
case 2:
|
|
87
|
-
|
|
86
|
+
_b.sent();
|
|
88
87
|
return [2 /*return*/];
|
|
89
88
|
}
|
|
90
89
|
});
|
|
@@ -96,3 +95,4 @@ var Tooltip = /** @class */ (function (_super) {
|
|
|
96
95
|
return Tooltip;
|
|
97
96
|
}(BaseComponent_1.BaseComponent));
|
|
98
97
|
exports.Tooltip = Tooltip;
|
|
98
|
+
_a = LocatorSymbols_1.toTextElementLocator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Paging = exports.Kebab = exports.FxInput = exports.FileUploader = exports.DateInput = exports.Autocomplete = exports.Spinner = exports.Loader = exports.Tab = exports.Tabs = exports.Link = exports.Toggle = exports.Select = exports.Toast = exports.Dropdown = exports.DropdownMenu = exports.Textarea = exports.DateRangePicker = exports.DatePicker = exports.TokenInput = exports.Token = exports.CurrencyInput = exports.Input = exports.RadioGroup = exports.Radio = exports.ComponentList = exports.MenuItem = exports.Label = exports.ComboBox = exports.Checkbox = exports.Portal = exports.Tooltip = exports.Button = exports.BaseComponent = void 0;
|
|
3
|
+
exports.MenuComponent = exports.Paging = exports.Kebab = exports.FxInput = exports.FileUploader = exports.DateInput = exports.Autocomplete = exports.Spinner = exports.Loader = exports.Tab = exports.Tabs = exports.Link = exports.Toggle = exports.Select = exports.Toast = exports.Dropdown = exports.DropdownMenu = exports.Textarea = exports.DateRangePicker = exports.DatePicker = exports.TokenInput = exports.Token = exports.CurrencyInput = exports.Input = exports.RadioGroup = exports.Radio = exports.ComponentList = exports.MenuItem = exports.Label = exports.ComboBox = exports.Checkbox = exports.Portal = exports.Tooltip = exports.Button = exports.BaseComponent = void 0;
|
|
4
4
|
var BaseComponent_1 = require("./BaseComponent");
|
|
5
5
|
Object.defineProperty(exports, "BaseComponent", { enumerable: true, get: function () { return BaseComponent_1.BaseComponent; } });
|
|
6
6
|
var Button_1 = require("./Button");
|
|
@@ -69,3 +69,5 @@ var Kebab_1 = require("./Kebab");
|
|
|
69
69
|
Object.defineProperty(exports, "Kebab", { enumerable: true, get: function () { return Kebab_1.Kebab; } });
|
|
70
70
|
var Paging_1 = require("./Paging");
|
|
71
71
|
Object.defineProperty(exports, "Paging", { enumerable: true, get: function () { return Paging_1.Paging; } });
|
|
72
|
+
var MenuComponent_1 = require("./MenuComponent");
|
|
73
|
+
Object.defineProperty(exports, "MenuComponent", { enumerable: true, get: function () { return MenuComponent_1.MenuComponent; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mergedExpects';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./mergedExpects"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Expect } from '@playwright/test';
|
|
2
|
+
import { type FormattedMatchers } from '../matchers/index';
|
|
3
|
+
import { type ComponentMatchers } from '../matchers/componentMatchers';
|
|
4
|
+
export type ExtendedExpect = Expect<FormattedMatchers & ComponentMatchers>;
|
|
5
|
+
export declare const expect: ExtendedExpect;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.expect = void 0;
|
|
4
|
+
var test_1 = require("@playwright/test");
|
|
5
|
+
var index_1 = require("../matchers/index");
|
|
6
|
+
var componentMatchers_1 = require("../matchers/componentMatchers");
|
|
7
|
+
exports.expect = (0, test_1.mergeExpects)(test_1.expect, index_1.formattedMatchers, componentMatchers_1.componentMatchers);
|
package/build/src/index.d.ts
CHANGED
package/build/src/index.js
CHANGED
|
@@ -19,3 +19,5 @@ __exportStar(require("./utils"), exports);
|
|
|
19
19
|
__exportStar(require("./options"), exports);
|
|
20
20
|
__exportStar(require("./matchers"), exports);
|
|
21
21
|
__exportStar(require("./components"), exports);
|
|
22
|
+
__exportStar(require("./extensions"), exports);
|
|
23
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
export declare const toRootElementLocator: unique symbol;
|
|
3
|
+
export declare const toVisibleElementLocator: unique symbol;
|
|
4
|
+
export declare const toControlElementLocator: unique symbol;
|
|
5
|
+
export declare const toItemsElementLocator: unique symbol;
|
|
6
|
+
export declare const toTextElementLocator: unique symbol;
|
|
7
|
+
export declare const toFocusableElementLocator: unique symbol;
|
|
8
|
+
export declare const toValueElementLocator: unique symbol;
|
|
9
|
+
export declare const toCheckableElementLocator: unique symbol;
|
|
10
|
+
export declare const toContainItemElementLocator: unique symbol;
|
|
11
|
+
export declare const toHaveAttributeElementLocator: unique symbol;
|
|
12
|
+
export type LocatorType = Locator | Promise<Locator>;
|
|
13
|
+
export type LocatorTypeFn = () => LocatorType;
|
|
14
|
+
export type RootSymbolLocator = {
|
|
15
|
+
[toRootElementLocator]: LocatorTypeFn;
|
|
16
|
+
};
|
|
17
|
+
export type VisibleElementLocator = {
|
|
18
|
+
[toVisibleElementLocator]: LocatorTypeFn;
|
|
19
|
+
};
|
|
20
|
+
export type ControlElementLocator = {
|
|
21
|
+
[toControlElementLocator]: LocatorTypeFn;
|
|
22
|
+
};
|
|
23
|
+
export type ToHaveAttributeElementLocator = {
|
|
24
|
+
[toHaveAttributeElementLocator]: LocatorTypeFn;
|
|
25
|
+
};
|
|
26
|
+
export type ToHaveItemsElementLocator = {
|
|
27
|
+
[toItemsElementLocator]: LocatorTypeFn;
|
|
28
|
+
};
|
|
29
|
+
export type ToContainItemElementLocator = {
|
|
30
|
+
[toContainItemElementLocator]: LocatorTypeFn;
|
|
31
|
+
};
|
|
32
|
+
export type ToTextElementLocator = {
|
|
33
|
+
[toTextElementLocator]: LocatorTypeFn;
|
|
34
|
+
};
|
|
35
|
+
export type ToBeFocusableElementLocator = {
|
|
36
|
+
[toFocusableElementLocator]: LocatorTypeFn;
|
|
37
|
+
};
|
|
38
|
+
export type ToWithValueElementLocator = {
|
|
39
|
+
[toValueElementLocator]: LocatorTypeFn;
|
|
40
|
+
};
|
|
41
|
+
export type ToBeCheckableElementLocator = {
|
|
42
|
+
[toCheckableElementLocator]: LocatorTypeFn;
|
|
43
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toHaveAttributeElementLocator = exports.toContainItemElementLocator = exports.toCheckableElementLocator = exports.toValueElementLocator = exports.toFocusableElementLocator = exports.toTextElementLocator = exports.toItemsElementLocator = exports.toControlElementLocator = exports.toVisibleElementLocator = exports.toRootElementLocator = void 0;
|
|
4
|
+
exports.toRootElementLocator = Symbol.for('toRootElementLocator');
|
|
5
|
+
exports.toVisibleElementLocator = Symbol.for('toVisibleElementLocator');
|
|
6
|
+
exports.toControlElementLocator = Symbol.for('toControlElementLocator');
|
|
7
|
+
exports.toItemsElementLocator = Symbol.for('toItemsElementLocator');
|
|
8
|
+
exports.toTextElementLocator = Symbol.for('toTextElementLocator');
|
|
9
|
+
exports.toFocusableElementLocator = Symbol.for('toFocusableElementLocator');
|
|
10
|
+
exports.toValueElementLocator = Symbol.for('toValueElementLocator');
|
|
11
|
+
exports.toCheckableElementLocator = Symbol.for('toCheckableElementLocator');
|
|
12
|
+
exports.toContainItemElementLocator = Symbol.for('toContainItemElementLocator');
|
|
13
|
+
exports.toHaveAttributeElementLocator = Symbol.for('toHaveAttributeElementLocator');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AttributeOptions } from '../../options';
|
|
2
|
+
import type { Tab } from '../../components';
|
|
3
|
+
export declare const toBeActiveEx: (this: import("@playwright/test").ExpectMatcherState, component: Tab, args_0?: AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toBeActiveEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var constants_1 = require("../../utils/constants");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toBeActiveEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toBeActiveEx', function (component) { return component.rootLocator; }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
50
|
+
return [4 /*yield*/, expectation.toHaveAttribute(constants_1.DataVisualState.Active, options)];
|
|
51
|
+
case 1:
|
|
52
|
+
_c.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FxInput } from '../../components';
|
|
2
|
+
import type { VisibleOptions } from '../../options';
|
|
3
|
+
export declare const toBeAutoEx: (this: import("@playwright/test").ExpectMatcherState, component: FxInput, args_0?: VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toBeAutoEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toBeAutoEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toBeAutoEx', function (component) { return component.autoButtonLocator; }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
43
|
+
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
44
|
+
return __generator(this, function (_c) {
|
|
45
|
+
switch (_c.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
if (!isNot) return [3 /*break*/, 2];
|
|
48
|
+
return [4 /*yield*/, (0, test_1.expect)(locator).toBeVisible(options)];
|
|
49
|
+
case 1:
|
|
50
|
+
_c.sent();
|
|
51
|
+
return [3 /*break*/, 5];
|
|
52
|
+
case 2: return [4 /*yield*/, component.waitFor()];
|
|
53
|
+
case 3:
|
|
54
|
+
_c.sent();
|
|
55
|
+
return [4 /*yield*/, (0, test_1.expect)(locator).toBeHidden(options)];
|
|
56
|
+
case 4:
|
|
57
|
+
_c.sent();
|
|
58
|
+
_c.label = 5;
|
|
59
|
+
case 5: return [2 /*return*/];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RadioGroup } from '../../components';
|
|
2
|
+
import type { CheckedOptions } from '../../options/AssertionOptions';
|
|
3
|
+
export declare const toBeCheckedByIndexEx: (this: import("playwright/test").ExpectMatcherState, component: RadioGroup, args_0: number, args_1?: CheckedOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
|