@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,12 @@
1
+ import type { Locator } from '@playwright/test';
2
+ import { BaseComponent } from './BaseComponent';
3
+ import { SpinnerAssertions } from '../assertions';
4
+ import type { InnerTextOptions } from '../options';
5
+ export declare class Spinner extends BaseComponent {
6
+ readonly rootLocator: Locator;
7
+ constructor(rootLocator: Locator);
8
+ getText(options?: InnerTextOptions): Promise<string>;
9
+ waitLoading(): Promise<void>;
10
+ waitLoaded(): Promise<void>;
11
+ expect(): SpinnerAssertions;
12
+ }
@@ -0,0 +1,103 @@
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.Spinner = void 0;
55
+ var BaseComponent_1 = require("./BaseComponent");
56
+ var assertions_1 = require("../assertions");
57
+ var Spinner = /** @class */ (function (_super) {
58
+ __extends(Spinner, _super);
59
+ function Spinner(rootLocator) {
60
+ var _this = _super.call(this, rootLocator) || this;
61
+ _this.rootLocator = rootLocator;
62
+ return _this;
63
+ }
64
+ Spinner.prototype.getText = 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*/, this.rootLocator.innerText(options)];
69
+ case 1: return [2 /*return*/, _a.sent()];
70
+ }
71
+ });
72
+ });
73
+ };
74
+ Spinner.prototype.waitLoading = function () {
75
+ return __awaiter(this, void 0, void 0, function () {
76
+ return __generator(this, function (_a) {
77
+ switch (_a.label) {
78
+ case 0: return [4 /*yield*/, this.waitFor()];
79
+ case 1:
80
+ _a.sent();
81
+ return [2 /*return*/];
82
+ }
83
+ });
84
+ });
85
+ };
86
+ Spinner.prototype.waitLoaded = function () {
87
+ return __awaiter(this, void 0, void 0, function () {
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0: return [4 /*yield*/, this.waitFor({ state: 'hidden' })];
91
+ case 1:
92
+ _a.sent();
93
+ return [2 /*return*/];
94
+ }
95
+ });
96
+ });
97
+ };
98
+ Spinner.prototype.expect = function () {
99
+ return new assertions_1.SpinnerAssertions(this);
100
+ };
101
+ return Spinner;
102
+ }(BaseComponent_1.BaseComponent));
103
+ exports.Spinner = Spinner;
@@ -0,0 +1,16 @@
1
+ import type { Locator } from '@playwright/test';
2
+ import { BaseComponent } from './BaseComponent';
3
+ import type { TooltipType } from '../utils';
4
+ import { TabAssertions } from '../assertions';
5
+ import type { BlurOptions, FocusOptions, InnerTextOptions } from '../options';
6
+ export declare class Tab extends BaseComponent {
7
+ readonly rootLocator: Locator;
8
+ constructor(rootLocator: Locator);
9
+ isDisabled(): Promise<boolean>;
10
+ isActive(): Promise<boolean>;
11
+ getText(options?: InnerTextOptions): Promise<string>;
12
+ focus(options?: FocusOptions): Promise<void>;
13
+ blur(options?: BlurOptions): Promise<void>;
14
+ getTooltip(type: TooltipType): Promise<import("./Tooltip").Tooltip>;
15
+ expect(): TabAssertions;
16
+ }
@@ -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.Tab = void 0;
55
+ var test_1 = require("@playwright/test");
56
+ var BaseComponent_1 = require("./BaseComponent");
57
+ var utils_1 = require("../utils");
58
+ var assertions_1 = require("../assertions");
59
+ var Tab = /** @class */ (function (_super) {
60
+ __extends(Tab, _super);
61
+ function Tab(rootLocator) {
62
+ var _this = _super.call(this, rootLocator) || this;
63
+ _this.rootLocator = rootLocator;
64
+ return _this;
65
+ }
66
+ 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
+ };
73
+ 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
+ });
79
+ };
80
+ 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
+ });
86
+ };
87
+ Tab.prototype.focus = function (options) {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ return __generator(this, function (_a) {
90
+ switch (_a.label) {
91
+ case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).toBeEnabled()];
92
+ case 1:
93
+ _a.sent();
94
+ return [4 /*yield*/, this.rootLocator.focus(options)];
95
+ case 2:
96
+ _a.sent();
97
+ return [2 /*return*/];
98
+ }
99
+ });
100
+ });
101
+ };
102
+ Tab.prototype.blur = function (options) {
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ return __generator(this, function (_a) {
105
+ switch (_a.label) {
106
+ case 0: return [4 /*yield*/, this.rootLocator.blur(options)];
107
+ case 1:
108
+ _a.sent();
109
+ return [2 /*return*/];
110
+ }
111
+ });
112
+ });
113
+ };
114
+ 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
+ });
120
+ };
121
+ Tab.prototype.expect = function () {
122
+ return new assertions_1.TabAssertions(this);
123
+ };
124
+ return Tab;
125
+ }(BaseComponent_1.BaseComponent));
126
+ exports.Tab = Tab;
@@ -0,0 +1,18 @@
1
+ import type { Locator } from '@playwright/test';
2
+ import { BaseComponent } from './BaseComponent';
3
+ import { ComponentList } from './ComponentList';
4
+ import { Tab } from './Tab';
5
+ import { TabsAssertions } from '../assertions';
6
+ export declare class Tabs extends BaseComponent {
7
+ readonly rootLocator: Locator;
8
+ readonly list: ComponentList<Tab>;
9
+ private readonly tabsLocator;
10
+ private readonly activeTabLocator;
11
+ constructor(rootLocator: Locator);
12
+ select(tabName: string): Promise<void>;
13
+ getActive(): Tab;
14
+ getFirst(): Promise<Tab>;
15
+ getByIndex(index: number): Promise<Tab>;
16
+ getByName(name: string | RegExp): Promise<Tab>;
17
+ expect(): TabsAssertions;
18
+ }
@@ -0,0 +1,136 @@
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.Tabs = void 0;
55
+ var react_ui_1 = require("@skbkontur/react-ui");
56
+ var BaseComponent_1 = require("./BaseComponent");
57
+ var ComponentList_1 = require("./ComponentList");
58
+ var Tab_1 = require("./Tab");
59
+ var utils_1 = require("../utils");
60
+ var assertions_1 = require("../assertions");
61
+ var dataTidSelector_1 = require("../utils/dataTidSelector");
62
+ var Tabs = /** @class */ (function (_super) {
63
+ __extends(Tabs, _super);
64
+ function Tabs(rootLocator) {
65
+ var _this = _super.call(this, rootLocator) || this;
66
+ _this.rootLocator = rootLocator;
67
+ _this.tabsLocator = rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.TabDataTids.root));
68
+ _this.activeTabLocator = _this.tabsLocator.and(_this.rootLocator.locator("[".concat(utils_1.DataVisualState.Active, "='']")));
69
+ _this.list = new ComponentList_1.ComponentList(rootLocator, function (_) { return _this.tabsLocator; }, function (locator) { return new Tab_1.Tab(locator); });
70
+ return _this;
71
+ }
72
+ Tabs.prototype.select = function (tabName) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ return __generator(this, function (_a) {
75
+ switch (_a.label) {
76
+ case 0: return [4 /*yield*/, this.tabsLocator.getByText(tabName).click()];
77
+ case 1:
78
+ _a.sent();
79
+ return [2 /*return*/];
80
+ }
81
+ });
82
+ });
83
+ };
84
+ Tabs.prototype.getActive = function () {
85
+ return new Tab_1.Tab(this.activeTabLocator);
86
+ };
87
+ Tabs.prototype.getFirst = function () {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ return __generator(this, function (_a) {
90
+ switch (_a.label) {
91
+ case 0: return [4 /*yield*/, this.list.getFirstItem()];
92
+ case 1: return [2 /*return*/, _a.sent()];
93
+ }
94
+ });
95
+ });
96
+ };
97
+ Tabs.prototype.getByIndex = function (index) {
98
+ return __awaiter(this, void 0, void 0, function () {
99
+ return __generator(this, function (_a) {
100
+ switch (_a.label) {
101
+ case 0: return [4 /*yield*/, this.list.getItemByIndex(index)];
102
+ case 1: return [2 /*return*/, _a.sent()];
103
+ }
104
+ });
105
+ });
106
+ };
107
+ Tabs.prototype.getByName = function (name) {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var pattern;
110
+ var _this = this;
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0:
114
+ pattern = typeof name === 'string' ? new RegExp(name) : name;
115
+ return [4 /*yield*/, this.list.getFirstItemByPredicate(function (x) { return __awaiter(_this, void 0, void 0, function () {
116
+ var text;
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0: return [4 /*yield*/, x.getText()];
120
+ case 1:
121
+ text = _a.sent();
122
+ return [2 /*return*/, pattern.test(text)];
123
+ }
124
+ });
125
+ }); })];
126
+ case 1: return [2 /*return*/, _a.sent()];
127
+ }
128
+ });
129
+ });
130
+ };
131
+ Tabs.prototype.expect = function () {
132
+ return new assertions_1.TabsAssertions(this);
133
+ };
134
+ return Tabs;
135
+ }(BaseComponent_1.BaseComponent));
136
+ exports.Tabs = Tabs;
@@ -0,0 +1,21 @@
1
+ import { type Locator } from '@playwright/test';
2
+ import { BaseComponent } from './BaseComponent';
3
+ import type { TooltipType } from '../utils';
4
+ import { TextareaAssertions } from '../assertions';
5
+ import type { BlurOptions, ClearOptions, ClickOptions, FillOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions, PressSequentiallyOptions } from '../options';
6
+ export declare class Textarea extends BaseComponent {
7
+ readonly rootLocator: Locator;
8
+ readonly textareaLocator: Locator;
9
+ constructor(rootLocator: Locator);
10
+ isDisabled(options?: IsDisabledOptions): Promise<boolean>;
11
+ getValue(options?: InputValueOptions): Promise<string>;
12
+ fill(value: string, options?: FillOptions): Promise<void>;
13
+ press(value: string, options?: PressOptions): Promise<void>;
14
+ pressSequentially(value: string, options?: PressSequentiallyOptions): Promise<void>;
15
+ clear(options?: ClearOptions): Promise<void>;
16
+ focus(options?: FocusOptions): Promise<void>;
17
+ blur(options?: BlurOptions): Promise<void>;
18
+ click(options?: ClickOptions): Promise<void>;
19
+ getTooltip(type: TooltipType): Promise<import("./Tooltip").Tooltip>;
20
+ expect(): TextareaAssertions;
21
+ }
@@ -0,0 +1,186 @@
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.Textarea = void 0;
55
+ var test_1 = require("@playwright/test");
56
+ var BaseComponent_1 = require("./BaseComponent");
57
+ var utils_1 = require("../utils");
58
+ var assertions_1 = require("../assertions");
59
+ var Textarea = /** @class */ (function (_super) {
60
+ __extends(Textarea, _super);
61
+ function Textarea(rootLocator) {
62
+ var _this = _super.call(this, rootLocator) || this;
63
+ _this.rootLocator = rootLocator;
64
+ _this.textareaLocator = rootLocator.locator('textarea').first();
65
+ return _this;
66
+ }
67
+ Textarea.prototype.isDisabled = function (options) {
68
+ return __awaiter(this, void 0, void 0, function () {
69
+ return __generator(this, function (_a) {
70
+ return [2 /*return*/, this.textareaLocator.isDisabled(options)];
71
+ });
72
+ });
73
+ };
74
+ Textarea.prototype.getValue = function (options) {
75
+ return __awaiter(this, void 0, void 0, function () {
76
+ return __generator(this, function (_a) {
77
+ return [2 /*return*/, this.textareaLocator.inputValue(options)];
78
+ });
79
+ });
80
+ };
81
+ Textarea.prototype.fill = function (value, options) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ return __generator(this, function (_a) {
84
+ switch (_a.label) {
85
+ case 0: return [4 /*yield*/, this.textareaLocator.fill(value, options)];
86
+ case 1:
87
+ _a.sent();
88
+ return [2 /*return*/];
89
+ }
90
+ });
91
+ });
92
+ };
93
+ Textarea.prototype.press = function (value, options) {
94
+ return __awaiter(this, void 0, void 0, function () {
95
+ return __generator(this, function (_a) {
96
+ switch (_a.label) {
97
+ case 0: return [4 /*yield*/, this.focus()];
98
+ case 1:
99
+ _a.sent();
100
+ return [4 /*yield*/, this.textareaLocator.press(value, options)];
101
+ case 2:
102
+ _a.sent();
103
+ return [2 /*return*/];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ Textarea.prototype.pressSequentially = function (value, options) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0: return [4 /*yield*/, this.focus()];
113
+ case 1:
114
+ _a.sent();
115
+ return [4 /*yield*/, this.textareaLocator.pressSequentially(value, options)];
116
+ case 2:
117
+ _a.sent();
118
+ return [2 /*return*/];
119
+ }
120
+ });
121
+ });
122
+ };
123
+ Textarea.prototype.clear = function (options) {
124
+ return __awaiter(this, void 0, void 0, function () {
125
+ return __generator(this, function (_a) {
126
+ switch (_a.label) {
127
+ case 0: return [4 /*yield*/, this.textareaLocator.clear(options)];
128
+ case 1:
129
+ _a.sent();
130
+ return [2 /*return*/];
131
+ }
132
+ });
133
+ });
134
+ };
135
+ Textarea.prototype.focus = function (options) {
136
+ return __awaiter(this, void 0, void 0, function () {
137
+ return __generator(this, function (_a) {
138
+ switch (_a.label) {
139
+ case 0: return [4 /*yield*/, (0, test_1.expect)(this.textareaLocator).toBeEnabled()];
140
+ case 1:
141
+ _a.sent();
142
+ return [4 /*yield*/, this.textareaLocator.focus(options)];
143
+ case 2:
144
+ _a.sent();
145
+ return [2 /*return*/];
146
+ }
147
+ });
148
+ });
149
+ };
150
+ Textarea.prototype.blur = function (options) {
151
+ return __awaiter(this, void 0, void 0, function () {
152
+ return __generator(this, function (_a) {
153
+ switch (_a.label) {
154
+ case 0: return [4 /*yield*/, this.textareaLocator.blur(options)];
155
+ case 1:
156
+ _a.sent();
157
+ return [2 /*return*/];
158
+ }
159
+ });
160
+ });
161
+ };
162
+ Textarea.prototype.click = function (options) {
163
+ return __awaiter(this, void 0, void 0, function () {
164
+ return __generator(this, function (_a) {
165
+ switch (_a.label) {
166
+ case 0: return [4 /*yield*/, this.textareaLocator.click(options)];
167
+ case 1:
168
+ _a.sent();
169
+ return [2 /*return*/];
170
+ }
171
+ });
172
+ });
173
+ };
174
+ Textarea.prototype.getTooltip = function (type) {
175
+ return __awaiter(this, void 0, void 0, function () {
176
+ return __generator(this, function (_a) {
177
+ return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
178
+ });
179
+ });
180
+ };
181
+ Textarea.prototype.expect = function () {
182
+ return new assertions_1.TextareaAssertions(this);
183
+ };
184
+ return Textarea;
185
+ }(BaseComponent_1.BaseComponent));
186
+ exports.Textarea = Textarea;
@@ -0,0 +1,10 @@
1
+ import type { Locator } from '@playwright/test';
2
+ import { BaseComponent } from './BaseComponent';
3
+ import { ToastAssertions } from '../assertions';
4
+ import type { InnerTextOptions } from '../options';
5
+ export declare class Toast extends BaseComponent {
6
+ readonly rootLocator: Locator;
7
+ constructor(rootLocator: Locator);
8
+ getText(options?: InnerTextOptions): Promise<string>;
9
+ expect(): ToastAssertions;
10
+ }