@skbkontur/playwright-react-ui-components 1.13.2 → 1.14.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) 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 +9 -2
  45. package/build/src/components/ComboBox.js +68 -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 +8 -2
  57. package/build/src/components/Dropdown.js +69 -65
  58. package/build/src/components/DropdownMenu.d.ts +7 -2
  59. package/build/src/components/DropdownMenu.js +68 -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 +6 -2
  67. package/build/src/components/Kebab.js +50 -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 +9 -0
  75. package/build/src/components/MenuComponent.js +78 -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/toBeActiveEx.d.ts +3 -0
  115. package/build/src/matchers/component/toBeActiveEx.js +56 -0
  116. package/build/src/matchers/component/toBeAutoEx.d.ts +3 -0
  117. package/build/src/matchers/component/toBeAutoEx.js +62 -0
  118. package/build/src/matchers/component/toBeCheckedByIndexEx.d.ts +3 -0
  119. package/build/src/matchers/component/toBeCheckedByIndexEx.js +62 -0
  120. package/build/src/matchers/component/toBeCheckedByTextEx.d.ts +3 -0
  121. package/build/src/matchers/component/toBeCheckedByTextEx.js +62 -0
  122. package/build/src/matchers/component/toBeCheckedByValueEx.d.ts +3 -0
  123. package/build/src/matchers/component/toBeCheckedByValueEx.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 +172 -0
  128. package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
  129. package/build/src/matchers/component/toBeEmptyEx.js +137 -0
  130. package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
  131. package/build/src/matchers/component/toBeEnabledEx.js +206 -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 +68 -0
  136. package/build/src/matchers/component/toBeInactiveEx.d.ts +3 -0
  137. package/build/src/matchers/component/toBeInactiveEx.js +56 -0
  138. package/build/src/matchers/component/toBeUncheckedByIndexEx.d.ts +3 -0
  139. package/build/src/matchers/component/toBeUncheckedByIndexEx.js +62 -0
  140. package/build/src/matchers/component/toBeUncheckedByTextEx.d.ts +3 -0
  141. package/build/src/matchers/component/toBeUncheckedByTextEx.js +57 -0
  142. package/build/src/matchers/component/toBeUncheckedByValueEx.d.ts +3 -0
  143. package/build/src/matchers/component/toBeUncheckedByValueEx.js +57 -0
  144. package/build/src/matchers/component/toBeUncheckedEx.d.ts +3 -0
  145. package/build/src/matchers/component/toBeUncheckedEx.js +56 -0
  146. package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
  147. package/build/src/matchers/component/toBeVisibleEx.js +68 -0
  148. package/build/src/matchers/component/toContainFormattedTextEx.d.ts +3 -0
  149. package/build/src/matchers/component/toContainFormattedTextEx.js +55 -0
  150. package/build/src/matchers/component/toContainItemEx.d.ts +4 -0
  151. package/build/src/matchers/component/toContainItemEx.js +79 -0
  152. package/build/src/matchers/component/toContainItemsEx.d.ts +3 -0
  153. package/build/src/matchers/component/toContainItemsEx.js +63 -0
  154. package/build/src/matchers/component/toContainTabsEx.d.ts +3 -0
  155. package/build/src/matchers/component/toContainTabsEx.js +80 -0
  156. package/build/src/matchers/component/toContainTextEx.d.ts +3 -0
  157. package/build/src/matchers/component/toContainTextEx.js +56 -0
  158. package/build/src/matchers/component/toContainTokensEx.d.ts +4 -0
  159. package/build/src/matchers/component/toContainTokensEx.js +80 -0
  160. package/build/src/matchers/component/toContainUploadedFilesEx.d.ts +4 -0
  161. package/build/src/matchers/component/toContainUploadedFilesEx.js +75 -0
  162. package/build/src/matchers/component/toContainValueEx.d.ts +3 -0
  163. package/build/src/matchers/component/toContainValueEx.js +55 -0
  164. package/build/src/matchers/component/toHaveActivePageEx.d.ts +4 -0
  165. package/build/src/matchers/component/toHaveActivePageEx.js +78 -0
  166. package/build/src/matchers/component/toHaveActiveTabEx.d.ts +2 -0
  167. package/build/src/matchers/component/toHaveActiveTabEx.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/toHaveErrorEx.d.ts +3 -0
  173. package/build/src/matchers/component/toHaveErrorEx.js +57 -0
  174. package/build/src/matchers/component/toHaveFormattedTextEx.d.ts +3 -0
  175. package/build/src/matchers/component/toHaveFormattedTextEx.js +56 -0
  176. package/build/src/matchers/component/toHaveFormattedValueEx.d.ts +3 -0
  177. package/build/src/matchers/component/toHaveFormattedValueEx.js +56 -0
  178. package/build/src/matchers/component/toHaveHrefEx.d.ts +3 -0
  179. package/build/src/matchers/component/toHaveHrefEx.js +55 -0
  180. package/build/src/matchers/component/toHaveItemsEx.d.ts +3 -0
  181. package/build/src/matchers/component/toHaveItemsEx.js +63 -0
  182. package/build/src/matchers/component/toHavePageCountEx.d.ts +4 -0
  183. package/build/src/matchers/component/toHavePageCountEx.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 +198 -0
  188. package/build/src/matchers/component/toHaveWarningEx.d.ts +3 -0
  189. package/build/src/matchers/component/toHaveWarningEx.js +57 -0
  190. package/build/src/matchers/componentMatchers.d.ts +104 -0
  191. package/build/src/matchers/componentMatchers.js +83 -0
  192. package/build/src/matchers/createAsyncMatcher.d.ts +47 -0
  193. package/build/src/matchers/createAsyncMatcher.js +155 -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/is.d.ts +3 -0
  203. package/build/src/utils/is.js +5 -0
  204. package/build/src/utils/makeMatcher.d.ts +5 -0
  205. package/build/src/utils/makeMatcher.js +65 -0
  206. package/build/src/utils/toMatchMessage.d.ts +12 -0
  207. package/build/src/utils/toMatchMessage.js +78 -0
  208. package/package.json +1 -1
  209. package/build/src/matchers/mergedExpects.d.ts +0 -15
  210. 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,16 @@
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, toContainItemElementLocator, 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>;
13
+ readonly [toContainItemElementLocator]: () => Locator;
10
14
  constructor(rootLocator: Locator);
