@skbkontur/playwright-react-ui-components 1.18.0 → 1.19.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.
Files changed (83) hide show
  1. package/build/src/assertions/ComponentListAssertions.d.ts +6 -1
  2. package/build/src/assertions/ComponentListAssertions.js +60 -0
  3. package/build/src/assertions/FileUploaderAssertions.d.ts +2 -4
  4. package/build/src/assertions/PagingAssertions.d.ts +2 -2
  5. package/build/src/assertions/TabsAssertions.d.ts +5 -3
  6. package/build/src/assertions/TabsAssertions.js +36 -0
  7. package/build/src/assertions/TokenInputAssertions.d.ts +5 -4
  8. package/build/src/assertions/TokenInputAssertions.js +36 -0
  9. package/build/src/components/Autocomplete.js +3 -3
  10. package/build/src/components/BaseComponent.js +3 -3
  11. package/build/src/components/Button.d.ts +2 -1
  12. package/build/src/components/Button.js +35 -1
  13. package/build/src/components/Checkbox.js +1 -1
  14. package/build/src/components/ComboBox.d.ts +7 -3
  15. package/build/src/components/ComboBox.js +21 -19
  16. package/build/src/components/ComponentList.d.ts +5 -2
  17. package/build/src/components/ComponentList.js +38 -32
  18. package/build/src/components/CurrencyInput.js +5 -5
  19. package/build/src/components/DateInput.js +4 -4
  20. package/build/src/components/DatePicker.js +5 -5
  21. package/build/src/components/Dropdown.d.ts +9 -3
  22. package/build/src/components/Dropdown.js +22 -32
  23. package/build/src/components/DropdownMenu.d.ts +12 -3
  24. package/build/src/components/DropdownMenu.js +24 -34
  25. package/build/src/components/FileUploader.js +6 -19
  26. package/build/src/components/FxInput.js +4 -4
  27. package/build/src/components/Input.js +3 -3
  28. package/build/src/components/Kebab.d.ts +12 -4
  29. package/build/src/components/Kebab.js +16 -16
  30. package/build/src/components/Link.js +1 -1
  31. package/build/src/components/MenuComponent.d.ts +3 -1
  32. package/build/src/components/Paging.d.ts +4 -4
  33. package/build/src/components/Paging.js +22 -24
  34. package/build/src/components/Portal.d.ts +3 -1
  35. package/build/src/components/Portal.js +5 -5
  36. package/build/src/components/Radio.js +1 -1
  37. package/build/src/components/RadioGroup.d.ts +6 -5
  38. package/build/src/components/RadioGroup.js +12 -36
  39. package/build/src/components/Select.d.ts +9 -3
  40. package/build/src/components/Select.js +21 -21
  41. package/build/src/components/Tab.js +1 -1
  42. package/build/src/components/Tabs.d.ts +3 -3
  43. package/build/src/components/Tabs.js +3 -38
  44. package/build/src/components/Textarea.js +3 -3
  45. package/build/src/components/Toggle.js +1 -1
  46. package/build/src/components/Token.d.ts +1 -1
  47. package/build/src/components/Token.js +2 -2
  48. package/build/src/components/TokenInput.d.ts +5 -3
  49. package/build/src/components/TokenInput.js +27 -39
  50. package/build/src/components/Tooltip.d.ts +3 -1
  51. package/build/src/components/Tooltip.js +3 -3
  52. package/build/src/matchers/component/toBeCheckedByIndex.js +9 -10
  53. package/build/src/matchers/component/toBeCheckedByText.js +9 -10
  54. package/build/src/matchers/component/toBeUncheckedByIndex.js +9 -10
  55. package/build/src/matchers/component/toBeUncheckedByText.js +3 -4
  56. package/build/src/matchers/component/toContainFormattedText.js +2 -3
  57. package/build/src/matchers/component/toContainItem.d.ts +1 -2
  58. package/build/src/matchers/component/toContainItem.js +30 -32
  59. package/build/src/matchers/component/toContainTab.d.ts +3 -0
  60. package/build/src/matchers/component/toContainTab.js +59 -0
  61. package/build/src/matchers/component/toContainTabs.d.ts +1 -1
  62. package/build/src/matchers/component/toContainTabs.js +2 -20
  63. package/build/src/matchers/component/toContainToken.d.ts +3 -0
  64. package/build/src/matchers/component/toContainToken.js +59 -0
  65. package/build/src/matchers/component/toContainTokens.d.ts +2 -2
  66. package/build/src/matchers/component/toContainTokens.js +2 -20
  67. package/build/src/matchers/component/toContainUploadedFiles.d.ts +2 -3
  68. package/build/src/matchers/component/toContainUploadedFiles.js +2 -15
  69. package/build/src/matchers/component/toHaveActivePage.d.ts +2 -2
  70. package/build/src/matchers/component/toHaveActivePage.js +5 -21
  71. package/build/src/matchers/component/toHaveActiveTab.js +9 -10
  72. package/build/src/matchers/component/toHaveFormattedText.js +2 -3
  73. package/build/src/matchers/component/toHaveFormattedValue.js +2 -3
  74. package/build/src/matchers/component/toHaveItemsByPredicate.d.ts +3 -0
  75. package/build/src/matchers/component/toHaveItemsByPredicate.js +64 -0
  76. package/build/src/matchers/component/toHaveTabs.d.ts +3 -0
  77. package/build/src/matchers/component/toHaveTabs.js +62 -0
  78. package/build/src/matchers/component/toHaveTokens.d.ts +3 -0
  79. package/build/src/matchers/component/toHaveTokens.js +62 -0
  80. package/build/src/matchers/componentMatchers.d.ts +14 -8
  81. package/build/src/matchers/componentMatchers.js +10 -0
  82. package/build/src/options/LocatorOptions.d.ts +39 -0
  83. package/package.json +1 -1
