@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.
Files changed (208) hide show
  1. package/build/src/assertions/AutocompleteAssertions.js +10 -10
  2. package/build/src/assertions/BaseComponentAssertions.js +11 -11
  3. package/build/src/assertions/ButtonAssertions.js +9 -9
  4. package/build/src/assertions/CheckboxAssertions.js +13 -13
  5. package/build/src/assertions/ComboBoxAssertions.js +17 -111
  6. package/build/src/assertions/ComponentListAssertions.js +6 -6
  7. package/build/src/assertions/CurrencyInputAssertions.js +11 -61
  8. package/build/src/assertions/DateInputAssertions.js +9 -9
  9. package/build/src/assertions/DatePickerAssertions.js +9 -9
  10. package/build/src/assertions/DateRangePickerAssertions.js +4 -25
  11. package/build/src/assertions/DropdownAssertions.js +13 -63
  12. package/build/src/assertions/DropdownMenuAssertions.js +11 -61
  13. package/build/src/assertions/FileUploaderAssertions.d.ts +1 -3
  14. package/build/src/assertions/FileUploaderAssertions.js +5 -22
  15. package/build/src/assertions/FxInputAssertions.js +11 -14
  16. package/build/src/assertions/InputAssertions.js +10 -10
  17. package/build/src/assertions/KebabAssertions.js +7 -58
  18. package/build/src/assertions/LabelAssertions.js +7 -7
  19. package/build/src/assertions/LinkAssertions.js +11 -12
  20. package/build/src/assertions/LoaderAssertions.js +2 -2
  21. package/build/src/assertions/MenuItemAssertations.js +5 -5
  22. package/build/src/assertions/PagingAssertions.js +5 -40
  23. package/build/src/assertions/PortalAssertions.js +3 -3
  24. package/build/src/assertions/RadioAssertions.js +13 -13
  25. package/build/src/assertions/RadioGroupAssertions.js +10 -81
  26. package/build/src/assertions/SelectAssertions.js +15 -64
  27. package/build/src/assertions/SpinnerAssertions.js +2 -2
  28. package/build/src/assertions/TabAssertions.js +11 -12
  29. package/build/src/assertions/TabsAssertions.js +4 -32
  30. package/build/src/assertions/TextareaAssertions.js +9 -9
  31. package/build/src/assertions/ToastAssertions.js +2 -2
  32. package/build/src/assertions/ToggleAssertions.js +11 -11
  33. package/build/src/assertions/TokenAssertions.js +8 -14
  34. package/build/src/assertions/TokenInputAssertions.js +8 -28
  35. package/build/src/assertions/TooltipAssertions.js +5 -5
  36. package/build/src/components/Autocomplete.d.ts +4 -0
  37. package/build/src/components/Autocomplete.js +52 -50
  38. package/build/src/components/BaseComponent.d.ts +4 -0
  39. package/build/src/components/BaseComponent.js +37 -30
  40. package/build/src/components/Button.d.ts +4 -0
  41. package/build/src/components/Button.js +25 -19
  42. package/build/src/components/Checkbox.d.ts +6 -0
  43. package/build/src/components/Checkbox.js +28 -36
  44. package/build/src/components/ComboBox.d.ts +8 -2
  45. package/build/src/components/ComboBox.js +67 -54
  46. package/build/src/components/ComponentList.d.ts +6 -3
  47. package/build/src/components/ComponentList.js +39 -50
  48. package/build/src/components/CurrencyInput.d.ts +4 -0
  49. package/build/src/components/CurrencyInput.js +39 -37
  50. package/build/src/components/DateInput.d.ts +4 -0
  51. package/build/src/components/DateInput.js +34 -32
  52. package/build/src/components/DatePicker.d.ts +4 -0
  53. package/build/src/components/DatePicker.js +35 -33
  54. package/build/src/components/DateRangePicker.d.ts +2 -0
  55. package/build/src/components/DateRangePicker.js +14 -10
  56. package/build/src/components/Dropdown.d.ts +7 -2
  57. package/build/src/components/Dropdown.js +68 -65
  58. package/build/src/components/DropdownMenu.d.ts +6 -2
  59. package/build/src/components/DropdownMenu.js +67 -65
  60. package/build/src/components/FileUploader.d.ts +3 -1
  61. package/build/src/components/FileUploader.js +39 -39
  62. package/build/src/components/FxInput.d.ts +4 -0
  63. package/build/src/components/FxInput.js +44 -42
  64. package/build/src/components/Input.d.ts +4 -0
  65. package/build/src/components/Input.js +37 -35
  66. package/build/src/components/Kebab.d.ts +5 -2
  67. package/build/src/components/Kebab.js +49 -48
  68. package/build/src/components/Label.d.ts +2 -0
  69. package/build/src/components/Label.js +9 -13
  70. package/build/src/components/Link.d.ts +4 -0
  71. package/build/src/components/Link.js +19 -25
  72. package/build/src/components/Loader.d.ts +2 -0
  73. package/build/src/components/Loader.js +15 -10
  74. package/build/src/components/MenuComponent.d.ts +10 -0
  75. package/build/src/components/MenuComponent.js +79 -0
  76. package/build/src/components/MenuItem.d.ts +2 -0
  77. package/build/src/components/MenuItem.js +7 -3
  78. package/build/src/components/Paging.d.ts +2 -0
  79. package/build/src/components/Paging.js +59 -52
  80. package/build/src/components/Portal.d.ts +2 -0
  81. package/build/src/components/Portal.js +14 -10
  82. package/build/src/components/Radio.d.ts +6 -0
  83. package/build/src/components/Radio.js +31 -27
  84. package/build/src/components/RadioGroup.d.ts +2 -0
  85. package/build/src/components/RadioGroup.js +51 -47
  86. package/build/src/components/Select.d.ts +5 -0
  87. package/build/src/components/Select.js +92 -76
  88. package/build/src/components/Spinner.d.ts +2 -0
  89. package/build/src/components/Spinner.js +13 -9
  90. package/build/src/components/Tab.d.ts +4 -0
  91. package/build/src/components/Tab.js +17 -27
  92. package/build/src/components/Textarea.d.ts +4 -0
  93. package/build/src/components/Textarea.js +33 -39
  94. package/build/src/components/Toast.d.ts +2 -0
  95. package/build/src/components/Toast.js +7 -3
  96. package/build/src/components/Toggle.d.ts +5 -0
  97. package/build/src/components/Toggle.js +24 -33
  98. package/build/src/components/Token.d.ts +3 -0
  99. package/build/src/components/Token.js +14 -9
  100. package/build/src/components/TokenInput.d.ts +4 -0
  101. package/build/src/components/TokenInput.js +61 -59
  102. package/build/src/components/Tooltip.d.ts +2 -0
  103. package/build/src/components/Tooltip.js +9 -9
  104. package/build/src/components/index.d.ts +1 -0
  105. package/build/src/components/index.js +3 -1
  106. package/build/src/extensions/index.d.ts +1 -0
  107. package/build/src/extensions/index.js +17 -0
  108. package/build/src/extensions/mergedExpects.d.ts +5 -0
  109. package/build/src/extensions/mergedExpects.js +7 -0
  110. package/build/src/index.d.ts +2 -0
  111. package/build/src/index.js +2 -0
  112. package/build/src/matchers/component/LocatorSymbols.d.ts +43 -0
  113. package/build/src/matchers/component/LocatorSymbols.js +13 -0
  114. package/build/src/matchers/component/toBeActiveTab.d.ts +3 -0
  115. package/build/src/matchers/component/toBeActiveTab.js +56 -0
  116. package/build/src/matchers/component/toBeAutoMode.d.ts +3 -0
  117. package/build/src/matchers/component/toBeAutoMode.js +62 -0
  118. package/build/src/matchers/component/toBeCheckedByIndex.d.ts +3 -0
  119. package/build/src/matchers/component/toBeCheckedByIndex.js +62 -0
  120. package/build/src/matchers/component/toBeCheckedByText.d.ts +3 -0
  121. package/build/src/matchers/component/toBeCheckedByText.js +62 -0
  122. package/build/src/matchers/component/toBeCheckedByValue.d.ts +3 -0
  123. package/build/src/matchers/component/toBeCheckedByValue.js +62 -0
  124. package/build/src/matchers/component/toBeCheckedEx.d.ts +3 -0
  125. package/build/src/matchers/component/toBeCheckedEx.js +56 -0
  126. package/build/src/matchers/component/toBeDisabledEx.d.ts +3 -0
  127. package/build/src/matchers/component/toBeDisabledEx.js +171 -0
  128. package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
  129. package/build/src/matchers/component/toBeEmptyEx.js +136 -0
  130. package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
  131. package/build/src/matchers/component/toBeEnabledEx.js +196 -0
  132. package/build/src/matchers/component/toBeFocusedEx.d.ts +3 -0
  133. package/build/src/matchers/component/toBeFocusedEx.js +56 -0
  134. package/build/src/matchers/component/toBeHiddenEx.d.ts +3 -0
  135. package/build/src/matchers/component/toBeHiddenEx.js +67 -0
  136. package/build/src/matchers/component/toBeInactiveTab.d.ts +3 -0
  137. package/build/src/matchers/component/toBeInactiveTab.js +56 -0
  138. package/build/src/matchers/component/toBeUnchecked.d.ts +3 -0
  139. package/build/src/matchers/component/toBeUnchecked.js +56 -0
  140. package/build/src/matchers/component/toBeUncheckedByIndex.d.ts +3 -0
  141. package/build/src/matchers/component/toBeUncheckedByIndex.js +62 -0
  142. package/build/src/matchers/component/toBeUncheckedByText.d.ts +3 -0
  143. package/build/src/matchers/component/toBeUncheckedByText.js +57 -0
  144. package/build/src/matchers/component/toBeUncheckedByValue.d.ts +3 -0
  145. package/build/src/matchers/component/toBeUncheckedByValue.js +57 -0
  146. package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
  147. package/build/src/matchers/component/toBeVisibleEx.js +67 -0
  148. package/build/src/matchers/component/toContainFormattedText.d.ts +3 -0
  149. package/build/src/matchers/component/toContainFormattedText.js +55 -0
  150. package/build/src/matchers/component/toContainItem.d.ts +4 -0
  151. package/build/src/matchers/component/toContainItem.js +78 -0
  152. package/build/src/matchers/component/toContainItems.d.ts +3 -0
  153. package/build/src/matchers/component/toContainItems.js +63 -0
  154. package/build/src/matchers/component/toContainSelectValue.d.ts +3 -0
  155. package/build/src/matchers/component/toContainSelectValue.js +55 -0
  156. package/build/src/matchers/component/toContainTabs.d.ts +3 -0
  157. package/build/src/matchers/component/toContainTabs.js +80 -0
  158. package/build/src/matchers/component/toContainTextEx.d.ts +3 -0
  159. package/build/src/matchers/component/toContainTextEx.js +56 -0
  160. package/build/src/matchers/component/toContainTokens.d.ts +4 -0
  161. package/build/src/matchers/component/toContainTokens.js +80 -0
  162. package/build/src/matchers/component/toContainUploadedFiles.d.ts +4 -0
  163. package/build/src/matchers/component/toContainUploadedFiles.js +75 -0
  164. package/build/src/matchers/component/toHaveActivePage.d.ts +4 -0
  165. package/build/src/matchers/component/toHaveActivePage.js +78 -0
  166. package/build/src/matchers/component/toHaveActiveTab.d.ts +2 -0
  167. package/build/src/matchers/component/toHaveActiveTab.js +62 -0
  168. package/build/src/matchers/component/toHaveAttributeEx.d.ts +3 -0
  169. package/build/src/matchers/component/toHaveAttributeEx.js +62 -0
  170. package/build/src/matchers/component/toHaveCountEx.d.ts +3 -0
  171. package/build/src/matchers/component/toHaveCountEx.js +56 -0
  172. package/build/src/matchers/component/toHaveError.d.ts +3 -0
  173. package/build/src/matchers/component/toHaveError.js +57 -0
  174. package/build/src/matchers/component/toHaveFormattedText.d.ts +3 -0
  175. package/build/src/matchers/component/toHaveFormattedText.js +56 -0
  176. package/build/src/matchers/component/toHaveFormattedValue.d.ts +3 -0
  177. package/build/src/matchers/component/toHaveFormattedValue.js +56 -0
  178. package/build/src/matchers/component/toHaveHref.d.ts +3 -0
  179. package/build/src/matchers/component/toHaveHref.js +55 -0
  180. package/build/src/matchers/component/toHaveItems.d.ts +3 -0
  181. package/build/src/matchers/component/toHaveItems.js +63 -0
  182. package/build/src/matchers/component/toHavePageCount.d.ts +4 -0
  183. package/build/src/matchers/component/toHavePageCount.js +71 -0
  184. package/build/src/matchers/component/toHaveTextEx.d.ts +3 -0
  185. package/build/src/matchers/component/toHaveTextEx.js +56 -0
  186. package/build/src/matchers/component/toHaveValueEx.d.ts +6 -0
  187. package/build/src/matchers/component/toHaveValueEx.js +197 -0
  188. package/build/src/matchers/component/toHaveWarning.d.ts +3 -0
  189. package/build/src/matchers/component/toHaveWarning.js +57 -0
  190. package/build/src/matchers/componentMatchers.d.ts +104 -0
  191. package/build/src/matchers/componentMatchers.js +89 -0
  192. package/build/src/matchers/createAsyncMatcher.d.ts +72 -0
  193. package/build/src/matchers/createAsyncMatcher.js +180 -0
  194. package/build/src/matchers/formattedMatchers.d.ts +15 -31
  195. package/build/src/matchers/formattedMatchers.js +19 -15
  196. package/build/src/matchers/index.d.ts +1 -1
  197. package/build/src/matchers/index.js +1 -3
  198. package/build/src/utils/getMarcherResult.d.ts +13 -0
  199. package/build/src/utils/getMarcherResult.js +13 -0
  200. package/build/src/utils/index.d.ts +3 -0
  201. package/build/src/utils/index.js +3 -0
  202. package/build/src/utils/makeMatcher.d.ts +5 -0
  203. package/build/src/utils/makeMatcher.js +65 -0
  204. package/build/src/utils/toMatchMessage.d.ts +23 -0
  205. package/build/src/utils/toMatchMessage.js +89 -0
  206. package/package.json +1 -1
  207. package/build/src/matchers/mergedExpects.d.ts +0 -15
  208. package/build/src/matchers/mergedExpects.js +0 -6
