@skbkontur/playwright-react-ui-components 1.13.0

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 (165) hide show
  1. package/build/index.d.ts +1 -0
  2. package/build/index.js +17 -0
  3. package/build/src/assertions/AutocompleteAssertions.d.ts +19 -0
  4. package/build/src/assertions/AutocompleteAssertions.js +177 -0
  5. package/build/src/assertions/BaseComponentAssertions.d.ts +15 -0
  6. package/build/src/assertions/BaseComponentAssertions.js +158 -0
  7. package/build/src/assertions/ButtonAssertions.d.ts +15 -0
  8. package/build/src/assertions/ButtonAssertions.js +162 -0
  9. package/build/src/assertions/CheckboxAssertions.d.ts +19 -0
  10. package/build/src/assertions/CheckboxAssertions.js +210 -0
  11. package/build/src/assertions/ComboBoxAssertions.d.ts +19 -0
  12. package/build/src/assertions/ComboBoxAssertions.js +304 -0
  13. package/build/src/assertions/ComponentListAssertions.d.ts +13 -0
  14. package/build/src/assertions/ComponentListAssertions.js +126 -0
  15. package/build/src/assertions/CurrencyInputAssertions.d.ts +15 -0
  16. package/build/src/assertions/CurrencyInputAssertions.js +212 -0
  17. package/build/src/assertions/DateInputAssertions.d.ts +15 -0
  18. package/build/src/assertions/DateInputAssertions.js +162 -0
  19. package/build/src/assertions/DatePickerAssertions.d.ts +15 -0
  20. package/build/src/assertions/DatePickerAssertions.js +162 -0
  21. package/build/src/assertions/DateRangePickerAssertions.d.ts +11 -0
  22. package/build/src/assertions/DateRangePickerAssertions.js +111 -0
  23. package/build/src/assertions/DropdownAssertions.d.ts +19 -0
  24. package/build/src/assertions/DropdownAssertions.js +260 -0
  25. package/build/src/assertions/DropdownMenuAssertions.d.ts +17 -0
  26. package/build/src/assertions/DropdownMenuAssertions.js +236 -0
  27. package/build/src/assertions/FileUploaderAssertions.d.ts +14 -0
  28. package/build/src/assertions/FileUploaderAssertions.js +119 -0
  29. package/build/src/assertions/FxInputAssertions.d.ts +17 -0
  30. package/build/src/assertions/FxInputAssertions.js +189 -0
  31. package/build/src/assertions/InputAssertions.d.ts +19 -0
  32. package/build/src/assertions/InputAssertions.js +177 -0
  33. package/build/src/assertions/KebabAssertions.d.ts +13 -0
  34. package/build/src/assertions/KebabAssertions.js +189 -0
  35. package/build/src/assertions/LabelAssertions.d.ts +19 -0
  36. package/build/src/assertions/LabelAssertions.js +144 -0
  37. package/build/src/assertions/LinkAssertions.d.ts +17 -0
  38. package/build/src/assertions/LinkAssertions.js +187 -0
  39. package/build/src/assertions/LoaderAssertions.d.ts +8 -0
  40. package/build/src/assertions/LoaderAssertions.js +78 -0
  41. package/build/src/assertions/MenuItemAssertations.d.ts +11 -0
  42. package/build/src/assertions/MenuItemAssertations.js +114 -0
  43. package/build/src/assertions/PagingAssertions.d.ts +15 -0
  44. package/build/src/assertions/PagingAssertions.js +149 -0
  45. package/build/src/assertions/PortalAssertions.d.ts +9 -0
  46. package/build/src/assertions/PortalAssertions.js +90 -0
  47. package/build/src/assertions/RadioAssertions.d.ts +19 -0
  48. package/build/src/assertions/RadioAssertions.js +210 -0
  49. package/build/src/assertions/RadioGroupAssertions.d.ts +15 -0
  50. package/build/src/assertions/RadioGroupAssertions.js +233 -0
  51. package/build/src/assertions/SelectAssertions.d.ts +15 -0
  52. package/build/src/assertions/SelectAssertions.js +211 -0
  53. package/build/src/assertions/SpinnerAssertions.d.ts +8 -0
  54. package/build/src/assertions/SpinnerAssertions.js +78 -0
  55. package/build/src/assertions/TabAssertions.d.ts +17 -0
  56. package/build/src/assertions/TabAssertions.js +187 -0
  57. package/build/src/assertions/TabsAssertions.d.ts +11 -0
  58. package/build/src/assertions/TabsAssertions.js +130 -0
  59. package/build/src/assertions/TextareaAssertions.d.ts +15 -0
  60. package/build/src/assertions/TextareaAssertions.js +162 -0
  61. package/build/src/assertions/ToastAssertions.d.ts +8 -0
  62. package/build/src/assertions/ToastAssertions.js +78 -0
  63. package/build/src/assertions/ToggleAssertions.d.ts +17 -0
  64. package/build/src/assertions/ToggleAssertions.js +186 -0
  65. package/build/src/assertions/TokenAssertions.d.ts +17 -0
  66. package/build/src/assertions/TokenAssertions.js +159 -0
  67. package/build/src/assertions/TokenInputAssertions.d.ts +16 -0
  68. package/build/src/assertions/TokenInputAssertions.js +170 -0
  69. package/build/src/assertions/TooltipAssertions.d.ts +11 -0
  70. package/build/src/assertions/TooltipAssertions.js +114 -0
  71. package/build/src/assertions/index.d.ts +34 -0
  72. package/build/src/assertions/index.js +71 -0
  73. package/build/src/components/Autocomplete.d.ts +25 -0
  74. package/build/src/components/Autocomplete.js +256 -0
  75. package/build/src/components/BaseComponent.d.ts +18 -0
  76. package/build/src/components/BaseComponent.js +159 -0
  77. package/build/src/components/Button.d.ts +21 -0
  78. package/build/src/components/Button.js +146 -0
  79. package/build/src/components/Checkbox.d.ts +21 -0
  80. package/build/src/components/Checkbox.js +161 -0
  81. package/build/src/components/ComboBox.d.ts +41 -0
  82. package/build/src/components/ComboBox.js +292 -0
  83. package/build/src/components/ComponentList.d.ts +21 -0
  84. package/build/src/components/ComponentList.js +203 -0
  85. package/build/src/components/CurrencyInput.d.ts +21 -0
  86. package/build/src/components/CurrencyInput.js +201 -0
  87. package/build/src/components/DateInput.d.ts +18 -0
  88. package/build/src/components/DateInput.js +195 -0
  89. package/build/src/components/DatePicker.d.ts +20 -0
  90. package/build/src/components/DatePicker.js +205 -0
  91. package/build/src/components/DateRangePicker.d.ts +20 -0
  92. package/build/src/components/DateRangePicker.js +111 -0
  93. package/build/src/components/Dropdown.d.ts +35 -0
  94. package/build/src/components/Dropdown.js +322 -0
  95. package/build/src/components/DropdownMenu.d.ts +40 -0
  96. package/build/src/components/DropdownMenu.js +321 -0
  97. package/build/src/components/FileUploader.d.ts +54 -0
  98. package/build/src/components/FileUploader.js +213 -0
  99. package/build/src/components/FxInput.d.ts +23 -0
  100. package/build/src/components/FxInput.js +217 -0
  101. package/build/src/components/Input.d.ts +21 -0
  102. package/build/src/components/Input.js +192 -0
  103. package/build/src/components/Kebab.d.ts +27 -0
  104. package/build/src/components/Kebab.js +247 -0
  105. package/build/src/components/Label.d.ts +13 -0
  106. package/build/src/components/Label.js +94 -0
  107. package/build/src/components/Link.d.ts +16 -0
  108. package/build/src/components/Link.js +130 -0
  109. package/build/src/components/Loader.d.ts +11 -0
  110. package/build/src/components/Loader.js +103 -0
  111. package/build/src/components/MenuItem.d.ts +13 -0
  112. package/build/src/components/MenuItem.js +84 -0
  113. package/build/src/components/Paging.d.ts +25 -0
  114. package/build/src/components/Paging.js +249 -0
  115. package/build/src/components/Portal.d.ts +11 -0
  116. package/build/src/components/Portal.js +112 -0
  117. package/build/src/components/Radio.d.ts +19 -0
  118. package/build/src/components/Radio.js +156 -0
  119. package/build/src/components/RadioGroup.d.ts +21 -0
  120. package/build/src/components/RadioGroup.js +232 -0
  121. package/build/src/components/Select.d.ts +43 -0
  122. package/build/src/components/Select.js +384 -0
  123. package/build/src/components/Spinner.d.ts +12 -0
  124. package/build/src/components/Spinner.js +103 -0
  125. package/build/src/components/Tab.d.ts +16 -0
  126. package/build/src/components/Tab.js +126 -0
  127. package/build/src/components/Tabs.d.ts +18 -0
  128. package/build/src/components/Tabs.js +136 -0
  129. package/build/src/components/Textarea.d.ts +21 -0
  130. package/build/src/components/Textarea.js +186 -0
  131. package/build/src/components/Toast.d.ts +10 -0
  132. package/build/src/components/Toast.js +79 -0
  133. package/build/src/components/Toggle.d.ts +19 -0
  134. package/build/src/components/Toggle.js +151 -0
  135. package/build/src/components/Token.d.ts +13 -0
  136. package/build/src/components/Token.js +106 -0
  137. package/build/src/components/TokenInput.d.ts +44 -0
  138. package/build/src/components/TokenInput.js +319 -0
  139. package/build/src/components/Tooltip.d.ts +14 -0
  140. package/build/src/components/Tooltip.js +98 -0
  141. package/build/src/components/index.d.ts +34 -0
  142. package/build/src/components/index.js +71 -0
  143. package/build/src/index.d.ts +5 -0
  144. package/build/src/index.js +21 -0
  145. package/build/src/matchers/formattedMatchers.d.ts +37 -0
  146. package/build/src/matchers/formattedMatchers.js +125 -0
  147. package/build/src/matchers/index.d.ts +2 -0
  148. package/build/src/matchers/index.js +20 -0
  149. package/build/src/matchers/mergedExpects.d.ts +25 -0
  150. package/build/src/matchers/mergedExpects.js +6 -0
  151. package/build/src/options/AssertionOptions.d.ts +82 -0
  152. package/build/src/options/AssertionOptions.js +2 -0
  153. package/build/src/options/LocatorOptions.d.ts +342 -0
  154. package/build/src/options/LocatorOptions.js +2 -0
  155. package/build/src/options/index.d.ts +2 -0
  156. package/build/src/options/index.js +18 -0
  157. package/build/src/utils/constants.d.ts +10 -0
  158. package/build/src/utils/constants.js +15 -0
  159. package/build/src/utils/dataTidSelector.d.ts +1 -0
  160. package/build/src/utils/dataTidSelector.js +6 -0
  161. package/build/src/utils/index.d.ts +2 -0
  162. package/build/src/utils/index.js +20 -0
  163. package/build/src/utils/tooltipProvider.d.ts +4 -0
  164. package/build/src/utils/tooltipProvider.js +95 -0
  165. package/package.json +27 -0