@@ -0,0 +1,64 @@
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.toHaveItemsByPredicate = void 0;
40
+ var extensions_1 = require("../../extensions");
41
+ var createAsyncMatcher_1 = require("../createAsyncMatcher");
42
+ exports.toHaveItemsByPredicate = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveItemsByPredicate', function (component) { return component.itemsLocator; }, function (_a, itemsText_1, selector_1, options_1) { return __awaiter(void 0, [_a, itemsText_1, selector_1, options_1], void 0, function (_b, itemsText, selector, options) {
43
+ var locators, itemsLocator;
44
+ var component = _b.component;
45
+ return __generator(this, function (_c) {
46
+ switch (_c.label) {
47
+ case 0:
48
+ if (itemsText.length === 0) {
49
+ throw new Error('itemsText не должен быть пустым');
50
+ }
51
+ return [4 /*yield*/, (0, extensions_1.expect)(component).toHaveCount(itemsText.length, {
52
+ timeout: options === null || options === void 0 ? void 0 : options.timeout,
53
+ })];
54
+ case 1:
55
+ _c.sent();
56
+ locators = Array.from({ length: itemsText.length }, function (_, i) { return selector(component.getItemByIndex(i)).rootLocator; });
57
+ itemsLocator = locators.slice(1).reduce(function (current, next) { return current.or(next); }, locators[0]);
58
+ return [4 /*yield*/, (0, extensions_1.expect)(itemsLocator).toHaveText(itemsText, options)];
59
+ case 2:
60
+ _c.sent();
61
+ return [2 /*return*/];
62
+ }
63
+ });
64
+ }); });
@@ -0,0 +1,3 @@
1
+ import type { Tabs } from '../../components';
2
+ import type { TextOptions } from '../../options';
3
+ export declare const toHaveTabs: (this: import("playwright/test").ExpectMatcherState, component: Tabs, args_0: string[], args_1?: TextOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.toHaveTabs = void 0;
40
+ var createAsyncMatcher_1 = require("../createAsyncMatcher");
41
+ var extensions_1 = require("../../extensions");
42
+ exports.toHaveTabs = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveTabs', function (component) { return component.list.itemsLocator; }, function (_a, expectedTabs_1, options_1) { return __awaiter(void 0, [_a, expectedTabs_1, options_1], void 0, function (_b, expectedTabs, options) {
43
+ var isNot = _b.isNot, component = _b.component;
44
+ return __generator(this, function (_c) {
45
+ switch (_c.label) {
46
+ case 0:
47
+ if (isNot) {
48
+ /** NOTE:
49
+ * Пример: в list лежит массив [Tab1, Tab2, Tab3]
50
+ * При проверке await expect(tabs).not.toHaveTabs([Tab1]); проверка пройдет.
51
+ * Потому что действительно, такого массива нету в list, есть массив [Tab1, Tab2, Tab3], но должен быть массив [Tab1]
52
+ * Поэтому нельзя использовать not assertion
53
+ */
54
+ throw new Error('not implemented toHaveTabs not assertion');
55
+ }
56
+ return [4 /*yield*/, (0, extensions_1.expect)(component.list).toHaveItems(expectedTabs, options)];
57
+ case 1:
58
+ _c.sent();
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); });
@@ -0,0 +1,3 @@
1
+ import type { TokenInput } from '../../components';
2
+ import type { TextOptions } from '../../options';
3
+ export declare const toHaveTokens: (this: import("playwright/test").ExpectMatcherState, component: TokenInput, args_0: string[], args_1?: TextOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.toHaveTokens = void 0;
40
+ var createAsyncMatcher_1 = require("../createAsyncMatcher");
41
+ var extensions_1 = require("../../extensions");
42
+ exports.toHaveTokens = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toHaveTokens', function (component) { return component.tokens.itemsLocator; }, function (_a, expectedTokens_1, options_1) { return __awaiter(void 0, [_a, expectedTokens_1, options_1], void 0, function (_b, expectedTokens, options) {
43
+ var isNot = _b.isNot, component = _b.component;
44
+ return __generator(this, function (_c) {
45
+ switch (_c.label) {
46
+ case 0:
47
+ if (isNot) {
48
+ /** NOTE:
49
+ * Пример: в tokens лежит массив [Token1, Token2, Token3]
50
+ * При проверке await expect(tokens).not.toHaveTokens([Token11]); проверка пройдет.
51
+ * Потому что действительно, такого массива нету в tokens, есть массив [Token11, Token12, Token13], но должен быть массив [Token11]
52
+ * Поэтому нельзя использовать not assertion
53
+ */
54
+ throw new Error('not implemented toHaveTokens not assertion');
55
+ }
56
+ return [4 /*yield*/, (0, extensions_1.expect)(component.tokens).toHaveItems(expectedTokens, options)];
57
+ case 1:
58
+ _c.sent();
59
+ return [2 /*return*/];
60
+ }
61
+ });
62
+ }); });
@@ -25,6 +25,8 @@ declare const matchers: {
25
25
  readonly toHaveCount: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
26
26
  readonly toHaveHref: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Link, args_0: string | RegExp, args_1?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
27
27
  readonly toHaveItems: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
28
+ readonly toHaveItemsByPredicate: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: string[], args_1: (item: any) => import("..").BaseComponent, args_2?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
29
+ readonly toHaveTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
28
30
  readonly toHaveError: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
29
31
  readonly toHaveWarning: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
30
32
  readonly toHaveActiveTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string | RegExp) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -37,17 +39,18 @@ declare const matchers: {
37
39
  readonly toHaveFormattedValue: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
38
40
  readonly toHaveFormattedText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
39
41
  readonly toContainItems: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
40
- readonly toContainItem: (this: import("@playwright/test").ExpectMatcherState, component: import("..").MenuComponent & import("./component/LocatorSymbols").ToContainItemElementLocator, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
42
+ readonly toContainItem: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToContainItemElementLocator, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
41
43
  readonly toContainTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
42
44
  timeout?: number;
43
45
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
44
46
  readonly toContainTabs: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
47
+ readonly toContainTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
45
48
  readonly toContainSelectValue: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Select, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
46
- readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
47
- timeout?: number;
48
- } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
49
+ readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
49
50
  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
51
  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>;
52
+ readonly toHaveTabs: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
53
+ readonly toContainToken: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
51
54
  /**
52
55
  * @deprecated will be removed in the next major version
53
56
  * @see {@link toBeVisible}
@@ -155,6 +158,8 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
155
158
  readonly toHaveCount: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
156
159
  readonly toHaveHref: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Link, args_0: string | RegExp, args_1?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
157
160
  readonly toHaveItems: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
161
+ readonly toHaveItemsByPredicate: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: string[], args_1: (item: any) => import("..").BaseComponent, args_2?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
162
+ readonly toHaveTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
158
163
  readonly toHaveError: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
159
164
  readonly toHaveWarning: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
160
165
  readonly toHaveActiveTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string | RegExp) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -167,17 +172,18 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
167
172
  readonly toHaveFormattedValue: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
168
173
  readonly toHaveFormattedText: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
169
174
  readonly toContainItems: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
170
- readonly toContainItem: (this: import("@playwright/test").ExpectMatcherState, component: import("..").MenuComponent & import("./component/LocatorSymbols").ToContainItemElementLocator, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
175
+ readonly toContainItem: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToContainItemElementLocator, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
171
176
  readonly toContainTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
172
177
  timeout?: number;
173
178
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
174
179
  readonly toContainTabs: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
180
+ readonly toContainTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
175
181
  readonly toContainSelectValue: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Select, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
176
- readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
177
- timeout?: number;
178
- } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
182
+ readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
179
183
  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>;
180
184
  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>;
185
+ readonly toHaveTabs: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
186
+ readonly toContainToken: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string, args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
181
187
  /**
182
188
  * @deprecated will be removed in the next major version
183
189
  * @see {@link toBeVisible}
@@ -26,6 +26,7 @@ var toHaveCount_1 = require("./component/toHaveCount");
26
26
  var toHaveFormattedValue_1 = require("./component/toHaveFormattedValue");
27
27
  var toHaveFormattedText_1 = require("./component/toHaveFormattedText");
28
28
  var toHaveItems_1 = require("./component/toHaveItems");
29
+ var toHaveItemsByPredicate_1 = require("./component/toHaveItemsByPredicate");
29
30
  var toHaveError_1 = require("./component/toHaveError");
30
31
  var toHaveWarning_1 = require("./component/toHaveWarning");
31
32
  var toHaveActiveTab_1 = require("./component/toHaveActiveTab");
@@ -39,7 +40,11 @@ var toContainItem_1 = require("./component/toContainItem");
39
40
  var toContainUploadedFiles_1 = require("./component/toContainUploadedFiles");
40
41
  var toContainTokens_1 = require("./component/toContainTokens");
41
42
  var toContainTabs_1 = require("./component/toContainTabs");
43
+ var toContainTab_1 = require("./component/toContainTab");
42
44
  var toContainSelectValue_1 = require("./component/toContainSelectValue");
45
+ var toHaveTabs_1 = require("./component/toHaveTabs");
46
+ var toHaveTokens_1 = require("./component/toHaveTokens");
47
+ var toContainToken_1 = require("./component/toContainToken");
43
48
  var matchers = {
44
49
  toBeEmpty: toBeEmpty_1.toBeEmpty,
45
50
  toBeVisible: toBeVisible_1.toBeVisible,
@@ -64,6 +69,8 @@ var matchers = {
64
69
  toHaveCount: toHaveCount_1.toHaveCount,
65
70
  toHaveHref: toHaveHref_1.toHaveHref,
66
71
  toHaveItems: toHaveItems_1.toHaveItems,
72
+ toHaveItemsByPredicate: toHaveItemsByPredicate_1.toHaveItemsByPredicate,
73
+ toHaveTokens: toHaveTokens_1.toHaveTokens,
67
74
  toHaveError: toHaveError_1.toHaveError,
68
75
  toHaveWarning: toHaveWarning_1.toHaveWarning,
69
76
  toHaveActiveTab: toHaveActiveTab_1.toHaveActiveTab,
@@ -75,10 +82,13 @@ var matchers = {
75
82
  toContainItem: toContainItem_1.toContainItem,
76
83
  toContainTokens: toContainTokens_1.toContainTokens,
77
84
  toContainTabs: toContainTabs_1.toContainTabs,
85
+ toContainTab: toContainTab_1.toContainTab,
78
86
  toContainSelectValue: toContainSelectValue_1.toContainSelectValue,
79
87
  toContainUploadedFiles: toContainUploadedFiles_1.toContainUploadedFiles,
80
88
  toContainText: toContainText_1.toContainText,
81
89
  toContainFormattedText: toContainFormattedText_1.toContainFormattedText,
90
+ toHaveTabs: toHaveTabs_1.toHaveTabs,
91
+ toContainToken: toContainToken_1.toContainToken,
82
92
  /**
83
93
  * @deprecated will be removed in the next major version
84
94
  * @see {@link toBeVisible}
@@ -1,3 +1,4 @@
1
+ import type { Locator } from '@playwright/test';
1
2
  export type IsDisabledOptions = {
2
3
  /**
3
4
  * Maximum time in milliseconds. Defaults to `0` - no timeout. The default value can be changed via `actionTimeout`
@@ -340,3 +341,41 @@ export type SetInputFilesOptions = {
340
341
  */
341
342
  timeout?: number;
342
343
  };
