@skbkontur/playwright-react-ui-components 1.13.1 → 1.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/assertions/AutocompleteAssertions.js +10 -10
- package/build/src/assertions/BaseComponentAssertions.js +11 -11
- package/build/src/assertions/ButtonAssertions.js +9 -9
- package/build/src/assertions/CheckboxAssertions.js +13 -13
- package/build/src/assertions/ComboBoxAssertions.js +17 -111
- package/build/src/assertions/ComponentListAssertions.js +6 -6
- package/build/src/assertions/CurrencyInputAssertions.js +11 -61
- package/build/src/assertions/DateInputAssertions.js +9 -9
- package/build/src/assertions/DatePickerAssertions.js +9 -9
- package/build/src/assertions/DateRangePickerAssertions.js +4 -25
- package/build/src/assertions/DropdownAssertions.js +13 -63
- package/build/src/assertions/DropdownMenuAssertions.js +11 -61
- package/build/src/assertions/FileUploaderAssertions.d.ts +1 -3
- package/build/src/assertions/FileUploaderAssertions.js +5 -22
- package/build/src/assertions/FxInputAssertions.js +11 -14
- package/build/src/assertions/InputAssertions.js +10 -10
- package/build/src/assertions/KebabAssertions.js +7 -58
- package/build/src/assertions/LabelAssertions.js +7 -7
- package/build/src/assertions/LinkAssertions.js +11 -12
- package/build/src/assertions/LoaderAssertions.js +2 -2
- package/build/src/assertions/MenuItemAssertations.js +5 -5
- package/build/src/assertions/PagingAssertions.js +5 -40
- package/build/src/assertions/PortalAssertions.js +3 -3
- package/build/src/assertions/RadioAssertions.js +13 -13
- package/build/src/assertions/RadioGroupAssertions.js +10 -81
- package/build/src/assertions/SelectAssertions.js +15 -64
- package/build/src/assertions/SpinnerAssertions.js +2 -2
- package/build/src/assertions/TabAssertions.js +11 -12
- package/build/src/assertions/TabsAssertions.js +4 -32
- package/build/src/assertions/TextareaAssertions.js +9 -9
- package/build/src/assertions/ToastAssertions.js +2 -2
- package/build/src/assertions/ToggleAssertions.js +11 -11
- package/build/src/assertions/TokenAssertions.js +8 -14
- package/build/src/assertions/TokenInputAssertions.js +8 -28
- package/build/src/assertions/TooltipAssertions.js +5 -5
- package/build/src/components/Autocomplete.d.ts +4 -0
- package/build/src/components/Autocomplete.js +52 -50
- package/build/src/components/BaseComponent.d.ts +4 -0
- package/build/src/components/BaseComponent.js +37 -30
- package/build/src/components/Button.d.ts +4 -0
- package/build/src/components/Button.js +25 -19
- package/build/src/components/Checkbox.d.ts +6 -0
- package/build/src/components/Checkbox.js +28 -36
- package/build/src/components/ComboBox.d.ts +9 -2
- package/build/src/components/ComboBox.js +68 -54
- package/build/src/components/ComponentList.d.ts +25 -3
- package/build/src/components/ComponentList.js +58 -50
- package/build/src/components/CurrencyInput.d.ts +4 -0
- package/build/src/components/CurrencyInput.js +39 -37
- package/build/src/components/DateInput.d.ts +4 -0
- package/build/src/components/DateInput.js +34 -32
- package/build/src/components/DatePicker.d.ts +4 -0
- package/build/src/components/DatePicker.js +35 -33
- package/build/src/components/DateRangePicker.d.ts +2 -0
- package/build/src/components/DateRangePicker.js +14 -10
- package/build/src/components/Dropdown.d.ts +8 -2
- package/build/src/components/Dropdown.js +69 -65
- package/build/src/components/DropdownMenu.d.ts +7 -2
- package/build/src/components/DropdownMenu.js +68 -65
- package/build/src/components/FileUploader.d.ts +3 -1
- package/build/src/components/FileUploader.js +39 -39
- package/build/src/components/FxInput.d.ts +4 -0
- package/build/src/components/FxInput.js +44 -42
- package/build/src/components/Input.d.ts +4 -0
- package/build/src/components/Input.js +37 -35
- package/build/src/components/Kebab.d.ts +6 -2
- package/build/src/components/Kebab.js +50 -48
- package/build/src/components/Label.d.ts +2 -0
- package/build/src/components/Label.js +9 -13
- package/build/src/components/Link.d.ts +4 -0
- package/build/src/components/Link.js +19 -25
- package/build/src/components/Loader.d.ts +2 -0
- package/build/src/components/Loader.js +15 -10
- package/build/src/components/MenuComponent.d.ts +9 -0
- package/build/src/components/MenuComponent.js +78 -0
- package/build/src/components/MenuItem.d.ts +2 -0
- package/build/src/components/MenuItem.js +7 -3
- package/build/src/components/Paging.d.ts +2 -0
- package/build/src/components/Paging.js +59 -52
- package/build/src/components/Portal.d.ts +2 -0
- package/build/src/components/Portal.js +14 -10
- package/build/src/components/Radio.d.ts +6 -0
- package/build/src/components/Radio.js +31 -27
- package/build/src/components/RadioGroup.d.ts +2 -0
- package/build/src/components/RadioGroup.js +51 -47
- package/build/src/components/Select.d.ts +5 -0
- package/build/src/components/Select.js +92 -76
- package/build/src/components/Spinner.d.ts +2 -0
- package/build/src/components/Spinner.js +13 -9
- package/build/src/components/Tab.d.ts +4 -0
- package/build/src/components/Tab.js +17 -27
- package/build/src/components/Textarea.d.ts +4 -0
- package/build/src/components/Textarea.js +33 -39
- package/build/src/components/Toast.d.ts +2 -0
- package/build/src/components/Toast.js +7 -3
- package/build/src/components/Toggle.d.ts +5 -0
- package/build/src/components/Toggle.js +24 -33
- package/build/src/components/Token.d.ts +3 -0
- package/build/src/components/Token.js +14 -9
- package/build/src/components/TokenInput.d.ts +4 -0
- package/build/src/components/TokenInput.js +61 -59
- package/build/src/components/Tooltip.d.ts +2 -0
- package/build/src/components/Tooltip.js +9 -9
- package/build/src/components/index.d.ts +1 -0
- package/build/src/components/index.js +3 -1
- package/build/src/extensions/index.d.ts +1 -0
- package/build/src/extensions/index.js +17 -0
- package/build/src/extensions/mergedExpects.d.ts +5 -0
- package/build/src/extensions/mergedExpects.js +7 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +2 -0
- package/build/src/matchers/component/LocatorSymbols.d.ts +43 -0
- package/build/src/matchers/component/LocatorSymbols.js +13 -0
- package/build/src/matchers/component/toBeActiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeActiveEx.js +56 -0
- package/build/src/matchers/component/toBeAutoEx.d.ts +3 -0
- package/build/src/matchers/component/toBeAutoEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedEx.js +56 -0
- package/build/src/matchers/component/toBeDisabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeDisabledEx.js +172 -0
- package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEmptyEx.js +137 -0
- package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEnabledEx.js +206 -0
- package/build/src/matchers/component/toBeFocusedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeFocusedEx.js +56 -0
- package/build/src/matchers/component/toBeHiddenEx.d.ts +3 -0
- package/build/src/matchers/component/toBeHiddenEx.js +68 -0
- package/build/src/matchers/component/toBeInactiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeInactiveEx.js +56 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedEx.js +56 -0
- package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
- package/build/src/matchers/component/toBeVisibleEx.js +68 -0
- package/build/src/matchers/component/toContainFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainFormattedTextEx.js +55 -0
- package/build/src/matchers/component/toContainItemEx.d.ts +4 -0
- package/build/src/matchers/component/toContainItemEx.js +79 -0
- package/build/src/matchers/component/toContainItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainItemsEx.js +63 -0
- package/build/src/matchers/component/toContainTabsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTabsEx.js +80 -0
- package/build/src/matchers/component/toContainTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTextEx.js +56 -0
- package/build/src/matchers/component/toContainTokensEx.d.ts +4 -0
- package/build/src/matchers/component/toContainTokensEx.js +80 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.d.ts +4 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.js +75 -0
- package/build/src/matchers/component/toContainValueEx.d.ts +3 -0
- package/build/src/matchers/component/toContainValueEx.js +55 -0
- package/build/src/matchers/component/toHaveActivePageEx.d.ts +4 -0
- package/build/src/matchers/component/toHaveActivePageEx.js +78 -0
- package/build/src/matchers/component/toHaveActiveTabEx.d.ts +2 -0
- package/build/src/matchers/component/toHaveActiveTabEx.js +62 -0
- package/build/src/matchers/component/toHaveAttributeEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveAttributeEx.js +62 -0
- package/build/src/matchers/component/toHaveCountEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveCountEx.js +56 -0
- package/build/src/matchers/component/toHaveErrorEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveErrorEx.js +57 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.js +56 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.js +56 -0
- package/build/src/matchers/component/toHaveHrefEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveHrefEx.js +55 -0
- package/build/src/matchers/component/toHaveItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveItemsEx.js +63 -0
- package/build/src/matchers/component/toHavePageCountEx.d.ts +4 -0
- package/build/src/matchers/component/toHavePageCountEx.js +71 -0
- package/build/src/matchers/component/toHaveTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveTextEx.js +56 -0
- package/build/src/matchers/component/toHaveValueEx.d.ts +6 -0
- package/build/src/matchers/component/toHaveValueEx.js +198 -0
- package/build/src/matchers/component/toHaveWarningEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveWarningEx.js +57 -0
- package/build/src/matchers/componentMatchers.d.ts +104 -0
- package/build/src/matchers/componentMatchers.js +83 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +47 -0
- package/build/src/matchers/createAsyncMatcher.js +155 -0
- package/build/src/matchers/formattedMatchers.d.ts +15 -31
- package/build/src/matchers/formattedMatchers.js +19 -15
- package/build/src/matchers/index.d.ts +1 -1
- package/build/src/matchers/index.js +1 -3
- package/build/src/utils/getMarcherResult.d.ts +13 -0
- package/build/src/utils/getMarcherResult.js +13 -0
- package/build/src/utils/index.d.ts +3 -0
- package/build/src/utils/index.js +3 -0
- package/build/src/utils/is.d.ts +3 -0
- package/build/src/utils/is.js +5 -0
- package/build/src/utils/makeMatcher.d.ts +5 -0
- package/build/src/utils/makeMatcher.js +65 -0
- package/build/src/utils/toMatchMessage.d.ts +12 -0
- package/build/src/utils/toMatchMessage.js +78 -0
- package/package.json +1 -1
- package/build/src/matchers/mergedExpects.d.ts +0 -15
- package/build/src/matchers/mergedExpects.js +0 -6
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toContainUploadedFilesEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toContainUploadedFilesEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toContainUploadedFilesEx', function (component) { return component.files.itemsLocator; }, function (_a, expectedFiles_1, options_1) { return __awaiter(void 0, [_a, expectedFiles_1, options_1], void 0, function (_b, expectedFiles, options) {
|
|
43
|
+
var expectedLower, expectation;
|
|
44
|
+
var isNot = _b.isNot, component = _b.component;
|
|
45
|
+
return __generator(this, function (_c) {
|
|
46
|
+
switch (_c.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
if (isNot) {
|
|
49
|
+
/** NOTE:
|
|
50
|
+
* Пример: в items лежит массив [File1, File2, File3]
|
|
51
|
+
* При проверке await expect(fileUploader).not.toContainUploadedFilesEx([File1]); проверка пройдет.
|
|
52
|
+
* Потому что действительно, такого массива нету в items, есть массив [File1, File2, File3], но должен быть массив [File1]
|
|
53
|
+
* Поэтому нельзя использовать not assertion
|
|
54
|
+
*/
|
|
55
|
+
throw new Error('not implemented toContainUploadedFilesEx not assertion');
|
|
56
|
+
}
|
|
57
|
+
expectedLower = expectedFiles.map(function (name) { return name.toLowerCase(); });
|
|
58
|
+
expectation = test_1.expect.poll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
59
|
+
var names;
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0: return [4 /*yield*/, component.getUploadedFileNames()];
|
|
63
|
+
case 1:
|
|
64
|
+
names = _a.sent();
|
|
65
|
+
return [2 /*return*/, names.map(function (name) { return name.toLowerCase(); })];
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}); }, options);
|
|
69
|
+
return [4 /*yield*/, expectation.toEqual(test_1.expect.arrayContaining(expectedLower))];
|
|
70
|
+
case 1:
|
|
71
|
+
_c.sent();
|
|
72
|
+
return [2 /*return*/];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TextOptions } from '../../options';
|
|
2
|
+
import type { Select } from '../../components';
|
|
3
|
+
export declare const toContainValueEx: (this: import("@playwright/test").ExpectMatcherState, component: Select, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toContainValueEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toContainValueEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toContainValueEx', function (component) { return component.buttonOrLinkLocator; }, function (_a, value_1, options_1) { return __awaiter(void 0, [_a, value_1, options_1], void 0, function (_b, value, options) {
|
|
43
|
+
var expectation;
|
|
44
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
45
|
+
return __generator(this, function (_c) {
|
|
46
|
+
switch (_c.label) {
|
|
47
|
+
case 0:
|
|
48
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
49
|
+
return [4 /*yield*/, expectation.toContainText(value, options)];
|
|
50
|
+
case 1:
|
|
51
|
+
_c.sent();
|
|
52
|
+
return [2 /*return*/];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}); });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Paging } from '../../components';
|
|
2
|
+
export declare const toHaveActivePageEx: (this: import("@playwright/test").ExpectMatcherState, component: Paging, args_0: number, args_1?: {
|
|
3
|
+
timeout?: number;
|
|
4
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveActivePageEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var constants_1 = require("../../utils/constants");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toHaveActivePageEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveActivePageEx', function (component) { return component.rootLocator; }, function (_a, expectedPageNumber_1, options_1) { return __awaiter(void 0, [_a, expectedPageNumber_1, options_1], void 0, function (_b, expectedPageNumber, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, component = _b.component;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = test_1.expect.poll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
50
|
+
var pageItem;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0: return [4 /*yield*/, component.pages.getFirstItemByPredicate(function (x) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
54
|
+
switch (_a.label) {
|
|
55
|
+
case 0: return [4 /*yield*/, x.hasAttribute(constants_1.DataVisualState.Active)];
|
|
56
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
57
|
+
}
|
|
58
|
+
}); }); })];
|
|
59
|
+
case 1:
|
|
60
|
+
pageItem = _a.sent();
|
|
61
|
+
return [4 /*yield*/, pageItem.getNumber()];
|
|
62
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}); }, options);
|
|
66
|
+
if (!isNot) return [3 /*break*/, 2];
|
|
67
|
+
return [4 /*yield*/, expectation.not.toEqual(expectedPageNumber)];
|
|
68
|
+
case 1:
|
|
69
|
+
_c.sent();
|
|
70
|
+
return [3 /*break*/, 4];
|
|
71
|
+
case 2: return [4 /*yield*/, expectation.toEqual(expectedPageNumber)];
|
|
72
|
+
case 3:
|
|
73
|
+
_c.sent();
|
|
74
|
+
_c.label = 4;
|
|
75
|
+
case 4: return [2 /*return*/];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}); });
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveActiveTabEx = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toHaveActiveTabEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveActiveTabEx', function (component) { return component.rootLocator; }, function (_a, expectedTabText_1) { return __awaiter(void 0, [_a, expectedTabText_1], void 0, function (_b, expectedTabText) {
|
|
43
|
+
var tab;
|
|
44
|
+
var isNot = _b.isNot, component = _b.component;
|
|
45
|
+
return __generator(this, function (_c) {
|
|
46
|
+
switch (_c.label) {
|
|
47
|
+
case 0: return [4 /*yield*/, component.getByName(expectedTabText)];
|
|
48
|
+
case 1:
|
|
49
|
+
tab = _c.sent();
|
|
50
|
+
if (!isNot) return [3 /*break*/, 3];
|
|
51
|
+
return [4 /*yield*/, (0, extensions_1.expect)(tab).toBeInactiveEx()];
|
|
52
|
+
case 2:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [3 /*break*/, 5];
|
|
55
|
+
case 3: return [4 /*yield*/, (0, extensions_1.expect)(tab).toBeActiveEx()];
|
|
56
|
+
case 4:
|
|
57
|
+
_c.sent();
|
|
58
|
+
_c.label = 5;
|
|
59
|
+
case 5: return [2 /*return*/];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ToHaveAttributeElementLocator } from './LocatorSymbols';
|
|
2
|
+
import type { AttributeOptions } from '../../options';
|
|
3
|
+
export declare const toHaveAttributeEx: (this: import("@playwright/test").ExpectMatcherState, component: ToHaveAttributeElementLocator, args_0: string, args_1?: string | RegExp | undefined, args_2?: AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveAttributeEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toHaveAttributeEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toHaveAttributeEx', function (component) { return component[LocatorSymbols_1.toHaveAttributeElementLocator](); }, function (_a, attribute_1, value_1, options_1) { return __awaiter(void 0, [_a, attribute_1, value_1, options_1], void 0, function (_b, attribute, value, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
50
|
+
if (!(value !== undefined)) return [3 /*break*/, 2];
|
|
51
|
+
return [4 /*yield*/, expectation.toHaveAttribute(attribute, value, options)];
|
|
52
|
+
case 1:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [3 /*break*/, 4];
|
|
55
|
+
case 2: return [4 /*yield*/, expectation.toHaveAttribute(attribute, options)];
|
|
56
|
+
case 3:
|
|
57
|
+
_c.sent();
|
|
58
|
+
_c.label = 4;
|
|
59
|
+
case 4: return [2 /*return*/];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CountOptions } from '../../options';
|
|
2
|
+
import type { ComponentList } from '../../components';
|
|
3
|
+
export declare const toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: ComponentList<any>, args_0: number, args_1?: CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveCountEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
exports.toHaveCountEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveCountEx', function (component) { return component.itemsLocator; }, function (_a, count_1, options_1) { return __awaiter(void 0, [_a, count_1, options_1], void 0, function (_b, count, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
50
|
+
return [4 /*yield*/, expectation.toHaveCount(count, options)];
|
|
51
|
+
case 1:
|
|
52
|
+
_c.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RootSymbolLocator } from './LocatorSymbols';
|
|
2
|
+
import type { AttributeOptions } from '../../options';
|
|
3
|
+
export declare const toHaveErrorEx: (this: import("@playwright/test").ExpectMatcherState, component: RootSymbolLocator, args_0?: AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveErrorEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var constants_1 = require("../../utils/constants");
|
|
42
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
44
|
+
exports.toHaveErrorEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toHaveErrorEx', function (component) { return component[LocatorSymbols_1.toRootElementLocator](); }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
45
|
+
var expectation;
|
|
46
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
47
|
+
return __generator(this, function (_c) {
|
|
48
|
+
switch (_c.label) {
|
|
49
|
+
case 0:
|
|
50
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
51
|
+
return [4 /*yield*/, expectation.toHaveAttribute(constants_1.DataVisualState.Error, options)];
|
|
52
|
+
case 1:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [2 /*return*/];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TransformOptions } from '../../options';
|
|
2
|
+
import type { ToTextElementLocator } from './LocatorSymbols';
|
|
3
|
+
export declare const toHaveFormattedTextEx: (this: import("playwright/test").ExpectMatcherState, component: ToTextElementLocator, args_0: string, args_1?: TransformOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveFormattedTextEx = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toHaveFormattedTextEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toHaveFormattedTextEx', function (component) { return component[LocatorSymbols_1.toTextElementLocator](); }, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = isNot ? (0, extensions_1.expect)(locator).not : (0, extensions_1.expect)(locator);
|
|
50
|
+
return [4 /*yield*/, expectation.toHaveFormattedText(expected, options)];
|
|
51
|
+
case 1:
|
|
52
|
+
_c.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TransformOptions } from '../../options';
|
|
2
|
+
import { type ToWithValueElementLocator } from './LocatorSymbols';
|
|
3
|
+
export declare const toHaveFormattedValueEx: (this: import("playwright/test").ExpectMatcherState, component: ToWithValueElementLocator, args_0: string, args_1?: TransformOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.toHaveFormattedValueEx = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toHaveFormattedValueEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toHaveFormattedValueEx', function (component) { return component[LocatorSymbols_1.toValueElementLocator](); }, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
44
|
+
var expectation;
|
|
45
|
+
var isNot = _b.isNot, locator = _b.locator;
|
|
46
|
+
return __generator(this, function (_c) {
|
|
47
|
+
switch (_c.label) {
|
|
48
|
+
case 0:
|
|
49
|
+
expectation = isNot ? (0, extensions_1.expect)(locator).not : (0, extensions_1.expect)(locator);
|
|
50
|
+
return [4 /*yield*/, expectation.toHaveFormattedValue(expected, options)];
|
|
51
|
+
case 1:
|
|
52
|
+
_c.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AttributeOptions } from '../../options';
|
|
2
|
+
import type { Link } from '../../components';
|
|
3
|
+
export declare const toHaveHrefEx: (this: import("@playwright/test").ExpectMatcherState, component: Link, args_0: string | RegExp, args_1?: AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|