@skbkontur/playwright-react-ui-components 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -0
- package/build/index.js +17 -0
- package/build/src/assertions/AutocompleteAssertions.d.ts +19 -0
- package/build/src/assertions/AutocompleteAssertions.js +177 -0
- package/build/src/assertions/BaseComponentAssertions.d.ts +15 -0
- package/build/src/assertions/BaseComponentAssertions.js +158 -0
- package/build/src/assertions/ButtonAssertions.d.ts +15 -0
- package/build/src/assertions/ButtonAssertions.js +162 -0
- package/build/src/assertions/CheckboxAssertions.d.ts +19 -0
- package/build/src/assertions/CheckboxAssertions.js +210 -0
- package/build/src/assertions/ComboBoxAssertions.d.ts +19 -0
- package/build/src/assertions/ComboBoxAssertions.js +304 -0
- package/build/src/assertions/ComponentListAssertions.d.ts +13 -0
- package/build/src/assertions/ComponentListAssertions.js +126 -0
- package/build/src/assertions/CurrencyInputAssertions.d.ts +15 -0
- package/build/src/assertions/CurrencyInputAssertions.js +212 -0
- package/build/src/assertions/DateInputAssertions.d.ts +15 -0
- package/build/src/assertions/DateInputAssertions.js +162 -0
- package/build/src/assertions/DatePickerAssertions.d.ts +15 -0
- package/build/src/assertions/DatePickerAssertions.js +162 -0
- package/build/src/assertions/DateRangePickerAssertions.d.ts +11 -0
- package/build/src/assertions/DateRangePickerAssertions.js +111 -0
- package/build/src/assertions/DropdownAssertions.d.ts +19 -0
- package/build/src/assertions/DropdownAssertions.js +260 -0
- package/build/src/assertions/DropdownMenuAssertions.d.ts +17 -0
- package/build/src/assertions/DropdownMenuAssertions.js +236 -0
- package/build/src/assertions/FileUploaderAssertions.d.ts +14 -0
- package/build/src/assertions/FileUploaderAssertions.js +119 -0
- package/build/src/assertions/FxInputAssertions.d.ts +17 -0
- package/build/src/assertions/FxInputAssertions.js +189 -0
- package/build/src/assertions/InputAssertions.d.ts +19 -0
- package/build/src/assertions/InputAssertions.js +177 -0
- package/build/src/assertions/KebabAssertions.d.ts +13 -0
- package/build/src/assertions/KebabAssertions.js +189 -0
- package/build/src/assertions/LabelAssertions.d.ts +19 -0
- package/build/src/assertions/LabelAssertions.js +144 -0
- package/build/src/assertions/LinkAssertions.d.ts +17 -0
- package/build/src/assertions/LinkAssertions.js +187 -0
- package/build/src/assertions/LoaderAssertions.d.ts +8 -0
- package/build/src/assertions/LoaderAssertions.js +78 -0
- package/build/src/assertions/MenuItemAssertations.d.ts +11 -0
- package/build/src/assertions/MenuItemAssertations.js +114 -0
- package/build/src/assertions/PagingAssertions.d.ts +15 -0
- package/build/src/assertions/PagingAssertions.js +149 -0
- package/build/src/assertions/PortalAssertions.d.ts +9 -0
- package/build/src/assertions/PortalAssertions.js +90 -0
- package/build/src/assertions/RadioAssertions.d.ts +19 -0
- package/build/src/assertions/RadioAssertions.js +210 -0
- package/build/src/assertions/RadioGroupAssertions.d.ts +15 -0
- package/build/src/assertions/RadioGroupAssertions.js +233 -0
- package/build/src/assertions/SelectAssertions.d.ts +15 -0
- package/build/src/assertions/SelectAssertions.js +211 -0
- package/build/src/assertions/SpinnerAssertions.d.ts +8 -0
- package/build/src/assertions/SpinnerAssertions.js +78 -0
- package/build/src/assertions/TabAssertions.d.ts +17 -0
- package/build/src/assertions/TabAssertions.js +187 -0
- package/build/src/assertions/TabsAssertions.d.ts +11 -0
- package/build/src/assertions/TabsAssertions.js +130 -0
- package/build/src/assertions/TextareaAssertions.d.ts +15 -0
- package/build/src/assertions/TextareaAssertions.js +162 -0
- package/build/src/assertions/ToastAssertions.d.ts +8 -0
- package/build/src/assertions/ToastAssertions.js +78 -0
- package/build/src/assertions/ToggleAssertions.d.ts +17 -0
- package/build/src/assertions/ToggleAssertions.js +186 -0
- package/build/src/assertions/TokenAssertions.d.ts +17 -0
- package/build/src/assertions/TokenAssertions.js +159 -0
- package/build/src/assertions/TokenInputAssertions.d.ts +16 -0
- package/build/src/assertions/TokenInputAssertions.js +170 -0
- package/build/src/assertions/TooltipAssertions.d.ts +11 -0
- package/build/src/assertions/TooltipAssertions.js +114 -0
- package/build/src/assertions/index.d.ts +34 -0
- package/build/src/assertions/index.js +71 -0
- package/build/src/components/Autocomplete.d.ts +25 -0
- package/build/src/components/Autocomplete.js +256 -0
- package/build/src/components/BaseComponent.d.ts +18 -0
- package/build/src/components/BaseComponent.js +159 -0
- package/build/src/components/Button.d.ts +21 -0
- package/build/src/components/Button.js +146 -0
- package/build/src/components/Checkbox.d.ts +21 -0
- package/build/src/components/Checkbox.js +161 -0
- package/build/src/components/ComboBox.d.ts +41 -0
- package/build/src/components/ComboBox.js +292 -0
- package/build/src/components/ComponentList.d.ts +21 -0
- package/build/src/components/ComponentList.js +203 -0
- package/build/src/components/CurrencyInput.d.ts +21 -0
- package/build/src/components/CurrencyInput.js +201 -0
- package/build/src/components/DateInput.d.ts +18 -0
- package/build/src/components/DateInput.js +195 -0
- package/build/src/components/DatePicker.d.ts +20 -0
- package/build/src/components/DatePicker.js +205 -0
- package/build/src/components/DateRangePicker.d.ts +20 -0
- package/build/src/components/DateRangePicker.js +111 -0
- package/build/src/components/Dropdown.d.ts +35 -0
- package/build/src/components/Dropdown.js +322 -0
- package/build/src/components/DropdownMenu.d.ts +40 -0
- package/build/src/components/DropdownMenu.js +321 -0
- package/build/src/components/FileUploader.d.ts +54 -0
- package/build/src/components/FileUploader.js +213 -0
- package/build/src/components/FxInput.d.ts +23 -0
- package/build/src/components/FxInput.js +217 -0
- package/build/src/components/Input.d.ts +21 -0
- package/build/src/components/Input.js +192 -0
- package/build/src/components/Kebab.d.ts +27 -0
- package/build/src/components/Kebab.js +247 -0
- package/build/src/components/Label.d.ts +13 -0
- package/build/src/components/Label.js +94 -0
- package/build/src/components/Link.d.ts +16 -0
- package/build/src/components/Link.js +130 -0
- package/build/src/components/Loader.d.ts +11 -0
- package/build/src/components/Loader.js +103 -0
- package/build/src/components/MenuItem.d.ts +13 -0
- package/build/src/components/MenuItem.js +84 -0
- package/build/src/components/Paging.d.ts +25 -0
- package/build/src/components/Paging.js +249 -0
- package/build/src/components/Portal.d.ts +11 -0
- package/build/src/components/Portal.js +112 -0
- package/build/src/components/Radio.d.ts +19 -0
- package/build/src/components/Radio.js +156 -0
- package/build/src/components/RadioGroup.d.ts +21 -0
- package/build/src/components/RadioGroup.js +232 -0
- package/build/src/components/Select.d.ts +43 -0
- package/build/src/components/Select.js +384 -0
- package/build/src/components/Spinner.d.ts +12 -0
- package/build/src/components/Spinner.js +103 -0
- package/build/src/components/Tab.d.ts +16 -0
- package/build/src/components/Tab.js +126 -0
- package/build/src/components/Tabs.d.ts +18 -0
- package/build/src/components/Tabs.js +136 -0
- package/build/src/components/Textarea.d.ts +21 -0
- package/build/src/components/Textarea.js +186 -0
- package/build/src/components/Toast.d.ts +10 -0
- package/build/src/components/Toast.js +79 -0
- package/build/src/components/Toggle.d.ts +19 -0
- package/build/src/components/Toggle.js +151 -0
- package/build/src/components/Token.d.ts +13 -0
- package/build/src/components/Token.js +106 -0
- package/build/src/components/TokenInput.d.ts +44 -0
- package/build/src/components/TokenInput.js +319 -0
- package/build/src/components/Tooltip.d.ts +14 -0
- package/build/src/components/Tooltip.js +98 -0
- package/build/src/components/index.d.ts +34 -0
- package/build/src/components/index.js +71 -0
- package/build/src/index.d.ts +5 -0
- package/build/src/index.js +21 -0
- package/build/src/matchers/formattedMatchers.d.ts +37 -0
- package/build/src/matchers/formattedMatchers.js +125 -0
- package/build/src/matchers/index.d.ts +2 -0
- package/build/src/matchers/index.js +20 -0
- package/build/src/matchers/mergedExpects.d.ts +25 -0
- package/build/src/matchers/mergedExpects.js +6 -0
- package/build/src/options/AssertionOptions.d.ts +82 -0
- package/build/src/options/AssertionOptions.js +2 -0
- package/build/src/options/LocatorOptions.d.ts +342 -0
- package/build/src/options/LocatorOptions.js +2 -0
- package/build/src/options/index.d.ts +2 -0
- package/build/src/options/index.js +18 -0
- package/build/src/utils/constants.d.ts +10 -0
- package/build/src/utils/constants.js +15 -0
- package/build/src/utils/dataTidSelector.d.ts +1 -0
- package/build/src/utils/dataTidSelector.js +6 -0
- package/build/src/utils/index.d.ts +2 -0
- package/build/src/utils/index.js +20 -0
- package/build/src/utils/tooltipProvider.d.ts +4 -0
- package/build/src/utils/tooltipProvider.js +95 -0
- package/package.json +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDataTidSelector(dataTid: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getTooltip = void 0;
|
|
18
|
+
var tooltipProvider_1 = require("./tooltipProvider");
|
|
19
|
+
Object.defineProperty(exports, "getTooltip", { enumerable: true, get: function () { return tooltipProvider_1.getTooltip; } });
|
|
20
|
+
__exportStar(require("./constants"), exports);
|
|
@@ -0,0 +1,95 @@
|
|
|
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.getTooltip = getTooltip;
|
|
40
|
+
var Popup_1 = require("@skbkontur/react-ui/internal/Popup");
|
|
41
|
+
var components_1 = require("../components");
|
|
42
|
+
var components_2 = require("../components");
|
|
43
|
+
var constants_1 = require("./constants");
|
|
44
|
+
var dataTidSelector_1 = require("./dataTidSelector");
|
|
45
|
+
function isFocusable(value) {
|
|
46
|
+
return typeof (value === null || value === void 0 ? void 0 : value.focus) === 'function';
|
|
47
|
+
}
|
|
48
|
+
function getTooltip(type, component) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var portal, _a, locator, container;
|
|
51
|
+
return __generator(this, function (_b) {
|
|
52
|
+
switch (_b.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
_a = type;
|
|
55
|
+
switch (_a) {
|
|
56
|
+
case constants_1.TooltipType.Validation: return [3 /*break*/, 1];
|
|
57
|
+
case constants_1.TooltipType.Information: return [3 /*break*/, 8];
|
|
58
|
+
}
|
|
59
|
+
return [3 /*break*/, 9];
|
|
60
|
+
case 1: return [4 /*yield*/, component.rootLocator.press('Tab')];
|
|
61
|
+
case 2:
|
|
62
|
+
_b.sent();
|
|
63
|
+
if (!isFocusable(component)) return [3 /*break*/, 4];
|
|
64
|
+
return [4 /*yield*/, component.focus()];
|
|
65
|
+
case 3:
|
|
66
|
+
_b.sent();
|
|
67
|
+
return [3 /*break*/, 6];
|
|
68
|
+
case 4: return [4 /*yield*/, component.rootLocator.focus()];
|
|
69
|
+
case 5:
|
|
70
|
+
_b.sent();
|
|
71
|
+
_b.label = 6;
|
|
72
|
+
case 6:
|
|
73
|
+
locator = component.rootLocator.locator('../../noscript');
|
|
74
|
+
return [4 /*yield*/, locator.count()];
|
|
75
|
+
case 7:
|
|
76
|
+
if ((_b.sent()) > 1) {
|
|
77
|
+
locator = component.rootLocator.locator('../following-sibling::noscript[1]');
|
|
78
|
+
}
|
|
79
|
+
portal = new components_1.Portal(locator);
|
|
80
|
+
return [3 /*break*/, 10];
|
|
81
|
+
case 8:
|
|
82
|
+
{
|
|
83
|
+
portal = new components_1.Portal(component.rootLocator.locator('../noscript'));
|
|
84
|
+
return [3 /*break*/, 10];
|
|
85
|
+
}
|
|
86
|
+
_b.label = 9;
|
|
87
|
+
case 9: throw new Error("Unknown tooltip type: ".concat(type));
|
|
88
|
+
case 10: return [4 /*yield*/, portal.getContainer()];
|
|
89
|
+
case 11:
|
|
90
|
+
container = _b.sent();
|
|
91
|
+
return [2 /*return*/, new components_2.Tooltip(container.locator((0, dataTidSelector_1.getDataTidSelector)(Popup_1.PopupDataTids.content)))];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skbkontur/playwright-react-ui-components",
|
|
3
|
+
"version": "1.13.0",
|
|
4
|
+
"description": "Пакет для взаимодействия с компонентами @skbkontur/react-ui при тестировании с помощью Playwright",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"build"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prepare": "npm run build",
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"lint:eslint": "run -T eslint --ext .ts,.tsx src --quiet",
|
|
13
|
+
"lint:types": "run -T tsc --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"author": "Evgeniy Ivanov (https://staff.skbkontur.ru/profile/sephiroth) & Fintech",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git@git.skbkontur.ru:ui/playwright.react-ui.components_ts.git"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"registry": "https://registry.npmjs.org/",
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@playwright/test": "^1.45.3"
|
|
26
|
+
}
|
|
27
|
+
}
|