344
+ export type FilterOptions = {
345
+ /**
346
+ * Narrows down the results of the method to those which contain elements matching this relative locator. For example,
347
+ * `article` that has `text=Playwright` matches `<article><div>Playwright</div></article>`.
348
+ *
349
+ * Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not
350
+ * the document root. For example, you can find `content` that has `div` in
351
+ * `<article><content><div>Playwright</div></content></article>`. However, looking for `content` that has `article
352
+ * div` will fail, because the inner locator must be relative and should not use any elements outside the `content`.
353
+ *
354
+ * Note that outer and inner locators must belong to the same frame. Inner locator must not contain
355
+ * [FrameLocator](https://playwright.dev/docs/api/class-framelocator)s.
356
+ */
357
+ has?: Locator;
358
+ /**
359
+ * Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
360
+ * outer one. For example, `article` that does not have `div` matches `<article><span>Playwright</span></article>`.
361
+ *
362
+ * Note that outer and inner locators must belong to the same frame. Inner locator must not contain
363
+ * [FrameLocator](https://playwright.dev/docs/api/class-framelocator)s.
364
+ */
365
+ hasNot?: Locator;
366
+ /**
367
+ * Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element.
368
+ * When passed a [string], matching is case-insensitive and searches for a substring.
369
+ */
370
+ hasNotText?: string | RegExp;
371
+ /**
372
+ * Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When
373
+ * passed a [string], matching is case-insensitive and searches for a substring. For example, `"Playwright"` matches
374
+ * `<article><div>Playwright</div></article>`.
375
+ */
376
+ hasText?: string | RegExp;
377
+ /**
378
+ * Only matches visible or invisible elements.
379
+ */
380
+ visible?: boolean;
381
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/playwright-react-ui-components",
3
- "version": "1.18.0",
3
+ "version": "1.19.0-beta.1",
4
4
  "description": "Пакет для взаимодействия с компонентами @skbkontur/react-ui при тестировании с помощью Playwright",
5
5
  "main": "build/index.js",
6
6
  "files": [