@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.
- package/build/index.d.ts +1 -0
- package/build/index.js +17 -0
- package/build/src/assertions/AutocompleteAssertions.d.ts +19 -0
- package/build/src/assertions/AutocompleteAssertions.js +177 -0
- package/build/src/assertions/BaseComponentAssertions.d.ts +15 -0
- package/build/src/assertions/BaseComponentAssertions.js +158 -0
- package/build/src/assertions/ButtonAssertions.d.ts +15 -0
- package/build/src/assertions/ButtonAssertions.js +162 -0
- package/build/src/assertions/CheckboxAssertions.d.ts +19 -0
- package/build/src/assertions/CheckboxAssertions.js +210 -0
- package/build/src/assertions/ComboBoxAssertions.d.ts +19 -0
- package/build/src/assertions/ComboBoxAssertions.js +304 -0
- package/build/src/assertions/ComponentListAssertions.d.ts +13 -0
- package/build/src/assertions/ComponentListAssertions.js +126 -0
- package/build/src/assertions/CurrencyInputAssertions.d.ts +15 -0
- package/build/src/assertions/CurrencyInputAssertions.js +212 -0
- package/build/src/assertions/DateInputAssertions.d.ts +15 -0
- package/build/src/assertions/DateInputAssertions.js +162 -0
- package/build/src/assertions/DatePickerAssertions.d.ts +15 -0
- package/build/src/assertions/DatePickerAssertions.js +162 -0
- package/build/src/assertions/DateRangePickerAssertions.d.ts +11 -0
- package/build/src/assertions/DateRangePickerAssertions.js +111 -0
- package/build/src/assertions/DropdownAssertions.d.ts +19 -0
- package/build/src/assertions/DropdownAssertions.js +260 -0
- package/build/src/assertions/DropdownMenuAssertions.d.ts +17 -0
- package/build/src/assertions/DropdownMenuAssertions.js +236 -0
- package/build/src/assertions/FileUploaderAssertions.d.ts +14 -0
- package/build/src/assertions/FileUploaderAssertions.js +119 -0
- package/build/src/assertions/FxInputAssertions.d.ts +17 -0
- package/build/src/assertions/FxInputAssertions.js +189 -0
- package/build/src/assertions/InputAssertions.d.ts +19 -0
- package/build/src/assertions/InputAssertions.js +177 -0
- package/build/src/assertions/KebabAssertions.d.ts +13 -0
- package/build/src/assertions/KebabAssertions.js +189 -0
- package/build/src/assertions/LabelAssertions.d.ts +19 -0
- package/build/src/assertions/LabelAssertions.js +144 -0
- package/build/src/assertions/LinkAssertions.d.ts +17 -0
- package/build/src/assertions/LinkAssertions.js +187 -0
- package/build/src/assertions/LoaderAssertions.d.ts +8 -0
- package/build/src/assertions/LoaderAssertions.js +78 -0
- package/build/src/assertions/MenuItemAssertations.d.ts +11 -0
- package/build/src/assertions/MenuItemAssertations.js +114 -0
- package/build/src/assertions/PagingAssertions.d.ts +15 -0
- package/build/src/assertions/PagingAssertions.js +149 -0
- package/build/src/assertions/PortalAssertions.d.ts +9 -0
- package/build/src/assertions/PortalAssertions.js +90 -0
- package/build/src/assertions/RadioAssertions.d.ts +19 -0
- package/build/src/assertions/RadioAssertions.js +210 -0
- package/build/src/assertions/RadioGroupAssertions.d.ts +15 -0
- package/build/src/assertions/RadioGroupAssertions.js +233 -0
- package/build/src/assertions/SelectAssertions.d.ts +15 -0
- package/build/src/assertions/SelectAssertions.js +211 -0
- package/build/src/assertions/SpinnerAssertions.d.ts +8 -0
- package/build/src/assertions/SpinnerAssertions.js +78 -0
- package/build/src/assertions/TabAssertions.d.ts +17 -0
- package/build/src/assertions/TabAssertions.js +187 -0
- package/build/src/assertions/TabsAssertions.d.ts +11 -0
- package/build/src/assertions/TabsAssertions.js +130 -0
- package/build/src/assertions/TextareaAssertions.d.ts +15 -0
- package/build/src/assertions/TextareaAssertions.js +162 -0
- package/build/src/assertions/ToastAssertions.d.ts +8 -0
- package/build/src/assertions/ToastAssertions.js +78 -0
- package/build/src/assertions/ToggleAssertions.d.ts +17 -0
- package/build/src/assertions/ToggleAssertions.js +186 -0
- package/build/src/assertions/TokenAssertions.d.ts +17 -0
- package/build/src/assertions/TokenAssertions.js +159 -0
- package/build/src/assertions/TokenInputAssertions.d.ts +16 -0
- package/build/src/assertions/TokenInputAssertions.js +170 -0
- package/build/src/assertions/TooltipAssertions.d.ts +11 -0
- package/build/src/assertions/TooltipAssertions.js +114 -0
- package/build/src/assertions/index.d.ts +34 -0
- package/build/src/assertions/index.js +71 -0
- package/build/src/components/Autocomplete.d.ts +25 -0
- package/build/src/components/Autocomplete.js +256 -0
- package/build/src/components/BaseComponent.d.ts +18 -0
- package/build/src/components/BaseComponent.js +159 -0
- package/build/src/components/Button.d.ts +21 -0
- package/build/src/components/Button.js +146 -0
- package/build/src/components/Checkbox.d.ts +21 -0
- package/build/src/components/Checkbox.js +161 -0
- package/build/src/components/ComboBox.d.ts +41 -0
- package/build/src/components/ComboBox.js +292 -0
- package/build/src/components/ComponentList.d.ts +21 -0
- package/build/src/components/ComponentList.js +203 -0
- package/build/src/components/CurrencyInput.d.ts +21 -0
- package/build/src/components/CurrencyInput.js +201 -0
- package/build/src/components/DateInput.d.ts +18 -0
- package/build/src/components/DateInput.js +195 -0
- package/build/src/components/DatePicker.d.ts +20 -0
- package/build/src/components/DatePicker.js +205 -0
- package/build/src/components/DateRangePicker.d.ts +20 -0
- package/build/src/components/DateRangePicker.js +111 -0
- package/build/src/components/Dropdown.d.ts +35 -0
- package/build/src/components/Dropdown.js +322 -0
- package/build/src/components/DropdownMenu.d.ts +40 -0
- package/build/src/components/DropdownMenu.js +321 -0
- package/build/src/components/FileUploader.d.ts +54 -0
- package/build/src/components/FileUploader.js +213 -0
- package/build/src/components/FxInput.d.ts +23 -0
- package/build/src/components/FxInput.js +217 -0
- package/build/src/components/Input.d.ts +21 -0
- package/build/src/components/Input.js +192 -0
- package/build/src/components/Kebab.d.ts +27 -0
- package/build/src/components/Kebab.js +247 -0
- package/build/src/components/Label.d.ts +13 -0
- package/build/src/components/Label.js +94 -0
- package/build/src/components/Link.d.ts +16 -0
- package/build/src/components/Link.js +130 -0
- package/build/src/components/Loader.d.ts +11 -0
- package/build/src/components/Loader.js +103 -0
- package/build/src/components/MenuItem.d.ts +13 -0
- package/build/src/components/MenuItem.js +84 -0
- package/build/src/components/Paging.d.ts +25 -0
- package/build/src/components/Paging.js +249 -0
- package/build/src/components/Portal.d.ts +11 -0
- package/build/src/components/Portal.js +112 -0
- package/build/src/components/Radio.d.ts +19 -0
- package/build/src/components/Radio.js +156 -0
- package/build/src/components/RadioGroup.d.ts +21 -0
- package/build/src/components/RadioGroup.js +232 -0
- package/build/src/components/Select.d.ts +43 -0
- package/build/src/components/Select.js +384 -0
- package/build/src/components/Spinner.d.ts +12 -0
- package/build/src/components/Spinner.js +103 -0
- package/build/src/components/Tab.d.ts +16 -0
- package/build/src/components/Tab.js +126 -0
- package/build/src/components/Tabs.d.ts +18 -0
- package/build/src/components/Tabs.js +136 -0
- package/build/src/components/Textarea.d.ts +21 -0
- package/build/src/components/Textarea.js +186 -0
- package/build/src/components/Toast.d.ts +10 -0
- package/build/src/components/Toast.js +79 -0
- package/build/src/components/Toggle.d.ts +19 -0
- package/build/src/components/Toggle.js +151 -0
- package/build/src/components/Token.d.ts +13 -0
- package/build/src/components/Token.js +106 -0
- package/build/src/components/TokenInput.d.ts +44 -0
- package/build/src/components/TokenInput.js +319 -0
- package/build/src/components/Tooltip.d.ts +14 -0
- package/build/src/components/Tooltip.js +98 -0
- package/build/src/components/index.d.ts +34 -0
- package/build/src/components/index.js +71 -0
- package/build/src/index.d.ts +5 -0
- package/build/src/index.js +21 -0
- package/build/src/matchers/formattedMatchers.d.ts +37 -0
- package/build/src/matchers/formattedMatchers.js +125 -0
- package/build/src/matchers/index.d.ts +2 -0
- package/build/src/matchers/index.js +20 -0
- package/build/src/matchers/mergedExpects.d.ts +25 -0
- package/build/src/matchers/mergedExpects.js +6 -0
- package/build/src/options/AssertionOptions.d.ts +82 -0
- package/build/src/options/AssertionOptions.js +2 -0
- package/build/src/options/LocatorOptions.d.ts +342 -0
- package/build/src/options/LocatorOptions.js +2 -0
- package/build/src/options/index.d.ts +2 -0
- package/build/src/options/index.js +18 -0
- package/build/src/utils/constants.d.ts +10 -0
- package/build/src/utils/constants.js +15 -0
- package/build/src/utils/dataTidSelector.d.ts +1 -0
- package/build/src/utils/dataTidSelector.js +6 -0
- package/build/src/utils/index.d.ts +2 -0
- package/build/src/utils/index.js +20 -0
- package/build/src/utils/tooltipProvider.d.ts +4 -0
- package/build/src/utils/tooltipProvider.js +95 -0
- package/package.json +27 -0
|
@@ -0,0 +1,201 @@
|
|
|
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.CurrencyInput = 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 CurrencyInput = /** @class */ (function (_super) {
|
|
60
|
+
__extends(CurrencyInput, _super);
|
|
61
|
+
function CurrencyInput(rootLocator) {
|
|
62
|
+
var _this = _super.call(this, rootLocator) || this;
|
|
63
|
+
_this.rootLocator = rootLocator;
|
|
64
|
+
_this.inputLocator = rootLocator.locator('input');
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
CurrencyInput.prototype.isDisabled = function (options) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0: return [4 /*yield*/, this.inputLocator.isDisabled(options)];
|
|
72
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
CurrencyInput.prototype.getValue = function (options) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0: return [4 /*yield*/, this.inputLocator.inputValue(options)];
|
|
82
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
CurrencyInput.prototype.fill = function (value, 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*/, this.clear()];
|
|
92
|
+
case 1:
|
|
93
|
+
_a.sent();
|
|
94
|
+
return [4 /*yield*/, this.inputLocator.fill(typeof value === 'number' ? value.toString(10) : value, options)];
|
|
95
|
+
case 2:
|
|
96
|
+
_a.sent();
|
|
97
|
+
return [2 /*return*/];
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
CurrencyInput.prototype.press = function (value, 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.clear()];
|
|
107
|
+
case 1:
|
|
108
|
+
_a.sent();
|
|
109
|
+
return [4 /*yield*/, this.inputLocator.press(value, options)];
|
|
110
|
+
case 2:
|
|
111
|
+
_a.sent();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
CurrencyInput.prototype.pressSequentially = function (value, options) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0: return [4 /*yield*/, this.clear()];
|
|
122
|
+
case 1:
|
|
123
|
+
_a.sent();
|
|
124
|
+
return [4 /*yield*/, this.inputLocator.pressSequentially(typeof value === 'number' ? value.toString(10) : value, options)];
|
|
125
|
+
case 2:
|
|
126
|
+
_a.sent();
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
CurrencyInput.prototype.clear = function (options) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
+
return __generator(this, function (_a) {
|
|
135
|
+
switch (_a.label) {
|
|
136
|
+
case 0:
|
|
137
|
+
// NOTE: без фокуса currencyInput полностью не очистится
|
|
138
|
+
return [4 /*yield*/, this.focus()];
|
|
139
|
+
case 1:
|
|
140
|
+
// NOTE: без фокуса currencyInput полностью не очистится
|
|
141
|
+
_a.sent();
|
|
142
|
+
return [4 /*yield*/, this.inputLocator.clear(options)];
|
|
143
|
+
case 2:
|
|
144
|
+
_a.sent();
|
|
145
|
+
return [2 /*return*/];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
CurrencyInput.prototype.focus = 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*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
155
|
+
case 1:
|
|
156
|
+
_a.sent();
|
|
157
|
+
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
158
|
+
case 2:
|
|
159
|
+
_a.sent();
|
|
160
|
+
return [2 /*return*/];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
CurrencyInput.prototype.blur = function (options) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
+
return __generator(this, function (_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
|
|
170
|
+
case 1:
|
|
171
|
+
_a.sent();
|
|
172
|
+
return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
CurrencyInput.prototype.click = function (options) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
switch (_a.label) {
|
|
181
|
+
case 0: return [4 /*yield*/, this.inputLocator.click(options)];
|
|
182
|
+
case 1:
|
|
183
|
+
_a.sent();
|
|
184
|
+
return [2 /*return*/];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
CurrencyInput.prototype.getTooltip = function (type) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
+
return __generator(this, function (_a) {
|
|
192
|
+
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
CurrencyInput.prototype.expect = function () {
|
|
197
|
+
return new assertions_1.CurrencyInputAssertions(this);
|
|
198
|
+
};
|
|
199
|
+
return CurrencyInput;
|
|
200
|
+
}(BaseComponent_1.BaseComponent));
|
|
201
|
+
exports.CurrencyInput = CurrencyInput;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseComponent } from './BaseComponent';
|
|
3
|
+
import { type TooltipType } from '../utils';
|
|
4
|
+
import { DateInputAssertions } from '../assertions';
|
|
5
|
+
import type { BlurOptions, ClickOptions, FillOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions } from '../options';
|
|
6
|
+
export declare class DateInput extends BaseComponent {
|
|
7
|
+
readonly nativeInputLocator: Locator;
|
|
8
|
+
constructor(rootLocator: Locator);
|
|
9
|
+
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
10
|
+
getValue(options?: InputValueOptions): Promise<string>;
|
|
11
|
+
fill(date: string, options?: FillOptions): Promise<void>;
|
|
12
|
+
clear(options?: PressOptions): Promise<void>;
|
|
13
|
+
focus(options?: FocusOptions): Promise<void>;
|
|
14
|
+
blur(options?: BlurOptions): Promise<void>;
|
|
15
|
+
click(options?: ClickOptions): Promise<void>;
|
|
16
|
+
getTooltip(type: TooltipType): Promise<import("./Tooltip").Tooltip>;
|
|
17
|
+
expect(): DateInputAssertions;
|
|
18
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
|
+
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;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.DateInput = void 0;
|
|
66
|
+
var test_1 = require("@playwright/test");
|
|
67
|
+
var BaseComponent_1 = require("./BaseComponent");
|
|
68
|
+
var utils_1 = require("../utils");
|
|
69
|
+
var assertions_1 = require("../assertions");
|
|
70
|
+
var DateInput = /** @class */ (function (_super) {
|
|
71
|
+
__extends(DateInput, _super);
|
|
72
|
+
function DateInput(rootLocator) {
|
|
73
|
+
var _this = _super.call(this, rootLocator) || this;
|
|
74
|
+
_this.nativeInputLocator = rootLocator.locator('input');
|
|
75
|
+
return _this;
|
|
76
|
+
}
|
|
77
|
+
DateInput.prototype.isDisabled = function (options) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
return __generator(this, function (_a) {
|
|
80
|
+
switch (_a.label) {
|
|
81
|
+
case 0: return [4 /*yield*/, this.nativeInputLocator.isDisabled(options)];
|
|
82
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
DateInput.prototype.getValue = 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*/, this.nativeInputLocator.inputValue(options)];
|
|
92
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
DateInput.prototype.fill = function (date, options) {
|
|
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.clear()];
|
|
102
|
+
case 1:
|
|
103
|
+
_a.sent();
|
|
104
|
+
return [4 /*yield*/, this.nativeInputLocator.pressSequentially(date, options)];
|
|
105
|
+
case 2:
|
|
106
|
+
_a.sent();
|
|
107
|
+
return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
DateInput.prototype.clear = 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*/, this.focus()];
|
|
117
|
+
case 1:
|
|
118
|
+
_a.sent();
|
|
119
|
+
return [4 /*yield*/, this.rootLocator.press('Control+A', options)];
|
|
120
|
+
case 2:
|
|
121
|
+
_a.sent();
|
|
122
|
+
return [4 /*yield*/, this.rootLocator.press('Meta+A', options)];
|
|
123
|
+
case 3:
|
|
124
|
+
_a.sent();
|
|
125
|
+
return [4 /*yield*/, this.rootLocator.press('Backspace', options)];
|
|
126
|
+
case 4:
|
|
127
|
+
_a.sent();
|
|
128
|
+
return [2 /*return*/];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
DateInput.prototype.focus = function (options) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
return __generator(this, function (_a) {
|
|
136
|
+
switch (_a.label) {
|
|
137
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
138
|
+
case 1:
|
|
139
|
+
_a.sent();
|
|
140
|
+
return [4 /*yield*/, this.rootLocator.focus(options)];
|
|
141
|
+
case 2:
|
|
142
|
+
_a.sent();
|
|
143
|
+
return [2 /*return*/];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
DateInput.prototype.blur = function (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*/, this.rootLocator.blur(options)];
|
|
153
|
+
case 1:
|
|
154
|
+
_a.sent();
|
|
155
|
+
return [2 /*return*/];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
DateInput.prototype.click = function (options) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
162
|
+
return __generator(this, function (_a) {
|
|
163
|
+
switch (_a.label) {
|
|
164
|
+
case 0:
|
|
165
|
+
// NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
|
|
166
|
+
return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
167
|
+
case 1:
|
|
168
|
+
// NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
|
|
169
|
+
_a.sent();
|
|
170
|
+
// NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
|
|
171
|
+
return [4 /*yield*/, this.rootLocator
|
|
172
|
+
.locator('span[data-fragment]')
|
|
173
|
+
.first()
|
|
174
|
+
.click(__assign(__assign({}, options), { force: true }))];
|
|
175
|
+
case 2:
|
|
176
|
+
// NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
|
|
177
|
+
_a.sent();
|
|
178
|
+
return [2 /*return*/];
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
DateInput.prototype.getTooltip = function (type) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
DateInput.prototype.expect = function () {
|
|
191
|
+
return new assertions_1.DateInputAssertions(this);
|
|
192
|
+
};
|
|
193
|
+
return DateInput;
|
|
194
|
+
}(BaseComponent_1.BaseComponent));
|
|
195
|
+
exports.DateInput = DateInput;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseComponent } from './BaseComponent';
|
|
3
|
+
import type { TooltipType } from '../utils';
|
|
4
|
+
import { DatePickerAssertions } from '../assertions';
|
|
5
|
+
import type { BlurOptions, ClickOptions, FocusOptions, InputValueOptions, IsDisabledOptions, PressOptions, PressSequentiallyOptions } from '../options';
|
|
6
|
+
export declare class DatePicker extends BaseComponent {
|
|
7
|
+
readonly rootLocator: Locator;
|
|
8
|
+
readonly nativeInputLocator: Locator;
|
|
9
|
+
readonly datePickerInputLocator: Locator;
|
|
10
|
+
constructor(rootLocator: Locator);
|
|
11
|
+
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
12
|
+
getValue(options?: InputValueOptions): Promise<string>;
|
|
13
|
+
fill(value: string, options?: PressSequentiallyOptions): Promise<void>;
|
|
14
|
+
clear(options?: PressOptions): Promise<void>;
|
|
15
|
+
focus(options?: FocusOptions): Promise<void>;
|
|
16
|
+
blur(options?: BlurOptions): Promise<void>;
|
|
17
|
+
click(options?: ClickOptions): Promise<void>;
|
|
18
|
+
getTooltip(type: TooltipType): Promise<import("./Tooltip").Tooltip>;
|
|
19
|
+
expect(): DatePickerAssertions;
|
|
20
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
|
+
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;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
+
exports.DatePicker = void 0;
|
|
66
|
+
var test_1 = require("@playwright/test");
|
|
67
|
+
var react_ui_1 = require("@skbkontur/react-ui");
|
|
68
|
+
var BaseComponent_1 = require("./BaseComponent");
|
|
69
|
+
var utils_1 = require("../utils");
|
|
70
|
+
var assertions_1 = require("../assertions");
|
|
71
|
+
var dataTidSelector_1 = require("../utils/dataTidSelector");
|
|
72
|
+
var DatePicker = /** @class */ (function (_super) {
|
|
73
|
+
__extends(DatePicker, _super);
|
|
74
|
+
function DatePicker(rootLocator) {
|
|
75
|
+
var _this = _super.call(this, rootLocator) || this;
|
|
76
|
+
_this.rootLocator = rootLocator;
|
|
77
|
+
_this.nativeInputLocator = rootLocator.locator('input');
|
|
78
|
+
_this.datePickerInputLocator = rootLocator
|
|
79
|
+
.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.DatePickerDataTids.input))
|
|
80
|
+
.or(rootLocator)
|
|
81
|
+
.last();
|
|
82
|
+
return _this;
|
|
83
|
+
}
|
|
84
|
+
DatePicker.prototype.isDisabled = function (options) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, this.nativeInputLocator.isDisabled(options)];
|
|
89
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
DatePicker.prototype.getValue = function (options) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0: return [4 /*yield*/, this.nativeInputLocator.inputValue(options)];
|
|
99
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
DatePicker.prototype.fill = function (value, options) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
switch (_a.label) {
|
|
108
|
+
case 0: return [4 /*yield*/, this.clear()];
|
|
109
|
+
case 1:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [4 /*yield*/, this.nativeInputLocator.pressSequentially(value, options)];
|
|
112
|
+
case 2:
|
|
113
|
+
_a.sent();
|
|
114
|
+
return [4 /*yield*/, this.blur()];
|
|
115
|
+
case 3:
|
|
116
|
+
_a.sent();
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
DatePicker.prototype.clear = function (options) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
switch (_a.label) {
|
|
126
|
+
case 0: return [4 /*yield*/, this.focus()];
|
|
127
|
+
case 1:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [4 /*yield*/, this.nativeInputLocator.press('Control+A', options)];
|
|
130
|
+
case 2:
|
|
131
|
+
_a.sent();
|
|
132
|
+
return [4 /*yield*/, this.nativeInputLocator.press('Meta+A', options)];
|
|
133
|
+
case 3:
|
|
134
|
+
_a.sent();
|
|
135
|
+
return [4 /*yield*/, this.nativeInputLocator.press('Backspace', options)];
|
|
136
|
+
case 4:
|
|
137
|
+
_a.sent();
|
|
138
|
+
return [2 /*return*/];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
DatePicker.prototype.focus = function (options) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
return __generator(this, function (_a) {
|
|
146
|
+
switch (_a.label) {
|
|
147
|
+
case 0: return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
148
|
+
case 1:
|
|
149
|
+
_a.sent();
|
|
150
|
+
return [4 /*yield*/, this.datePickerInputLocator.focus(options)];
|
|
151
|
+
case 2:
|
|
152
|
+
_a.sent();
|
|
153
|
+
return [2 /*return*/];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
DatePicker.prototype.blur = function (options) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
162
|
+
case 0: return [4 /*yield*/, this.datePickerInputLocator.blur(options)];
|
|
163
|
+
case 1:
|
|
164
|
+
_a.sent();
|
|
165
|
+
return [2 /*return*/];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
DatePicker.prototype.click = function (options) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
return __generator(this, function (_a) {
|
|
173
|
+
switch (_a.label) {
|
|
174
|
+
case 0:
|
|
175
|
+
// NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
|
|
176
|
+
return [4 /*yield*/, (0, test_1.expect)(this.nativeInputLocator).toBeEnabled()];
|
|
177
|
+
case 1:
|
|
178
|
+
// NOTE: rootLocator всегда в состоянии enabled, даже если DatePicker disabled
|
|
179
|
+
_a.sent();
|
|
180
|
+
// NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
|
|
181
|
+
return [4 /*yield*/, this.rootLocator
|
|
182
|
+
.locator('span[data-fragment]')
|
|
183
|
+
.first()
|
|
184
|
+
.click(__assign(__assign({}, options), { force: true }))];
|
|
185
|
+
case 2:
|
|
186
|
+
// NOTE: обычный клик по rootLocator может кликать в середину DatePicker, в результате курсор оказывается во второй ячейке
|
|
187
|
+
_a.sent();
|
|
188
|
+
return [2 /*return*/];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
DatePicker.prototype.getTooltip = function (type) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
DatePicker.prototype.expect = function () {
|
|
201
|
+
return new assertions_1.DatePickerAssertions(this);
|
|
202
|
+
};
|
|
203
|
+
return DatePicker;
|
|
204
|
+
}(BaseComponent_1.BaseComponent));
|
|
205
|
+
exports.DatePicker = DatePicker;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseComponent } from './BaseComponent';
|
|
3
|
+
import { DatePicker } from './DatePicker';
|
|
4
|
+
import { DateRangePickerAssertions } from '../assertions';
|
|
5
|
+
import type { ClearOptions } from '../options';
|
|
6
|
+
export declare class DateRangePicker extends BaseComponent {
|
|
7
|
+
readonly rootLocator: Locator;
|
|
8
|
+
readonly datePickerStart: DatePicker;
|
|
9
|
+
readonly datePickerEnd: DatePicker;
|
|
10
|
+
constructor(rootLocator: Locator);
|
|
11
|
+
fill(values: {
|
|
12
|
+
start: string;
|
|
13
|
+
end?: string;
|
|
14
|
+
} | {
|
|
15
|
+
start?: string;
|
|
16
|
+
end: string;
|
|
17
|
+
}): Promise<void>;
|
|
18
|
+
clear(options?: ClearOptions): Promise<void>;
|
|
19
|
+
expect(): DateRangePickerAssertions;
|
|
20
|
+
}
|