@skbkontur/playwright-react-ui-components 1.13.2 → 1.14.0-beta.2
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 +8 -2
- package/build/src/components/ComboBox.js +67 -54
- package/build/src/components/ComponentList.d.ts +6 -3
- package/build/src/components/ComponentList.js +39 -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 +7 -2
- package/build/src/components/Dropdown.js +68 -65
- package/build/src/components/DropdownMenu.d.ts +6 -2
- package/build/src/components/DropdownMenu.js +67 -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 +5 -2
- package/build/src/components/Kebab.js +49 -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 +10 -0
- package/build/src/components/MenuComponent.js +79 -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/toBeActiveTab.d.ts +3 -0
- package/build/src/matchers/component/toBeActiveTab.js +56 -0
- package/build/src/matchers/component/toBeAutoMode.d.ts +3 -0
- package/build/src/matchers/component/toBeAutoMode.js +62 -0
- package/build/src/matchers/component/toBeCheckedByIndex.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByIndex.js +62 -0
- package/build/src/matchers/component/toBeCheckedByText.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByText.js +62 -0
- package/build/src/matchers/component/toBeCheckedByValue.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByValue.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 +171 -0
- package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEmptyEx.js +136 -0
- package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEnabledEx.js +196 -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 +67 -0
- package/build/src/matchers/component/toBeInactiveTab.d.ts +3 -0
- package/build/src/matchers/component/toBeInactiveTab.js +56 -0
- package/build/src/matchers/component/toBeUnchecked.d.ts +3 -0
- package/build/src/matchers/component/toBeUnchecked.js +56 -0
- package/build/src/matchers/component/toBeUncheckedByIndex.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByIndex.js +62 -0
- package/build/src/matchers/component/toBeUncheckedByText.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByText.js +57 -0
- package/build/src/matchers/component/toBeUncheckedByValue.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByValue.js +57 -0
- package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
- package/build/src/matchers/component/toBeVisibleEx.js +67 -0
- package/build/src/matchers/component/toContainFormattedText.d.ts +3 -0
- package/build/src/matchers/component/toContainFormattedText.js +55 -0
- package/build/src/matchers/component/toContainItem.d.ts +4 -0
- package/build/src/matchers/component/toContainItem.js +78 -0
- package/build/src/matchers/component/toContainItems.d.ts +3 -0
- package/build/src/matchers/component/toContainItems.js +63 -0
- package/build/src/matchers/component/toContainSelectValue.d.ts +3 -0
- package/build/src/matchers/component/toContainSelectValue.js +55 -0
- package/build/src/matchers/component/toContainTabs.d.ts +3 -0
- package/build/src/matchers/component/toContainTabs.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/toContainTokens.d.ts +4 -0
- package/build/src/matchers/component/toContainTokens.js +80 -0
- package/build/src/matchers/component/toContainUploadedFiles.d.ts +4 -0
- package/build/src/matchers/component/toContainUploadedFiles.js +75 -0
- package/build/src/matchers/component/toHaveActivePage.d.ts +4 -0
- package/build/src/matchers/component/toHaveActivePage.js +78 -0
- package/build/src/matchers/component/toHaveActiveTab.d.ts +2 -0
- package/build/src/matchers/component/toHaveActiveTab.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/toHaveError.d.ts +3 -0
- package/build/src/matchers/component/toHaveError.js +57 -0
- package/build/src/matchers/component/toHaveFormattedText.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedText.js +56 -0
- package/build/src/matchers/component/toHaveFormattedValue.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedValue.js +56 -0
- package/build/src/matchers/component/toHaveHref.d.ts +3 -0
- package/build/src/matchers/component/toHaveHref.js +55 -0
- package/build/src/matchers/component/toHaveItems.d.ts +3 -0
- package/build/src/matchers/component/toHaveItems.js +63 -0
- package/build/src/matchers/component/toHavePageCount.d.ts +4 -0
- package/build/src/matchers/component/toHavePageCount.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 +197 -0
- package/build/src/matchers/component/toHaveWarning.d.ts +3 -0
- package/build/src/matchers/component/toHaveWarning.js +57 -0
- package/build/src/matchers/componentMatchers.d.ts +104 -0
- package/build/src/matchers/componentMatchers.js +89 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +72 -0
- package/build/src/matchers/createAsyncMatcher.js +180 -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/makeMatcher.d.ts +5 -0
- package/build/src/utils/makeMatcher.js +65 -0
- package/build/src/utils/toMatchMessage.d.ts +23 -0
- package/build/src/utils/toMatchMessage.js +89 -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,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.toBeCheckedByIndex = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toBeCheckedByIndex = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toBeCheckedByIndex', function (component) { return component.rootLocator; }, function (_a, index_1, options_1) { return __awaiter(void 0, [_a, index_1, options_1], void 0, function (_b, index, options) {
|
|
43
|
+
var radio;
|
|
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.getByIndex(index)];
|
|
48
|
+
case 1:
|
|
49
|
+
radio = _c.sent();
|
|
50
|
+
if (!isNot) return [3 /*break*/, 3];
|
|
51
|
+
return [4 /*yield*/, (0, extensions_1.expect)(radio).not.toBeCheckedEx(options)];
|
|
52
|
+
case 2:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [3 /*break*/, 5];
|
|
55
|
+
case 3: return [4 /*yield*/, (0, extensions_1.expect)(radio).toBeCheckedEx(options)];
|
|
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 { RadioGroup } from '../../components';
|
|
2
|
+
import type { CheckedOptions } from '../../options';
|
|
3
|
+
export declare const toBeCheckedByText: (this: import("playwright/test").ExpectMatcherState, component: RadioGroup, args_0: string | RegExp, args_1?: CheckedOptions | 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.toBeCheckedByText = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toBeCheckedByText = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toBeCheckedByText', function (component) { return component.rootLocator; }, function (_a, text_1, options_1) { return __awaiter(void 0, [_a, text_1, options_1], void 0, function (_b, text, options) {
|
|
43
|
+
var radio;
|
|
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.getByText(text)];
|
|
48
|
+
case 1:
|
|
49
|
+
radio = _c.sent();
|
|
50
|
+
if (!isNot) return [3 /*break*/, 3];
|
|
51
|
+
return [4 /*yield*/, (0, extensions_1.expect)(radio).not.toBeCheckedEx(options)];
|
|
52
|
+
case 2:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [3 /*break*/, 5];
|
|
55
|
+
case 3: return [4 /*yield*/, (0, extensions_1.expect)(radio).toBeCheckedEx(options)];
|
|
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 { RadioGroup } from '../../components';
|
|
2
|
+
import type { CheckedOptions } from '../../options';
|
|
3
|
+
export declare const toBeCheckedByValue: (this: import("playwright/test").ExpectMatcherState, component: RadioGroup, args_0: string | RegExp, args_1?: CheckedOptions | 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.toBeCheckedByValue = void 0;
|
|
40
|
+
var extensions_1 = require("../../extensions");
|
|
41
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
|
+
exports.toBeCheckedByValue = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toBeCheckedByValue', function (component) { return component.rootLocator; }, function (_a, value_1, options_1) { return __awaiter(void 0, [_a, value_1, options_1], void 0, function (_b, value, options) {
|
|
43
|
+
var radio;
|
|
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.getByValue(value)];
|
|
48
|
+
case 1:
|
|
49
|
+
radio = _c.sent();
|
|
50
|
+
if (!isNot) return [3 /*break*/, 3];
|
|
51
|
+
return [4 /*yield*/, (0, extensions_1.expect)(radio).not.toBeCheckedEx(options)];
|
|
52
|
+
case 2:
|
|
53
|
+
_c.sent();
|
|
54
|
+
return [3 /*break*/, 5];
|
|
55
|
+
case 3: return [4 /*yield*/, (0, extensions_1.expect)(radio).toBeCheckedEx(options)];
|
|
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 ToBeCheckableElementLocator } from './LocatorSymbols';
|
|
2
|
+
import type { CheckedOptions } from '../../options';
|
|
3
|
+
export declare const toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: ToBeCheckableElementLocator, args_0?: CheckedOptions | 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.toBeCheckedEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
+
exports.toBeCheckedEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toBeCheckedEx', function (component) { return component[LocatorSymbols_1.toCheckableElementLocator](); }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, 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.toBeChecked(options)];
|
|
51
|
+
case 1:
|
|
52
|
+
_c.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AttributeOptions, EnabledOptions } from '../../options';
|
|
2
|
+
import type { ControlElementLocator } from './LocatorSymbols';
|
|
3
|
+
export declare const toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: ControlElementLocator, args_0?: EnabledOptions | AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,171 @@
|
|
|
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.toBeDisabledEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var components_1 = require("../../components");
|
|
42
|
+
var constants_1 = require("../../utils/constants");
|
|
43
|
+
var extensions_1 = require("../../extensions");
|
|
44
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
45
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
46
|
+
exports.toBeDisabledEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toBeDisabledEx', function (component) { return component[LocatorSymbols_1.toControlElementLocator](); }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
47
|
+
var _c, expectation;
|
|
48
|
+
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
49
|
+
return __generator(this, function (_d) {
|
|
50
|
+
switch (_d.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
_c = true;
|
|
53
|
+
switch (_c) {
|
|
54
|
+
case component instanceof components_1.Select: return [3 /*break*/, 1];
|
|
55
|
+
case component instanceof components_1.Token: return [3 /*break*/, 3];
|
|
56
|
+
case component instanceof components_1.RadioGroup: return [3 /*break*/, 5];
|
|
57
|
+
case component instanceof components_1.Kebab: return [3 /*break*/, 7];
|
|
58
|
+
case component instanceof components_1.Paging: return [3 /*break*/, 7];
|
|
59
|
+
case component instanceof components_1.Tab: return [3 /*break*/, 7];
|
|
60
|
+
case component instanceof components_1.Link: return [3 /*break*/, 7];
|
|
61
|
+
}
|
|
62
|
+
return [3 /*break*/, 9];
|
|
63
|
+
case 1: return [4 /*yield*/, checkSelect(component, isNot, locator, options)];
|
|
64
|
+
case 2:
|
|
65
|
+
_d.sent();
|
|
66
|
+
return [3 /*break*/, 11];
|
|
67
|
+
case 3: return [4 /*yield*/, checkVisible(isNot, locator, options)];
|
|
68
|
+
case 4:
|
|
69
|
+
_d.sent();
|
|
70
|
+
return [3 /*break*/, 11];
|
|
71
|
+
case 5: return [4 /*yield*/, checkRadioGroup(component, isNot, options)];
|
|
72
|
+
case 6:
|
|
73
|
+
_d.sent();
|
|
74
|
+
return [3 /*break*/, 11];
|
|
75
|
+
case 7: return [4 /*yield*/, checkAttribute(component, isNot, options)];
|
|
76
|
+
case 8:
|
|
77
|
+
_d.sent();
|
|
78
|
+
return [3 /*break*/, 11];
|
|
79
|
+
case 9:
|
|
80
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
81
|
+
return [4 /*yield*/, expectation.toBeDisabled(options)];
|
|
82
|
+
case 10:
|
|
83
|
+
_d.sent();
|
|
84
|
+
_d.label = 11;
|
|
85
|
+
case 11: return [2 /*return*/];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}); });
|
|
89
|
+
function checkSelect(component, isNot, locator, options) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var expectation;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
96
|
+
return [4 /*yield*/, component.isLinkSelect()];
|
|
97
|
+
case 1:
|
|
98
|
+
if (!_a.sent()) return [3 /*break*/, 3];
|
|
99
|
+
return [4 /*yield*/, expectation.toHaveAttribute(constants_1.DataVisualState.Disabled, options)];
|
|
100
|
+
case 2:
|
|
101
|
+
_a.sent();
|
|
102
|
+
return [3 /*break*/, 5];
|
|
103
|
+
case 3: return [4 /*yield*/, expectation.toBeDisabled(options)];
|
|
104
|
+
case 4:
|
|
105
|
+
_a.sent();
|
|
106
|
+
_a.label = 5;
|
|
107
|
+
case 5: return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function checkVisible(isNot, locator, options) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
var expectation;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0:
|
|
118
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
119
|
+
return [4 /*yield*/, expectation.toBeHidden(options)];
|
|
120
|
+
case 1:
|
|
121
|
+
_a.sent();
|
|
122
|
+
return [2 /*return*/];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function checkRadioGroup(component, isNot, options) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var radios, _i, radios_1, radio;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0: return [4 /*yield*/, component.getItems()];
|
|
133
|
+
case 1:
|
|
134
|
+
radios = _a.sent();
|
|
135
|
+
_i = 0, radios_1 = radios;
|
|
136
|
+
_a.label = 2;
|
|
137
|
+
case 2:
|
|
138
|
+
if (!(_i < radios_1.length)) return [3 /*break*/, 7];
|
|
139
|
+
radio = radios_1[_i];
|
|
140
|
+
if (!isNot) return [3 /*break*/, 4];
|
|
141
|
+
return [4 /*yield*/, (0, extensions_1.expect)(radio).not.toBeDisabledEx(options)];
|
|
142
|
+
case 3:
|
|
143
|
+
_a.sent();
|
|
144
|
+
return [3 /*break*/, 6];
|
|
145
|
+
case 4: return [4 /*yield*/, (0, extensions_1.expect)(radio).toBeDisabledEx(options)];
|
|
146
|
+
case 5:
|
|
147
|
+
_a.sent();
|
|
148
|
+
_a.label = 6;
|
|
149
|
+
case 6:
|
|
150
|
+
_i++;
|
|
151
|
+
return [3 /*break*/, 2];
|
|
152
|
+
case 7: return [2 /*return*/];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function checkAttribute(component, isNot, options) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
159
|
+
var expectation;
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
162
|
+
case 0:
|
|
163
|
+
expectation = isNot ? (0, extensions_1.expect)(component).not : (0, extensions_1.expect)(component);
|
|
164
|
+
return [4 /*yield*/, expectation.toHaveAttributeEx(constants_1.DataVisualState.Disabled, undefined, options)];
|
|
165
|
+
case 1:
|
|
166
|
+
_a.sent();
|
|
167
|
+
return [2 /*return*/];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EmptyOptions } from '../../options';
|
|
2
|
+
import type { ToWithValueElementLocator } from './LocatorSymbols';
|
|
3
|
+
export declare const toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: ToWithValueElementLocator, args_0?: EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
@@ -0,0 +1,136 @@
|
|
|
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.toBeEmptyEx = void 0;
|
|
40
|
+
var test_1 = require("@playwright/test");
|
|
41
|
+
var components_1 = require("../../components");
|
|
42
|
+
var extensions_1 = require("../../extensions");
|
|
43
|
+
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
44
|
+
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
45
|
+
exports.toBeEmptyEx = (0, createAsyncMatcher_1.createAsyncMatcher)('toBeEmptyEx', function (component) { return component[LocatorSymbols_1.toValueElementLocator](); }, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
46
|
+
var _c, expectation;
|
|
47
|
+
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
48
|
+
return __generator(this, function (_d) {
|
|
49
|
+
switch (_d.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
_c = true;
|
|
52
|
+
switch (_c) {
|
|
53
|
+
case component instanceof components_1.ComboBox: return [3 /*break*/, 1];
|
|
54
|
+
case component instanceof components_1.DateRangePicker: return [3 /*break*/, 3];
|
|
55
|
+
case component instanceof components_1.ComponentList: return [3 /*break*/, 5];
|
|
56
|
+
case component instanceof components_1.TokenInput: return [3 /*break*/, 5];
|
|
57
|
+
}
|
|
58
|
+
return [3 /*break*/, 7];
|
|
59
|
+
case 1: return [4 /*yield*/, checkComboBox(component, isNot, locator, options)];
|
|
60
|
+
case 2:
|
|
61
|
+
_d.sent();
|
|
62
|
+
return [3 /*break*/, 9];
|
|
63
|
+
case 3: return [4 /*yield*/, checkDateRangePicker(component)];
|
|
64
|
+
case 4:
|
|
65
|
+
_d.sent();
|
|
66
|
+
return [3 /*break*/, 9];
|
|
67
|
+
case 5: return [4 /*yield*/, checkComponentList(isNot, locator, options)];
|
|
68
|
+
case 6:
|
|
69
|
+
_d.sent();
|
|
70
|
+
return [3 /*break*/, 9];
|
|
71
|
+
case 7:
|
|
72
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
73
|
+
return [4 /*yield*/, expectation.toBeEmpty(options)];
|
|
74
|
+
case 8:
|
|
75
|
+
_d.sent();
|
|
76
|
+
_d.label = 9;
|
|
77
|
+
case 9: return [2 /*return*/];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}); });
|
|
81
|
+
function checkComboBox(component, isNot, locator, options) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var expectation;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
88
|
+
return [4 /*yield*/, component.isDisabled()];
|
|
89
|
+
case 1:
|
|
90
|
+
if (!!(_a.sent())) return [3 /*break*/, 4];
|
|
91
|
+
return [4 /*yield*/, component.focus()];
|
|
92
|
+
case 2:
|
|
93
|
+
_a.sent();
|
|
94
|
+
return [4 /*yield*/, expectation.toBeEmpty(options)];
|
|
95
|
+
case 3:
|
|
96
|
+
_a.sent();
|
|
97
|
+
return [3 /*break*/, 6];
|
|
98
|
+
case 4: return [4 /*yield*/, expectation.toBeEmpty(options)];
|
|
99
|
+
case 5:
|
|
100
|
+
_a.sent();
|
|
101
|
+
_a.label = 6;
|
|
102
|
+
case 6: return [2 /*return*/];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function checkDateRangePicker(component) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, (0, extensions_1.expect)(component.datePickerStart).toBeEmptyEx()];
|
|
112
|
+
case 1:
|
|
113
|
+
_a.sent();
|
|
114
|
+
return [4 /*yield*/, (0, extensions_1.expect)(component.datePickerEnd).toBeEmptyEx()];
|
|
115
|
+
case 2:
|
|
116
|
+
_a.sent();
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function checkComponentList(isNot, locator, options) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
+
var expectation;
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
switch (_a.label) {
|
|
127
|
+
case 0:
|
|
128
|
+
expectation = isNot ? (0, test_1.expect)(locator).not : (0, test_1.expect)(locator);
|
|
129
|
+
return [4 /*yield*/, expectation.toHaveCount(0, options)];
|
|
130
|
+
case 1:
|
|
131
|
+
_a.sent();
|
|
132
|
+
return [2 /*return*/];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EnabledOptions } from '../../options';
|
|
2
|
+
import type { ControlElementLocator } from './LocatorSymbols';
|
|
3
|
+
export declare const toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: ControlElementLocator, args_0?: EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|