@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,27 +50,31 @@ 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.ComponentList = void 0;
55
56
  var test_1 = require("@playwright/test");
56
57
  var BaseComponent_1 = require("./BaseComponent");
57
58
  var assertions_1 = require("../assertions");
58
59
  var utils_1 = require("../utils");
60
+ var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
59
61
  var ComponentList = /** @class */ (function (_super) {
60
62
  __extends(ComponentList, _super);
61
63
  function ComponentList(rootLocator, itemsLocator, itemFactory) {
62
64
  var _this = _super.call(this, rootLocator) || this;
63
65
  _this.rootLocator = rootLocator;
66
+ _this[_a] = function () { return _this.itemsLocator.first(); };
67
+ _this[_b] = function () { return _this.itemsLocator; };
64
68
  _this.itemsLocator = itemsLocator(_this.rootLocator);
65
69
  _this.itemFactory = itemFactory;
66
70
  return _this;
67
71
  }
68
72
  ComponentList.prototype.isVisible = function (options) {
69
73
  return __awaiter(this, void 0, void 0, function () {
70
- return __generator(this, function (_a) {
71
- switch (_a.label) {
74
+ return __generator(this, function (_c) {
75
+ switch (_c.label) {
72
76
  case 0: return [4 /*yield*/, this.itemsLocator.first().isVisible(options)];
73
- case 1: return [2 /*return*/, _a.sent()];
77
+ case 1: return [2 /*return*/, _c.sent()];
74
78
  }
75
79
  });
76
80
  });
@@ -86,14 +90,14 @@ var ComponentList = /** @class */ (function (_super) {
86
90
  return __awaiter(this, void 0, void 0, function () {
87
91
  var itemsLocators;
88
92
  var _this = this;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
93
+ return __generator(this, function (_c) {
94
+ switch (_c.label) {
91
95
  case 0: return [4 /*yield*/, this.waitFor({ state: 'attached' })];
92
96
  case 1:
93
- _a.sent();
97
+ _c.sent();
94
98
  return [4 /*yield*/, this.itemsLocator.all()];
95
99
  case 2:
96
- itemsLocators = _a.sent();
100
+ itemsLocators = _c.sent();
97
101
  return [2 /*return*/, itemsLocators.map(function (x) { return _this.itemFactory(x); })];
98
102
  }
99
103
  });
@@ -103,40 +107,28 @@ var ComponentList = /** @class */ (function (_super) {
103
107
  * Поведение метода идентично вызову locator.nth(0)
104
108
  */
105
109
  ComponentList.prototype.getFirstItem = function () {
106
- return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- return [2 /*return*/, this.getItemByIndex(0)];
109
- });
110
- });
110
+ return this.getItemByIndex(0);
111
111
  };
112
112
  /**
113
113
  * Поведение метода идентично вызову locator.nth(-1)
114
114
  */
115
115
  ComponentList.prototype.getLastItem = function () {
116
- return __awaiter(this, void 0, void 0, function () {
117
- return __generator(this, function (_a) {
118
- return [2 /*return*/, this.getItemByIndex(-1)];
119
- });
120
- });
116
+ return this.getItemByIndex(-1);
121
117
  };
122
118
  /**
123
119
  * Поведение метода идентично вызову locator.nth(index)
124
120
  */
125
121
  ComponentList.prototype.getItemByIndex = function (index) {
126
- return __awaiter(this, void 0, void 0, function () {
127
- return __generator(this, function (_a) {
128
- return [2 /*return*/, this.itemFactory(this.itemsLocator.nth(index))];
129
- });
130
- });
122
+ return this.itemFactory(this.itemsLocator.nth(index));
131
123
  };
132
124
  ComponentList.prototype.getFirstItemByPredicate = function (predicate) {
133
125
  return __awaiter(this, void 0, void 0, function () {
134
126
  var list;
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
127
+ return __generator(this, function (_c) {
128
+ switch (_c.label) {
137
129
  case 0: return [4 /*yield*/, this.getItemsByPredicate(predicate)];
138
130
  case 1:
139
- list = _a.sent();
131
+ list = _c.sent();
140
132
  return [2 /*return*/, list[0]];
141
133
  }
142
134
  });
@@ -146,37 +138,37 @@ var ComponentList = /** @class */ (function (_super) {
146
138
  return __awaiter(this, void 0, void 0, function () {
147
139
  var items;
148
140
  var _this = this;
149
- return __generator(this, function (_a) {
150
- switch (_a.label) {
141
+ return __generator(this, function (_c) {
142
+ switch (_c.label) {
151
143
  case 0:
152
144
  items = [];
153
145
  return [4 /*yield*/, test_1.expect
154
146
  .poll(function () { return __awaiter(_this, void 0, void 0, function () {
155
147
  var list, predicateResults;
156
148
  var _this = this;
157
- return __generator(this, function (_a) {
158
- switch (_a.label) {
149
+ return __generator(this, function (_c) {
150
+ switch (_c.label) {
159
151
  case 0: return [4 /*yield*/, this.getItems()];
160
152
  case 1:
161
- list = _a.sent();
153
+ list = _c.sent();
162
154
  return [4 /*yield*/, Promise.all(list.map(function (item) { return __awaiter(_this, void 0, void 0, function () {
163
- var _a;
164
- return __generator(this, function (_b) {
165
- switch (_b.label) {
155
+ var _c;
156
+ return __generator(this, function (_d) {
157
+ switch (_d.label) {
166
158
  case 0:
167
- _a = { item: item };
159
+ _c = { item: item };
168
160
  return [4 /*yield*/, predicate(item)];
169
- case 1: return [2 /*return*/, (_a.result = _b.sent(), _a)];
161
+ case 1: return [2 /*return*/, (_c.result = _d.sent(), _c)];
170
162
  }
171
163
  });
172
164
  }); }))];
173
165
  case 2:
174
- predicateResults = _a.sent();
175
- items = predicateResults.filter(function (_a) {
176
- var result = _a.result;
166
+ predicateResults = _c.sent();
167
+ items = predicateResults.filter(function (_c) {
168
+ var result = _c.result;
177
169
  return result;
178
- }).map(function (_a) {
179
- var item = _a.item;
170
+ }).map(function (_c) {
171
+ var item = _c.item;
180
172
  return item;
181
173
  });
182
174
  return [2 /*return*/, items.length];
@@ -185,7 +177,7 @@ var ComponentList = /** @class */ (function (_super) {
185
177
  }); }, { message: 'Items not found by predicate' })
186
178
  .toBeGreaterThan(0)];
187
179
  case 1:
188
- _a.sent();
180
+ _c.sent();
189
181
  return [2 /*return*/, items];
190
182
  }
191
183
  });
@@ -196,23 +188,19 @@ var ComponentList = /** @class */ (function (_super) {
196
188
  */
197
189
  ComponentList.prototype.count = function () {
198
190
  return __awaiter(this, void 0, void 0, function () {
199
- return __generator(this, function (_a) {
200
- switch (_a.label) {
191
+ return __generator(this, function (_c) {
192
+ switch (_c.label) {
201
193
  case 0: return [4 /*yield*/, this.waitFor({ state: 'attached' })];
202
194
  case 1:
203
- _a.sent();
195
+ _c.sent();
204
196
  return [4 /*yield*/, this.itemsLocator.count()];
205
- case 2: return [2 /*return*/, _a.sent()];
197
+ case 2: return [2 /*return*/, _c.sent()];
206
198
  }
207
199
  });
208
200
  });
209
201
  };
210
202
  ComponentList.prototype.getTooltip = function (type) {
211
- return __awaiter(this, void 0, void 0, function () {
212
- return __generator(this, function (_a) {
213
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
214
- });
215
- });
203
+ return (0, utils_1.getTooltip)(type, this);
216
204
  };
217
205
  ComponentList.prototype.expect = function () {
218
206
  return new assertions_1.ComponentListAssertions(this);
@@ -220,3 +208,4 @@ var ComponentList = /** @class */ (function (_super) {
220
208
  return ComponentList;
221
209
  }(BaseComponent_1.BaseComponent));
222
210
  exports.ComponentList = ComponentList;
211
+ _a = LocatorSymbols_1.toVisibleElementLocator, _b = LocatorSymbols_1.toValueElementLocator;
@@ -3,9 +3,13 @@ import { BaseComponent } from './BaseComponent';
3
3
  import type { TooltipType } from '../utils';
4
4
  import { CurrencyInputAssertions } from '../assertions';
5
5
  import type { BlurOptions, ClearOptions, ClickOptions, FillOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions, PressSequentiallyOptions } from '../options';
6
+ import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator } from '../matchers/component/LocatorSymbols';
6
7
  export declare class CurrencyInput 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,50 +50,55 @@ 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.CurrencyInput = 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 CurrencyInput = /** @class */ (function (_super) {
60
62
  __extends(CurrencyInput, _super);
61
63
  function CurrencyInput(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
  CurrencyInput.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
  CurrencyInput.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
  CurrencyInput.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.clear()];
92
97
  case 1:
93
- _a.sent();
98
+ _d.sent();
94
99
  return [4 /*yield*/, this.inputLocator.fill(typeof value === 'number' ? value.toString(10) : value, options)];
95
100
  case 2:
96
- _a.sent();
101
+ _d.sent();
97
102
  return [2 /*return*/];
98
103
  }
99
104
  });
@@ -101,14 +106,14 @@ var CurrencyInput = /** @class */ (function (_super) {
101
106
  };
102
107
  CurrencyInput.prototype.press = function (value, options) {
103
108
  return __awaiter(this, void 0, void 0, function () {
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
109
+ return __generator(this, function (_d) {
110
+ switch (_d.label) {
106
111
  case 0: return [4 /*yield*/, this.clear()];
107
112
  case 1:
108
- _a.sent();
113
+ _d.sent();
109
114
  return [4 /*yield*/, this.inputLocator.press(value, options)];
110
115
  case 2:
111
- _a.sent();
116
+ _d.sent();
112
117
  return [2 /*return*/];
113
118
  }
114
119
  });
@@ -116,14 +121,14 @@ var CurrencyInput = /** @class */ (function (_super) {
116
121
  };
117
122
  CurrencyInput.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.clear()];
122
127
  case 1:
123
- _a.sent();
128
+ _d.sent();
124
129
  return [4 /*yield*/, this.inputLocator.pressSequentially(typeof value === 'number' ? value.toString(10) : value, options)];
125
130
  case 2:
126
- _a.sent();
131
+ _d.sent();
127
132
  return [2 /*return*/];
128
133
  }
129
134
  });
@@ -131,17 +136,17 @@ var CurrencyInput = /** @class */ (function (_super) {
131
136
  };
132
137
  CurrencyInput.prototype.clear = function (options) {
133
138
  return __awaiter(this, void 0, void 0, function () {
134
- return __generator(this, function (_a) {
135
- switch (_a.label) {
139
+ return __generator(this, function (_d) {
140
+ switch (_d.label) {
136
141
  case 0:
137
142
  // NOTE: без фокуса currencyInput полностью не очистится
138
143
  return [4 /*yield*/, this.focus()];
139
144
  case 1:
140
145
  // NOTE: без фокуса currencyInput полностью не очистится
141
- _a.sent();
146
+ _d.sent();
142
147
  return [4 /*yield*/, this.inputLocator.clear(options)];
143
148
  case 2:
144
- _a.sent();
149
+ _d.sent();
145
150
  return [2 /*return*/];
146
151
  }
147
152
  });
@@ -149,14 +154,14 @@ var CurrencyInput = /** @class */ (function (_super) {
149
154
  };
150
155
  CurrencyInput.prototype.focus = function (options) {
151
156
  return __awaiter(this, void 0, void 0, function () {
152
- return __generator(this, function (_a) {
153
- switch (_a.label) {
157
+ return __generator(this, function (_d) {
158
+ switch (_d.label) {
154
159
  case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
155
160
  case 1:
156
- _a.sent();
161
+ _d.sent();
157
162
  return [4 /*yield*/, this.inputLocator.focus(options)];
158
163
  case 2:
159
- _a.sent();
164
+ _d.sent();
160
165
  return [2 /*return*/];
161
166
  }
162
167
  });
@@ -164,11 +169,11 @@ var CurrencyInput = /** @class */ (function (_super) {
164
169
  };
165
170
  CurrencyInput.prototype.blur = function (options) {
166
171
  return __awaiter(this, void 0, void 0, function () {
167
- return __generator(this, function (_a) {
168
- switch (_a.label) {
172
+ return __generator(this, function (_d) {
173
+ switch (_d.label) {
169
174
  case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
170
175
  case 1:
171
- _a.sent();
176
+ _d.sent();
172
177
  return [2 /*return*/];
173
178
  }
174
179
  });
@@ -176,22 +181,18 @@ var CurrencyInput = /** @class */ (function (_super) {
176
181
  };
177
182
  CurrencyInput.prototype.click = function (options) {
178
183
  return __awaiter(this, void 0, void 0, function () {
179
- return __generator(this, function (_a) {
180
- switch (_a.label) {
184
+ return __generator(this, function (_d) {
185
+ switch (_d.label) {
181
186
  case 0: return [4 /*yield*/, this.inputLocator.click(options)];
182
187
  case 1:
183
- _a.sent();
188
+ _d.sent();
184
189
  return [2 /*return*/];
185
190
  }
186
191
  });
187
192
  });
188
193
  };
189
194
  CurrencyInput.prototype.getTooltip = function (type) {
190
- return __awaiter(this, void 0, void 0, function () {
191
- return __generator(this, function (_a) {
192
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
193
- });
194
- });
195
+ return (0, utils_1.getTooltip)(type, this);
195
196
  };
196
197
  CurrencyInput.prototype.expect = function () {
197
198
  return new assertions_1.CurrencyInputAssertions(this);
@@ -199,3 +200,4 @@ var CurrencyInput = /** @class */ (function (_super) {
199
200
  return CurrencyInput;
200
201
  }(BaseComponent_1.BaseComponent));
201
202
  exports.CurrencyInput = CurrencyInput;
203
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -3,8 +3,12 @@ import { BaseComponent } from './BaseComponent';
3
3
  import { type TooltipType } from '../utils';
4
4
  import { DateInputAssertions } from '../assertions';
5
5
  import type { BlurOptions, ClickOptions, FillOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions } from '../options';
6
+ import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator } from '../matchers/component/LocatorSymbols';
6
7
  export declare class DateInput extends BaseComponent {
7
8
  readonly nativeInputLocator: Locator;
9
+ readonly [toControlElementLocator]: () => Locator;
10
+ readonly [toValueElementLocator]: () => Locator;
11
+ readonly [toFocusableElementLocator]: () => Locator;
8
12
  constructor(rootLocator: Locator);
9
13
  isDisabled(options?: IsDisabledOptions): Promise<boolean>;
10
14
  getValue(options?: InputValueOptions): Promise<string>;
@@ -61,49 +61,54 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
61
61
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
62
  }
63
63
  };
64
+ var _a, _b, _c;
64
65
  Object.defineProperty(exports, "__esModule", { value: true });
65
66
  exports.DateInput = void 0;
66
67
  var test_1 = require("@playwright/test");
67
68
  var BaseComponent_1 = require("./BaseComponent");
68
69
  var utils_1 = require("../utils");
69
70
  var assertions_1 = require("../assertions");
71
+ var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
70
72
  var DateInput = /** @class */ (function (_super) {
71
73
  __extends(DateInput, _super);
72
74
  function DateInput(rootLocator) {
73
75
  var _this = _super.call(this, rootLocator) || this;
76
+ _this[_a] = function () { return _this.nativeInputLocator; };
77
+ _this[_b] = function () { return _this.nativeInputLocator; };
78
+ _this[_c] = function () { return _this.rootLocator; };
74
79
  _this.nativeInputLocator = rootLocator.locator('input');
75
80
  return _this;
76
81
  }
77
82
  DateInput.prototype.isDisabled = 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.nativeInputLocator.isDisabled(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
  DateInput.prototype.getValue = function (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.nativeInputLocator.inputValue(options)];
92
- case 1: return [2 /*return*/, _a.sent()];
97
+ case 1: return [2 /*return*/, _d.sent()];
93
98
  }
94
99
  });
95
100
  });
96
101
  };
97
102
  DateInput.prototype.fill = function (date, options) {
98
103
  return __awaiter(this, void 0, void 0, function () {
99
- return __generator(this, function (_a) {
100
- switch (_a.label) {
104
+ return __generator(this, function (_d) {
105
+ switch (_d.label) {
101
106
  case 0: return [4 /*yield*/, this.clear()];
102
107
  case 1:
103
- _a.sent();
108
+ _d.sent();
104
109
  return [4 /*yield*/, this.nativeInputLocator.pressSequentially(date, options)];
105
110
  case 2:
106
- _a.sent();
111
+ _d.sent();
107
112
  return [2 /*return*/];
108
113
  }
109
114
  });
@@ -111,20 +116,20 @@ var DateInput = /** @class */ (function (_super) {
111
116
  };
112
117
  DateInput.prototype.clear = function (options) {
113
118
  return __awaiter(this, void 0, void 0, function () {
114
- return __generator(this, function (_a) {
115
- switch (_a.label) {
119
+ return __generator(this, function (_d) {
120
+ switch (_d.label) {
116
121
  case 0: return [4 /*yield*/, this.focus()];
117
122
  case 1:
118
- _a.sent();
123
+ _d.sent();
119
124
  return [4 /*yield*/, this.rootLocator.press('Control+A', options)];
120
125
  case 2:
121
- _a.sent();
126
+ _d.sent();
122
127
  return [4 /*yield*/, this.rootLocator.press('Meta+A', options)];
123
128
  case 3:
124
- _a.sent();
129
+ _d.sent();
125
130
  return [4 /*yield*/, this.rootLocator.press('Backspace', options)];
126
131
  case 4:
127
- _a.sent();
132
+ _d.sent();
128
133
  return [2 /*return*/];
129
134
  }
130
135
  });
@@ -132,14 +137,14 @@ var DateInput = /** @class */ (function (_super) {
132
137
  };
133
138
  DateInput.prototype.focus = function (options) {
134
139
  return __awaiter(this, void 0, void 0, function () {
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
140
+ return __generator(this, function (_d) {
141
+ switch (_d.label) {
137
142
  case 0: return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
138
143
  case 1:
139
- _a.sent();
144
+ _d.sent();
140
145
  return [4 /*yield*/, this.rootLocator.focus(options)];
141
146
  case 2:
142
- _a.sent();
147
+ _d.sent();
143
148
  return [2 /*return*/];
144
149
  }
145
150
  });
@@ -147,11 +152,11 @@ var DateInput = /** @class */ (function (_super) {
147
152
  };
148
153
  DateInput.prototype.blur = function (options) {
149
154
  return __awaiter(this, void 0, void 0, function () {
150
- return __generator(this, function (_a) {
151
- switch (_a.label) {
155
+ return __generator(this, function (_d) {
156
+ switch (_d.label) {
152
157
  case 0: return [4 /*yield*/, this.rootLocator.blur(options)];
153
158
  case 1:
154
- _a.sent();
159
+ _d.sent();
155
160
  return [2 /*return*/];
156
161
  }
157
162
  });
@@ -159,14 +164,14 @@ var DateInput = /** @class */ (function (_super) {
159
164
  };
160
165
  DateInput.prototype.click = function (options) {
161
166
  return __awaiter(this, void 0, void 0, function () {
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
167
+ return __generator(this, function (_d) {
168
+ switch (_d.label) {
164
169
  case 0:
165
170
  // NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
166
171
  return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
167
172
  case 1:
168
173
  // NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
169
- _a.sent();
174
+ _d.sent();
170
175
  // NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
171
176
  return [4 /*yield*/, this.rootLocator
172
177
  .locator('span[data-fragment]')
@@ -174,18 +179,14 @@ var DateInput = /** @class */ (function (_super) {
174
179
  .click(__assign(__assign({}, options), { force: true }))];
175
180
  case 2:
176
181
  // NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
177
- _a.sent();
182
+ _d.sent();
178
183
  return [2 /*return*/];
179
184
  }
180
185
  });
181
186
  });
182
187
  };
183
188
  DateInput.prototype.getTooltip = function (type) {
184
- return __awaiter(this, void 0, void 0, function () {
185
- return __generator(this, function (_a) {
186
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
187
- });
188
- });
189
+ return (0, utils_1.getTooltip)(type, this);
189
190
  };
190
191
  DateInput.prototype.expect = function () {
191
192
  return new assertions_1.DateInputAssertions(this);
@@ -193,3 +194,4 @@ var DateInput = /** @class */ (function (_super) {
193
194
  return DateInput;
194
195
  }(BaseComponent_1.BaseComponent));
195
196
  exports.DateInput = DateInput;
197
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -3,10 +3,14 @@ import { BaseComponent } from './BaseComponent';
3
3
  import type { TooltipType } from '../utils';
4
4
  import { DatePickerAssertions } from '../assertions';
5
5
  import type { BlurOptions, ClickOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions, PressSequentiallyOptions } from '../options';
6
+ import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator } from '../matchers/component/LocatorSymbols';
6
7
  export declare class DatePicker extends BaseComponent {
7
8
  readonly rootLocator: Locator;
8
9
  readonly nativeInputLocator: Locator;
9
10
  readonly datePickerInputLocator: Locator;
11
+ readonly [toControlElementLocator]: () => Locator;
12
+ readonly [toValueElementLocator]: () => Locator;
13
+ readonly [toFocusableElementLocator]: () => Locator;
10
14
  constructor(rootLocator: Locator);
11
15
  isDisabled(options?: IsDisabledOptions): Promise<boolean>;
12
16
  getValue(options?: InputValueOptions): Promise<string>;