@skbkontur/playwright-react-ui-components 1.14.2 → 1.15.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 (106) hide show
  1. package/build/src/assertions/AutocompleteAssertions.js +9 -9
  2. package/build/src/assertions/ButtonAssertions.js +8 -8
  3. package/build/src/assertions/CheckboxAssertions.js +11 -11
  4. package/build/src/assertions/ComboBoxAssertions.js +8 -8
  5. package/build/src/assertions/ComponentListAssertions.js +5 -5
  6. package/build/src/assertions/CurrencyInputAssertions.js +8 -8
  7. package/build/src/assertions/DateInputAssertions.js +8 -8
  8. package/build/src/assertions/DatePickerAssertions.js +8 -8
  9. package/build/src/assertions/DateRangePickerAssertions.js +2 -2
  10. package/build/src/assertions/DropdownAssertions.js +8 -8
  11. package/build/src/assertions/DropdownMenuAssertions.js +4 -4
  12. package/build/src/assertions/FileUploaderAssertions.js +2 -2
  13. package/build/src/assertions/FxInputAssertions.js +8 -8
  14. package/build/src/assertions/InputAssertions.js +9 -9
  15. package/build/src/assertions/KebabAssertions.js +2 -2
  16. package/build/src/assertions/LabelAssertions.js +6 -6
  17. package/build/src/assertions/LinkAssertions.js +8 -8
  18. package/build/src/assertions/LoaderAssertions.js +1 -1
  19. package/build/src/assertions/MenuItemAssertations.js +4 -4
  20. package/build/src/assertions/PagingAssertions.js +2 -2
  21. package/build/src/assertions/PortalAssertions.js +2 -2
  22. package/build/src/assertions/RadioAssertions.js +12 -12
  23. package/build/src/assertions/RadioGroupAssertions.js +2 -2
  24. package/build/src/assertions/SelectAssertions.js +6 -6
  25. package/build/src/assertions/SpinnerAssertions.js +1 -1
  26. package/build/src/assertions/TabAssertions.js +8 -8
  27. package/build/src/assertions/TextareaAssertions.js +8 -8
  28. package/build/src/assertions/ToastAssertions.js +1 -1
  29. package/build/src/assertions/ToggleAssertions.js +10 -10
  30. package/build/src/assertions/TokenAssertions.js +7 -7
  31. package/build/src/assertions/TokenInputAssertions.js +6 -6
  32. package/build/src/assertions/TooltipAssertions.js +4 -4
  33. package/build/src/extensions/mergedExpects.d.ts +1 -2
  34. package/build/src/extensions/mergedExpects.js +1 -2
  35. package/build/src/matchers/component/toBeChecked.d.ts +3 -0
  36. package/build/src/matchers/component/{toBeCheckedEx.js → toBeChecked.js} +2 -2
  37. package/build/src/matchers/component/toBeCheckedByIndex.js +2 -2
  38. package/build/src/matchers/component/toBeCheckedByText.js +2 -2
  39. package/build/src/matchers/component/toBeCheckedByValue.js +2 -2
  40. package/build/src/matchers/component/toBeDisabled.d.ts +3 -0
  41. package/build/src/matchers/component/{toBeDisabledEx.js → toBeDisabled.js} +5 -5
  42. package/build/src/matchers/component/toBeEmpty.d.ts +3 -0
  43. package/build/src/matchers/component/{toBeEmptyEx.js → toBeEmpty.js} +4 -4
  44. package/build/src/matchers/component/toBeEnabled.d.ts +3 -0
  45. package/build/src/matchers/component/{toBeEnabledEx.js → toBeEnabled.js} +4 -4
  46. package/build/src/matchers/component/toBeFocused.d.ts +3 -0
  47. package/build/src/matchers/component/{toBeFocusedEx.js → toBeFocused.js} +2 -2
  48. package/build/src/matchers/component/toBeHidden.d.ts +3 -0
  49. package/build/src/matchers/component/{toBeHiddenEx.js → toBeHidden.js} +2 -2
  50. package/build/src/matchers/component/toBeUnchecked.js +1 -1
  51. package/build/src/matchers/component/toBeVisible.d.ts +3 -0
  52. package/build/src/matchers/component/{toBeVisibleEx.js → toBeVisible.js} +2 -2
  53. package/build/src/matchers/component/toContainFormattedText.d.ts +3 -0
  54. package/build/src/matchers/component/toContainFormattedText.js +77 -0
  55. package/build/src/matchers/component/toContainItem.d.ts +1 -1
  56. package/build/src/matchers/component/toContainItem.js +2 -1
  57. package/build/src/matchers/component/toContainItems.js +1 -1
  58. package/build/src/matchers/component/toContainTabs.js +2 -2
  59. package/build/src/matchers/component/toContainText.d.ts +3 -0
  60. package/build/src/matchers/component/{toContainTextEx.js → toContainText.js} +2 -2
  61. package/build/src/matchers/component/toContainTokens.js +2 -2
  62. package/build/src/matchers/component/toContainUploadedFiles.js +2 -2
  63. package/build/src/matchers/component/toHaveAttribute.d.ts +3 -0
  64. package/build/src/matchers/component/{toHaveAttributeEx.js → toHaveAttribute.js} +2 -2
  65. package/build/src/matchers/component/toHaveCount.d.ts +3 -0
  66. package/build/src/matchers/component/{toHaveCountEx.js → toHaveCount.js} +2 -2
  67. package/build/src/matchers/component/toHaveError.js +1 -1
  68. package/build/src/matchers/component/toHaveFormattedText.d.ts +3 -0
  69. package/build/src/matchers/component/toHaveFormattedText.js +77 -0
  70. package/build/src/matchers/component/toHaveFormattedValue.d.ts +3 -0
  71. package/build/src/matchers/component/toHaveFormattedValue.js +77 -0
  72. package/build/src/matchers/component/toHaveItems.js +1 -1
  73. package/build/src/matchers/component/toHaveText.d.ts +3 -0
  74. package/build/src/matchers/component/{toHaveTextEx.js → toHaveText.js} +2 -2
  75. package/build/src/matchers/component/{toHaveValueEx.d.ts → toHaveValue.d.ts} +1 -1
  76. package/build/src/matchers/component/{toHaveValueEx.js → toHaveValue.js} +6 -6
  77. package/build/src/matchers/component/toHaveWarning.js +1 -1
  78. package/build/src/matchers/componentMatchers.d.ts +36 -36
  79. package/build/src/matchers/componentMatchers.js +42 -48
  80. package/build/src/matchers/createAsyncMatcher.d.ts +10 -10
  81. package/build/src/matchers/createAsyncMatcher.js +26 -19
  82. package/build/src/matchers/index.d.ts +0 -1
  83. package/build/src/matchers/index.js +0 -1
  84. package/build/src/options/AssertionOptions.d.ts +1 -1
  85. package/build/src/utils/removeSpaces.d.ts +6 -0
  86. package/build/src/utils/removeSpaces.js +10 -0
  87. package/package.json +2 -2
  88. package/build/src/matchers/component/toBeCheckedEx.d.ts +0 -3
  89. package/build/src/matchers/component/toBeDisabledEx.d.ts +0 -3
  90. package/build/src/matchers/component/toBeEmptyEx.d.ts +0 -3
  91. package/build/src/matchers/component/toBeEnabledEx.d.ts +0 -3
  92. package/build/src/matchers/component/toBeFocusedEx.d.ts +0 -3
  93. package/build/src/matchers/component/toBeHiddenEx.d.ts +0 -3
  94. package/build/src/matchers/component/toBeVisibleEx.d.ts +0 -3
  95. package/build/src/matchers/component/toContainFormattedTextEx.d.ts +0 -3
  96. package/build/src/matchers/component/toContainFormattedTextEx.js +0 -55
  97. package/build/src/matchers/component/toContainTextEx.d.ts +0 -3
  98. package/build/src/matchers/component/toHaveAttributeEx.d.ts +0 -3
  99. package/build/src/matchers/component/toHaveCountEx.d.ts +0 -3
  100. package/build/src/matchers/component/toHaveFormattedTextEx.d.ts +0 -3
  101. package/build/src/matchers/component/toHaveFormattedTextEx.js +0 -56
  102. package/build/src/matchers/component/toHaveFormattedValueEx.d.ts +0 -3
  103. package/build/src/matchers/component/toHaveFormattedValueEx.js +0 -56
  104. package/build/src/matchers/component/toHaveTextEx.d.ts +0 -3
  105. package/build/src/matchers/formattedMatchers.d.ts +0 -21
  106. package/build/src/matchers/formattedMatchers.js +0 -129