@@ -0,0 +1,210 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.CheckboxAssertions = void 0;
55
+ var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
56
+ var matchers_1 = require("../matchers");
57
+ var CheckboxAssertions = /** @class */ (function (_super) {
58
+ __extends(CheckboxAssertions, _super);
59
+ function CheckboxAssertions(checkbox) {
60
+ var _this = _super.call(this, checkbox) || this;
61
+ _this.checkbox = checkbox;
62
+ return _this;
63
+ }
64
+ CheckboxAssertions.prototype.toBeEnabled = function (options) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ return __generator(this, function (_a) {
67
+ switch (_a.label) {
68
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).toBeEnabled(options)];
69
+ case 1:
70
+ _a.sent();
71
+ return [2 /*return*/];
72
+ }
73
+ });
74
+ });
75
+ };
76
+ CheckboxAssertions.prototype.toBeDisabled = function (options) {
77
+ return __awaiter(this, void 0, void 0, function () {
78
+ return __generator(this, function (_a) {
79
+ switch (_a.label) {
80
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).toBeDisabled(options)];
81
+ case 1:
82
+ _a.sent();
83
+ return [2 /*return*/];
84
+ }
85
+ });
86
+ });
87
+ };
88
+ CheckboxAssertions.prototype.toBeChecked = function (options) {
89
+ return __awaiter(this, void 0, void 0, function () {
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).toBeChecked(options)];
93
+ case 1:
94
+ _a.sent();
95
+ return [2 /*return*/];
96
+ }
97
+ });
98
+ });
99
+ };
100
+ CheckboxAssertions.prototype.toBeUnchecked = function (options) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ return __generator(this, function (_a) {
103
+ switch (_a.label) {
104
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).not.toBeChecked(options)];
105
+ case 1:
106
+ _a.sent();
107
+ return [2 /*return*/];
108
+ }
109
+ });
110
+ });
111
+ };
112
+ CheckboxAssertions.prototype.toHaveText = function (text, options) {
113
+ return __awaiter(this, void 0, void 0, function () {
114
+ return __generator(this, function (_a) {
115
+ switch (_a.label) {
116
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.rootLocator).toHaveText(text, options)];
117
+ case 1:
118
+ _a.sent();
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ CheckboxAssertions.prototype.notToHaveText = function (text, options) {
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ return __generator(this, function (_a) {
127
+ switch (_a.label) {
128
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.rootLocator).not.toHaveText(text, options)];
129
+ case 1:
130
+ _a.sent();
131
+ return [2 /*return*/];
132
+ }
133
+ });
134
+ });
135
+ };
136
+ CheckboxAssertions.prototype.toContainText = function (text, options) {
137
+ return __awaiter(this, void 0, void 0, function () {
138
+ return __generator(this, function (_a) {
139
+ switch (_a.label) {
140
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.rootLocator).toContainText(text, options)];
141
+ case 1:
142
+ _a.sent();
143
+ return [2 /*return*/];
144
+ }
145
+ });
146
+ });
147
+ };
148
+ CheckboxAssertions.prototype.notToContainText = function (text, options) {
149
+ return __awaiter(this, void 0, void 0, function () {
150
+ return __generator(this, function (_a) {
151
+ switch (_a.label) {
152
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.rootLocator).not.toContainText(text, options)];
153
+ case 1:
154
+ _a.sent();
155
+ return [2 /*return*/];
156
+ }
157
+ });
158
+ });
159
+ };
160
+ CheckboxAssertions.prototype.toHaveValue = function (value, options) {
161
+ return __awaiter(this, void 0, void 0, function () {
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).toHaveValue(value, options)];
165
+ case 1:
166
+ _a.sent();
167
+ return [2 /*return*/];
168
+ }
169
+ });
170
+ });
171
+ };
172
+ CheckboxAssertions.prototype.notToHaveValue = function (value, options) {
173
+ return __awaiter(this, void 0, void 0, function () {
174
+ return __generator(this, function (_a) {
175
+ switch (_a.label) {
176
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).not.toHaveValue(value, options)];
177
+ case 1:
178
+ _a.sent();
179
+ return [2 /*return*/];
180
+ }
181
+ });
182
+ });
183
+ };
184
+ CheckboxAssertions.prototype.toBeFocused = function (options) {
185
+ return __awaiter(this, void 0, void 0, function () {
186
+ return __generator(this, function (_a) {
187
+ switch (_a.label) {
188
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).toBeFocused(options)];
189
+ case 1:
190
+ _a.sent();
191
+ return [2 /*return*/];
192
+ }
193
+ });
194
+ });
195
+ };
196
+ CheckboxAssertions.prototype.notToBeFocused = function (options) {
197
+ return __awaiter(this, void 0, void 0, function () {
198
+ return __generator(this, function (_a) {
199
+ switch (_a.label) {
200
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.checkbox.inputLocator).not.toBeFocused(options)];
201
+ case 1:
202
+ _a.sent();
203
+ return [2 /*return*/];
204
+ }
205
+ });
206
+ });
207
+ };
208
+ return CheckboxAssertions;
209
+ }(BaseComponentAssertions_1.BaseComponentAssertions));
210
+ exports.CheckboxAssertions = CheckboxAssertions;
@@ -0,0 +1,19 @@
1
+ import { BaseComponentAssertions } from './BaseComponentAssertions';
2
+ import type { ComboBox } from '../components';
3
+ import type { EnabledOptions, FocusedOptions, EmptyOptions, ValueOptions, TextOptions } from '../options';
4
+ export declare class ComboBoxAssertions extends BaseComponentAssertions {
5
+ private readonly comboBox;
6
+ constructor(comboBox: ComboBox);
7
+ toBeEnabled(options?: EnabledOptions): Promise<void>;
8
+ toBeDisabled(options?: EnabledOptions): Promise<void>;
9
+ toHaveValue(value: string | RegExp, options?: ValueOptions): Promise<void>;
10
+ notToHaveValue(value: string | RegExp, options?: ValueOptions): Promise<void>;
11
+ toBeEmpty(options?: EmptyOptions): Promise<void>;
12
+ notToBeEmpty(options?: EmptyOptions): Promise<void>;
13
+ toHaveItems(itemsText: string[], options?: TextOptions): Promise<void>;
14
+ toContainItems(itemsText: string[], options?: TextOptions): Promise<void>;
15
+ toContainItem(itemText: string, options?: TextOptions): Promise<void>;
16
+ notToContainItem(itemText: string, options?: TextOptions): Promise<void>;
17
+ toBeFocused(options?: FocusedOptions): Promise<void>;
18
+ notToBeFocused(options?: FocusedOptions): Promise<void>;
19
+ }
@@ -0,0 +1,304 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.ComboBoxAssertions = void 0;
55
+ var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
56
+ var matchers_1 = require("../matchers");
57
+ var ComboBoxAssertions = /** @class */ (function (_super) {
58
+ __extends(ComboBoxAssertions, _super);
59
+ function ComboBoxAssertions(comboBox) {
60
+ var _this = _super.call(this, comboBox) || this;
61
+ _this.comboBox = comboBox;
62
+ return _this;
63
+ }
64
+ ComboBoxAssertions.prototype.toBeEnabled = function (options) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ return __generator(this, function (_a) {
67
+ switch (_a.label) {
68
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).toBeEnabled(options)];
69
+ case 1:
70
+ _a.sent();
71
+ return [2 /*return*/];
72
+ }
73
+ });
74
+ });
75
+ };
76
+ ComboBoxAssertions.prototype.toBeDisabled = function (options) {
77
+ return __awaiter(this, void 0, void 0, function () {
78
+ return __generator(this, function (_a) {
79
+ switch (_a.label) {
80
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).toBeDisabled(options)];
81
+ case 1:
82
+ _a.sent();
83
+ return [2 /*return*/];
84
+ }
85
+ });
86
+ });
87
+ };
88
+ ComboBoxAssertions.prototype.toHaveValue = function (value, options) {
89
+ return __awaiter(this, void 0, void 0, function () {
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4 /*yield*/, this.comboBox.isDisabled()];
93
+ case 1:
94
+ if (!!(_a.sent())) return [3 /*break*/, 4];
95
+ return [4 /*yield*/, this.comboBox.focus()];
96
+ case 2:
97
+ _a.sent();
98
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).toHaveValue(value, options)];
99
+ case 3:
100
+ _a.sent();
101
+ return [3 /*break*/, 6];
102
+ case 4: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.inputLikeTextLocator).toHaveText(value, options)];
103
+ case 5:
104
+ _a.sent();
105
+ _a.label = 6;
106
+ case 6: return [2 /*return*/];
107
+ }
108
+ });
109
+ });
110
+ };
111
+ ComboBoxAssertions.prototype.notToHaveValue = function (value, options) {
112
+ return __awaiter(this, void 0, void 0, function () {
113
+ return __generator(this, function (_a) {
114
+ switch (_a.label) {
115
+ case 0: return [4 /*yield*/, this.comboBox.isDisabled()];
116
+ case 1:
117
+ if (!!(_a.sent())) return [3 /*break*/, 4];
118
+ return [4 /*yield*/, this.comboBox.focus()];
119
+ case 2:
120
+ _a.sent();
121
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).not.toHaveValue(value, options)];
122
+ case 3:
123
+ _a.sent();
124
+ return [3 /*break*/, 6];
125
+ case 4: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.inputLikeTextLocator).not.toHaveText(value, options)];
126
+ case 5:
127
+ _a.sent();
128
+ _a.label = 6;
129
+ case 6: return [2 /*return*/];
130
+ }
131
+ });
132
+ });
133
+ };
134
+ ComboBoxAssertions.prototype.toBeEmpty = function (options) {
135
+ return __awaiter(this, void 0, void 0, function () {
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0: return [4 /*yield*/, this.comboBox.isDisabled()];
139
+ case 1:
140
+ if (!!(_a.sent())) return [3 /*break*/, 4];
141
+ return [4 /*yield*/, this.comboBox.focus()];
142
+ case 2:
143
+ _a.sent();
144
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).toBeEmpty(options)];
145
+ case 3:
146
+ _a.sent();
147
+ return [3 /*break*/, 6];
148
+ case 4: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.inputLikeTextLocator).toBeEmpty(options)];
149
+ case 5:
150
+ _a.sent();
151
+ _a.label = 6;
152
+ case 6: return [2 /*return*/];
153
+ }
154
+ });
155
+ });
156
+ };
157
+ ComboBoxAssertions.prototype.notToBeEmpty = function (options) {
158
+ return __awaiter(this, void 0, void 0, function () {
159
+ return __generator(this, function (_a) {
160
+ switch (_a.label) {
161
+ case 0: return [4 /*yield*/, this.comboBox.isDisabled()];
162
+ case 1:
163
+ if (!!(_a.sent())) return [3 /*break*/, 4];
164
+ return [4 /*yield*/, this.comboBox.focus()];
165
+ case 2:
166
+ _a.sent();
167
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).not.toBeEmpty(options)];
168
+ case 3:
169
+ _a.sent();
170
+ return [3 /*break*/, 6];
171
+ case 4: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.inputLikeTextLocator).not.toBeEmpty(options)];
172
+ case 5:
173
+ _a.sent();
174
+ _a.label = 6;
175
+ case 6: return [2 /*return*/];
176
+ }
177
+ });
178
+ });
179
+ };
180
+ ComboBoxAssertions.prototype.toHaveItems = function (itemsText, options) {
181
+ return __awaiter(this, void 0, void 0, function () {
182
+ var itemsLocator;
183
+ return __generator(this, function (_a) {
184
+ switch (_a.label) {
185
+ case 0: return [4 /*yield*/, this.comboBox.getMenuItems()];
186
+ case 1:
187
+ itemsLocator = (_a.sent()).itemsLocator;
188
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(itemsLocator).toHaveText(itemsText, options)];
189
+ case 2:
190
+ _a.sent();
191
+ return [2 /*return*/];
192
+ }
193
+ });
194
+ });
195
+ };
196
+ ComboBoxAssertions.prototype.toContainItems = function (itemsText, options) {
197
+ return __awaiter(this, void 0, void 0, function () {
198
+ var itemsLocator;
199
+ return __generator(this, function (_a) {
200
+ switch (_a.label) {
201
+ case 0: return [4 /*yield*/, this.comboBox.getMenuItems()];
202
+ case 1:
203
+ itemsLocator = (_a.sent()).itemsLocator;
204
+ return [4 /*yield*/, (0, matchers_1.mergedExpects)(itemsLocator).toContainText(itemsText, options)];
205
+ case 2:
206
+ _a.sent();
207
+ return [2 /*return*/];
208
+ }
209
+ });
210
+ });
211
+ };
212
+ ComboBoxAssertions.prototype.toContainItem = function (itemText, options) {
213
+ return __awaiter(this, void 0, void 0, function () {
214
+ var _this = this;
215
+ return __generator(this, function (_a) {
216
+ switch (_a.label) {
217
+ case 0: return [4 /*yield*/, matchers_1.mergedExpects
218
+ .poll(function () { return __awaiter(_this, void 0, void 0, function () {
219
+ var menus, _a, _b;
220
+ var _this = this;
221
+ return __generator(this, function (_c) {
222
+ switch (_c.label) {
223
+ case 0: return [4 /*yield*/, this.comboBox.getMenuItems()];
224
+ case 1:
225
+ menus = _c.sent();
226
+ _b = (_a = Promise).all;
227
+ return [4 /*yield*/, menus.getItems()];
228
+ case 2: return [2 /*return*/, _b.apply(_a, [(_c.sent()).map(function (x) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0: return [4 /*yield*/, x.getText()];
231
+ case 1: return [2 /*return*/, _a.sent()];
232
+ }
233
+ }); }); })])];
234
+ }
235
+ });
236
+ }); }, options)
237
+ .toContain(itemText)];
238
+ case 1:
239
+ _a.sent();
240
+ return [2 /*return*/];
241
+ }
242
+ });
243
+ });
244
+ };
245
+ ComboBoxAssertions.prototype.notToContainItem = function (itemText, options) {
246
+ return __awaiter(this, void 0, void 0, function () {
247
+ var _this = this;
248
+ return __generator(this, function (_a) {
249
+ switch (_a.label) {
250
+ case 0: return [4 /*yield*/, matchers_1.mergedExpects
251
+ .poll(function () { return __awaiter(_this, void 0, void 0, function () {
252
+ var menus, _a, _b;
253
+ var _this = this;
254
+ return __generator(this, function (_c) {
255
+ switch (_c.label) {
256
+ case 0: return [4 /*yield*/, this.comboBox.getMenuItems()];
257
+ case 1:
258
+ menus = _c.sent();
259
+ _b = (_a = Promise).all;
260
+ return [4 /*yield*/, menus.getItems()];
261
+ case 2: return [2 /*return*/, _b.apply(_a, [(_c.sent()).map(function (x) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
262
+ switch (_a.label) {
263
+ case 0: return [4 /*yield*/, x.getText()];
264
+ case 1: return [2 /*return*/, _a.sent()];
265
+ }
266
+ }); }); })])];
267
+ }
268
+ });
269
+ }); }, options)
270
+ .not.toContain(itemText)];
271
+ case 1:
272
+ _a.sent();
273
+ return [2 /*return*/];
274
+ }
275
+ });
276
+ });
277
+ };
278
+ ComboBoxAssertions.prototype.toBeFocused = function (options) {
279
+ return __awaiter(this, void 0, void 0, function () {
280
+ return __generator(this, function (_a) {
281
+ switch (_a.label) {
282
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).toBeFocused(options)];
283
+ case 1:
284
+ _a.sent();
285
+ return [2 /*return*/];
286
+ }
287
+ });
288
+ });
289
+ };
290
+ ComboBoxAssertions.prototype.notToBeFocused = function (options) {
291
+ return __awaiter(this, void 0, void 0, function () {
292
+ return __generator(this, function (_a) {
293
+ switch (_a.label) {
294
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.comboBox.nativeInputLocator).not.toBeFocused(options)];
295
+ case 1:
296
+ _a.sent();
297
+ return [2 /*return*/];
298
+ }
299
+ });
300
+ });
301
+ };
302
+ return ComboBoxAssertions;
303
+ }(BaseComponentAssertions_1.BaseComponentAssertions));
304
+ exports.ComboBoxAssertions = ComboBoxAssertions;
@@ -0,0 +1,13 @@
1
+ import { BaseComponentAssertions } from './BaseComponentAssertions';
2
+ import type { ComponentList } from '../components';
3
+ import type { BaseComponent } from '../components';
4
+ import type { HiddenOptions, VisibleOptions, CountOptions } from '../options';
5
+ export declare class ComponentListAssertions<TItem extends BaseComponent> extends BaseComponentAssertions {
6
+ private readonly componentList;
7
+ constructor(componentList: ComponentList<TItem>);
8
+ toBeVisible(options?: VisibleOptions): Promise<void>;
9
+ toBeHidden(options?: HiddenOptions): Promise<void>;
10
+ toHaveCount(count: number, options?: CountOptions): Promise<void>;
11
+ toBeEmpty(options?: CountOptions): Promise<void>;
12
+ notToBeEmpty(options?: CountOptions): Promise<void>;
13
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.ComponentListAssertions = void 0;
55
+ var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
56
+ var matchers_1 = require("../matchers");
57
+ var ComponentListAssertions = /** @class */ (function (_super) {
58
+ __extends(ComponentListAssertions, _super);
59
+ function ComponentListAssertions(componentList) {
60
+ var _this = _super.call(this, componentList) || this;
61
+ _this.componentList = componentList;
62
+ return _this;
63
+ }
64
+ ComponentListAssertions.prototype.toBeVisible = function (options) {
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ return __generator(this, function (_a) {
67
+ switch (_a.label) {
68
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.componentList.itemsLocator.first()).toBeVisible(options)];
69
+ case 1:
70
+ _a.sent();
71
+ return [2 /*return*/];
72
+ }
73
+ });
74
+ });
75
+ };
76
+ ComponentListAssertions.prototype.toBeHidden = function (options) {
77
+ return __awaiter(this, void 0, void 0, function () {
78
+ return __generator(this, function (_a) {
79
+ switch (_a.label) {
80
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.componentList.itemsLocator.first()).toBeHidden(options)];
81
+ case 1:
82
+ _a.sent();
83
+ return [2 /*return*/];
84
+ }
85
+ });
86
+ });
87
+ };
88
+ ComponentListAssertions.prototype.toHaveCount = function (count, options) {
89
+ return __awaiter(this, void 0, void 0, function () {
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.componentList.itemsLocator).toHaveCount(count, options)];
93
+ case 1:
94
+ _a.sent();
95
+ return [2 /*return*/];
96
+ }
97
+ });
98
+ });
99
+ };
100
+ ComponentListAssertions.prototype.toBeEmpty = function (options) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ return __generator(this, function (_a) {
103
+ switch (_a.label) {
104
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.componentList.itemsLocator).toHaveCount(0, options)];
105
+ case 1:
106
+ _a.sent();
107
+ return [2 /*return*/];
108
+ }
109
+ });
110
+ });
111
+ };
112
+ ComponentListAssertions.prototype.notToBeEmpty = function (options) {
113
+ return __awaiter(this, void 0, void 0, function () {
114
+ return __generator(this, function (_a) {
115
+ switch (_a.label) {
116
+ case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.componentList.itemsLocator).not.toHaveCount(0, options)];
117
+ case 1:
118
+ _a.sent();
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ });
123
+ };
124
+ return ComponentListAssertions;
125
+ }(BaseComponentAssertions_1.BaseComponentAssertions));
126
+ exports.ComponentListAssertions = ComponentListAssertions;