@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
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { BaseComponent } from './BaseComponent';
|
|
3
3
|
import { PortalAssertions } from '../assertions';
|
|
4
|
+
import { toVisibleElementLocator } from '../matchers/component/LocatorSymbols';
|
|
4
5
|
export declare class Portal extends BaseComponent {
|
|
5
6
|
readonly rootLocator: Locator;
|
|
7
|
+
readonly [toVisibleElementLocator]: () => Locator;
|
|
6
8
|
constructor(rootLocator: Locator);
|
|
7
9
|
isVisible(): Promise<boolean>;
|
|
8
10
|
getContainer(): Promise<Locator>;
|
|
@@ -50,24 +50,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Portal = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var assertions_1 = require("../assertions");
|
|
59
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
58
60
|
var Portal = /** @class */ (function (_super) {
|
|
59
61
|
__extends(Portal, _super);
|
|
60
62
|
function Portal(rootLocator) {
|
|
61
63
|
var _this = _super.call(this, rootLocator) || this;
|
|
62
64
|
_this.rootLocator = rootLocator;
|
|
65
|
+
_this[_a] = function () { return _this.rootLocator; };
|
|
63
66
|
return _this;
|
|
64
67
|
}
|
|
65
68
|
Portal.prototype.isVisible = function () {
|
|
66
69
|
return __awaiter(this, void 0, void 0, function () {
|
|
67
|
-
return __generator(this, function (
|
|
68
|
-
switch (
|
|
70
|
+
return __generator(this, function (_b) {
|
|
71
|
+
switch (_b.label) {
|
|
69
72
|
case 0: return [4 /*yield*/, this.rootLocator.count()];
|
|
70
|
-
case 1: return [2 /*return*/, (
|
|
73
|
+
case 1: return [2 /*return*/, (_b.sent()) === 1];
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
});
|
|
@@ -75,11 +78,11 @@ var Portal = /** @class */ (function (_super) {
|
|
|
75
78
|
Portal.prototype.getContainer = function () {
|
|
76
79
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
80
|
var containerId;
|
|
78
|
-
return __generator(this, function (
|
|
79
|
-
switch (
|
|
81
|
+
return __generator(this, function (_b) {
|
|
82
|
+
switch (_b.label) {
|
|
80
83
|
case 0: return [4 /*yield*/, this.getContainerId()];
|
|
81
84
|
case 1:
|
|
82
|
-
containerId =
|
|
85
|
+
containerId = _b.sent();
|
|
83
86
|
return [2 /*return*/, this.page.locator("[data-rendered-container-id='".concat(containerId, "']"))];
|
|
84
87
|
}
|
|
85
88
|
});
|
|
@@ -88,14 +91,14 @@ var Portal = /** @class */ (function (_super) {
|
|
|
88
91
|
Portal.prototype.getContainerId = function () {
|
|
89
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
93
|
var containerId;
|
|
91
|
-
return __generator(this, function (
|
|
92
|
-
switch (
|
|
94
|
+
return __generator(this, function (_b) {
|
|
95
|
+
switch (_b.label) {
|
|
93
96
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.rootLocator).toHaveCount(1)];
|
|
94
97
|
case 1:
|
|
95
|
-
|
|
98
|
+
_b.sent();
|
|
96
99
|
return [4 /*yield*/, this.getAttribute('data-render-container-id')];
|
|
97
100
|
case 2:
|
|
98
|
-
containerId =
|
|
101
|
+
containerId = _b.sent();
|
|
99
102
|
if (containerId == null) {
|
|
100
103
|
throw Error("Can't get portal container id");
|
|
101
104
|
}
|
|
@@ -110,3 +113,4 @@ var Portal = /** @class */ (function (_super) {
|
|
|
110
113
|
return Portal;
|
|
111
114
|
}(BaseComponent_1.BaseComponent));
|
|
112
115
|
exports.Portal = Portal;
|
|
116
|
+
_a = LocatorSymbols_1.toVisibleElementLocator;
|
|
@@ -3,9 +3,15 @@ import { BaseComponent } from './BaseComponent';
|
|
|
3
3
|
import { RadioAssertions } from '../assertions';
|
|
4
4
|
import type { TooltipType } from '../utils';
|
|
5
5
|
import type { BlurOptions, CheckOptions, FocusOptions, InnerTextOptions, InputValueOptions, IsCheckedOptions, IsDisabledOptions } from '../options';
|
|
6
|
+
import { toControlElementLocator, toCheckableElementLocator, toFocusableElementLocator, toValueElementLocator, toTextElementLocator } from '../matchers/component/LocatorSymbols';
|
|
6
7
|
export declare class Radio extends BaseComponent {
|
|
7
8
|
readonly rootLocator: Locator;
|
|
8
9
|
readonly inputLocator: Locator;
|
|
10
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
11
|
+
readonly [toCheckableElementLocator]: () => Locator;
|
|
12
|
+
readonly [toValueElementLocator]: () => Locator;
|
|
13
|
+
readonly [toTextElementLocator]: () => Locator;
|
|
14
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
9
15
|
constructor(rootLocator: Locator);
|
|
10
16
|
isDisabled(options?: IsDisabledOptions): Promise<boolean>;
|
|
11
17
|
isChecked(options?: IsCheckedOptions): Promise<boolean>;
|
|
@@ -50,80 +50,87 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a, _b, _c, _d, _e;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.Radio = void 0;
|
|
55
56
|
var test_1 = require("@playwright/test");
|
|
56
57
|
var BaseComponent_1 = require("./BaseComponent");
|
|
57
58
|
var assertions_1 = require("../assertions");
|
|
58
59
|
var utils_1 = require("../utils");
|
|
60
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
59
61
|
var Radio = /** @class */ (function (_super) {
|
|
60
62
|
__extends(Radio, _super);
|
|
61
63
|
function Radio(rootLocator) {
|
|
62
64
|
var _this = _super.call(this, rootLocator) || this;
|
|
63
65
|
_this.rootLocator = rootLocator;
|
|
66
|
+
_this[_a] = function () { return _this.inputLocator; };
|
|
67
|
+
_this[_b] = function () { return _this.inputLocator; };
|
|
68
|
+
_this[_c] = function () { return _this.inputLocator; };
|
|
69
|
+
_this[_d] = function () { return _this.rootLocator; };
|
|
70
|
+
_this[_e] = function () { return _this.inputLocator; };
|
|
64
71
|
_this.inputLocator = rootLocator.locator('input');
|
|
65
72
|
return _this;
|
|
66
73
|
}
|
|
67
74
|
Radio.prototype.isDisabled = function (options) {
|
|
68
75
|
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
-
return __generator(this, function (
|
|
70
|
-
switch (
|
|
76
|
+
return __generator(this, function (_f) {
|
|
77
|
+
switch (_f.label) {
|
|
71
78
|
case 0: return [4 /*yield*/, this.inputLocator.isDisabled(options)];
|
|
72
|
-
case 1: return [2 /*return*/,
|
|
79
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
73
80
|
}
|
|
74
81
|
});
|
|
75
82
|
});
|
|
76
83
|
};
|
|
77
84
|
Radio.prototype.isChecked = function (options) {
|
|
78
85
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
-
return __generator(this, function (
|
|
80
|
-
switch (
|
|
86
|
+
return __generator(this, function (_f) {
|
|
87
|
+
switch (_f.label) {
|
|
81
88
|
case 0: return [4 /*yield*/, this.inputLocator.isChecked(options)];
|
|
82
|
-
case 1: return [2 /*return*/,
|
|
89
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
83
90
|
}
|
|
84
91
|
});
|
|
85
92
|
});
|
|
86
93
|
};
|
|
87
94
|
Radio.prototype.getText = function (options) {
|
|
88
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
return __generator(this, function (
|
|
90
|
-
switch (
|
|
96
|
+
return __generator(this, function (_f) {
|
|
97
|
+
switch (_f.label) {
|
|
91
98
|
case 0: return [4 /*yield*/, this.rootLocator.innerText(options)];
|
|
92
|
-
case 1: return [2 /*return*/,
|
|
99
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
93
100
|
}
|
|
94
101
|
});
|
|
95
102
|
});
|
|
96
103
|
};
|
|
97
104
|
Radio.prototype.getValue = function (options) {
|
|
98
105
|
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
-
return __generator(this, function (
|
|
100
|
-
switch (
|
|
106
|
+
return __generator(this, function (_f) {
|
|
107
|
+
switch (_f.label) {
|
|
101
108
|
case 0: return [4 /*yield*/, this.inputLocator.inputValue(options)];
|
|
102
|
-
case 1: return [2 /*return*/,
|
|
109
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
103
110
|
}
|
|
104
111
|
});
|
|
105
112
|
});
|
|
106
113
|
};
|
|
107
114
|
Radio.prototype.check = function (options) {
|
|
108
115
|
return __awaiter(this, void 0, void 0, function () {
|
|
109
|
-
return __generator(this, function (
|
|
110
|
-
switch (
|
|
116
|
+
return __generator(this, function (_f) {
|
|
117
|
+
switch (_f.label) {
|
|
111
118
|
case 0: return [4 /*yield*/, this.rootLocator.check(options)];
|
|
112
|
-
case 1: return [2 /*return*/,
|
|
119
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
113
120
|
}
|
|
114
121
|
});
|
|
115
122
|
});
|
|
116
123
|
};
|
|
117
124
|
Radio.prototype.focus = function (options) {
|
|
118
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
return __generator(this, function (
|
|
120
|
-
switch (
|
|
126
|
+
return __generator(this, function (_f) {
|
|
127
|
+
switch (_f.label) {
|
|
121
128
|
case 0: return [4 /*yield*/, (0, test_1.expect)(this.inputLocator).toBeEnabled()];
|
|
122
129
|
case 1:
|
|
123
|
-
|
|
130
|
+
_f.sent();
|
|
124
131
|
return [4 /*yield*/, this.inputLocator.focus(options)];
|
|
125
132
|
case 2:
|
|
126
|
-
|
|
133
|
+
_f.sent();
|
|
127
134
|
return [2 /*return*/];
|
|
128
135
|
}
|
|
129
136
|
});
|
|
@@ -131,22 +138,18 @@ var Radio = /** @class */ (function (_super) {
|
|
|
131
138
|
};
|
|
132
139
|
Radio.prototype.blur = function (options) {
|
|
133
140
|
return __awaiter(this, void 0, void 0, function () {
|
|
134
|
-
return __generator(this, function (
|
|
135
|
-
switch (
|
|
141
|
+
return __generator(this, function (_f) {
|
|
142
|
+
switch (_f.label) {
|
|
136
143
|
case 0: return [4 /*yield*/, this.inputLocator.blur(options)];
|
|
137
144
|
case 1:
|
|
138
|
-
|
|
145
|
+
_f.sent();
|
|
139
146
|
return [2 /*return*/];
|
|
140
147
|
}
|
|
141
148
|
});
|
|
142
149
|
});
|
|
143
150
|
};
|
|
144
151
|
Radio.prototype.getTooltip = function (type) {
|
|
145
|
-
return
|
|
146
|
-
return __generator(this, function (_a) {
|
|
147
|
-
return [2 /*return*/, (0, utils_1.getTooltip)(type, this)];
|
|
148
|
-
});
|
|
149
|
-
});
|
|
152
|
+
return (0, utils_1.getTooltip)(type, this);
|
|
150
153
|
};
|
|
151
154
|
Radio.prototype.expect = function () {
|
|
152
155
|
return new assertions_1.RadioAssertions(this);
|
|
@@ -154,3 +157,4 @@ var Radio = /** @class */ (function (_super) {
|
|
|
154
157
|
return Radio;
|
|
155
158
|
}(BaseComponent_1.BaseComponent));
|
|
156
159
|
exports.Radio = Radio;
|
|
160
|
+
_a = LocatorSymbols_1.toControlElementLocator, _b = LocatorSymbols_1.toCheckableElementLocator, _c = LocatorSymbols_1.toValueElementLocator, _d = LocatorSymbols_1.toTextElementLocator, _e = LocatorSymbols_1.toFocusableElementLocator;
|
|
@@ -3,9 +3,11 @@ import { RadioGroupAssertions } from '../assertions';
|
|
|
3
3
|
import { BaseComponent } from './BaseComponent';
|
|
4
4
|
import { Radio } from './Radio';
|
|
5
5
|
import { type TooltipType } from '../utils';
|
|
6
|
+
import { toControlElementLocator } from '../matchers/component/LocatorSymbols';
|
|
6
7
|
export declare class RadioGroup extends BaseComponent {
|
|
7
8
|
readonly rootLocator: Locator;
|
|
8
9
|
private readonly list;
|
|
10
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
9
11
|
constructor(rootLocator: Locator);
|
|
10
12
|
getItems(): Promise<Radio[]>;
|
|
11
13
|
isDisabled(): Promise<boolean>;
|
|
@@ -50,6 +50,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var _a;
|
|
53
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
55
|
exports.RadioGroup = void 0;
|
|
55
56
|
var react_ui_1 = require("@skbkontur/react-ui");
|
|
@@ -59,20 +60,22 @@ var ComponentList_1 = require("./ComponentList");
|
|
|
59
60
|
var Radio_1 = require("./Radio");
|
|
60
61
|
var utils_1 = require("../utils");
|
|
61
62
|
var dataTidSelector_1 = require("../utils/dataTidSelector");
|
|
63
|
+
var LocatorSymbols_1 = require("../matchers/component/LocatorSymbols");
|
|
62
64
|
var RadioGroup = /** @class */ (function (_super) {
|
|
63
65
|
__extends(RadioGroup, _super);
|
|
64
66
|
function RadioGroup(rootLocator) {
|
|
65
67
|
var _this = _super.call(this, rootLocator) || this;
|
|
66
68
|
_this.rootLocator = rootLocator;
|
|
69
|
+
_this[_a] = function () { return _this.rootLocator; };
|
|
67
70
|
_this.list = new ComponentList_1.ComponentList(rootLocator, function (rootLocator) { return rootLocator.locator((0, dataTidSelector_1.getDataTidSelector)(react_ui_1.RadioDataTids.root)); }, function (rootLocator) { return new Radio_1.Radio(rootLocator); });
|
|
68
71
|
return _this;
|
|
69
72
|
}
|
|
70
73
|
RadioGroup.prototype.getItems = function () {
|
|
71
74
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
return __generator(this, function (
|
|
73
|
-
switch (
|
|
75
|
+
return __generator(this, function (_b) {
|
|
76
|
+
switch (_b.label) {
|
|
74
77
|
case 0: return [4 /*yield*/, this.list.getItems()];
|
|
75
|
-
case 1: return [2 /*return*/,
|
|
78
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
76
79
|
}
|
|
77
80
|
});
|
|
78
81
|
});
|
|
@@ -80,22 +83,22 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
80
83
|
RadioGroup.prototype.isDisabled = function () {
|
|
81
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
82
85
|
var radioList, _i, radioList_1, radio;
|
|
83
|
-
return __generator(this, function (
|
|
84
|
-
switch (
|
|
86
|
+
return __generator(this, function (_b) {
|
|
87
|
+
switch (_b.label) {
|
|
85
88
|
case 0: return [4 /*yield*/, this.getItems()];
|
|
86
89
|
case 1:
|
|
87
|
-
radioList =
|
|
90
|
+
radioList = _b.sent();
|
|
88
91
|
_i = 0, radioList_1 = radioList;
|
|
89
|
-
|
|
92
|
+
_b.label = 2;
|
|
90
93
|
case 2:
|
|
91
94
|
if (!(_i < radioList_1.length)) return [3 /*break*/, 5];
|
|
92
95
|
radio = radioList_1[_i];
|
|
93
96
|
return [4 /*yield*/, radio.isDisabled()];
|
|
94
97
|
case 3:
|
|
95
|
-
if (!(
|
|
98
|
+
if (!(_b.sent())) {
|
|
96
99
|
return [2 /*return*/, false];
|
|
97
100
|
}
|
|
98
|
-
|
|
101
|
+
_b.label = 4;
|
|
99
102
|
case 4:
|
|
100
103
|
_i++;
|
|
101
104
|
return [3 /*break*/, 2];
|
|
@@ -107,14 +110,14 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
107
110
|
RadioGroup.prototype.checkByValue = function (value) {
|
|
108
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
109
112
|
var radio;
|
|
110
|
-
return __generator(this, function (
|
|
111
|
-
switch (
|
|
113
|
+
return __generator(this, function (_b) {
|
|
114
|
+
switch (_b.label) {
|
|
112
115
|
case 0: return [4 /*yield*/, this.getByValue(value)];
|
|
113
116
|
case 1:
|
|
114
|
-
radio =
|
|
117
|
+
radio = _b.sent();
|
|
115
118
|
return [4 /*yield*/, radio.check()];
|
|
116
119
|
case 2:
|
|
117
|
-
|
|
120
|
+
_b.sent();
|
|
118
121
|
return [2 /*return*/];
|
|
119
122
|
}
|
|
120
123
|
});
|
|
@@ -123,14 +126,14 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
123
126
|
RadioGroup.prototype.checkByIndex = function (index) {
|
|
124
127
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
128
|
var radio;
|
|
126
|
-
return __generator(this, function (
|
|
127
|
-
switch (
|
|
129
|
+
return __generator(this, function (_b) {
|
|
130
|
+
switch (_b.label) {
|
|
128
131
|
case 0: return [4 /*yield*/, this.getByIndex(index)];
|
|
129
132
|
case 1:
|
|
130
|
-
radio =
|
|
133
|
+
radio = _b.sent();
|
|
131
134
|
return [4 /*yield*/, radio.check()];
|
|
132
135
|
case 2:
|
|
133
|
-
|
|
136
|
+
_b.sent();
|
|
134
137
|
return [2 /*return*/];
|
|
135
138
|
}
|
|
136
139
|
});
|
|
@@ -139,14 +142,14 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
139
142
|
RadioGroup.prototype.checkByText = function (text) {
|
|
140
143
|
return __awaiter(this, void 0, void 0, function () {
|
|
141
144
|
var radio;
|
|
142
|
-
return __generator(this, function (
|
|
143
|
-
switch (
|
|
145
|
+
return __generator(this, function (_b) {
|
|
146
|
+
switch (_b.label) {
|
|
144
147
|
case 0: return [4 /*yield*/, this.getByText(text)];
|
|
145
148
|
case 1:
|
|
146
|
-
radio =
|
|
149
|
+
radio = _b.sent();
|
|
147
150
|
return [4 /*yield*/, radio.check()];
|
|
148
151
|
case 2:
|
|
149
|
-
|
|
152
|
+
_b.sent();
|
|
150
153
|
return [2 /*return*/];
|
|
151
154
|
}
|
|
152
155
|
});
|
|
@@ -155,15 +158,15 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
155
158
|
RadioGroup.prototype.getCheckedRadio = function () {
|
|
156
159
|
return __awaiter(this, void 0, void 0, function () {
|
|
157
160
|
var _this = this;
|
|
158
|
-
return __generator(this, function (
|
|
159
|
-
switch (
|
|
160
|
-
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (
|
|
161
|
-
switch (
|
|
161
|
+
return __generator(this, function (_b) {
|
|
162
|
+
switch (_b.label) {
|
|
163
|
+
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_b) {
|
|
164
|
+
switch (_b.label) {
|
|
162
165
|
case 0: return [4 /*yield*/, radio.isChecked()];
|
|
163
|
-
case 1: return [2 /*return*/,
|
|
166
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
164
167
|
}
|
|
165
168
|
}); }); })];
|
|
166
|
-
case 1: return [2 /*return*/,
|
|
169
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
167
170
|
}
|
|
168
171
|
});
|
|
169
172
|
});
|
|
@@ -171,27 +174,27 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
171
174
|
RadioGroup.prototype.getByValue = function (value) {
|
|
172
175
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
176
|
var _this = this;
|
|
174
|
-
return __generator(this, function (
|
|
175
|
-
switch (
|
|
176
|
-
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { var
|
|
177
|
-
switch (
|
|
177
|
+
return __generator(this, function (_b) {
|
|
178
|
+
switch (_b.label) {
|
|
179
|
+
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { var _b; return __generator(this, function (_c) {
|
|
180
|
+
switch (_c.label) {
|
|
178
181
|
case 0:
|
|
179
|
-
|
|
182
|
+
_b = Boolean;
|
|
180
183
|
return [4 /*yield*/, radio.getValue()];
|
|
181
|
-
case 1: return [2 /*return*/,
|
|
184
|
+
case 1: return [2 /*return*/, _b.apply(void 0, [(_c.sent()).match(value)])];
|
|
182
185
|
}
|
|
183
186
|
}); }); })];
|
|
184
|
-
case 1: return [2 /*return*/,
|
|
187
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
185
188
|
}
|
|
186
189
|
});
|
|
187
190
|
});
|
|
188
191
|
};
|
|
189
192
|
RadioGroup.prototype.getByIndex = function (index) {
|
|
190
193
|
return __awaiter(this, void 0, void 0, function () {
|
|
191
|
-
return __generator(this, function (
|
|
192
|
-
switch (
|
|
194
|
+
return __generator(this, function (_b) {
|
|
195
|
+
switch (_b.label) {
|
|
193
196
|
case 0: return [4 /*yield*/, this.list.getItemByIndex(index)];
|
|
194
|
-
case 1: return [2 /*return*/,
|
|
197
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
195
198
|
}
|
|
196
199
|
});
|
|
197
200
|
});
|
|
@@ -199,27 +202,27 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
199
202
|
RadioGroup.prototype.getByText = function (text) {
|
|
200
203
|
return __awaiter(this, void 0, void 0, function () {
|
|
201
204
|
var _this = this;
|
|
202
|
-
return __generator(this, function (
|
|
203
|
-
switch (
|
|
204
|
-
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { var
|
|
205
|
-
switch (
|
|
205
|
+
return __generator(this, function (_b) {
|
|
206
|
+
switch (_b.label) {
|
|
207
|
+
case 0: return [4 /*yield*/, this.list.getFirstItemByPredicate(function (radio) { return __awaiter(_this, void 0, void 0, function () { var _b; return __generator(this, function (_c) {
|
|
208
|
+
switch (_c.label) {
|
|
206
209
|
case 0:
|
|
207
|
-
|
|
210
|
+
_b = Boolean;
|
|
208
211
|
return [4 /*yield*/, radio.getText()];
|
|
209
|
-
case 1: return [2 /*return*/,
|
|
212
|
+
case 1: return [2 /*return*/, _b.apply(void 0, [(_c.sent()).match(text)])];
|
|
210
213
|
}
|
|
211
214
|
}); }); })];
|
|
212
|
-
case 1: return [2 /*return*/,
|
|
215
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
213
216
|
}
|
|
214
217
|
});
|
|
215
218
|
});
|
|
216
219
|
};
|
|
217
220
|
RadioGroup.prototype.getTooltip = function (type) {
|
|
218
221
|
return __awaiter(this, void 0, void 0, function () {
|
|
219
|
-
return __generator(this, function (
|
|
220
|
-
switch (
|
|
222
|
+
return __generator(this, function (_b) {
|
|
223
|
+
switch (_b.label) {
|
|
221
224
|
case 0: return [4 /*yield*/, (0, utils_1.getTooltip)(type, this)];
|
|
222
|
-
case 1: return [2 /*return*/,
|
|
225
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
223
226
|
}
|
|
224
227
|
});
|
|
225
228
|
});
|
|
@@ -230,3 +233,4 @@ var RadioGroup = /** @class */ (function (_super) {
|
|
|
230
233
|
return RadioGroup;
|
|
231
234
|
}(BaseComponent_1.BaseComponent));
|
|
232
235
|
exports.RadioGroup = RadioGroup;
|
|
236
|
+
_a = LocatorSymbols_1.toControlElementLocator;
|
|
@@ -5,11 +5,16 @@ import type { TooltipType } from '../utils';
|
|
|
5
5
|
import { ComponentList } from './ComponentList';
|
|
6
6
|
import { MenuItem } from './MenuItem';
|
|
7
7
|
import type { BlurOptions, ClickOptions, FillOptions, FocusOptions, InnerTextOptions } from '../options';
|
|
8
|
+
import { toControlElementLocator, toValueElementLocator, toFocusableElementLocator } from '../matchers/component/LocatorSymbols';
|
|
8
9
|
export declare class Select extends BaseComponent {
|
|
9
10
|
private readonly portal;
|
|
10
11
|
readonly buttonOrLinkLocator: Locator;
|
|
11
12
|
readonly selectLabelLocator: Locator;
|
|
13
|
+
readonly [toControlElementLocator]: () => Locator;
|
|
14
|
+
readonly [toValueElementLocator]: () => Promise<Locator>;
|
|
15
|
+
readonly [toFocusableElementLocator]: () => Locator;
|
|
12
16
|
constructor(rootLocator: Locator);
|
|
17
|
+
private getValueLocator;
|
|
13
18
|
isDisabled(): Promise<boolean>;
|
|
14
19
|
isMenuOpened(): Promise<boolean>;
|
|
15
20
|
isLinkSelect(): Promise<boolean>;
|