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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +25 -3
  47. package/build/src/components/ComponentList.js +58 -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,6 +50,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
50
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
51
  }
52
52
  };
53
+ var _a, _b, _c;
53
54
  Object.defineProperty(exports, "__esModule", { value: true });
54
55
  exports.Select = void 0;
55
56
  var react_ui_1 = require("@skbkontur/react-ui");
@@ -63,10 +64,14 @@ var utils_2 = require("../utils");
63
64
  var ComponentList_1 = require("./ComponentList");
64
65
  var MenuItem_1 = require("./MenuItem");
65
66
  var dataTidSelector_1 = require("../utils/dataTidSelector");
67
+ var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
66
68
  var Select = /** @class */ (function (_super) {
67
69
  __extends(Select, _super);
68
70
  function Select(rootLocator) {
69
71
  var _this = _super.call(this, rootLocator) || this;
72
+ _this[_a] = function () { return _this.buttonOrLinkLocator; };
73
+ _this[_b] = function () { return _this.getValueLocator(); };
74
+ _this[_c] = function () { return _this.buttonOrLinkLocator; };
70
75
  _this.portal = new Portal_1.Portal(rootLocator.locator('noscript'));
71
76
  _this.buttonOrLinkLocator = rootLocator
72
77
  .locator('button')
@@ -74,50 +79,60 @@ var Select = /** @class */ (function (_super) {
74
79
  _this.selectLabelLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SelectDataTids.label));
75
80
  return _this;
76
81
  }
82
+ Select.prototype.getValueLocator = function () {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ return __generator(this, function (_d) {
85
+ switch (_d.label) {
86
+ case 0: return [4 /*yield*/, this.isLinkSelect()];
87
+ case 1: return [2 /*return*/, (_d.sent()) ? this.buttonOrLinkLocator : this.selectLabelLocator];
88
+ }
89
+ });
90
+ });
91
+ };
77
92
  Select.prototype.isDisabled = function () {
78
93
  return __awaiter(this, void 0, void 0, function () {
79
- return __generator(this, function (_a) {
80
- switch (_a.label) {
94
+ return __generator(this, function (_d) {
95
+ switch (_d.label) {
81
96
  case 0: return [4 /*yield*/, this.isLinkSelect()];
82
97
  case 1:
83
- if (!_a.sent()) return [3 /*break*/, 4];
98
+ if (!_d.sent()) return [3 /*break*/, 4];
84
99
  return [4 /*yield*/, this.waitFor()];
85
100
  case 2:
86
- _a.sent();
101
+ _d.sent();
87
102
  return [4 /*yield*/, this.buttonOrLinkLocator.getAttribute(utils_1.DataVisualState.Disabled)];
88
- case 3: return [2 /*return*/, (_a.sent()) !== null];
103
+ case 3: return [2 /*return*/, (_d.sent()) !== null];
89
104
  case 4: return [4 /*yield*/, this.buttonOrLinkLocator.isDisabled()];
90
- case 5: return [2 /*return*/, _a.sent()];
105
+ case 5: return [2 /*return*/, _d.sent()];
91
106
  }
92
107
  });
93
108
  });
94
109
  };
95
110
  Select.prototype.isMenuOpened = function () {
96
111
  return __awaiter(this, void 0, void 0, function () {
97
- return __generator(this, function (_a) {
98
- switch (_a.label) {
112
+ return __generator(this, function (_d) {
113
+ switch (_d.label) {
99
114
  case 0: return [4 /*yield*/, this.portal.isVisible()];
100
- case 1: return [2 /*return*/, _a.sent()];
115
+ case 1: return [2 /*return*/, _d.sent()];
101
116
  }
102
117
  });
103
118
  });
104
119
  };
105
120
  Select.prototype.isLinkSelect = function () {
106
121
  return __awaiter(this, void 0, void 0, function () {
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
122
+ return __generator(this, function (_d) {
123
+ switch (_d.label) {
109
124
  case 0: return [4 /*yield*/, this.buttonOrLinkLocator.getAttribute('type')];
110
- case 1: return [2 /*return*/, (_a.sent()) !== 'button'];
125
+ case 1: return [2 /*return*/, (_d.sent()) !== 'button'];
111
126
  }
112
127
  });
113
128
  });
114
129
  };
115
130
  Select.prototype.getSelectedValue = function (options) {
116
131
  return __awaiter(this, void 0, void 0, function () {
117
- return __generator(this, function (_a) {
118
- switch (_a.label) {
132
+ return __generator(this, function (_d) {
133
+ switch (_d.label) {
119
134
  case 0: return [4 /*yield*/, this.buttonOrLinkLocator.innerText(options)];
120
- case 1: return [2 /*return*/, _a.sent()];
135
+ case 1: return [2 /*return*/, _d.sent()];
121
136
  }
122
137
  });
123
138
  });
@@ -125,14 +140,14 @@ var Select = /** @class */ (function (_super) {
125
140
  Select.prototype.fillSearch = function (searchText, options) {
126
141
  return __awaiter(this, void 0, void 0, function () {
127
142
  var searchInput;
128
- return __generator(this, function (_a) {
129
- switch (_a.label) {
143
+ return __generator(this, function (_d) {
144
+ switch (_d.label) {
130
145
  case 0: return [4 /*yield*/, this.getSearchInput()];
131
146
  case 1:
132
- searchInput = _a.sent();
147
+ searchInput = _d.sent();
133
148
  return [4 /*yield*/, searchInput.fill(searchText, options)];
134
149
  case 2:
135
- _a.sent();
150
+ _d.sent();
136
151
  return [2 /*return*/];
137
152
  }
138
153
  });
@@ -145,14 +160,14 @@ var Select = /** @class */ (function (_super) {
145
160
  Select.prototype.selectFirst = function (text, options) {
146
161
  return __awaiter(this, void 0, void 0, function () {
147
162
  var items;
148
- return __generator(this, function (_a) {
149
- switch (_a.label) {
163
+ return __generator(this, function (_d) {
164
+ switch (_d.label) {
150
165
  case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
151
166
  case 1:
152
- items = _a.sent();
167
+ items = _d.sent();
153
168
  return [4 /*yield*/, items.first().click(options)];
154
169
  case 2:
155
- _a.sent();
170
+ _d.sent();
156
171
  return [2 /*return*/];
157
172
  }
158
173
  });
@@ -161,17 +176,17 @@ var Select = /** @class */ (function (_super) {
161
176
  Select.prototype.select = function (text, options) {
162
177
  return __awaiter(this, void 0, void 0, function () {
163
178
  var items;
164
- return __generator(this, function (_a) {
165
- switch (_a.label) {
179
+ return __generator(this, function (_d) {
180
+ switch (_d.label) {
166
181
  case 0: return [4 /*yield*/, this.getMenuItemsLocator(text)];
167
182
  case 1:
168
- items = _a.sent();
183
+ items = _d.sent();
169
184
  return [4 /*yield*/, (0, test_1.expect)(items).toHaveCount(1)];
170
185
  case 2:
171
- _a.sent();
186
+ _d.sent();
172
187
  return [4 /*yield*/, items.click(options)];
173
188
  case 3:
174
- _a.sent();
189
+ _d.sent();
175
190
  return [2 /*return*/];
176
191
  }
177
192
  });
@@ -179,14 +194,14 @@ var Select = /** @class */ (function (_super) {
179
194
  };
180
195
  Select.prototype.focus = function (options) {
181
196
  return __awaiter(this, void 0, void 0, function () {
182
- return __generator(this, function (_a) {
183
- switch (_a.label) {
197
+ return __generator(this, function (_d) {
198
+ switch (_d.label) {
184
199
  case 0: return [4 /*yield*/, this.waitEnabled()];
185
200
  case 1:
186
- _a.sent();
201
+ _d.sent();
187
202
  return [4 /*yield*/, this.buttonOrLinkLocator.focus(options)];
188
203
  case 2:
189
- _a.sent();
204
+ _d.sent();
190
205
  return [2 /*return*/];
191
206
  }
192
207
  });
@@ -194,11 +209,11 @@ var Select = /** @class */ (function (_super) {
194
209
  };
195
210
  Select.prototype.blur = function (options) {
196
211
  return __awaiter(this, void 0, void 0, function () {
197
- return __generator(this, function (_a) {
198
- switch (_a.label) {
212
+ return __generator(this, function (_d) {
213
+ switch (_d.label) {
199
214
  case 0: return [4 /*yield*/, this.buttonOrLinkLocator.blur(options)];
200
215
  case 1:
201
- _a.sent();
216
+ _d.sent();
202
217
  return [2 /*return*/];
203
218
  }
204
219
  });
@@ -206,8 +221,8 @@ var Select = /** @class */ (function (_super) {
206
221
  };
207
222
  Select.prototype.click = function (options) {
208
223
  return __awaiter(this, void 0, void 0, function () {
209
- return __generator(this, function (_a) {
210
- switch (_a.label) {
224
+ return __generator(this, function (_d) {
225
+ switch (_d.label) {
211
226
  case 0:
212
227
  // note: rootLocator всегда в состоянии enabled, даже если Select disabled
213
228
  // чтобы не было гонок дожидаемся доступности компонента, перед тем как взаимодействовать с ним
@@ -215,10 +230,10 @@ var Select = /** @class */ (function (_super) {
215
230
  case 1:
216
231
  // note: rootLocator всегда в состоянии enabled, даже если Select disabled
217
232
  // чтобы не было гонок дожидаемся доступности компонента, перед тем как взаимодействовать с ним
218
- _a.sent();
233
+ _d.sent();
219
234
  return [4 /*yield*/, _super.prototype.click.call(this, options)];
220
235
  case 2:
221
- _a.sent();
236
+ _d.sent();
222
237
  return [2 /*return*/];
223
238
  }
224
239
  });
@@ -226,11 +241,11 @@ var Select = /** @class */ (function (_super) {
226
241
  };
227
242
  Select.prototype.getTooltip = function (type) {
228
243
  return __awaiter(this, void 0, void 0, function () {
229
- return __generator(this, function (_a) {
230
- switch (_a.label) {
244
+ return __generator(this, function (_d) {
245
+ switch (_d.label) {
231
246
  case 0: return [4 /*yield*/, this.click()];
232
247
  case 1:
233
- _a.sent();
248
+ _d.sent();
234
249
  return [2 /*return*/, (0, utils_2.getTooltip)(type, this)];
235
250
  }
236
251
  });
@@ -245,14 +260,14 @@ var Select = /** @class */ (function (_super) {
245
260
  Select.prototype.getMenuItems = function () {
246
261
  return __awaiter(this, void 0, void 0, function () {
247
262
  var container;
248
- return __generator(this, function (_a) {
249
- switch (_a.label) {
263
+ return __generator(this, function (_d) {
264
+ switch (_d.label) {
250
265
  case 0: return [4 /*yield*/, this.getPortalContainer()];
251
266
  case 1:
252
- container = _a.sent();
267
+ container = _d.sent();
253
268
  return [4 /*yield*/, container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.SpinnerDataTids.root)).waitFor({ state: 'hidden' })];
254
269
  case 2:
255
- _a.sent();
270
+ _d.sent();
256
271
  return [2 /*return*/, new ComponentList_1.ComponentList(container, function (locator) {
257
272
  return locator
258
273
  .locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root))
@@ -267,23 +282,23 @@ var Select = /** @class */ (function (_super) {
267
282
  return __awaiter(this, void 0, void 0, function () {
268
283
  var items;
269
284
  var _this = this;
270
- return __generator(this, function (_a) {
271
- switch (_a.label) {
285
+ return __generator(this, function (_d) {
286
+ switch (_d.label) {
272
287
  case 0: return [4 /*yield*/, this.getMenuItems()];
273
288
  case 1:
274
- items = _a.sent();
289
+ items = _d.sent();
275
290
  return [4 /*yield*/, items.getFirstItemByPredicate(function (item) { return __awaiter(_this, void 0, void 0, function () {
276
291
  var itemText;
277
- return __generator(this, function (_a) {
278
- switch (_a.label) {
292
+ return __generator(this, function (_d) {
293
+ switch (_d.label) {
279
294
  case 0: return [4 /*yield*/, item.getText()];
280
295
  case 1:
281
- itemText = _a.sent();
296
+ itemText = _d.sent();
282
297
  return [2 /*return*/, itemText.toLowerCase() === text.toLowerCase()];
283
298
  }
284
299
  });
285
300
  }); })];
286
- case 2: return [2 /*return*/, _a.sent()];
301
+ case 2: return [2 /*return*/, _d.sent()];
287
302
  }
288
303
  });
289
304
  });
@@ -291,11 +306,11 @@ var Select = /** @class */ (function (_super) {
291
306
  Select.prototype.getMenuItemByIndex = function (index) {
292
307
  return __awaiter(this, void 0, void 0, function () {
293
308
  var items;
294
- return __generator(this, function (_a) {
295
- switch (_a.label) {
309
+ return __generator(this, function (_d) {
310
+ switch (_d.label) {
296
311
  case 0: return [4 /*yield*/, this.getMenuItems()];
297
312
  case 1:
298
- items = _a.sent();
313
+ items = _d.sent();
299
314
  return [2 /*return*/, items.getItemByIndex(index)];
300
315
  }
301
316
  });
@@ -307,11 +322,11 @@ var Select = /** @class */ (function (_super) {
307
322
  Select.prototype.getMenuItemsLocator = function (byText) {
308
323
  return __awaiter(this, void 0, void 0, function () {
309
324
  var container, items;
310
- return __generator(this, function (_a) {
311
- switch (_a.label) {
325
+ return __generator(this, function (_d) {
326
+ switch (_d.label) {
312
327
  case 0: return [4 /*yield*/, this.getPortalContainer()];
313
328
  case 1:
314
- container = _a.sent();
329
+ container = _d.sent();
315
330
  items = container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.MenuItemDataTids.root));
316
331
  return [2 /*return*/, items.getByText(byText)];
317
332
  }
@@ -321,11 +336,11 @@ var Select = /** @class */ (function (_super) {
321
336
  Select.prototype.getSearchInput = function () {
322
337
  return __awaiter(this, void 0, void 0, function () {
323
338
  var container;
324
- return __generator(this, function (_a) {
325
- switch (_a.label) {
339
+ return __generator(this, function (_d) {
340
+ switch (_d.label) {
326
341
  case 0: return [4 /*yield*/, this.getPortalContainer()];
327
342
  case 1:
328
- container = _a.sent();
343
+ container = _d.sent();
329
344
  return [2 /*return*/, container.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.InputDataTids.root))];
330
345
  }
331
346
  });
@@ -333,11 +348,11 @@ var Select = /** @class */ (function (_super) {
333
348
  };
334
349
  Select.prototype.getPortalContainer = function () {
335
350
  return __awaiter(this, void 0, void 0, function () {
336
- return __generator(this, function (_a) {
337
- switch (_a.label) {
351
+ return __generator(this, function (_d) {
352
+ switch (_d.label) {
338
353
  case 0: return [4 /*yield*/, this.openMenuIfNeeded()];
339
354
  case 1:
340
- _a.sent();
355
+ _d.sent();
341
356
  return [2 /*return*/, this.portal.getContainer()];
342
357
  }
343
358
  });
@@ -345,15 +360,15 @@ var Select = /** @class */ (function (_super) {
345
360
  };
346
361
  Select.prototype.openMenuIfNeeded = function () {
347
362
  return __awaiter(this, void 0, void 0, function () {
348
- return __generator(this, function (_a) {
349
- switch (_a.label) {
363
+ return __generator(this, function (_d) {
364
+ switch (_d.label) {
350
365
  case 0: return [4 /*yield*/, this.isMenuOpened()];
351
366
  case 1:
352
- if (!!(_a.sent())) return [3 /*break*/, 3];
367
+ if (!!(_d.sent())) return [3 /*break*/, 3];
353
368
  return [4 /*yield*/, this.buttonOrLinkLocator.click()];
354
369
  case 2:
355
- _a.sent();
356
- _a.label = 3;
370
+ _d.sent();
371
+ _d.label = 3;
357
372
  case 3: return [2 /*return*/];
358
373
  }
359
374
  });
@@ -361,19 +376,19 @@ var Select = /** @class */ (function (_super) {
361
376
  };
362
377
  Select.prototype.waitEnabled = function () {
363
378
  return __awaiter(this, void 0, void 0, function () {
364
- return __generator(this, function (_a) {
365
- switch (_a.label) {
379
+ return __generator(this, function (_d) {
380
+ switch (_d.label) {
366
381
  case 0: return [4 /*yield*/, this.isLinkSelect()];
367
382
  case 1:
368
- if (!_a.sent()) return [3 /*break*/, 3];
383
+ if (!_d.sent()) return [3 /*break*/, 3];
369
384
  return [4 /*yield*/, (0, test_1.expect)(this.buttonOrLinkLocator).not.toHaveAttribute(utils_1.DataVisualState.Disabled)];
370
385
  case 2:
371
- _a.sent();
386
+ _d.sent();
372
387
  return [3 /*break*/, 5];
373
388
  case 3: return [4 /*yield*/, (0, test_1.expect)(this.buttonOrLinkLocator).toBeEnabled()];
374
389
  case 4:
375
- _a.sent();
376
- _a.label = 5;
390
+ _d.sent();
391
+ _d.label = 5;
377
392
  case 5: return [2 /*return*/];
378
393
  }
379
394
  });
@@ -382,3 +397,4 @@ var Select = /** @class */ (function (_super) {
382
397
  return Select;
383
398
  }(BaseComponent_1.BaseComponent));
384
399
  exports.Select = Select;
400
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toValueElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -2,8 +2,10 @@ import type { Locator } from '@playwright/test';
2
2
  import { BaseComponent } from './BaseComponent';
3
3
  import { SpinnerAssertions } from '../assertions';
4
4
  import type { InnerTextOptions } from '../options';
5
+ import { toTextElementLocator } from '../matchers/component/LocatorSymbols';
5
6
  export declare class Spinner extends BaseComponent {
6
7
  readonly rootLocator: Locator;
8
+ readonly [toTextElementLocator]: () => Locator;
7
9
  constructor(rootLocator: Locator);
8
10
  getText(options?: InnerTextOptions): Promise<string>;
9
11
  waitLoading(options?: {
@@ -50,34 +50,37 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
50
50
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
51
  }
52
52
  };
53
+ var _a;
53
54
  Object.defineProperty(exports, "__esModule", { value: true });
54
55
  exports.Spinner = void 0;
55
56
  var BaseComponent_1 = require("./BaseComponent");
56
57
  var assertions_1 = require("../assertions");
58
+ var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
57
59
  var Spinner = /** @class */ (function (_super) {
58
60
  __extends(Spinner, _super);
59
61
  function Spinner(rootLocator) {
60
62
  var _this = _super.call(this, rootLocator) || this;
61
63
  _this.rootLocator = rootLocator;
64
+ _this[_a] = function () { return _this.rootLocator; };
62
65
  return _this;
63
66
  }
64
67
  Spinner.prototype.getText = function (options) {
65
68
  return __awaiter(this, void 0, void 0, function () {
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
69
+ return __generator(this, function (_b) {
70
+ switch (_b.label) {
68
71
  case 0: return [4 /*yield*/, this.rootLocator.innerText(options)];
69
- case 1: return [2 /*return*/, _a.sent()];
72
+ case 1: return [2 /*return*/, _b.sent()];
70
73
  }
71
74
  });
72
75
  });
73
76
  };
74
77
  Spinner.prototype.waitLoading = function (options) {
75
78
  return __awaiter(this, void 0, void 0, function () {
76
- return __generator(this, function (_a) {
77
- switch (_a.label) {
79
+ return __generator(this, function (_b) {
80
+ switch (_b.label) {
78
81
  case 0: return [4 /*yield*/, this.waitFor(options)];
79
82
  case 1:
80
- _a.sent();
83
+ _b.sent();
81
84
  return [2 /*return*/];
82
85
  }
83
86
  });
@@ -85,11 +88,11 @@ var Spinner = /** @class */ (function (_super) {
85
88
  };
86
89
  Spinner.prototype.waitLoaded = function (options) {
87
90
  return __awaiter(this, void 0, void 0, function () {
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
91
+ return __generator(this, function (_b) {
92
+ switch (_b.label) {
90
93
  case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden', timeout: options === null || options === void 0 ? void 0 : options.timeout })];
91
94
  case 1:
92
- _a.sent();
95
+ _b.sent();
93
96
  return [2 /*return*/];
94
97
  }
95
98
  });
@@ -101,3 +104,4 @@ var Spinner = /** @class */ (function (_super) {
101
104
  return Spinner;
102
105
  }(BaseComponent_1.BaseComponent));
103
106
  exports.Spinner = Spinner;
107
+ _a = LocatorSymbols_1.toTextElementLocator;
@@ -3,8 +3,12 @@ import { BaseComponent } from './BaseComponent';
3
3
  import type { TooltipType } from '../utils';
4
4
  import { TabAssertions } from '../assertions';
5
5
  import type { BlurOptions, FocusOptions, InnerTextOptions } from '../options';
6
+ import { toControlElementLocator, toFocusableElementLocator, toTextElementLocator } from '../matchers/component/LocatorSymbols';
6
7
  export declare class Tab extends BaseComponent {
7
8
  readonly rootLocator: Locator;
9
+ readonly [toControlElementLocator]: () => Locator;
10
+ readonly [toTextElementLocator]: () => Locator;
11
+ readonly [toFocusableElementLocator]: () => Locator;
8
12
  constructor(rootLocator: Locator);
9
13
  isDisabled(): Promise<boolean>;
10
14
  isActive(): Promise<boolean>;
@@ -50,50 +50,43 @@ 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.Tab = 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 Tab = /** @class */ (function (_super) {
60
62
  __extends(Tab, _super);
61
63
  function Tab(rootLocator) {
62
64
  var _this = _super.call(this, rootLocator) || this;
63
65
  _this.rootLocator = rootLocator;
66
+ _this[_a] = function () { return _this.rootLocator; };
67
+ _this[_b] = function () { return _this.rootLocator; };
68
+ _this[_c] = function () { return _this.rootLocator; };
64
69
  return _this;
65
70
  }
66
71
  Tab.prototype.isDisabled = function () {
67
- return __awaiter(this, void 0, void 0, function () {
68
- return __generator(this, function (_a) {
69
- return [2 /*return*/, this.hasAttribute(utils_1.DataVisualState.Disabled)];
70
- });
71
- });
72
+ return this.hasAttribute(utils_1.DataVisualState.Disabled);
72
73
  };
73
74
  Tab.prototype.isActive = function () {
74
- return __awaiter(this, void 0, void 0, function () {
75
- return __generator(this, function (_a) {
76
- return [2 /*return*/, this.hasAttribute(utils_1.DataVisualState.Active)];
77
- });
78
- });
75
+ return this.hasAttribute(utils_1.DataVisualState.Active);
79
76
  };
80
77
  Tab.prototype.getText = function (options) {
81
- return __awaiter(this, void 0, void 0, function () {
82
- return __generator(this, function (_a) {
83
- return [2 /*return*/, this.rootLocator.innerText(options)];
84
- });
85
- });
78
+ return this.rootLocator.innerText(options);
86
79
  };
87
80
  Tab.prototype.focus = function (options) {
88
81
  return __awaiter(this, void 0, void 0, function () {
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
82
+ return __generator(this, function (_d) {
83
+ switch (_d.label) {
91
84
  case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).toBeEnabled()];
92
85
  case 1:
93
- _a.sent();
86
+ _d.sent();
94
87
  return [4 /*yield*/, this.rootLocator.focus(options)];
95
88
  case 2:
96
- _a.sent();
89
+ _d.sent();
97
90
  return [2 /*return*/];
98
91
  }
99
92
  });
@@ -101,22 +94,18 @@ var Tab = /** @class */ (function (_super) {
101
94
  };
102
95
  Tab.prototype.blur = function (options) {
103
96
  return __awaiter(this, void 0, void 0, function () {
104
- return __generator(this, function (_a) {
105
- switch (_a.label) {
97
+ return __generator(this, function (_d) {
98
+ switch (_d.label) {
106
99
  case 0: return [4 /*yield*/, this.rootLocator.blur(options)];
107
100
  case 1:
108
- _a.sent();
101
+ _d.sent();
109
102
  return [2 /*return*/];
110
103
  }
111
104
  });
112
105
  });
113
106
  };
114
107
  Tab.prototype.getTooltip = function (type) {
115
- return __awaiter(this, void 0, void 0, function () {
116
- return __generator(this, function (_a) {
117
- return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
118
- });
119
- });
108
+ return (0, utils_1.getTooltip)(type, this);
120
109
  };
121
110
  Tab.prototype.expect = function () {
122
111
  return new assertions_1.TabAssertions(this);
@@ -124,3 +113,4 @@ var Tab = /** @class */ (function (_super) {
124
113
  return Tab;
125
114
  }(BaseComponent_1.BaseComponent));
126
115
  exports.Tab = Tab;
116
+ _a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toTextElementLocator, _c = LocatorSymbols_1.toFocusableElementLocator;
@@ -3,9 +3,13 @@ import { BaseComponent } from './BaseComponent';
3
3
  import type { TooltipType } from '../utils';
4
4
  import { TextareaAssertions } 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 Textarea extends BaseComponent {
7
8
  readonly rootLocator: Locator;
8
9
  readonly textareaLocator: 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>;