@@ -1,22 +1,11 @@
1
1
  declare const matchers: {
2
- readonly toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
3
- readonly toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
4
- readonly toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
5
- readonly toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
6
- readonly toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
7
- readonly toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
8
- readonly toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
9
- 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>;
10
- readonly toHaveValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
11
- start?: string;
12
- end?: string;
13
- }, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
14
- 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>;
15
- readonly toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
16
- 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>;
17
- 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>;
18
- 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>;
19
- readonly toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Label, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
2
+ readonly toBeEmpty: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
3
+ readonly toBeVisible: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
4
+ readonly toBeHidden: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
5
+ readonly toBeEnabled: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
6
+ readonly toBeDisabled: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
7
+ readonly toBeFocused: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
8
+ readonly toBeChecked: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
20
9
  readonly toBeAutoMode: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FxInput, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
21
10
  readonly toBeUnchecked: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
22
11
  readonly toBeActiveTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -27,6 +16,13 @@ declare const matchers: {
27
16
  readonly toBeUncheckedByIndex: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
28
17
  readonly toBeCheckedByText: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
29
18
  readonly toBeUncheckedByText: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
19
+ readonly toHaveAttribute: (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>;
20
+ readonly toHaveValue: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
21
+ start?: string;
22
+ end?: string;
23
+ }, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
24
+ readonly toHaveText: (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>;
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>;
30
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>;
31
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>;
32
28
  readonly toHaveError: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -38,6 +34,8 @@ declare const matchers: {
38
34
  readonly toHaveActivePage: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
39
35
  timeout?: number;
40
36
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
37
+ 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
+ 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>;
41
39
  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>;
42
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>;
43
41
  readonly toContainTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
@@ -48,27 +46,18 @@ declare const matchers: {
48
46
  readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
49
47
  timeout?: number;
50
48
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
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
+ 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
51
  };
52
52
  export type ComponentMatchers = typeof matchers;
53
53
  export declare const componentMatchers: import("@playwright/test").Expect<{
54
- readonly toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
55
- readonly toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
56
- readonly toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
57
- readonly toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
58
- readonly toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
59
- readonly toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
60
- readonly toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
61
- 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>;
62
- readonly toHaveValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
63
- start?: string;
64
- end?: string;
65
- }, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
66
- 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>;
67
- readonly toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
68
- 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>;
69
- 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>;
70
- 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>;
71
- readonly toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Label, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
54
+ readonly toBeEmpty: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
55
+ readonly toBeVisible: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
56
+ readonly toBeHidden: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
57
+ readonly toBeEnabled: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
58
+ readonly toBeDisabled: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
59
+ readonly toBeFocused: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
60
+ readonly toBeChecked: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
72
61
  readonly toBeAutoMode: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FxInput, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
73
62
  readonly toBeUnchecked: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
74
63
  readonly toBeActiveTab: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -79,6 +68,13 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
79
68
  readonly toBeUncheckedByIndex: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
80
69
  readonly toBeCheckedByText: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
81
70
  readonly toBeUncheckedByText: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
71
+ readonly toHaveAttribute: (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>;
72
+ readonly toHaveValue: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string | number | RegExp | readonly (string | RegExp)[] | {
73
+ start?: string;
74
+ end?: string;
75
+ }, args_1?: import("..").ValueOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
76
+ readonly toHaveText: (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>;
77
+ readonly toHaveCount: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
82
78
  readonly toHaveHref: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Link, args_0: string | RegExp, args_1?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
83
79
  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>;
84
80
  readonly toHaveError: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -90,6 +86,8 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
90
86
  readonly toHaveActivePage: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
91
87
  timeout?: number;
92
88
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
89
+ 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>;
90
+ 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>;
93
91
  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>;
94
92
  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>;
95
93
  readonly toContainTokens: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
@@ -100,5 +98,7 @@ export declare const componentMatchers: import("@playwright/test").Expect<{
100
98
  readonly toContainUploadedFiles: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
101
99
  timeout?: number;
102
100
  } | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
101
+ 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
+ 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>;
103
103
  }>;
104
104
  export {};
@@ -2,66 +2,52 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.componentMatchers = void 0;
4
4
  var test_1 = require("@playwright/test");
5
- var toBeEmptyEx_1 = require("./component/toBeEmptyEx");
6
- var toBeVisibleEx_1 = require("./component/toBeVisibleEx");
7
- var toBeHiddenEx_1 = require("./component/toBeHiddenEx");
8
- var toBeEnabledEx_1 = require("./component/toBeEnabledEx");
9
- var toBeDisabledEx_1 = require("./component/toBeDisabledEx");
10
- var toHaveAttributeEx_1 = require("./component/toHaveAttributeEx");
11
- var toHaveValueEx_1 = require("./component/toHaveValueEx");
12
- var toBeFocusedEx_1 = require("./component/toBeFocusedEx");
13
- var toBeCheckedEx_1 = require("./component/toBeCheckedEx");
5
+ var toBeEmpty_1 = require("./component/toBeEmpty");
6
+ var toBeVisible_1 = require("./component/toBeVisible");
7
+ var toBeHidden_1 = require("./component/toBeHidden");
8
+ var toBeEnabled_1 = require("./component/toBeEnabled");
9
+ var toBeDisabled_1 = require("./component/toBeDisabled");
10
+ var toBeFocused_1 = require("./component/toBeFocused");
11
+ var toBeChecked_1 = require("./component/toBeChecked");
14
12
  var toBeUnchecked_1 = require("./component/toBeUnchecked");
15
- var toHaveTextEx_1 = require("./component/toHaveTextEx");
16
- var toContainTextEx_1 = require("./component/toContainTextEx");
17
- var toHaveCountEx_1 = require("./component/toHaveCountEx");
18
- var toContainFormattedTextEx_1 = require("./component/toContainFormattedTextEx");
19
- var toHaveFormattedValueEx_1 = require("./component/toHaveFormattedValueEx");
20
- var toHaveFormattedTextEx_1 = require("./component/toHaveFormattedTextEx");
21
- var toHaveItems_1 = require("./component/toHaveItems");
22
- var toContainItems_1 = require("./component/toContainItems");
23
- var toContainItem_1 = require("./component/toContainItem");
24
13
  var toBeActiveTab_1 = require("./component/toBeActiveTab");
25
14
  var toBeInactiveTab_1 = require("./component/toBeInactiveTab");
26
15
  var toBeAutoMode_1 = require("./component/toBeAutoMode");
27
- var toHaveError_1 = require("./component/toHaveError");
28
- var toHaveWarning_1 = require("./component/toHaveWarning");
29
- var toContainUploadedFiles_1 = require("./component/toContainUploadedFiles");
30
- var toContainTokens_1 = require("./component/toContainTokens");
31
- var toHaveActiveTab_1 = require("./component/toHaveActiveTab");
32
- var toContainTabs_1 = require("./component/toContainTabs");
33
- var toHaveHref_1 = require("./component/toHaveHref");
34
- var toHavePageCount_1 = require("./component/toHavePageCount");
35
16
  var toBeCheckedByValue_1 = require("./component/toBeCheckedByValue");
36
17
  var toBeCheckedByIndex_1 = require("./component/toBeCheckedByIndex");
37
18
  var toBeUncheckedByValue_1 = require("./component/toBeUncheckedByValue");
38
19
  var toBeUncheckedByIndex_1 = require("./component/toBeUncheckedByIndex");
39
- var toContainSelectValue_1 = require("./component/toContainSelectValue");
40
20
  var toBeCheckedByText_1 = require("./component/toBeCheckedByText");
41
21
  var toBeUncheckedByText_1 = require("./component/toBeUncheckedByText");
22
+ var toHaveAttribute_1 = require("./component/toHaveAttribute");
23
+ var toHaveValue_1 = require("./component/toHaveValue");
24
+ var toHaveText_1 = require("./component/toHaveText");
25
+ var toHaveCount_1 = require("./component/toHaveCount");
26
+ var toHaveFormattedValue_1 = require("./component/toHaveFormattedValue");
27
+ var toHaveFormattedText_1 = require("./component/toHaveFormattedText");
28
+ var toHaveItems_1 = require("./component/toHaveItems");
29
+ var toHaveError_1 = require("./component/toHaveError");
30
+ var toHaveWarning_1 = require("./component/toHaveWarning");
31
+ var toHaveActiveTab_1 = require("./component/toHaveActiveTab");
32
+ var toHaveHref_1 = require("./component/toHaveHref");
33
+ var toHavePageCount_1 = require("./component/toHavePageCount");
42
34
  var toHaveActivePage_1 = require("./component/toHaveActivePage");
35
+ var toContainText_1 = require("./component/toContainText");
36
+ var toContainFormattedText_1 = require("./component/toContainFormattedText");
37
+ var toContainItems_1 = require("./component/toContainItems");
38
+ var toContainItem_1 = require("./component/toContainItem");
39
+ var toContainUploadedFiles_1 = require("./component/toContainUploadedFiles");
40
+ var toContainTokens_1 = require("./component/toContainTokens");
41
+ var toContainTabs_1 = require("./component/toContainTabs");
42
+ var toContainSelectValue_1 = require("./component/toContainSelectValue");
43
43
  var matchers = {
44
- /*
45
- NOTE: некоторые кастомные матчеры содержат суффикс "Ex",
46
- для того чтобы не переопределять стандартные матчеры playwright,
47
- тк. уже есть матчеры с такими же именами 'toBeEmpty' и тд и при extend они мутируются и перезаписываются { ...matchers, ...customMatchers }
48
- https://playwright.dev/docs/test-assertions#auto-retrying-assertions
49
- */
50
- toBeEmptyEx: toBeEmptyEx_1.toBeEmptyEx,
51
- toBeVisibleEx: toBeVisibleEx_1.toBeVisibleEx,
52
- toBeHiddenEx: toBeHiddenEx_1.toBeHiddenEx,
53
- toBeEnabledEx: toBeEnabledEx_1.toBeEnabledEx,
54
- toBeDisabledEx: toBeDisabledEx_1.toBeDisabledEx,
55
- toBeFocusedEx: toBeFocusedEx_1.toBeFocusedEx,
56
- toBeCheckedEx: toBeCheckedEx_1.toBeCheckedEx,
57
- toHaveAttributeEx: toHaveAttributeEx_1.toHaveAttributeEx,
58
- toHaveValueEx: toHaveValueEx_1.toHaveValueEx,
59
- toHaveTextEx: toHaveTextEx_1.toHaveTextEx,
60
- toHaveCountEx: toHaveCountEx_1.toHaveCountEx,
61
- toHaveFormattedValueEx: toHaveFormattedValueEx_1.toHaveFormattedValueEx,
62
- toHaveFormattedTextEx: toHaveFormattedTextEx_1.toHaveFormattedTextEx,
63
- toContainTextEx: toContainTextEx_1.toContainTextEx,
64
- toContainFormattedTextEx: toContainFormattedTextEx_1.toContainFormattedTextEx,
44
+ toBeEmpty: toBeEmpty_1.toBeEmpty,
45
+ toBeVisible: toBeVisible_1.toBeVisible,
46
+ toBeHidden: toBeHidden_1.toBeHidden,
47
+ toBeEnabled: toBeEnabled_1.toBeEnabled,
48
+ toBeDisabled: toBeDisabled_1.toBeDisabled,
49
+ toBeFocused: toBeFocused_1.toBeFocused,
50
+ toBeChecked: toBeChecked_1.toBeChecked,
65
51
  toBeAutoMode: toBeAutoMode_1.toBeAutoMode,
66
52
  toBeUnchecked: toBeUnchecked_1.toBeUnchecked,
67
53
  toBeActiveTab: toBeActiveTab_1.toBeActiveTab,
@@ -72,6 +58,10 @@ var matchers = {
72
58
  toBeUncheckedByIndex: toBeUncheckedByIndex_1.toBeUncheckedByIndex,
73
59
  toBeCheckedByText: toBeCheckedByText_1.toBeCheckedByText,
74
60
  toBeUncheckedByText: toBeUncheckedByText_1.toBeUncheckedByText,
61
+ toHaveAttribute: toHaveAttribute_1.toHaveAttribute,
62
+ toHaveValue: toHaveValue_1.toHaveValue,
63
+ toHaveText: toHaveText_1.toHaveText,
64
+ toHaveCount: toHaveCount_1.toHaveCount,
75
65
  toHaveHref: toHaveHref_1.toHaveHref,
76
66
  toHaveItems: toHaveItems_1.toHaveItems,
77
67
  toHaveError: toHaveError_1.toHaveError,
@@ -79,11 +69,15 @@ var matchers = {
79
69
  toHaveActiveTab: toHaveActiveTab_1.toHaveActiveTab,
80
70
  toHavePageCount: toHavePageCount_1.toHavePageCount,
81
71
  toHaveActivePage: toHaveActivePage_1.toHaveActivePage,
72
+ toHaveFormattedValue: toHaveFormattedValue_1.toHaveFormattedValue,
73
+ toHaveFormattedText: toHaveFormattedText_1.toHaveFormattedText,
82
74
  toContainItems: toContainItems_1.toContainItems,
83
75
  toContainItem: toContainItem_1.toContainItem,
84
76
  toContainTokens: toContainTokens_1.toContainTokens,
85
77
  toContainTabs: toContainTabs_1.toContainTabs,
86
78
  toContainSelectValue: toContainSelectValue_1.toContainSelectValue,
87
79
  toContainUploadedFiles: toContainUploadedFiles_1.toContainUploadedFiles,
80
+ toContainText: toContainText_1.toContainText,
81
+ toContainFormattedText: toContainFormattedText_1.toContainFormattedText,
88
82
  };
89
83
  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 toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
26
- * 'toExampleEx',
25
+ * const toExample = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
26
+ * 'toExample',
27
27
  * component => component.rootLocator,
28
28
  * async ({ isNot, locator, component }, options) => {
29
29
  * await component.waitFor();
@@ -39,16 +39,16 @@ export declare function createComponentAsyncMatcher<TComponent, TArgs extends un
39
39
  *
40
40
  *
41
41
  * @param matcherName - уникальное имя матчера
42
- * @param getLocator - функция для получения локатора
42
+ * @param componentSymbol - символ локатора компонента
43
43
  * @param createMatcherLogicAsync - асинхронная функция для создания логики матчера
44
44
  * @param createExpectMessage - функция для создания сообщения для ожидания
45
45
  *
46
46
  * @example
47
- * export type ToExampleExLocator = {
48
- * [toExampleExLocator]: () => Locator;
47
+ * export type ToExampleLocator = {
48
+ * [toExampleLocator]: () => Locator;
49
49
  * }
50
50
  *
51
- * export const toExampleExLocator = Symbol.for('toExampleExLocator');
51
+ * export const toExampleLocator = Symbol.for('toExampleLocator');
52
52
  *
53
53
  * Дженерик аргументы:
54
54
  *
@@ -58,9 +58,9 @@ export declare function createComponentAsyncMatcher<TComponent, TArgs extends un
58
58
  * - TComponent - тип компонента
59
59
  *
60
60
  *
61
- * const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
62
- * 'toExampleEx',
63
- * component => component[toExampleExLocator](),
61
+ * const toExample = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
62
+ * 'toExample',
63
+ * toExampleExLocator,
64
64
  * async ({ isNot, locator, component }, options) => {
65
65
  * await component.waitFor();
66
66
  * const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
@@ -69,4 +69,4 @@ export declare function createComponentAsyncMatcher<TComponent, TArgs extends un
69
69
  * isNot => (isNot ? 'not to be example' : 'to be example'),
70
70
  * );
71
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>;
72
+ export declare function createAsyncMatcher<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>;
@@ -66,8 +66,8 @@ var utils_2 = require("../utils");
66
66
  * - Component - тип компонента
67
67
  * - TArgs - массив аргументов матчера
68
68
  *
69
- * const toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
70
- * 'toExampleEx',
69
+ * const toExample = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
70
+ * 'toExample',
71
71
  * component => component.rootLocator,
72
72
  * async ({ isNot, locator, component }, options) => {
73
73
  * await component.waitFor();
@@ -115,16 +115,16 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
115
115
  *
116
116
  *
117
117
  * @param matcherName - уникальное имя матчера
118
- * @param getLocator - функция для получения локатора
118
+ * @param componentSymbol - символ локатора компонента
119
119
  * @param createMatcherLogicAsync - асинхронная функция для создания логики матчера
120
120
  * @param createExpectMessage - функция для создания сообщения для ожидания
121
121
  *
122
122
  * @example
123
- * export type ToExampleExLocator = {
124
- * [toExampleExLocator]: () => Locator;
123
+ * export type ToExampleLocator = {
124
+ * [toExampleLocator]: () => Locator;
125
125
  * }
126
126
  *
127
- * export const toExampleExLocator = Symbol.for('toExampleExLocator');
127
+ * export const toExampleLocator = Symbol.for('toExampleLocator');
128
128
  *
129
129
  * Дженерик аргументы:
130
130
  *
@@ -134,9 +134,9 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
134
134
  * - TComponent - тип компонента
135
135
  *
136
136
  *
137
- * const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
138
- * 'toExampleEx',
139
- * component => component[toExampleExLocator](),
137
+ * const toExample = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], Component>(
138
+ * 'toExample',
139
+ * toExampleExLocator,
140
140
  * async ({ isNot, locator, component }, options) => {
141
141
  * await component.waitFor();
142
142
  * const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
@@ -145,23 +145,30 @@ function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic
145
145
  * isNot => (isNot ? 'not to be example' : 'to be example'),
146
146
  * );
147
147
  */
148
- function createAsyncMatcher(matcherName, getLocator, createMatcherLogicAsync, createExpectMessage) {
148
+ function createAsyncMatcher(matcherName, componentSymbol, createMatcherLogicAsync, createExpectMessage) {
149
149
  return function matcher(component) {
150
150
  var args = [];
151
151
  for (var _i = 1; _i < arguments.length; _i++) {
152
152
  args[_i - 1] = arguments[_i];
153
153
  }
154
154
  return __awaiter(this, void 0, void 0, function () {
155
- var _a, _b;
155
+ var locatorResult, _a, locator;
156
156
  var _this = this;
157
- return __generator(this, function (_c) {
158
- switch (_c.label) {
157
+ return __generator(this, function (_b) {
158
+ switch (_b.label) {
159
159
  case 0:
160
- _a = utils_2.toMatchMessage;
161
- _b = [this,
162
- matcherName];
163
- return [4 /*yield*/, getLocator(component)];
164
- case 1: return [2 /*return*/, _a.apply(void 0, _b.concat([_c.sent(), function (isNot, locator) {
160
+ if (!component[componentSymbol]) return [3 /*break*/, 2];
161
+ return [4 /*yield*/, component[componentSymbol]()];
162
+ case 1:
163
+ _a = _b.sent();
164
+ return [3 /*break*/, 3];
165
+ case 2:
166
+ _a = component;
167
+ _b.label = 3;
168
+ case 3:
169
+ locatorResult = _a;
170
+ locator = locatorResult;
171
+ return [2 /*return*/, (0, utils_2.toMatchMessage)(this, matcherName, locator, function (isNot, locator) {
165
172
  return (0, utils_1.makeMatcher)(isNot, function () { return __awaiter(_this, void 0, void 0, function () {
166
173
  return __generator(this, function (_a) {
167
174
  switch (_a.label) {
@@ -172,7 +179,7 @@ function createAsyncMatcher(matcherName, getLocator, createMatcherLogicAsync, cr
172
179
  }
173
180
  });
174
181
  }); });
175
- }, createExpectMessage === null || createExpectMessage === void 0 ? void 0 : createExpectMessage.apply(void 0, __spreadArray([this.isNot], args, false))]))];
182
+ }, createExpectMessage === null || createExpectMessage === void 0 ? void 0 : createExpectMessage.apply(void 0, __spreadArray([this.isNot], args, false)))];
176
183
  }
177
184
  });
178
185
  });
@@ -1,2 +1 @@
1
- export * from './formattedMatchers';
2
1
  export * from './componentMatchers';
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./formattedMatchers"), exports);
18
17
  __exportStar(require("./componentMatchers"), exports);
@@ -1,4 +1,3 @@
1
- import type { Transform } from '../matchers';
2
1
  export type VisibleOptions = {
3
2
  /**
4
3
  * Time to retry the assertion for in milliseconds. Defaults to `timeout` in `TestConfig.expect`.
@@ -73,6 +72,7 @@ export type AttributeOptions = {
73
72
  */
74
73
  timeout?: number;
75
74
  };
75
+ export type Transform = (value: string) => string;
76
76
  export type TransformOptions = {
77
77
  transform?: Transform;
78
78
  /**
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Удаляет все пробелы из строки.
3
+ * @param value - Строка, из которой нужно удалить пробелы.
4
+ * @returns Строка без пробелов.
5
+ */
6
+ export declare const removeSpaces: (value: string) => string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeSpaces = void 0;
4
+ /**
5
+ * Удаляет все пробелы из строки.
6
+ * @param value - Строка, из которой нужно удалить пробелы.
7
+ * @returns Строка без пробелов.
8
+ */
9
+ var removeSpaces = function (value) { return value.replace(/\s/g, ''); };
10
+ exports.removeSpaces = removeSpaces;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/playwright-react-ui-components",
3
- "version": "1.14.2",
3
+ "version": "1.15.0-beta.1",
4
4
  "description": "Пакет для взаимодействия с компонентами @skbkontur/react-ui при тестировании с помощью Playwright",
5
5
  "main": "build/index.js",
6
6
  "files": [
@@ -23,6 +23,6 @@
23
23
  "access": "public"
24
24
  },
25
25
  "peerDependencies": {
26
- "@playwright/test": "^1.45.3"
26
+ "@playwright/test": "^1.48.2"
27
27
  }
28
28
  }
@@ -1,3 +0,0 @@
1
- import { type ToBeCheckableElementLocator } from './LocatorSymbols';
2
- import type { CheckedOptions } from '../../options';
3
- export declare const toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: ToBeCheckableElementLocator, args_0?: CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { AttributeOptions, EnabledOptions } from '../../options';
2
- import type { ControlElementLocator } from './LocatorSymbols';
3
- export declare const toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: ControlElementLocator, args_0?: EnabledOptions | AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { EmptyOptions } from '../../options';
2
- import type { ToWithValueElementLocator } from './LocatorSymbols';
3
- export declare const toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: ToWithValueElementLocator, args_0?: EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { EnabledOptions } from '../../options';
2
- import type { ControlElementLocator } from './LocatorSymbols';
3
- export declare const toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: ControlElementLocator, args_0?: EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import { type ToBeFocusableElementLocator } from './LocatorSymbols';
2
- import type { FocusedOptions } from '../../options';
3
- export declare const toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: ToBeFocusableElementLocator, args_0?: FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import { type VisibleElementLocator } from './LocatorSymbols';
2
- import type { HiddenOptions } from '../../options';
3
- export declare const toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: VisibleElementLocator, args_0?: HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { VisibleElementLocator } from './LocatorSymbols';
2
- import type { VisibleOptions } from '../../options';
3
- export declare const toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: VisibleElementLocator, args_0?: VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { Label } from '../../components';
2
- import type { TransformOptions } from '../../options';
3
- export declare const toContainFormattedTextEx: (this: import("playwright/test").ExpectMatcherState, component: Label, args_0: string, args_1?: TransformOptions | undefined) => Promise<import("playwright/test").MatcherReturnType>;
@@ -1,55 +0,0 @@
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.toContainFormattedTextEx = void 0;
40
- var extensions_1 = require("../../extensions");
41
- var createAsyncMatcher_1 = require("../createAsyncMatcher");
42
- exports.toContainFormattedTextEx = (0, createAsyncMatcher_1.createComponentAsyncMatcher)('toContainFormattedTextEx', function (component) { return component.rootLocator; }, function (_a, expected_1, options_1) { return __awaiter(void 0, [_a, expected_1, options_1], void 0, function (_b, expected, options) {
43
- var expectation;
44
- var isNot = _b.isNot, locator = _b.locator;
45
- return __generator(this, function (_c) {
46
- switch (_c.label) {
47
- case 0:
48
- expectation = isNot ? (0, extensions_1.expect)(locator).not : (0, extensions_1.expect)(locator);
49
- return [4 /*yield*/, expectation.toContainFormattedText(expected, options)];
50
- case 1:
51
- _c.sent();
52
- return [2 /*return*/];
53
- }
54
- });
55
- }); });
@@ -1,3 +0,0 @@
1
- import type { ToTextElementLocator } from './LocatorSymbols';
2
- import type { TextOptions } from '../../options';
3
- export declare const toContainTextEx: (this: import("@playwright/test").ExpectMatcherState, component: ToTextElementLocator, args_0: string | RegExp | readonly (string | RegExp)[], args_1?: TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { ToHaveAttributeElementLocator } from './LocatorSymbols';
2
- import type { AttributeOptions } from '../../options';
3
- export declare const toHaveAttributeEx: (this: import("@playwright/test").ExpectMatcherState, component: ToHaveAttributeElementLocator, args_0: string, args_1?: string | RegExp | undefined, args_2?: AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
@@ -1,3 +0,0 @@
1
- import type { CountOptions } from '../../options';
2
- import type { ComponentList } from '../../components';
3
- export declare const toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: ComponentList<any>, args_0: number, args_1?: CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;