@@ -50,53 +50,58 @@ 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.FxInput = 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 FxInput = /** @class */ (function (_super) {
60
62
  __extends(FxInput, _super);
61
63
  function FxInput(rootLocator) {
62
64
  var _this = _super.call(this, rootLocator) || this;
65
+ _this[_a] = function () { return _this.inputLocator; };
66
+ _this[_b] = function () { return _this.inputLocator; };
67
+ _this[_c] = function () { return _this.inputLocator; };
63
68
  _this.autoButtonLocator = rootLocator.locator('button');
64
69
  _this.inputLocator = rootLocator.locator('input');
65
70
  return _this;
66
71
  }
67
72
  FxInput.prototype.isDisabled = function (options) {
68
73
  return __awaiter(this, void 0, void 0, function () {
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
74
+ return __generator(this, function (_d) {
75
+ switch (_d.label) {
71
76
  case 0: return [4 /*yield*/, this.inputLocator.isDisabled(options)];
72
- case 1: return [2 /*return*/, _a.sent()];
77
+ case 1: return [2 /*return*/, _d.sent()];
73
78
  }
74
79
  });
75
80
  });
76
81
  };
77
82
  FxInput.prototype.getValue = function (options) {
78
83
  return __awaiter(this, void 0, void 0, function () {
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
84
+ return __generator(this, function (_d) {
85
+ switch (_d.label) {
81
86
  case 0: return [4 /*yield*/, this.inputLocator.inputValue(options)];
82
- case 1: return [2 /*return*/, _a.sent()];
87
+ case 1: return [2 /*return*/, _d.sent()];
83
88
  }
84
89
  });
85
90
  });
86
91
  };
87
92
  FxInput.prototype.fill = function (value, options) {
88
93
  return __awaiter(this, void 0, void 0, function () {
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
94
+ return __generator(this, function (_d) {
95
+ switch (_d.label) {
91
96
  case 0: return [4 /*yield*/, this.focus()];
92
97
  case 1:
93
- _a.sent();
98
+ _d.sent();
94
99
  return [4 /*yield*/, this.clear()];
95
100
  case 2:
96
- _a.sent();
101
+ _d.sent();
97
102
  return [4 /*yield*/, this.inputLocator.fill(value, options)];
98
103
  case 3:
99
- _a.sent();
104
+ _d.sent();
100
105
  return [2 /*return*/];
101
106
  }
102
107
  });
@@ -104,11 +109,11 @@ var FxInput = /** @class */ (function (_super) {
104
109
  };
105
110
  FxInput.prototype.press = function (value, options) {
106
111
  return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
112
+ return __generator(this, function (_d) {
113
+ switch (_d.label) {
109
114
  case 0: return [4 /*yield*/, this.inputLocator.press(value, options)];
110
115
  case 1:
111
- _a.sent();
116
+ _d.sent();
112
117
  return [2 /*return*/];
113
118
  }
114
119
  });
@@ -116,11 +121,11 @@ var FxInput = /** @class */ (function (_super) {
116
121
  };
117
122
  FxInput.prototype.pressSequentially = function (value, options) {
118
123
  return __awaiter(this, void 0, void 0, function () {
119
- return __generator(this, function (_a) {
120
- switch (_a.label) {
124
+ return __generator(this, function (_d) {
125
+ switch (_d.label) {
121
126
  case 0: return [4 /*yield*/, this.inputLocator.pressSequentially(value, options)];
122
127
  case 1:
123
- _a.sent();
128
+ _d.sent();
124
129
  return [2 /*return*/];
125
130
  }
126
131
  });
@@ -128,11 +133,11 @@ var FxInput = /** @class */ (function (_super) {
128
133
  };
129
134
  FxInput.prototype.clear = function (options) {
130
135
  return __awaiter(this, void 0, void 0, function () {
131
- return __generator(this, function (_a) {
132
- switch (_a.label) {
136
+ return __generator(this, function (_d) {
137
+ switch (_d.label) {
133
138
  case 0: return [4 /*yield*/, this.inputLocator.clear(options)];
134
139
  case 1:
135
- _a.sent();
140
+ _d.sent();
136
141
  return [2 /*return*/];
137
142
  }
138
143
  });
@@ -140,14 +145,14 @@ var FxInput = /** @class */ (function (_super) {
140
145
  };
141
146
  FxInput.prototype.focus = function (options) {
142
147
  return __awaiter(this, void 0, void 0, function () {
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
148
+ return __generator(this, function (_d) {
149
+ switch (_d.label) {
145
150
  case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
146
151
  case 1:
147
- _a.sent();
152
+ _d.sent();
148
153
  return [4 /*yield*/, this.inputLocator.focus(options)];
149
154
  case 2:
150
- _a.sent();
155
+ _d.sent();
151
156
  return [2 /*return*/];
152
157
  }
153
158
  });
@@ -155,11 +160,11 @@ var FxInput = /** @class */ (function (_super) {
155
160
  };
156
161
  FxInput.prototype.blur = function (options) {
157
162
  return __awaiter(this, void 0, void 0, function () {
158
- return __generator(this, function (_a) {
159
- switch (_a.label) {
163
+ return __generator(this, function (_d) {
164
+ switch (_d.label) {
160
165
  case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
161
166
  case 1:
162
- _a.sent();
167
+ _d.sent();
163
168
  return [2 /*return*/];
164
169
  }
165
170
  });
@@ -167,43 +172,39 @@ var FxInput = /** @class */ (function (_super) {
167
172
  };
168
173
  FxInput.prototype.click = function (options) {
169
174
  return __awaiter(this, void 0, void 0, function () {
170
- return __generator(this, function (_a) {
171
- switch (_a.label) {
175
+ return __generator(this, function (_d) {
176
+ switch (_d.label) {
172
177
  case 0: return [4 /*yield*/, this.inputLocator.click(options)];
173
178
  case 1:
174
- _a.sent();
179
+ _d.sent();
175
180
  return [2 /*return*/];
176
181
  }
177
182
  });
178
183
  });
179
184
  };
180
185
  FxInput.prototype.getTooltip = function (type) {
181
- return __awaiter(this, void 0, void 0, function () {
182
- return __generator(this, function (_a) {
183
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
184
- });
185
- });
186
+ return (0, utils_1.getTooltip)(type, this);
186
187
  };
187
188
  FxInput.prototype.isAuto = function (options) {
188
189
  return __awaiter(this, void 0, void 0, function () {
189
- return __generator(this, function (_a) {
190
- switch (_a.label) {
190
+ return __generator(this, function (_d) {
191
+ switch (_d.label) {
191
192
  case 0: return [4 /*yield*/, this.waitFor()];
192
193
  case 1:
193
- _a.sent();
194
+ _d.sent();
194
195
  return [4 /*yield*/, this.autoButtonLocator.isVisible(options)];
195
- case 2: return [2 /*return*/, !(_a.sent())];
196
+ case 2: return [2 /*return*/, !(_d.sent())];
196
197
  }
197
198
  });
198
199
  });
199
200
  };
200
201
  FxInput.prototype.setAuto = function (options) {
201
202
  return __awaiter(this, void 0, void 0, function () {
202
- return __generator(this, function (_a) {
203
- switch (_a.label) {
203
+ return __generator(this, function (_d) {
204
+ switch (_d.label) {
204
205
  case 0: return [4 /*yield*/, this.autoButtonLocator.click(options)];
205
206
  case 1:
206
- _a.sent();
207
+ _d.sent();
207
208
  return [2 /*return*/];
208
209
  }
209
210
  });
@@ -215,3 +216,4 @@ var FxInput = /** @class */ (function (_super) {
215
216
  return FxInput;
216
217
  }(BaseComponent_1.BaseComponent));
217
218
  exports.FxInput = FxInput;
219
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -3,9 +3,13 @@ import { BaseComponent } from './BaseComponent';
3
3
  import { type TooltipType } from '../utils';
4
4
  import { InputAssertions } from '../assertions';
5
5
  import type { BlurOptions, ClearOptions, ClickOptions, FillOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions, PressSequentiallyOptions } from '../options';
6
+ import { toControlElementLocator, toFocusableElementLocator, toValueElementLocator } from '../matchers/component/LocatorSymbols';
6
7
  export declare class Input extends BaseComponent {
7
8
  readonly rootLocator: Locator;
8
9
  readonly inputLocator: Locator;
10
+ readonly [toControlElementLocator]: () => Locator;
11
+ readonly [toValueElementLocator]: () => Locator;
12
+ readonly [toFocusableElementLocator]: () => Locator;
9
13
  constructor(rootLocator: Locator);
10
14
  isDisabled(options?: IsDisabledOptions): Promise<boolean>;
11
15
  getValue(options?: InputValueOptions): Promise<string>;
@@ -50,53 +50,58 @@ 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.Input = 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 Input = /** @class */ (function (_super) {
60
62
  __extends(Input, _super);
61
63
  function Input(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; };
64
69
  _this.inputLocator = rootLocator.locator('input');
65
70
  return _this;
66
71
  }
67
72
  Input.prototype.isDisabled = function (options) {
68
73
  return __awaiter(this, void 0, void 0, function () {
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
74
+ return __generator(this, function (_d) {
75
+ switch (_d.label) {
71
76
  case 0: return [4 /*yield*/, this.inputLocator.isDisabled(options)];
72
- case 1: return [2 /*return*/, _a.sent()];
77
+ case 1: return [2 /*return*/, _d.sent()];
73
78
  }
74
79
  });
75
80
  });
76
81
  };
77
82
  Input.prototype.getValue = function (options) {
78
83
  return __awaiter(this, void 0, void 0, function () {
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
84
+ return __generator(this, function (_d) {
85
+ switch (_d.label) {
81
86
  case 0: return [4 /*yield*/, this.inputLocator.inputValue(options)];
82
- case 1: return [2 /*return*/, _a.sent()];
87
+ case 1: return [2 /*return*/, _d.sent()];
83
88
  }
84
89
  });
85
90
  });
86
91
  };
87
92
  Input.prototype.fill = function (value, options) {
88
93
  return __awaiter(this, void 0, void 0, function () {
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
94
+ return __generator(this, function (_d) {
95
+ switch (_d.label) {
91
96
  case 0: return [4 /*yield*/, this.focus()];
92
97
  case 1:
93
- _a.sent();
98
+ _d.sent();
94
99
  return [4 /*yield*/, this.clear()];
95
100
  case 2:
96
- _a.sent();
101
+ _d.sent();
97
102
  return [4 /*yield*/, this.inputLocator.fill(value, options)];
98
103
  case 3:
99
- _a.sent();
104
+ _d.sent();
100
105
  return [2 /*return*/];
101
106
  }
102
107
  });
@@ -104,11 +109,11 @@ var Input = /** @class */ (function (_super) {
104
109
  };
105
110
  Input.prototype.press = function (value, options) {
106
111
  return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
112
+ return __generator(this, function (_d) {
113
+ switch (_d.label) {
109
114
  case 0: return [4 /*yield*/, this.inputLocator.press(value, options)];
110
115
  case 1:
111
- _a.sent();
116
+ _d.sent();
112
117
  return [2 /*return*/];
113
118
  }
114
119
  });
@@ -116,11 +121,11 @@ var Input = /** @class */ (function (_super) {
116
121
  };
117
122
  Input.prototype.pressSequentially = function (value, options) {
118
123
  return __awaiter(this, void 0, void 0, function () {
119
- return __generator(this, function (_a) {
120
- switch (_a.label) {
124
+ return __generator(this, function (_d) {
125
+ switch (_d.label) {
121
126
  case 0: return [4 /*yield*/, this.inputLocator.pressSequentially(value, options)];
122
127
  case 1:
123
- _a.sent();
128
+ _d.sent();
124
129
  return [2 /*return*/];
125
130
  }
126
131
  });
@@ -128,11 +133,11 @@ var Input = /** @class */ (function (_super) {
128
133
  };
129
134
  Input.prototype.clear = function (options) {
130
135
  return __awaiter(this, void 0, void 0, function () {
131
- return __generator(this, function (_a) {
132
- switch (_a.label) {
136
+ return __generator(this, function (_d) {
137
+ switch (_d.label) {
133
138
  case 0: return [4 /*yield*/, this.inputLocator.clear(options)];
134
139
  case 1:
135
- _a.sent();
140
+ _d.sent();
136
141
  return [2 /*return*/];
137
142
  }
138
143
  });
@@ -140,14 +145,14 @@ var Input = /** @class */ (function (_super) {
140
145
  };
141
146
  Input.prototype.focus = function (options) {
142
147
  return __awaiter(this, void 0, void 0, function () {
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
148
+ return __generator(this, function (_d) {
149
+ switch (_d.label) {
145
150
  case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
146
151
  case 1:
147
- _a.sent();
152
+ _d.sent();
148
153
  return [4 /*yield*/, this.inputLocator.focus(options)];
149
154
  case 2:
150
- _a.sent();
155
+ _d.sent();
151
156
  return [2 /*return*/];
152
157
  }
153
158
  });
@@ -155,11 +160,11 @@ var Input = /** @class */ (function (_super) {
155
160
  };
156
161
  Input.prototype.blur = function (options) {
157
162
  return __awaiter(this, void 0, void 0, function () {
158
- return __generator(this, function (_a) {
159
- switch (_a.label) {
163
+ return __generator(this, function (_d) {
164
+ switch (_d.label) {
160
165
  case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
161
166
  case 1:
162
- _a.sent();
167
+ _d.sent();
163
168
  return [2 /*return*/];
164
169
  }
165
170
  });
@@ -167,22 +172,18 @@ var Input = /** @class */ (function (_super) {
167
172
  };
168
173
  Input.prototype.click = function (options) {
169
174
  return __awaiter(this, void 0, void 0, function () {
170
- return __generator(this, function (_a) {
171
- switch (_a.label) {
175
+ return __generator(this, function (_d) {
176
+ switch (_d.label) {
172
177
  case 0: return [4 /*yield*/, this.inputLocator.click(options)];
173
178
  case 1:
174
- _a.sent();
179
+ _d.sent();
175
180
  return [2 /*return*/];
176
181
  }
177
182
  });
178
183
  });
179
184
  };
180
185
  Input.prototype.getTooltip = function (type) {
181
- return __awaiter(this, void 0, void 0, function () {
182
- return __generator(this, function (_a) {
183
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
184
- });
185
- });
186
+ return (0, utils_1.getTooltip)(type, this);
186
187
  };
187
188
  Input.prototype.expect = function () {
188
189
  return new assertions_1.InputAssertions(this);
@@ -190,3 +191,4 @@ var Input = /** @class */ (function (_super) {
190
191
  return Input;
191
192
  }(BaseComponent_1.BaseComponent));
192
193
  exports.Input = Input;
194
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -1,12 +1,15 @@
1
1
  import type { Locator } from '@playwright/test';
2
- import { BaseComponent } from './BaseComponent';
3
2
  import { ComponentList } from './ComponentList';
4
3
  import { MenuItem } from './MenuItem';
5
4
  import { KebabAssertions } from '../assertions';
6
5
  import type { ClickOptions, GetAttributeOptions } from '../options';
7
- export declare class Kebab extends BaseComponent {
6
+ import { MenuComponent } from './MenuComponent';
7
+ import { toControlElementLocator, toItemsElementLocator } from '../matchers/component/LocatorSymbols';
8
+ export declare class Kebab extends MenuComponent {
8
9
  private readonly portal;
9
10
  readonly captionLocator: Locator;
11
+ readonly [toControlElementLocator]: () => Locator;
12
+ readonly [toItemsElementLocator]: () => Promise<Locator>;
10
13
  constructor(rootLocator: Locator);
11
14
  isDisabled(options?: GetAttributeOptions): Promise<boolean>;
12
15
  isMenuOpened(): Promise<boolean>;
@@ -50,52 +50,52 @@ 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.Kebab = void 0;
55
56
  var react_ui_1 = require("@skbkontur/react-ui");
56
- var BaseComponent_1 = require("./BaseComponent");
57
57
  var Portal_1 = require("./Portal");
58
58
  var utils_1 = require("../utils");
59
59
  var ComponentList_1 = require("./ComponentList");
60
60
  var MenuItem_1 = require("./MenuItem");
61
61
  var assertions_1 = require("../assertions");
62
62
  var dataTidSelector_1 = require("../utils/dataTidSelector");
63
+ var MenuComponent_1 = require("./MenuComponent");
64
+ var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
63
65
  var Kebab = /** @class */ (function (_super) {
64
66
  __extends(Kebab, _super);
65
67
  function Kebab(rootLocator) {
66
68
  var _this = _super.call(this, rootLocator) || this;
69
+ _this[_a] = function () { return _this.rootLocator; };
70
+ _this[_b] = function () { return _this.getItemsLocator(); };
67
71
  _this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
68
72
  _this.captionLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.KebabDataTids.caption));
69
73
  return _this;
70
74
  }
71
75
  Kebab.prototype.isDisabled = function (options) {
72
76
  return __awaiter(this, void 0, void 0, function () {
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
77
+ return __generator(this, function (_c) {
78
+ switch (_c.label) {
75
79
  case 0: return [4 /*yield*/, this.getAttribute(utils_1.DataVisualState.Disabled, options)];
76
- case 1: return [2 /*return*/, (_a.sent()) !== null];
80
+ case 1: return [2 /*return*/, (_c.sent()) !== null];
77
81
  }
78
82
  });
79
83
  });
80
84
  };
81
85
  Kebab.prototype.isMenuOpened = function () {
82
- return __awaiter(this, void 0, void 0, function () {
83
- return __generator(this, function (_a) {
84
- return [2 /*return*/, this.portal.isVisible()];
85
- });
86
- });
86
+ return this.portal.isVisible();
87
87
  };
88
88
  Kebab.prototype.selectFirstByText = function (text, options) {
89
89
  return __awaiter(this, void 0, void 0, function () {
90
90
  var item;
91
- return __generator(this, function (_a) {
92
- switch (_a.label) {
91
+ return __generator(this, function (_c) {
92
+ switch (_c.label) {
93
93
  case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
94
94
  case 1:
95
- item = _a.sent();
95
+ item = _c.sent();
96
96
  return [4 /*yield*/, item.first().click(options)];
97
97
  case 2:
98
- _a.sent();
98
+ _c.sent();
99
99
  return [2 /*return*/];
100
100
  }
101
101
  });
@@ -104,14 +104,14 @@ var Kebab = /** @class */ (function (_super) {
104
104
  Kebab.prototype.selectByIndex = function (index, options) {
105
105
  return __awaiter(this, void 0, void 0, function () {
106
106
  var items;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
107
+ return __generator(this, function (_c) {
108
+ switch (_c.label) {
109
109
  case 0: return [4 /*yield*/, this.getMenuItemsLocator()];
110
110
  case 1:
111
- items = _a.sent();
111
+ items = _c.sent();
112
112
  return [4 /*yield*/, items.nth(index).click(options)];
113
113
  case 2:
114
- _a.sent();
114
+ _c.sent();
115
115
  return [2 /*return*/];
116
116
  }
117
117
  });
@@ -120,20 +120,20 @@ var Kebab = /** @class */ (function (_super) {
120
120
  Kebab.prototype.selectByDataTid = function (dataTid, options) {
121
121
  return __awaiter(this, void 0, void 0, function () {
122
122
  var container, item;
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
123
+ return __generator(this, function (_c) {
124
+ switch (_c.label) {
125
125
  case 0: return [4 /*yield*/, this.getPortalContainer()];
126
126
  case 1:
127
- container = _a.sent();
127
+ container = _c.sent();
128
128
  item = container.locator((0, dataTidSelector_1.getDataTidSelector)(dataTid));
129
129
  return [4 /*yield*/, item.count()];
130
130
  case 2:
131
- if ((_a.sent()) > 1) {
131
+ if ((_c.sent()) > 1) {
132
132
  throw Error('DataTid должен быть уникальным');
133
133
  }
134
134
  return [4 /*yield*/, item.click(options)];
135
135
  case 3:
136
- _a.sent();
136
+ _c.sent();
137
137
  return [2 /*return*/];
138
138
  }
139
139
  });
@@ -141,14 +141,14 @@ var Kebab = /** @class */ (function (_super) {
141
141
  };
142
142
  Kebab.prototype.click = function (options) {
143
143
  return __awaiter(this, void 0, void 0, function () {
144
- return __generator(this, function (_a) {
145
- switch (_a.label) {
144
+ return __generator(this, function (_c) {
145
+ switch (_c.label) {
146
146
  case 0: return [4 /*yield*/, this.expect().toBeEnabled()];
147
147
  case 1:
148
- _a.sent();
148
+ _c.sent();
149
149
  return [4 /*yield*/, this.captionLocator.click(options)];
150
150
  case 2:
151
- _a.sent();
151
+ _c.sent();
152
152
  return [2 /*return*/];
153
153
  }
154
154
  });
@@ -161,11 +161,11 @@ var Kebab = /** @class */ (function (_super) {
161
161
  Kebab.prototype.getMenuItems = function () {
162
162
  return __awaiter(this, void 0, void 0, function () {
163
163
  var container;
164
- return __generator(this, function (_a) {
165
- switch (_a.label) {
164
+ return __generator(this, function (_c) {
165
+ switch (_c.label) {
166
166
  case 0: return [4 /*yield*/, this.getPortalContainer()];
167
167
  case 1:
168
- container = _a.sent();
168
+ container = _c.sent();
169
169
  return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) { return locator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root)); }, function (locator) { return new MenuItem_1.MenuItem(locator); })];
170
170
  }
171
171
  });
@@ -175,23 +175,23 @@ var Kebab = /** @class */ (function (_super) {
175
175
  return __awaiter(this, void 0, void 0, function () {
176
176
  var items;
177
177
  var _this = this;
178
- return __generator(this, function (_a) {
179
- switch (_a.label) {
178
+ return __generator(this, function (_c) {
179
+ switch (_c.label) {
180
180
  case 0: return [4 /*yield*/, this.getMenuItems()];
181
181
  case 1:
182
- items = _a.sent();
182
+ items = _c.sent();
183
183
  return [4 /*yield*/, items.getFirstItemByPredicate(function (item) { return __awaiter(_this, void 0, void 0, function () {
184
184
  var itemText;
185
- return __generator(this, function (_a) {
186
- switch (_a.label) {
185
+ return __generator(this, function (_c) {
186
+ switch (_c.label) {
187
187
  case 0: return [4 /*yield*/, item.getText()];
188
188
  case 1:
189
- itemText = _a.sent();
189
+ itemText = _c.sent();
190
190
  return [2 /*return*/, itemText.toLowerCase() === text.toLowerCase()];
191
191
  }
192
192
  });
193
193
  }); })];
194
- case 2: return [2 /*return*/, _a.sent()];
194
+ case 2: return [2 /*return*/, _c.sent()];
195
195
  }
196
196
  });
197
197
  });
@@ -199,11 +199,11 @@ var Kebab = /** @class */ (function (_super) {
199
199
  Kebab.prototype.getMenuItemByIndex = function (index) {
200
200
  return __awaiter(this, void 0, void 0, function () {
201
201
  var items;
202
- return __generator(this, function (_a) {
203
- switch (_a.label) {
202
+ return __generator(this, function (_c) {
203
+ switch (_c.label) {
204
204
  case 0: return [4 /*yield*/, this.getMenuItems()];
205
205
  case 1:
206
- items = _a.sent();
206
+ items = _c.sent();
207
207
  return [2 /*return*/, items.getItemByIndex(index)];
208
208
  }
209
209
  });
@@ -215,11 +215,11 @@ var Kebab = /** @class */ (function (_super) {
215
215
  Kebab.prototype.getMenuItemsLocator = function (byText) {
216
216
  return __awaiter(this, void 0, void 0, function () {
217
217
  var container, items;
218
- return __generator(this, function (_a) {
219
- switch (_a.label) {
218
+ return __generator(this, function (_c) {
219
+ switch (_c.label) {
220
220
  case 0: return [4 /*yield*/, this.getPortalContainer()];
221
221
  case 1:
222
- container = _a.sent();
222
+ container = _c.sent();
223
223
  items = container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root));
224
224
  return [2 /*return*/, !byText ? items : items.getByText(byText)];
225
225
  }
@@ -228,20 +228,21 @@ var Kebab = /** @class */ (function (_super) {
228
228
  };
229
229
  Kebab.prototype.getPortalContainer = function () {
230
230
  return __awaiter(this, void 0, void 0, function () {
231
- return __generator(this, function (_a) {
232
- switch (_a.label) {
231
+ return __generator(this, function (_c) {
232
+ switch (_c.label) {
233
233
  case 0: return [4 /*yield*/, this.isMenuOpened()];
234
234
  case 1:
235
- if (!!(_a.sent())) return [3 /*break*/, 3];
235
+ if (!!(_c.sent())) return [3 /*break*/, 3];
236
236
  return [4 /*yield*/, this.click()];
237
237
  case 2:
238
- _a.sent();
239
- _a.label = 3;
238
+ _c.sent();
239
+ _c.label = 3;
240
240
  case 3: return [2 /*return*/, this.portal.getContainer()];
241
241
  }
242
242
  });
243
243
  });
244
244
  };
245
245
  return Kebab;
246
- }(BaseComponent_1.BaseComponent));
246
+ }(MenuComponent_1.MenuComponent));
247
247
  exports.Kebab = Kebab;
248
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toItemsElementLocator;