@skbkontur/playwright-react-ui-components 1.15.0-beta.1 → 1.15.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/src/matchers/component/toBeChecked.js +1 -1
- package/build/src/matchers/component/toBeDisabled.js +1 -1
- package/build/src/matchers/component/toBeEmpty.js +1 -1
- package/build/src/matchers/component/toBeEnabled.js +1 -1
- package/build/src/matchers/component/toBeFocused.js +1 -1
- package/build/src/matchers/component/toBeHidden.js +1 -1
- package/build/src/matchers/component/toBeUnchecked.js +1 -1
- package/build/src/matchers/component/toBeVisible.js +1 -1
- package/build/src/matchers/component/toContainFormattedText.js +1 -1
- package/build/src/matchers/component/toContainItem.js +1 -1
- package/build/src/matchers/component/toContainItems.js +1 -1
- package/build/src/matchers/component/toContainText.js +1 -1
- package/build/src/matchers/component/toHaveAttribute.js +1 -1
- package/build/src/matchers/component/toHaveError.js +1 -1
- package/build/src/matchers/component/toHaveFormattedText.js +1 -1
- package/build/src/matchers/component/toHaveFormattedValue.js +1 -1
- package/build/src/matchers/component/toHaveItems.js +1 -1
- package/build/src/matchers/component/toHaveText.js +1 -1
- package/build/src/matchers/component/toHaveValue.js +1 -1
- package/build/src/matchers/component/toHaveWarning.js +1 -1
- package/build/src/matchers/componentMatchers.d.ts +156 -0
- package/build/src/matchers/componentMatchers.js +75 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +41 -5
- package/build/src/matchers/createAsyncMatcher.js +74 -5
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ exports.toBeChecked = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toBeChecked = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toBeChecked = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeChecked', LocatorSymbols_1.toCheckableElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -43,7 +43,7 @@ var utils_1 = require("../../utils");
|
|
|
43
43
|
var extensions_1 = require("../../extensions");
|
|
44
44
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
45
45
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
46
|
-
exports.toBeDisabled = (0, createAsyncMatcher_1.
|
|
46
|
+
exports.toBeDisabled = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeDisabled', LocatorSymbols_1.toControlElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
47
47
|
var _c, expectation;
|
|
48
48
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
49
49
|
return __generator(this, function (_d) {
|
|
@@ -42,7 +42,7 @@ var components_1 = require("../../components");
|
|
|
42
42
|
var extensions_1 = require("../../extensions");
|
|
43
43
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
44
44
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
45
|
-
exports.toBeEmpty = (0, createAsyncMatcher_1.
|
|
45
|
+
exports.toBeEmpty = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeEmpty', LocatorSymbols_1.toValueElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
46
46
|
var _c, expectation;
|
|
47
47
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
48
48
|
return __generator(this, function (_d) {
|
|
@@ -54,7 +54,7 @@ var utils_1 = require("../../utils");
|
|
|
54
54
|
var extensions_1 = require("../../extensions");
|
|
55
55
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
56
56
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
57
|
-
exports.toBeEnabled = (0, createAsyncMatcher_1.
|
|
57
|
+
exports.toBeEnabled = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeEnabled', LocatorSymbols_1.toControlElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
58
58
|
var _c, expectation;
|
|
59
59
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
60
60
|
return __generator(this, function (_d) {
|
|
@@ -40,7 +40,7 @@ exports.toBeFocused = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toBeFocused = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toBeFocused = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeFocused', LocatorSymbols_1.toFocusableElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var components_1 = require("../../components");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
43
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
44
|
-
exports.toBeHidden = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toBeHidden = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeHidden', LocatorSymbols_1.toVisibleElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
45
45
|
var expectation, _c;
|
|
46
46
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
47
47
|
return __generator(this, function (_d) {
|
|
@@ -40,7 +40,7 @@ exports.toBeUnchecked = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
42
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
|
-
exports.toBeUnchecked = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toBeUnchecked = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeUnchecked', LocatorSymbols_1.toCheckableElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var components_1 = require("../../components");
|
|
42
42
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
43
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
44
|
-
exports.toBeVisible = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toBeVisible = (0, createAsyncMatcher_1.createSymbolMatcher)('toBeVisible', LocatorSymbols_1.toVisibleElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
45
45
|
var expectation, _c;
|
|
46
46
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
47
47
|
return __generator(this, function (_d) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
42
42
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
43
|
var removeSpaces_1 = require("../../utils/removeSpaces");
|
|
44
|
-
exports.toContainFormattedText = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toContainFormattedText = (0, createAsyncMatcher_1.createSymbolMatcher)('toContainFormattedText', LocatorSymbols_1.toTextElementLocator, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
45
45
|
function pollAndTransform() {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
47
|
var value, transformedValue;
|
|
@@ -40,7 +40,7 @@ exports.toContainItem = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toContainItem = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toContainItem = (0, createAsyncMatcher_1.createSymbolMatcher)('toContainItem', LocatorSymbols_1.toContainItemElementLocator, function (_a, itemText_1, options_1) { return __awaiter(void 0, [_a, itemText_1, options_1], void 0, function (_b, itemText, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, component = _b.component;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -40,7 +40,7 @@ exports.toContainItems = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toContainItems = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toContainItems = (0, createAsyncMatcher_1.createSymbolMatcher)('toContainItems', LocatorSymbols_1.toItemsElementLocator, function (_a, itemsText_1, options_1) { return __awaiter(void 0, [_a, itemsText_1, options_1], void 0, function (_b, itemsText, options) {
|
|
44
44
|
var isNot = _b.isNot, locator = _b.locator;
|
|
45
45
|
return __generator(this, function (_c) {
|
|
46
46
|
switch (_c.label) {
|
|
@@ -40,7 +40,7 @@ exports.toContainText = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toContainText = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toContainText = (0, createAsyncMatcher_1.createSymbolMatcher)('toContainText', LocatorSymbols_1.toTextElementLocator, function (_a, text_1, options_1) { return __awaiter(void 0, [_a, text_1, options_1], void 0, function (_b, text, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -40,7 +40,7 @@ exports.toHaveAttribute = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toHaveAttribute = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toHaveAttribute = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveAttribute', LocatorSymbols_1.toHaveAttributeElementLocator, function (_a, attribute_1, value_1, options_1) { return __awaiter(void 0, [_a, attribute_1, value_1, options_1], void 0, function (_b, attribute, value, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var utils_1 = require("../../utils");
|
|
42
42
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
43
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
44
|
-
exports.toHaveError = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toHaveError = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveError', LocatorSymbols_1.toRootElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
45
45
|
var expectation;
|
|
46
46
|
var isNot = _b.isNot, locator = _b.locator;
|
|
47
47
|
return __generator(this, function (_c) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
43
|
var removeSpaces_1 = require("../../utils/removeSpaces");
|
|
44
|
-
exports.toHaveFormattedText = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toHaveFormattedText = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveFormattedText', LocatorSymbols_1.toTextElementLocator, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
45
45
|
function pollAndTransform() {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
47
|
var value, transformedValue;
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
43
|
var removeSpaces_1 = require("../../utils/removeSpaces");
|
|
44
|
-
exports.toHaveFormattedValue = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toHaveFormattedValue = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveFormattedValue', LocatorSymbols_1.toValueElementLocator, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
45
45
|
function pollAndTransform() {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
47
|
var value, transformedValue;
|
|
@@ -40,7 +40,7 @@ exports.toHaveItems = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toHaveItems = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toHaveItems = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveItems', LocatorSymbols_1.toItemsElementLocator, function (_a, itemsText_1, options_1) { return __awaiter(void 0, [_a, itemsText_1, options_1], void 0, function (_b, itemsText, options) {
|
|
44
44
|
var isNot = _b.isNot, locator = _b.locator;
|
|
45
45
|
return __generator(this, function (_c) {
|
|
46
46
|
switch (_c.label) {
|
|
@@ -40,7 +40,7 @@ exports.toHaveText = void 0;
|
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
42
42
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
43
|
-
exports.toHaveText = (0, createAsyncMatcher_1.
|
|
43
|
+
exports.toHaveText = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveText', LocatorSymbols_1.toTextElementLocator, function (_a, text_1, options_1) { return __awaiter(void 0, [_a, text_1, options_1], void 0, function (_b, text, options) {
|
|
44
44
|
var expectation;
|
|
45
45
|
var isNot = _b.isNot, locator = _b.locator;
|
|
46
46
|
return __generator(this, function (_c) {
|
|
@@ -42,7 +42,7 @@ var components_1 = require("../../components");
|
|
|
42
42
|
var extensions_1 = require("../../extensions");
|
|
43
43
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
44
44
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
45
|
-
exports.toHaveValue = (0, createAsyncMatcher_1.
|
|
45
|
+
exports.toHaveValue = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveValue', LocatorSymbols_1.toValueElementLocator, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
|
|
46
46
|
var expectation, _c;
|
|
47
47
|
var isNot = _b.isNot, locator = _b.locator, component = _b.component;
|
|
48
48
|
return __generator(this, function (_d) {
|
|
@@ -41,7 +41,7 @@ var test_1 = require("@playwright/test");
|
|
|
41
41
|
var utils_1 = require("../../utils");
|
|
42
42
|
var LocatorSymbols_1 = require("./LocatorSymbols");
|
|
43
43
|
var createAsyncMatcher_1 = require("../createAsyncMatcher");
|
|
44
|
-
exports.toHaveWarning = (0, createAsyncMatcher_1.
|
|
44
|
+
exports.toHaveWarning = (0, createAsyncMatcher_1.createSymbolMatcher)('toHaveWarning', LocatorSymbols_1.toRootElementLocator, function (_a, options_1) { return __awaiter(void 0, [_a, options_1], void 0, function (_b, options) {
|
|
45
45
|
var expectation;
|
|
46
46
|
var isNot = _b.isNot, locator = _b.locator;
|
|
47
47
|
return __generator(this, function (_c) {
|
|
@@ -48,6 +48,84 @@ declare const matchers: {
|
|
|
48
48
|
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
49
49
|
readonly toContainText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
50
50
|
readonly toContainFormattedText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated will be removed in the next major version
|
|
53
|
+
* @see {@link toBeVisible}
|
|
54
|
+
*/
|
|
55
|
+
readonly toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated will be removed in the next major version
|
|
58
|
+
* @see {@link toBeVisible}
|
|
59
|
+
*/
|
|
60
|
+
readonly toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
61
|
+
/**
|
|
62
|
+
* @deprecated will be removed in the next major version
|
|
63
|
+
* @see {@link toBeHidden}
|
|
64
|
+
*/
|
|
65
|
+
readonly toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated will be removed in the next major version
|
|
68
|
+
* @see {@link toBeEnabled}
|
|
69
|
+
*/
|
|
70
|
+
readonly toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated will be removed in the next major version
|
|
73
|
+
* @see {@link toBeDisabled}
|
|
74
|
+
*/
|
|
75
|
+
readonly toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated will be removed in the next major version
|
|
78
|
+
* @see {@link toBeFocused}
|
|
79
|
+
*/
|
|
80
|
+
readonly toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated will be removed in the next major version
|
|
83
|
+
* @see {@link toBeChecked}
|
|
84
|
+
*/
|
|
85
|
+
readonly toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated will be removed in the next major version
|
|
88
|
+
* @see {@link toHaveAttribute}
|
|
89
|
+
*/
|
|
90
|
+
readonly toHaveAttributeEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveAttributeElementLocator, args_0: string, args_1?: string | RegExp | undefined, args_2?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated will be removed in the next major version
|
|
93
|
+
* @see {@link toHaveValue}
|
|
94
|
+
*/
|
|
95
|
+
readonly toHaveValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
|
|
96
|
+
start?: string;
|
|
97
|
+
end?: string;
|
|
98
|
+
}, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated will be removed in the next major version
|
|
101
|
+
* @see {@link toHaveText}
|
|
102
|
+
*/
|
|
103
|
+
readonly toHaveTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated will be removed in the next major version
|
|
106
|
+
* @see {@link toHaveCount}
|
|
107
|
+
*/
|
|
108
|
+
readonly toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated will be removed in the next major version
|
|
111
|
+
* @see {@link toHaveFormattedValue}
|
|
112
|
+
*/
|
|
113
|
+
readonly toHaveFormattedValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated will be removed in the next major version
|
|
116
|
+
* @see {@link toHaveFormattedText}
|
|
117
|
+
*/
|
|
118
|
+
readonly toHaveFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated will be removed in the next major version
|
|
121
|
+
* @see {@link toContainText}
|
|
122
|
+
*/
|
|
123
|
+
readonly toContainTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated will be removed in the next major version
|
|
126
|
+
* @see {@link toContainFormattedText}
|
|
127
|
+
*/
|
|
128
|
+
readonly toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
51
129
|
};
|
|
52
130
|
export type ComponentMatchers = typeof matchers;
|
|
53
131
|
export declare const componentMatchers: import("@playwright/test").Expect<{
|
|
@@ -100,5 +178,83 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
|
|
|
100
178
|
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
101
179
|
readonly toContainText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
102
180
|
readonly toContainFormattedText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
181
|
+
/**
|
|
182
|
+
* @deprecated will be removed in the next major version
|
|
183
|
+
* @see {@link toBeVisible}
|
|
184
|
+
*/
|
|
185
|
+
readonly toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
186
|
+
/**
|
|
187
|
+
* @deprecated will be removed in the next major version
|
|
188
|
+
* @see {@link toBeVisible}
|
|
189
|
+
*/
|
|
190
|
+
readonly toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated will be removed in the next major version
|
|
193
|
+
* @see {@link toBeHidden}
|
|
194
|
+
*/
|
|
195
|
+
readonly toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated will be removed in the next major version
|
|
198
|
+
* @see {@link toBeEnabled}
|
|
199
|
+
*/
|
|
200
|
+
readonly toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
201
|
+
/**
|
|
202
|
+
* @deprecated will be removed in the next major version
|
|
203
|
+
* @see {@link toBeDisabled}
|
|
204
|
+
*/
|
|
205
|
+
readonly toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
206
|
+
/**
|
|
207
|
+
* @deprecated will be removed in the next major version
|
|
208
|
+
* @see {@link toBeFocused}
|
|
209
|
+
*/
|
|
210
|
+
readonly toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
211
|
+
/**
|
|
212
|
+
* @deprecated will be removed in the next major version
|
|
213
|
+
* @see {@link toBeChecked}
|
|
214
|
+
*/
|
|
215
|
+
readonly toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated will be removed in the next major version
|
|
218
|
+
* @see {@link toHaveAttribute}
|
|
219
|
+
*/
|
|
220
|
+
readonly toHaveAttributeEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveAttributeElementLocator, args_0: string, args_1?: string | RegExp | undefined, args_2?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
221
|
+
/**
|
|
222
|
+
* @deprecated will be removed in the next major version
|
|
223
|
+
* @see {@link toHaveValue}
|
|
224
|
+
*/
|
|
225
|
+
readonly toHaveValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
|
|
226
|
+
start?: string;
|
|
227
|
+
end?: string;
|
|
228
|
+
}, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
229
|
+
/**
|
|
230
|
+
* @deprecated will be removed in the next major version
|
|
231
|
+
* @see {@link toHaveText}
|
|
232
|
+
*/
|
|
233
|
+
readonly toHaveTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
234
|
+
/**
|
|
235
|
+
* @deprecated will be removed in the next major version
|
|
236
|
+
* @see {@link toHaveCount}
|
|
237
|
+
*/
|
|
238
|
+
readonly toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated will be removed in the next major version
|
|
241
|
+
* @see {@link toHaveFormattedValue}
|
|
242
|
+
*/
|
|
243
|
+
readonly toHaveFormattedValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
244
|
+
/**
|
|
245
|
+
* @deprecated will be removed in the next major version
|
|
246
|
+
* @see {@link toHaveFormattedText}
|
|
247
|
+
*/
|
|
248
|
+
readonly toHaveFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
249
|
+
/**
|
|
250
|
+
* @deprecated will be removed in the next major version
|
|
251
|
+
* @see {@link toContainText}
|
|
252
|
+
*/
|
|
253
|
+
readonly toContainTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
254
|
+
/**
|
|
255
|
+
* @deprecated will be removed in the next major version
|
|
256
|
+
* @see {@link toContainFormattedText}
|
|
257
|
+
*/
|
|
258
|
+
readonly toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
103
259
|
}>;
|
|
104
260
|
export {};
|
|
@@ -79,5 +79,80 @@ var matchers = {
|
|
|
79
79
|
toContainUploadedFiles: toContainUploadedFiles_1.toContainUploadedFiles,
|
|
80
80
|
toContainText: toContainText_1.toContainText,
|
|
81
81
|
toContainFormattedText: toContainFormattedText_1.toContainFormattedText,
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated will be removed in the next major version
|
|
84
|
+
* @see {@link toBeVisible}
|
|
85
|
+
*/
|
|
86
|
+
toBeEmptyEx: toBeEmpty_1.toBeEmpty,
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated will be removed in the next major version
|
|
89
|
+
* @see {@link toBeVisible}
|
|
90
|
+
*/
|
|
91
|
+
toBeVisibleEx: toBeVisible_1.toBeVisible,
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated will be removed in the next major version
|
|
94
|
+
* @see {@link toBeHidden}
|
|
95
|
+
*/
|
|
96
|
+
toBeHiddenEx: toBeHidden_1.toBeHidden,
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated will be removed in the next major version
|
|
99
|
+
* @see {@link toBeEnabled}
|
|
100
|
+
*/
|
|
101
|
+
toBeEnabledEx: toBeEnabled_1.toBeEnabled,
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated will be removed in the next major version
|
|
104
|
+
* @see {@link toBeDisabled}
|
|
105
|
+
*/
|
|
106
|
+
toBeDisabledEx: toBeDisabled_1.toBeDisabled,
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated will be removed in the next major version
|
|
109
|
+
* @see {@link toBeFocused}
|
|
110
|
+
*/
|
|
111
|
+
toBeFocusedEx: toBeFocused_1.toBeFocused,
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated will be removed in the next major version
|
|
114
|
+
* @see {@link toBeChecked}
|
|
115
|
+
*/
|
|
116
|
+
toBeCheckedEx: toBeChecked_1.toBeChecked,
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated will be removed in the next major version
|
|
119
|
+
* @see {@link toHaveAttribute}
|
|
120
|
+
*/
|
|
121
|
+
toHaveAttributeEx: toHaveAttribute_1.toHaveAttribute,
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated will be removed in the next major version
|
|
124
|
+
* @see {@link toHaveValue}
|
|
125
|
+
*/
|
|
126
|
+
toHaveValueEx: toHaveValue_1.toHaveValue,
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated will be removed in the next major version
|
|
129
|
+
* @see {@link toHaveText}
|
|
130
|
+
*/
|
|
131
|
+
toHaveTextEx: toHaveText_1.toHaveText,
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated will be removed in the next major version
|
|
134
|
+
* @see {@link toHaveCount}
|
|
135
|
+
*/
|
|
136
|
+
toHaveCountEx: toHaveCount_1.toHaveCount,
|
|
137
|
+
/**
|
|
138
|
+
* @deprecated will be removed in the next major version
|
|
139
|
+
* @see {@link toHaveFormattedValue}
|
|
140
|
+
*/
|
|
141
|
+
toHaveFormattedValueEx: toHaveFormattedValue_1.toHaveFormattedValue,
|
|
142
|
+
/**
|
|
143
|
+
* @deprecated will be removed in the next major version
|
|
144
|
+
* @see {@link toHaveFormattedText}
|
|
145
|
+
*/
|
|
146
|
+
toHaveFormattedTextEx: toHaveFormattedText_1.toHaveFormattedText,
|
|
147
|
+
/**
|
|
148
|
+
* @deprecated will be removed in the next major version
|
|
149
|
+
* @see {@link toContainText}
|
|
150
|
+
*/
|
|
151
|
+
toContainTextEx: toContainText_1.toContainText,
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated will be removed in the next major version
|
|
154
|
+
* @see {@link toContainFormattedText}
|
|
155
|
+
*/
|
|
156
|
+
toContainFormattedTextEx: toContainFormattedText_1.toContainFormattedText,
|
|
82
157
|
};
|
|
83
158
|
exports.componentMatchers = test_1.expect.extend(matchers);
|
|
@@ -22,8 +22,8 @@ export interface CreateMatcherLogicParams<TComponent> {
|
|
|
22
22
|
* - Component - тип компонента
|
|
23
23
|
* - TArgs - массив аргументов матчера
|
|
24
24
|
*
|
|
25
|
-
* const
|
|
26
|
-
* '
|
|
25
|
+
* const toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
|
|
26
|
+
* 'toExampleEx',
|
|
27
27
|
* component => component.rootLocator,
|
|
28
28
|
* async ({ isNot, locator, component }, options) => {
|
|
29
29
|
* await component.waitFor();
|
|
@@ -34,6 +34,42 @@ export interface CreateMatcherLogicParams<TComponent> {
|
|
|
34
34
|
* );
|
|
35
35
|
*/
|
|
36
36
|
export declare function createComponentAsyncMatcher<TComponent, TArgs extends unknown[]>(matcherName: string, getLocator: (component: TComponent) => LocatorType, createMatcherLogicAsync: (params: CreateMatcherLogicParams<TComponent>, ...args: TArgs) => Promise<void>, createExpectMessage?: (isNot: boolean, ...args: TArgs) => string): (this: ExpectMatcherState, component: TComponent, ...args: TArgs) => Promise<MatcherReturnType>;
|
|
37
|
+
/**
|
|
38
|
+
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* @param matcherName - уникальное имя матчера
|
|
42
|
+
* @param getLocator - функция для получения локатора
|
|
43
|
+
* @param createMatcherLogicAsync - асинхронная функция для создания логики матчера
|
|
44
|
+
* @param createExpectMessage - функция для создания сообщения для ожидания
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* export type ToExampleExLocator = {
|
|
48
|
+
* [toExampleExLocator]: () => Locator;
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* export const toExampleExLocator = Symbol.for('toExampleExLocator');
|
|
52
|
+
*
|
|
53
|
+
* Дженерик аргументы:
|
|
54
|
+
*
|
|
55
|
+
* createAsyncMatcher<TLocatorSymbolInterface, TArgs, Component>
|
|
56
|
+
* - TLocatorSymbolInterface - тип с символом локатора
|
|
57
|
+
* - TArgs - массив аргументов матчера
|
|
58
|
+
* - TComponent - тип компонента
|
|
59
|
+
*
|
|
60
|
+
*
|
|
61
|
+
* const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
|
|
62
|
+
* 'toExampleEx',
|
|
63
|
+
* component => component[toExampleExLocator](),
|
|
64
|
+
* async ({ isNot, locator, component }, options) => {
|
|
65
|
+
* await component.waitFor();
|
|
66
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
67
|
+
* await expectation.toBeEmpty();
|
|
68
|
+
* },
|
|
69
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
70
|
+
* );
|
|
71
|
+
*/
|
|
72
|
+
export declare function createAsyncMatcher<TLocatorSymbolInterface extends Record<symbol, LocatorTypeFn>, TArgs extends unknown[], TComponent = unknown>(matcherName: string, getLocator: (component: TComponent & TLocatorSymbolInterface) => LocatorType, createMatcherLogicAsync: (params: CreateMatcherLogicParams<TComponent>, ...args: TArgs) => Promise<void>, createExpectMessage?: (isNot: boolean, ...args: TArgs) => string): (this: ExpectMatcherState, component: TComponent & TLocatorSymbolInterface, ...args: TArgs) => Promise<MatcherReturnType>;
|
|
37
73
|
/**
|
|
38
74
|
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
39
75
|
*
|
|
@@ -52,13 +88,13 @@ export declare function createComponentAsyncMatcher<TComponent, TArgs extends un
|
|
|
52
88
|
*
|
|
53
89
|
* Дженерик аргументы:
|
|
54
90
|
*
|
|
55
|
-
*
|
|
91
|
+
* createSymbolMatcher<TLocatorSymbolInterface, TArgs, Component>
|
|
56
92
|
* - TLocatorSymbolInterface - тип с символом локатора
|
|
57
93
|
* - TArgs - массив аргументов матчера
|
|
58
94
|
* - TComponent - тип компонента
|
|
59
95
|
*
|
|
60
96
|
*
|
|
61
|
-
* const toExample =
|
|
97
|
+
* const toExample = createSymbolMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
|
|
62
98
|
* 'toExample',
|
|
63
99
|
* toExampleExLocator,
|
|
64
100
|
* async ({ isNot, locator, component }, options) => {
|
|
@@ -69,4 +105,4 @@ export declare function createComponentAsyncMatcher<TComponent, TArgs extends un
|
|
|
69
105
|
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
70
106
|
* );
|
|
71
107
|
*/
|
|
72
|
-
export declare function
|
|
108
|
+
export declare function createSymbolMatcher<TLocatorSymbolInterface extends Record<symbol, LocatorTypeFn>, TArgs extends unknown[], TComponent = unknown>(matcherName: string, componentSymbol: symbol, createMatcherLogicAsync: (params: CreateMatcherLogicParams<TComponent>, ...args: TArgs) => Promise<void>, createExpectMessage?: (isNot: boolean, ...args: TArgs) => string): (this: ExpectMatcherState, component: TComponent & TLocatorSymbolInterface, ...args: TArgs) => Promise<MatcherReturnType>;
|
|
@@ -47,6 +47,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
48
|
exports.createComponentAsyncMatcher = createComponentAsyncMatcher;
|
|
49
49
|
exports.createAsyncMatcher = createAsyncMatcher;
|
|
50
|
+
exports.createSymbolMatcher = createSymbolMatcher;
|
|
50
51
|
var utils_1 = require("../utils");
|
|
51
52
|
var utils_2 = require("../utils");
|
|
52
53
|
/**
|
|
@@ -66,8 +67,8 @@ var utils_2 = require("../utils");
|
|
|
66
67
|
* - Component - тип компонента
|
|
67
68
|
* - TArgs - массив аргументов матчера
|
|
68
69
|
*
|
|
69
|
-
* const
|
|
70
|
-
* '
|
|
70
|
+
* const toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
|
|
71
|
+
* 'toExampleEx',
|
|
71
72
|
* component => component.rootLocator,
|
|
72
73
|
* async ({ isNot, locator, component }, options) => {
|
|
73
74
|
* await component.waitFor();
|
|
@@ -110,6 +111,74 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
|
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* @param matcherName - уникальное имя матчера
|
|
119
|
+
* @param getLocator - функция для получения локатора
|
|
120
|
+
* @param createMatcherLogicAsync - асинхронная функция для создания логики матчера
|
|
121
|
+
* @param createExpectMessage - функция для создания сообщения для ожидания
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* export type ToExampleExLocator = {
|
|
125
|
+
* [toExampleExLocator]: () => Locator;
|
|
126
|
+
* }
|
|
127
|
+
*
|
|
128
|
+
* export const toExampleExLocator = Symbol.for('toExampleExLocator');
|
|
129
|
+
*
|
|
130
|
+
* Дженерик аргументы:
|
|
131
|
+
*
|
|
132
|
+
* createAsyncMatcher<TLocatorSymbolInterface, TArgs, Component>
|
|
133
|
+
* - TLocatorSymbolInterface - тип с символом локатора
|
|
134
|
+
* - TArgs - массив аргументов матчера
|
|
135
|
+
* - TComponent - тип компонента
|
|
136
|
+
*
|
|
137
|
+
*
|
|
138
|
+
* const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
|
|
139
|
+
* 'toExampleEx',
|
|
140
|
+
* component => component[toExampleExLocator](),
|
|
141
|
+
* async ({ isNot, locator, component }, options) => {
|
|
142
|
+
* await component.waitFor();
|
|
143
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
144
|
+
* await expectation.toBeEmpty();
|
|
145
|
+
* },
|
|
146
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
147
|
+
* );
|
|
148
|
+
*/
|
|
149
|
+
function createAsyncMatcher(matcherName, getLocator, createMatcherLogicAsync, createExpectMessage) {
|
|
150
|
+
return function matcher(component) {
|
|
151
|
+
var args = [];
|
|
152
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
153
|
+
args[_i - 1] = arguments[_i];
|
|
154
|
+
}
|
|
155
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
var _this = this;
|
|
158
|
+
return __generator(this, function (_c) {
|
|
159
|
+
switch (_c.label) {
|
|
160
|
+
case 0:
|
|
161
|
+
_a = utils_2.toMatchMessage;
|
|
162
|
+
_b = [this,
|
|
163
|
+
matcherName];
|
|
164
|
+
return [4 /*yield*/, getLocator(component)];
|
|
165
|
+
case 1: return [2 /*return*/, _a.apply(void 0, _b.concat([_c.sent(), function (isNot, locator) {
|
|
166
|
+
return (0, utils_1.makeMatcher)(isNot, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
167
|
+
return __generator(this, function (_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0: return [4 /*yield*/, createMatcherLogicAsync.apply(void 0, __spreadArray([{ isNot: isNot, locator: locator, component: component }], args, false))];
|
|
170
|
+
case 1:
|
|
171
|
+
_a.sent();
|
|
172
|
+
return [2 /*return*/];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}); });
|
|
176
|
+
}, createExpectMessage === null || createExpectMessage === void 0 ? void 0 : createExpectMessage.apply(void 0, __spreadArray([this.isNot], args, false))]))];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
}
|
|
113
182
|
/**
|
|
114
183
|
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
115
184
|
*
|
|
@@ -128,13 +197,13 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
|
|
|
128
197
|
*
|
|
129
198
|
* Дженерик аргументы:
|
|
130
199
|
*
|
|
131
|
-
*
|
|
200
|
+
* createSymbolMatcher<TLocatorSymbolInterface, TArgs, Component>
|
|
132
201
|
* - TLocatorSymbolInterface - тип с символом локатора
|
|
133
202
|
* - TArgs - массив аргументов матчера
|
|
134
203
|
* - TComponent - тип компонента
|
|
135
204
|
*
|
|
136
205
|
*
|
|
137
|
-
* const toExample =
|
|
206
|
+
* const toExample = createSymbolMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
|
|
138
207
|
* 'toExample',
|
|
139
208
|
* toExampleExLocator,
|
|
140
209
|
* async ({ isNot, locator, component }, options) => {
|
|
@@ -145,7 +214,7 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
|
|
|
145
214
|
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
146
215
|
* );
|
|
147
216
|
*/
|
|
148
|
-
function
|
|
217
|
+
function createSymbolMatcher(matcherName, componentSymbol, createMatcherLogicAsync, createExpectMessage) {
|
|
149
218
|
return function matcher(component) {
|
|
150
219
|
var args = [];
|
|
151
220
|
for (var _i = 1; _i < arguments.length; _i++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skbkontur/playwright-react-ui-components",
|
|
3
|
-
"version": "1.15.0
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Пакет для взаимодействия с компонентами @skbkontur/react-ui при тестировании с помощью Playwright",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"files": [
|