11
15
  isDisabled(options?: GetAttributeOptions): Promise<boolean>;
12
16
  isMenuOpened(): Promise<boolean>;
@@ -50,52 +50,53 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
50
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
51
  }
52
52
  };
53
+ var _a, _b, _c;
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(); };
71
+ _this[_c] = function () { return _this.rootLocator; };
67
72
  _this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
68
73
  _this.captionLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.KebabDataTids.caption));
69
74
  return _this;
70
75
  }
71
76
  Kebab.prototype.isDisabled = function (options) {
72
77
  return __awaiter(this, void 0, void 0, function () {
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
78
+ return __generator(this, function (_d) {
79
+ switch (_d.label) {
75
80
  case 0: return [4 /*yield*/, this.getAttribute(utils_1.DataVisualState.Disabled, options)];
76
- case 1: return [2 /*return*/, (_a.sent()) !== null];
81
+ case 1: return [2 /*return*/, (_d.sent()) !== null];
77
82
  }
78
83
  });
79
84
  });
80
85
  };
81
86
  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
- });
87
+ return this.portal.isVisible();
87
88
  };
88
89
  Kebab.prototype.selectFirstByText = function (text, options) {
89
90
  return __awaiter(this, void 0, void 0, function () {
90
91
  var item;
91
- return __generator(this, function (_a) {
92
- switch (_a.label) {
92
+ return __generator(this, function (_d) {
93
+ switch (_d.label) {
93
94
  case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
94
95
  case 1:
95
- item = _a.sent();
96
+ item = _d.sent();
96
97
  return [4 /*yield*/, item.first().click(options)];
97
98
  case 2:
98
- _a.sent();
99
+ _d.sent();
99
100
  return [2 /*return*/];
100
101
  }
101
102
  });
@@ -104,14 +105,14 @@ var Kebab = /** @class */ (function (_super) {
104
105
  Kebab.prototype.selectByIndex = function (index, options) {
105
106
  return __awaiter(this, void 0, void 0, function () {
106
107
  var items;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
108
+ return __generator(this, function (_d) {
109
+ switch (_d.label) {
109
110
  case 0: return [4 /*yield*/, this.getMenuItemsLocator()];
110
111
  case 1:
111
- items = _a.sent();
112
+ items = _d.sent();
112
113
  return [4 /*yield*/, items.nth(index).click(options)];
113
114
  case 2:
114
- _a.sent();
115
+ _d.sent();
115
116
  return [2 /*return*/];
116
117
  }
117
118
  });
@@ -120,20 +121,20 @@ var Kebab = /** @class */ (function (_super) {
120
121
  Kebab.prototype.selectByDataTid = function (dataTid, options) {
121
122
  return __awaiter(this, void 0, void 0, function () {
122
123
  var container, item;
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
124
+ return __generator(this, function (_d) {
125
+ switch (_d.label) {
125
126
  case 0: return [4 /*yield*/, this.getPortalContainer()];
126
127
  case 1:
127
- container = _a.sent();
128
+ container = _d.sent();
128
129
  item = container.locator((0, dataTidSelector_1.getDataTidSelector)(dataTid));
129
130
  return [4 /*yield*/, item.count()];
130
131
  case 2:
131
- if ((_a.sent()) > 1) {
132
+ if ((_d.sent()) > 1) {
132
133
  throw Error('DataTid должен быть уникальным');
133
134
  }
134
135
  return [4 /*yield*/, item.click(options)];
135
136
  case 3:
136
- _a.sent();
137
+ _d.sent();
137
138
  return [2 /*return*/];
138
139
  }
139
140
  });
@@ -141,14 +142,14 @@ var Kebab = /** @class */ (function (_super) {
141
142
  };
142
143
  Kebab.prototype.click = function (options) {
143
144
  return __awaiter(this, void 0, void 0, function () {
144
- return __generator(this, function (_a) {
145
- switch (_a.label) {
145
+ return __generator(this, function (_d) {
146
+ switch (_d.label) {
146
147
  case 0: return [4 /*yield*/, this.expect().toBeEnabled()];
147
148
  case 1:
148
- _a.sent();
149
+ _d.sent();
149
150
  return [4 /*yield*/, this.captionLocator.click(options)];
150
151
  case 2:
151
- _a.sent();
152
+ _d.sent();
152
153
  return [2 /*return*/];
153
154
  }
154
155
  });
@@ -161,11 +162,11 @@ var Kebab = /** @class */ (function (_super) {
161
162
  Kebab.prototype.getMenuItems = function () {
162
163
  return __awaiter(this, void 0, void 0, function () {
163
164
  var container;
164
- return __generator(this, function (_a) {
165
- switch (_a.label) {
165
+ return __generator(this, function (_d) {
166
+ switch (_d.label) {
166
167
  case 0: return [4 /*yield*/, this.getPortalContainer()];
167
168
  case 1:
168
- container = _a.sent();
169
+ container = _d.sent();
169
170
  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
171
  }
171
172
  });
@@ -175,23 +176,23 @@ var Kebab = /** @class */ (function (_super) {
175
176
  return __awaiter(this, void 0, void 0, function () {
176
177
  var items;
177
178
  var _this = this;
178
- return __generator(this, function (_a) {
179
- switch (_a.label) {
179
+ return __generator(this, function (_d) {
180
+ switch (_d.label) {
180
181
  case 0: return [4 /*yield*/, this.getMenuItems()];
181
182
  case 1:
182
- items = _a.sent();
183
+ items = _d.sent();
183
184
  return [4 /*yield*/, items.getFirstItemByPredicate(function (item) { return __awaiter(_this, void 0, void 0, function () {
184
185
  var itemText;
185
- return __generator(this, function (_a) {
186
- switch (_a.label) {
186
+ return __generator(this, function (_d) {
187
+ switch (_d.label) {
187
188
  case 0: return [4 /*yield*/, item.getText()];
188
189
  case 1:
189
- itemText = _a.sent();
190
+ itemText = _d.sent();
190
191
  return [2 /*return*/, itemText.toLowerCase() === text.toLowerCase()];
191
192
  }
192
193
  });
193
194
  }); })];
194
- case 2: return [2 /*return*/, _a.sent()];
195
+ case 2: return [2 /*return*/, _d.sent()];
195
196
  }
196
197
  });
197
198
  });
@@ -199,11 +200,11 @@ var Kebab = /** @class */ (function (_super) {
199
200
  Kebab.prototype.getMenuItemByIndex = function (index) {
200
201
  return __awaiter(this, void 0, void 0, function () {
201
202
  var items;
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.getMenuItems()];
205
206
  case 1:
206
- items = _a.sent();
207
+ items = _d.sent();
207
208
  return [2 /*return*/, items.getItemByIndex(index)];
208
209
  }
209
210
  });
@@ -215,11 +216,11 @@ var Kebab = /** @class */ (function (_super) {
215
216
  Kebab.prototype.getMenuItemsLocator = function (byText) {
216
217
  return __awaiter(this, void 0, void 0, function () {
217
218
  var container, items;
218
- return __generator(this, function (_a) {
219
- switch (_a.label) {
219
+ return __generator(this, function (_d) {
220
+ switch (_d.label) {
220
221
  case 0: return [4 /*yield*/, this.getPortalContainer()];
221
222
  case 1:
222
- container = _a.sent();
223
+ container = _d.sent();
223
224
  items = container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root));
224
225
  return [2 /*return*/, !byText ? items : items.getByText(byText)];
225
226
  }
@@ -228,20 +229,21 @@ var Kebab = /** @class */ (function (_super) {
228
229
  };
229
230
  Kebab.prototype.getPortalContainer = function () {
230
231
  return __awaiter(this, void 0, void 0, function () {
231
- return __generator(this, function (_a) {
232
- switch (_a.label) {
232
+ return __generator(this, function (_d) {
233
+ switch (_d.label) {
233
234
  case 0: return [4 /*yield*/, this.isMenuOpened()];
234
235
  case 1:
235
- if (!!(_a.sent())) return [3 /*break*/, 3];
236
+ if (!!(_d.sent())) return [3 /*break*/, 3];
236
237
  return [4 /*yield*/, this.click()];
237
238
  case 2:
238
- _a.sent();
239
- _a.label = 3;
239
+ _d.sent();
240
+ _d.label = 3;
240
241
  case 3: return [2 /*return*/, this.portal.getContainer()];
241
242
  }
242
243
  });
243
244
  });
244
245
  };
245
246
  return Kebab;
246
- }(BaseComponent_1.BaseComponent));
247
+ }(MenuComponent_1.MenuComponent));
247
248
  exports.Kebab = Kebab;
249
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toItemsElementLocator, _c = LocatorSymbols_1.toContainItemElementLocator;