@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,189 @@
|
|
|
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.KebabAssertions = void 0;
|
|
55
|
+
var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
|
|
56
|
+
var utils_1 = require("../utils");
|
|
57
|
+
var matchers_1 = require("../matchers");
|
|
58
|
+
var KebabAssertions = /** @class */ (function (_super) {
|
|
59
|
+
__extends(KebabAssertions, _super);
|
|
60
|
+
function KebabAssertions(kebab) {
|
|
61
|
+
var _this = _super.call(this, kebab) || this;
|
|
62
|
+
_this.kebab = kebab;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
KebabAssertions.prototype.toBeEnabled = function (options) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0: return [4 /*yield*/, this.kebab.expect().notToHaveAttribute(utils_1.DataVisualState.Disabled, undefined, options)];
|
|
70
|
+
case 1:
|
|
71
|
+
_a.sent();
|
|
72
|
+
return [2 /*return*/];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
KebabAssertions.prototype.toBeDisabled = 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.kebab.expect().toHaveAttribute(utils_1.DataVisualState.Disabled, undefined, options)];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
KebabAssertions.prototype.toHaveItems = function (itemsText, options) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var itemsLocator;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0: return [4 /*yield*/, this.kebab.getMenuItems()];
|
|
95
|
+
case 1:
|
|
96
|
+
itemsLocator = (_a.sent()).itemsLocator;
|
|
97
|
+
return [4 /*yield*/, (0, matchers_1.mergedExpects)(itemsLocator).toHaveText(itemsText, options)];
|
|
98
|
+
case 2:
|
|
99
|
+
_a.sent();
|
|
100
|
+
return [2 /*return*/];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
KebabAssertions.prototype.toContainItems = function (itemsText, options) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var itemsLocator;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0: return [4 /*yield*/, this.kebab.getMenuItems()];
|
|
111
|
+
case 1:
|
|
112
|
+
itemsLocator = (_a.sent()).itemsLocator;
|
|
113
|
+
return [4 /*yield*/, (0, matchers_1.mergedExpects)(itemsLocator).toContainText(itemsText, options)];
|
|
114
|
+
case 2:
|
|
115
|
+
_a.sent();
|
|
116
|
+
return [2 /*return*/];
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
KebabAssertions.prototype.toContainItem = function (itemText, options) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var _this = this;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
switch (_a.label) {
|
|
126
|
+
case 0: return [4 /*yield*/, matchers_1.mergedExpects
|
|
127
|
+
.poll(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
128
|
+
var menus, _a, _b;
|
|
129
|
+
var _this = this;
|
|
130
|
+
return __generator(this, function (_c) {
|
|
131
|
+
switch (_c.label) {
|
|
132
|
+
case 0: return [4 /*yield*/, this.kebab.getMenuItems()];
|
|
133
|
+
case 1:
|
|
134
|
+
menus = _c.sent();
|
|
135
|
+
_b = (_a = Promise).all;
|
|
136
|
+
return [4 /*yield*/, menus.getItems()];
|
|
137
|
+
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) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0: return [4 /*yield*/, x.getText()];
|
|
140
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
141
|
+
}
|
|
142
|
+
}); }); })])];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}); }, options)
|
|
146
|
+
.toContain(itemText)];
|
|
147
|
+
case 1:
|
|
148
|
+
_a.sent();
|
|
149
|
+
return [2 /*return*/];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
KebabAssertions.prototype.notToContainItem = function (itemText, options) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
var _this = this;
|
|
157
|
+
return __generator(this, function (_a) {
|
|
158
|
+
switch (_a.label) {
|
|
159
|
+
case 0: return [4 /*yield*/, matchers_1.mergedExpects
|
|
160
|
+
.poll(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
161
|
+
var menus, _a, _b;
|
|
162
|
+
var _this = this;
|
|
163
|
+
return __generator(this, function (_c) {
|
|
164
|
+
switch (_c.label) {
|
|
165
|
+
case 0: return [4 /*yield*/, this.kebab.getMenuItems()];
|
|
166
|
+
case 1:
|
|
167
|
+
menus = _c.sent();
|
|
168
|
+
_b = (_a = Promise).all;
|
|
169
|
+
return [4 /*yield*/, menus.getItems()];
|
|
170
|
+
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) {
|
|
171
|
+
switch (_a.label) {
|
|
172
|
+
case 0: return [4 /*yield*/, x.getText()];
|
|
173
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
174
|
+
}
|
|
175
|
+
}); }); })])];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}); }, options)
|
|
179
|
+
.not.toContain(itemText)];
|
|
180
|
+
case 1:
|
|
181
|
+
_a.sent();
|
|
182
|
+
return [2 /*return*/];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
return KebabAssertions;
|
|
188
|
+
}(BaseComponentAssertions_1.BaseComponentAssertions));
|
|
189
|
+
exports.KebabAssertions = KebabAssertions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseComponentAssertions } from './BaseComponentAssertions';
|
|
2
|
+
import type { Label } from '../components';
|
|
3
|
+
import type { TextOptions, TransformOptions } from '../options';
|
|
4
|
+
export declare class LabelAssertions extends BaseComponentAssertions {
|
|
5
|
+
private readonly label;
|
|
6
|
+
constructor(label: Label);
|
|
7
|
+
toHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
8
|
+
notToHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
9
|
+
toContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
10
|
+
notToContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* игнорирует форматирование (отбивку пробелами) при сравнении значений
|
|
13
|
+
*/
|
|
14
|
+
toHaveFormattedText(text: string, options?: TransformOptions): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Сравнивает по подстроке, игнорирует форматирование (отбивку пробелами) при сравнении значений
|
|
17
|
+
*/
|
|
18
|
+
toContainFormattedText(text: string, options?: TransformOptions): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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.LabelAssertions = void 0;
|
|
55
|
+
var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
|
|
56
|
+
var matchers_1 = require("../matchers");
|
|
57
|
+
var LabelAssertions = /** @class */ (function (_super) {
|
|
58
|
+
__extends(LabelAssertions, _super);
|
|
59
|
+
function LabelAssertions(label) {
|
|
60
|
+
var _this = _super.call(this, label) || this;
|
|
61
|
+
_this.label = label;
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
LabelAssertions.prototype.toHaveText = function (text, 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.label.rootLocator).toHaveText(text, options)];
|
|
69
|
+
case 1:
|
|
70
|
+
_a.sent();
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
LabelAssertions.prototype.notToHaveText = function (text, 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.label.rootLocator).not.toHaveText(text, options)];
|
|
81
|
+
case 1:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
LabelAssertions.prototype.toContainText = function (text, 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.label.rootLocator).toContainText(text, options)];
|
|
93
|
+
case 1:
|
|
94
|
+
_a.sent();
|
|
95
|
+
return [2 /*return*/];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
LabelAssertions.prototype.notToContainText = function (text, 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.label.rootLocator).not.toContainText(text, options)];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* игнорирует форматирование (отбивку пробелами) при сравнении значений
|
|
114
|
+
*/
|
|
115
|
+
LabelAssertions.prototype.toHaveFormattedText = function (text, options) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
117
|
+
return __generator(this, function (_a) {
|
|
118
|
+
switch (_a.label) {
|
|
119
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.label.rootLocator).toHaveFormattedText(text, options)];
|
|
120
|
+
case 1:
|
|
121
|
+
_a.sent();
|
|
122
|
+
return [2 /*return*/];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Сравнивает по подстроке, игнорирует форматирование (отбивку пробелами) при сравнении значений
|
|
129
|
+
*/
|
|
130
|
+
LabelAssertions.prototype.toContainFormattedText = function (text, options) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
return __generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.label.rootLocator).toContainFormattedText(text, options)];
|
|
135
|
+
case 1:
|
|
136
|
+
_a.sent();
|
|
137
|
+
return [2 /*return*/];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
return LabelAssertions;
|
|
143
|
+
}(BaseComponentAssertions_1.BaseComponentAssertions));
|
|
144
|
+
exports.LabelAssertions = LabelAssertions;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseComponentAssertions } from './BaseComponentAssertions';
|
|
2
|
+
import type { AttributeOptions, FocusedOptions, TextOptions } from '../options';
|
|
3
|
+
import type { Link } from '../components';
|
|
4
|
+
export declare class LinkAssertions extends BaseComponentAssertions {
|
|
5
|
+
private readonly link;
|
|
6
|
+
constructor(link: Link);
|
|
7
|
+
toBeEnabled(options?: AttributeOptions): Promise<void>;
|
|
8
|
+
toBeDisabled(options?: AttributeOptions): Promise<void>;
|
|
9
|
+
toHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
10
|
+
notToHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
11
|
+
toContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
12
|
+
notToContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
13
|
+
toHaveHref(href: string | RegExp, options?: AttributeOptions): Promise<void>;
|
|
14
|
+
notToHaveHref(href: string | RegExp, options?: AttributeOptions): Promise<void>;
|
|
15
|
+
toBeFocused(options?: FocusedOptions): Promise<void>;
|
|
16
|
+
notToBeFocused(options?: FocusedOptions): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
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.LinkAssertions = void 0;
|
|
55
|
+
var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
|
|
56
|
+
var utils_1 = require("../utils");
|
|
57
|
+
var matchers_1 = require("../matchers");
|
|
58
|
+
var LinkAssertions = /** @class */ (function (_super) {
|
|
59
|
+
__extends(LinkAssertions, _super);
|
|
60
|
+
function LinkAssertions(link) {
|
|
61
|
+
var _this = _super.call(this, link) || this;
|
|
62
|
+
_this.link = link;
|
|
63
|
+
return _this;
|
|
64
|
+
}
|
|
65
|
+
LinkAssertions.prototype.toBeEnabled = function (options) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).not.toHaveAttribute(utils_1.DataVisualState.Disabled, options)];
|
|
70
|
+
case 1:
|
|
71
|
+
_a.sent();
|
|
72
|
+
return [2 /*return*/];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
LinkAssertions.prototype.toBeDisabled = 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*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).toHaveAttribute(utils_1.DataVisualState.Disabled, options)];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
LinkAssertions.prototype.toHaveText = function (text, options) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).toHaveText(text, options)];
|
|
94
|
+
case 1:
|
|
95
|
+
_a.sent();
|
|
96
|
+
return [2 /*return*/];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
LinkAssertions.prototype.notToHaveText = function (text, options) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
switch (_a.label) {
|
|
105
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).not.toHaveText(text, options)];
|
|
106
|
+
case 1:
|
|
107
|
+
_a.sent();
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
LinkAssertions.prototype.toContainText = function (text, options) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).toContainText(text, options)];
|
|
118
|
+
case 1:
|
|
119
|
+
_a.sent();
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
LinkAssertions.prototype.notToContainText = function (text, options) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
return __generator(this, function (_a) {
|
|
128
|
+
switch (_a.label) {
|
|
129
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).not.toContainText(text, options)];
|
|
130
|
+
case 1:
|
|
131
|
+
_a.sent();
|
|
132
|
+
return [2 /*return*/];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
LinkAssertions.prototype.toHaveHref = function (href, options) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).toHaveAttribute('href', href, options)];
|
|
142
|
+
case 1:
|
|
143
|
+
_a.sent();
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
LinkAssertions.prototype.notToHaveHref = function (href, options) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
+
return __generator(this, function (_a) {
|
|
152
|
+
switch (_a.label) {
|
|
153
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).not.toHaveAttribute('href', href, options)];
|
|
154
|
+
case 1:
|
|
155
|
+
_a.sent();
|
|
156
|
+
return [2 /*return*/];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
LinkAssertions.prototype.toBeFocused = function (options) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).toBeFocused(options)];
|
|
166
|
+
case 1:
|
|
167
|
+
_a.sent();
|
|
168
|
+
return [2 /*return*/];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
LinkAssertions.prototype.notToBeFocused = function (options) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
175
|
+
return __generator(this, function (_a) {
|
|
176
|
+
switch (_a.label) {
|
|
177
|
+
case 0: return [4 /*yield*/, (0, matchers_1.mergedExpects)(this.link.rootLocator).not.toBeFocused(options)];
|
|
178
|
+
case 1:
|
|
179
|
+
_a.sent();
|
|
180
|
+
return [2 /*return*/];
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
return LinkAssertions;
|
|
186
|
+
}(BaseComponentAssertions_1.BaseComponentAssertions));
|
|
187
|
+
exports.LinkAssertions = LinkAssertions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseComponentAssertions } from './BaseComponentAssertions';
|
|
2
|
+
import type { Loader } from '../components';
|
|
3
|
+
import type { TextOptions } from '../options';
|
|
4
|
+
export declare class LoaderAssertions extends BaseComponentAssertions {
|
|
5
|
+
private readonly loader;
|
|
6
|
+
constructor(loader: Loader);
|
|
7
|
+
toHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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.LoaderAssertions = void 0;
|
|
55
|
+
var BaseComponentAssertions_1 = require("./BaseComponentAssertions");
|
|
56
|
+
var matchers_1 = require("../matchers");
|
|
57
|
+
var LoaderAssertions = /** @class */ (function (_super) {
|
|
58
|
+
__extends(LoaderAssertions, _super);
|
|
59
|
+
function LoaderAssertions(loader) {
|
|
60
|
+
var _this = _super.call(this, loader) || this;
|
|
61
|
+
_this.loader = loader;
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
LoaderAssertions.prototype.toHaveText = function (text, 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.loader.rootLocator).toHaveText(text, options)];
|
|
69
|
+
case 1:
|
|
70
|
+
_a.sent();
|
|
71
|
+
return [2 /*return*/];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
return LoaderAssertions;
|
|
77
|
+
}(BaseComponentAssertions_1.BaseComponentAssertions));
|
|
78
|
+
exports.LoaderAssertions = LoaderAssertions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseComponentAssertions } from './BaseComponentAssertions';
|
|
2
|
+
import type { MenuItem } from '../components';
|
|
3
|
+
import type { TextOptions } from '../options';
|
|
4
|
+
export declare class MenuItemAssertations extends BaseComponentAssertions {
|
|
5
|
+
private readonly menu;
|
|
6
|
+
constructor(menu: MenuItem);
|
|
7
|
+
toHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
8
|
+
notToHaveText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
9
|
+
toContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
10
|
+
notToContainText(text: string | RegExp | ReadonlyArray<string | RegExp>, options?: TextOptions): Promise<void>;
|
|
11
|
+
}
|