@skbkontur/playwright-react-ui-components 1.13.1 → 1.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/assertions/AutocompleteAssertions.js +10 -10
- package/build/src/assertions/BaseComponentAssertions.js +11 -11
- package/build/src/assertions/ButtonAssertions.js +9 -9
- package/build/src/assertions/CheckboxAssertions.js +13 -13
- package/build/src/assertions/ComboBoxAssertions.js +17 -111
- package/build/src/assertions/ComponentListAssertions.js +6 -6
- package/build/src/assertions/CurrencyInputAssertions.js +11 -61
- package/build/src/assertions/DateInputAssertions.js +9 -9
- package/build/src/assertions/DatePickerAssertions.js +9 -9
- package/build/src/assertions/DateRangePickerAssertions.js +4 -25
- package/build/src/assertions/DropdownAssertions.js +13 -63
- package/build/src/assertions/DropdownMenuAssertions.js +11 -61
- package/build/src/assertions/FileUploaderAssertions.d.ts +1 -3
- package/build/src/assertions/FileUploaderAssertions.js +5 -22
- package/build/src/assertions/FxInputAssertions.js +11 -14
- package/build/src/assertions/InputAssertions.js +10 -10
- package/build/src/assertions/KebabAssertions.js +7 -58
- package/build/src/assertions/LabelAssertions.js +7 -7
- package/build/src/assertions/LinkAssertions.js +11 -12
- package/build/src/assertions/LoaderAssertions.js +2 -2
- package/build/src/assertions/MenuItemAssertations.js +5 -5
- package/build/src/assertions/PagingAssertions.js +5 -40
- package/build/src/assertions/PortalAssertions.js +3 -3
- package/build/src/assertions/RadioAssertions.js +13 -13
- package/build/src/assertions/RadioGroupAssertions.js +10 -81
- package/build/src/assertions/SelectAssertions.js +15 -64
- package/build/src/assertions/SpinnerAssertions.js +2 -2
- package/build/src/assertions/TabAssertions.js +11 -12
- package/build/src/assertions/TabsAssertions.js +4 -32
- package/build/src/assertions/TextareaAssertions.js +9 -9
- package/build/src/assertions/ToastAssertions.js +2 -2
- package/build/src/assertions/ToggleAssertions.js +11 -11
- package/build/src/assertions/TokenAssertions.js +8 -14
- package/build/src/assertions/TokenInputAssertions.js +8 -28
- package/build/src/assertions/TooltipAssertions.js +5 -5
- package/build/src/components/Autocomplete.d.ts +4 -0
- package/build/src/components/Autocomplete.js +52 -50
- package/build/src/components/BaseComponent.d.ts +4 -0
- package/build/src/components/BaseComponent.js +37 -30
- package/build/src/components/Button.d.ts +4 -0
- package/build/src/components/Button.js +25 -19
- package/build/src/components/Checkbox.d.ts +6 -0
- package/build/src/components/Checkbox.js +28 -36
- package/build/src/components/ComboBox.d.ts +9 -2
- package/build/src/components/ComboBox.js +68 -54
- package/build/src/components/ComponentList.d.ts +25 -3
- package/build/src/components/ComponentList.js +58 -50
- package/build/src/components/CurrencyInput.d.ts +4 -0
- package/build/src/components/CurrencyInput.js +39 -37
- package/build/src/components/DateInput.d.ts +4 -0
- package/build/src/components/DateInput.js +34 -32
- package/build/src/components/DatePicker.d.ts +4 -0
- package/build/src/components/DatePicker.js +35 -33
- package/build/src/components/DateRangePicker.d.ts +2 -0
- package/build/src/components/DateRangePicker.js +14 -10
- package/build/src/components/Dropdown.d.ts +8 -2
- package/build/src/components/Dropdown.js +69 -65
- package/build/src/components/DropdownMenu.d.ts +7 -2
- package/build/src/components/DropdownMenu.js +68 -65
- package/build/src/components/FileUploader.d.ts +3 -1
- package/build/src/components/FileUploader.js +39 -39
- package/build/src/components/FxInput.d.ts +4 -0
- package/build/src/components/FxInput.js +44 -42
- package/build/src/components/Input.d.ts +4 -0
- package/build/src/components/Input.js +37 -35
- package/build/src/components/Kebab.d.ts +6 -2
- package/build/src/components/Kebab.js +50 -48
- package/build/src/components/Label.d.ts +2 -0
- package/build/src/components/Label.js +9 -13
- package/build/src/components/Link.d.ts +4 -0
- package/build/src/components/Link.js +19 -25
- package/build/src/components/Loader.d.ts +2 -0
- package/build/src/components/Loader.js +15 -10
- package/build/src/components/MenuComponent.d.ts +9 -0
- package/build/src/components/MenuComponent.js +78 -0
- package/build/src/components/MenuItem.d.ts +2 -0
- package/build/src/components/MenuItem.js +7 -3
- package/build/src/components/Paging.d.ts +2 -0
- package/build/src/components/Paging.js +59 -52
- package/build/src/components/Portal.d.ts +2 -0
- package/build/src/components/Portal.js +14 -10
- package/build/src/components/Radio.d.ts +6 -0
- package/build/src/components/Radio.js +31 -27
- package/build/src/components/RadioGroup.d.ts +2 -0
- package/build/src/components/RadioGroup.js +51 -47
- package/build/src/components/Select.d.ts +5 -0
- package/build/src/components/Select.js +92 -76
- package/build/src/components/Spinner.d.ts +2 -0
- package/build/src/components/Spinner.js +13 -9
- package/build/src/components/Tab.d.ts +4 -0
- package/build/src/components/Tab.js +17 -27
- package/build/src/components/Textarea.d.ts +4 -0
- package/build/src/components/Textarea.js +33 -39
- package/build/src/components/Toast.d.ts +2 -0
- package/build/src/components/Toast.js +7 -3
- package/build/src/components/Toggle.d.ts +5 -0
- package/build/src/components/Toggle.js +24 -33
- package/build/src/components/Token.d.ts +3 -0
- package/build/src/components/Token.js +14 -9
- package/build/src/components/TokenInput.d.ts +4 -0
- package/build/src/components/TokenInput.js +61 -59
- package/build/src/components/Tooltip.d.ts +2 -0
- package/build/src/components/Tooltip.js +9 -9
- package/build/src/components/index.d.ts +1 -0
- package/build/src/components/index.js +3 -1
- package/build/src/extensions/index.d.ts +1 -0
- package/build/src/extensions/index.js +17 -0
- package/build/src/extensions/mergedExpects.d.ts +5 -0
- package/build/src/extensions/mergedExpects.js +7 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +2 -0
- package/build/src/matchers/component/LocatorSymbols.d.ts +43 -0
- package/build/src/matchers/component/LocatorSymbols.js +13 -0
- package/build/src/matchers/component/toBeActiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeActiveEx.js +56 -0
- package/build/src/matchers/component/toBeAutoEx.d.ts +3 -0
- package/build/src/matchers/component/toBeAutoEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByTextEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedByValueEx.js +62 -0
- package/build/src/matchers/component/toBeCheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeCheckedEx.js +56 -0
- package/build/src/matchers/component/toBeDisabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeDisabledEx.js +172 -0
- package/build/src/matchers/component/toBeEmptyEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEmptyEx.js +137 -0
- package/build/src/matchers/component/toBeEnabledEx.d.ts +3 -0
- package/build/src/matchers/component/toBeEnabledEx.js +206 -0
- package/build/src/matchers/component/toBeFocusedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeFocusedEx.js +56 -0
- package/build/src/matchers/component/toBeHiddenEx.d.ts +3 -0
- package/build/src/matchers/component/toBeHiddenEx.js +68 -0
- package/build/src/matchers/component/toBeInactiveEx.d.ts +3 -0
- package/build/src/matchers/component/toBeInactiveEx.js +56 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByIndexEx.js +62 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByTextEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedByValueEx.js +57 -0
- package/build/src/matchers/component/toBeUncheckedEx.d.ts +3 -0
- package/build/src/matchers/component/toBeUncheckedEx.js +56 -0
- package/build/src/matchers/component/toBeVisibleEx.d.ts +3 -0
- package/build/src/matchers/component/toBeVisibleEx.js +68 -0
- package/build/src/matchers/component/toContainFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainFormattedTextEx.js +55 -0
- package/build/src/matchers/component/toContainItemEx.d.ts +4 -0
- package/build/src/matchers/component/toContainItemEx.js +79 -0
- package/build/src/matchers/component/toContainItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainItemsEx.js +63 -0
- package/build/src/matchers/component/toContainTabsEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTabsEx.js +80 -0
- package/build/src/matchers/component/toContainTextEx.d.ts +3 -0
- package/build/src/matchers/component/toContainTextEx.js +56 -0
- package/build/src/matchers/component/toContainTokensEx.d.ts +4 -0
- package/build/src/matchers/component/toContainTokensEx.js +80 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.d.ts +4 -0
- package/build/src/matchers/component/toContainUploadedFilesEx.js +75 -0
- package/build/src/matchers/component/toContainValueEx.d.ts +3 -0
- package/build/src/matchers/component/toContainValueEx.js +55 -0
- package/build/src/matchers/component/toHaveActivePageEx.d.ts +4 -0
- package/build/src/matchers/component/toHaveActivePageEx.js +78 -0
- package/build/src/matchers/component/toHaveActiveTabEx.d.ts +2 -0
- package/build/src/matchers/component/toHaveActiveTabEx.js +62 -0
- package/build/src/matchers/component/toHaveAttributeEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveAttributeEx.js +62 -0
- package/build/src/matchers/component/toHaveCountEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveCountEx.js +56 -0
- package/build/src/matchers/component/toHaveErrorEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveErrorEx.js +57 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedTextEx.js +56 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveFormattedValueEx.js +56 -0
- package/build/src/matchers/component/toHaveHrefEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveHrefEx.js +55 -0
- package/build/src/matchers/component/toHaveItemsEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveItemsEx.js +63 -0
- package/build/src/matchers/component/toHavePageCountEx.d.ts +4 -0
- package/build/src/matchers/component/toHavePageCountEx.js +71 -0
- package/build/src/matchers/component/toHaveTextEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveTextEx.js +56 -0
- package/build/src/matchers/component/toHaveValueEx.d.ts +6 -0
- package/build/src/matchers/component/toHaveValueEx.js +198 -0
- package/build/src/matchers/component/toHaveWarningEx.d.ts +3 -0
- package/build/src/matchers/component/toHaveWarningEx.js +57 -0
- package/build/src/matchers/componentMatchers.d.ts +104 -0
- package/build/src/matchers/componentMatchers.js +83 -0
- package/build/src/matchers/createAsyncMatcher.d.ts +47 -0
- package/build/src/matchers/createAsyncMatcher.js +155 -0
- package/build/src/matchers/formattedMatchers.d.ts +15 -31
- package/build/src/matchers/formattedMatchers.js +19 -15
- package/build/src/matchers/index.d.ts +1 -1
- package/build/src/matchers/index.js +1 -3
- package/build/src/utils/getMarcherResult.d.ts +13 -0
- package/build/src/utils/getMarcherResult.js +13 -0
- package/build/src/utils/index.d.ts +3 -0
- package/build/src/utils/index.js +3 -0
- package/build/src/utils/is.d.ts +3 -0
- package/build/src/utils/is.js +5 -0
- package/build/src/utils/makeMatcher.d.ts +5 -0
- package/build/src/utils/makeMatcher.js +65 -0
- package/build/src/utils/toMatchMessage.d.ts +12 -0
- package/build/src/utils/toMatchMessage.js +78 -0
- package/package.json +1 -1
- package/build/src/matchers/mergedExpects.d.ts +0 -15
- package/build/src/matchers/mergedExpects.js +0 -6
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
declare const matchers: {
|
|
2
|
+
toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
3
|
+
toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
4
|
+
toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
5
|
+
toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
6
|
+
toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
7
|
+
toHaveErrorEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
8
|
+
toHaveWarningEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
9
|
+
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
|
+
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
|
+
toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
15
|
+
toContainUploadedFilesEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
|
|
16
|
+
timeout?: number;
|
|
17
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
18
|
+
toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
19
|
+
toBeUncheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
20
|
+
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>;
|
|
21
|
+
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>;
|
|
22
|
+
toHaveItemsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
23
|
+
toContainItemsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
24
|
+
toContainItemEx: (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>;
|
|
25
|
+
toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
26
|
+
toBeActiveEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
27
|
+
toBeInactiveEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
28
|
+
toContainTokensEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
|
|
29
|
+
timeout?: number;
|
|
30
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
31
|
+
toHaveActiveTabEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string | RegExp) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
32
|
+
toContainTabsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
33
|
+
toBeAutoEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FxInput, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
34
|
+
toHaveHrefEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Link, args_0: string | RegExp, args_1?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
35
|
+
toHavePageCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
|
|
36
|
+
timeout?: number;
|
|
37
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
38
|
+
toBeCheckedByValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
39
|
+
toBeCheckedByIndexEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
40
|
+
toBeUncheckedByValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
41
|
+
toBeUncheckedByIndexEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
42
|
+
toContainValueEx: (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>;
|
|
43
|
+
toBeCheckedByTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
44
|
+
toBeUncheckedByTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
45
|
+
toHaveActivePageEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
|
|
46
|
+
timeout?: number;
|
|
47
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
48
|
+
toHaveFormattedValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
49
|
+
toHaveFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
50
|
+
toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Label, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
51
|
+
};
|
|
52
|
+
export type ComponentMatchers = typeof matchers;
|
|
53
|
+
export declare const componentMatchers: import("@playwright/test").Expect<{
|
|
54
|
+
toBeEmptyEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0?: import("..").EmptyOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
55
|
+
toBeVisibleEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
56
|
+
toBeHiddenEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").VisibleElementLocator, args_0?: import("..").HiddenOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
57
|
+
toBeEnabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
58
|
+
toBeDisabledEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ControlElementLocator, args_0?: import("..").EnabledOptions | import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
59
|
+
toHaveErrorEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
60
|
+
toHaveWarningEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").RootSymbolLocator, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
61
|
+
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
|
+
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
|
+
toBeFocusedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeFocusableElementLocator, args_0?: import("..").FocusedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
67
|
+
toContainUploadedFilesEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FileUploader, args_0: string[], args_1?: {
|
|
68
|
+
timeout?: number;
|
|
69
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
70
|
+
toBeCheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
71
|
+
toBeUncheckedEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToBeCheckableElementLocator, args_0?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
72
|
+
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>;
|
|
73
|
+
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>;
|
|
74
|
+
toHaveItemsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
75
|
+
toContainItemsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToHaveItemsElementLocator, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
76
|
+
toContainItemEx: (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>;
|
|
77
|
+
toHaveCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").ComponentList<any>, args_0: number, args_1?: import("..").CountOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
78
|
+
toBeActiveEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
79
|
+
toBeInactiveEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tab, args_0?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
80
|
+
toContainTokensEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").TokenInput, args_0: string[], args_1?: {
|
|
81
|
+
timeout?: number;
|
|
82
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
83
|
+
toHaveActiveTabEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string | RegExp) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
84
|
+
toContainTabsEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Tabs, args_0: string[], args_1?: import("..").TextOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
85
|
+
toBeAutoEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").FxInput, args_0?: import("..").VisibleOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
86
|
+
toHaveHrefEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Link, args_0: string | RegExp, args_1?: import("..").AttributeOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
87
|
+
toHavePageCountEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
|
|
88
|
+
timeout?: number;
|
|
89
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
90
|
+
toBeCheckedByValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
91
|
+
toBeCheckedByIndexEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
92
|
+
toBeUncheckedByValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
93
|
+
toBeUncheckedByIndexEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: number, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
94
|
+
toContainValueEx: (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>;
|
|
95
|
+
toBeCheckedByTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
96
|
+
toBeUncheckedByTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").RadioGroup, args_0: string | RegExp, args_1?: import("..").CheckedOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
97
|
+
toHaveActivePageEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Paging, args_0: number, args_1?: {
|
|
98
|
+
timeout?: number;
|
|
99
|
+
} | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
100
|
+
toHaveFormattedValueEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToWithValueElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
101
|
+
toHaveFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("./component/LocatorSymbols").ToTextElementLocator, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
102
|
+
toContainFormattedTextEx: (this: import("@playwright/test").ExpectMatcherState, component: import("..").Label, args_0: string, args_1?: import("..").TransformOptions | undefined) => Promise<import("@playwright/test").MatcherReturnType>;
|
|
103
|
+
}>;
|
|
104
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentMatchers = void 0;
|
|
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 toHaveErrorEx_1 = require("./component/toHaveErrorEx");
|
|
11
|
+
var toHaveWarningEx_1 = require("./component/toHaveWarningEx");
|
|
12
|
+
var toHaveAttributeEx_1 = require("./component/toHaveAttributeEx");
|
|
13
|
+
var toHaveValueEx_1 = require("./component/toHaveValueEx");
|
|
14
|
+
var toBeFocusedEx_1 = require("./component/toBeFocusedEx");
|
|
15
|
+
var toContainUploadedFilesEx_1 = require("./component/toContainUploadedFilesEx");
|
|
16
|
+
var toBeCheckedEx_1 = require("./component/toBeCheckedEx");
|
|
17
|
+
var toBeUncheckedEx_1 = require("./component/toBeUncheckedEx");
|
|
18
|
+
var toHaveTextEx_1 = require("./component/toHaveTextEx");
|
|
19
|
+
var toContainTextEx_1 = require("./component/toContainTextEx");
|
|
20
|
+
var toHaveItemsEx_1 = require("./component/toHaveItemsEx");
|
|
21
|
+
var toContainItemsEx_1 = require("./component/toContainItemsEx");
|
|
22
|
+
var toContainItemEx_1 = require("./component/toContainItemEx");
|
|
23
|
+
var toContainFormattedTextEx_1 = require("./component/toContainFormattedTextEx");
|
|
24
|
+
var toHaveCountEx_1 = require("./component/toHaveCountEx");
|
|
25
|
+
var toBeActiveEx_1 = require("./component/toBeActiveEx");
|
|
26
|
+
var toBeInactiveEx_1 = require("./component/toBeInactiveEx");
|
|
27
|
+
var toContainTokensEx_1 = require("./component/toContainTokensEx");
|
|
28
|
+
var toHaveActiveTabEx_1 = require("./component/toHaveActiveTabEx");
|
|
29
|
+
var toContainTabsEx_1 = require("./component/toContainTabsEx");
|
|
30
|
+
var toBeAutoEx_1 = require("./component/toBeAutoEx");
|
|
31
|
+
var toHaveHrefEx_1 = require("./component/toHaveHrefEx");
|
|
32
|
+
var toHavePageCountEx_1 = require("./component/toHavePageCountEx");
|
|
33
|
+
var toBeCheckedByValueEx_1 = require("./component/toBeCheckedByValueEx");
|
|
34
|
+
var toBeCheckedByIndexEx_1 = require("./component/toBeCheckedByIndexEx");
|
|
35
|
+
var toBeUncheckedByValueEx_1 = require("./component/toBeUncheckedByValueEx");
|
|
36
|
+
var toBeUncheckedByIndexEx_1 = require("./component/toBeUncheckedByIndexEx");
|
|
37
|
+
var toContainValueEx_1 = require("./component/toContainValueEx");
|
|
38
|
+
var toBeCheckedByTextEx_1 = require("./component/toBeCheckedByTextEx");
|
|
39
|
+
var toBeUncheckedByTextEx_1 = require("./component/toBeUncheckedByTextEx");
|
|
40
|
+
var toHaveActivePageEx_1 = require("./component/toHaveActivePageEx");
|
|
41
|
+
var toHaveFormattedValueEx_1 = require("./component/toHaveFormattedValueEx");
|
|
42
|
+
var toHaveFormattedTextEx_1 = require("./component/toHaveFormattedTextEx");
|
|
43
|
+
var matchers = {
|
|
44
|
+
toBeEmptyEx: toBeEmptyEx_1.toBeEmptyEx,
|
|
45
|
+
toBeVisibleEx: toBeVisibleEx_1.toBeVisibleEx,
|
|
46
|
+
toBeHiddenEx: toBeHiddenEx_1.toBeHiddenEx,
|
|
47
|
+
toBeEnabledEx: toBeEnabledEx_1.toBeEnabledEx,
|
|
48
|
+
toBeDisabledEx: toBeDisabledEx_1.toBeDisabledEx,
|
|
49
|
+
toHaveErrorEx: toHaveErrorEx_1.toHaveErrorEx,
|
|
50
|
+
toHaveWarningEx: toHaveWarningEx_1.toHaveWarningEx,
|
|
51
|
+
toHaveAttributeEx: toHaveAttributeEx_1.toHaveAttributeEx,
|
|
52
|
+
toHaveValueEx: toHaveValueEx_1.toHaveValueEx,
|
|
53
|
+
toBeFocusedEx: toBeFocusedEx_1.toBeFocusedEx,
|
|
54
|
+
toContainUploadedFilesEx: toContainUploadedFilesEx_1.toContainUploadedFilesEx,
|
|
55
|
+
toBeCheckedEx: toBeCheckedEx_1.toBeCheckedEx,
|
|
56
|
+
toBeUncheckedEx: toBeUncheckedEx_1.toBeUncheckedEx,
|
|
57
|
+
toHaveTextEx: toHaveTextEx_1.toHaveTextEx,
|
|
58
|
+
toContainTextEx: toContainTextEx_1.toContainTextEx,
|
|
59
|
+
toHaveItemsEx: toHaveItemsEx_1.toHaveItemsEx,
|
|
60
|
+
toContainItemsEx: toContainItemsEx_1.toContainItemsEx,
|
|
61
|
+
toContainItemEx: toContainItemEx_1.toContainItemEx,
|
|
62
|
+
toHaveCountEx: toHaveCountEx_1.toHaveCountEx,
|
|
63
|
+
toBeActiveEx: toBeActiveEx_1.toBeActiveEx,
|
|
64
|
+
toBeInactiveEx: toBeInactiveEx_1.toBeInactiveEx,
|
|
65
|
+
toContainTokensEx: toContainTokensEx_1.toContainTokensEx,
|
|
66
|
+
toHaveActiveTabEx: toHaveActiveTabEx_1.toHaveActiveTabEx,
|
|
67
|
+
toContainTabsEx: toContainTabsEx_1.toContainTabsEx,
|
|
68
|
+
toBeAutoEx: toBeAutoEx_1.toBeAutoEx,
|
|
69
|
+
toHaveHrefEx: toHaveHrefEx_1.toHaveHrefEx,
|
|
70
|
+
toHavePageCountEx: toHavePageCountEx_1.toHavePageCountEx,
|
|
71
|
+
toBeCheckedByValueEx: toBeCheckedByValueEx_1.toBeCheckedByValueEx,
|
|
72
|
+
toBeCheckedByIndexEx: toBeCheckedByIndexEx_1.toBeCheckedByIndexEx,
|
|
73
|
+
toBeUncheckedByValueEx: toBeUncheckedByValueEx_1.toBeUncheckedByValueEx,
|
|
74
|
+
toBeUncheckedByIndexEx: toBeUncheckedByIndexEx_1.toBeUncheckedByIndexEx,
|
|
75
|
+
toContainValueEx: toContainValueEx_1.toContainValueEx,
|
|
76
|
+
toBeCheckedByTextEx: toBeCheckedByTextEx_1.toBeCheckedByTextEx,
|
|
77
|
+
toBeUncheckedByTextEx: toBeUncheckedByTextEx_1.toBeUncheckedByTextEx,
|
|
78
|
+
toHaveActivePageEx: toHaveActivePageEx_1.toHaveActivePageEx,
|
|
79
|
+
toHaveFormattedValueEx: toHaveFormattedValueEx_1.toHaveFormattedValueEx,
|
|
80
|
+
toHaveFormattedTextEx: toHaveFormattedTextEx_1.toHaveFormattedTextEx,
|
|
81
|
+
toContainFormattedTextEx: toContainFormattedTextEx_1.toContainFormattedTextEx,
|
|
82
|
+
};
|
|
83
|
+
exports.componentMatchers = test_1.expect.extend(matchers);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ExpectMatcherState, Locator, MatcherReturnType } from '@playwright/test';
|
|
2
|
+
import type { LocatorType } from './component/LocatorSymbols';
|
|
3
|
+
export interface CreateMatcherLogicParams<TComponent> {
|
|
4
|
+
isNot: boolean;
|
|
5
|
+
locator: Locator;
|
|
6
|
+
component: TComponent;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Создает асинхронный матчер для конкретного компонента
|
|
10
|
+
* @param matcherName - имя матчера
|
|
11
|
+
* @param getLocator - функция для получения локатора
|
|
12
|
+
* @param createMatcherLogic - функция для создания логики матчера
|
|
13
|
+
* @param createMessage - функция для создания сообщения
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
|
|
17
|
+
* 'toExampleEx',
|
|
18
|
+
* component => component.rootLocator,
|
|
19
|
+
* async ({ isNot, locator, component }, options) => {
|
|
20
|
+
* await component.waitFor();
|
|
21
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
22
|
+
* await expectation.toBeEmpty();
|
|
23
|
+
* },
|
|
24
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
25
|
+
* );
|
|
26
|
+
*/
|
|
27
|
+
export declare function createComponentAsyncMatcher<TComponent, TArgs extends unknown[]>(matcherName: string, getLocator: (component: TComponent) => LocatorType, createMatcherLogic: (params: CreateMatcherLogicParams<TComponent>, ...args: TArgs) => Promise<void>, createMessage?: (isNot: boolean, ...args: TArgs) => string): (this: ExpectMatcherState, component: TComponent, ...args: TArgs) => Promise<MatcherReturnType>;
|
|
28
|
+
/**
|
|
29
|
+
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
30
|
+
* @param matcherName - имя матчера
|
|
31
|
+
* @param getLocator - функция для получения локатора
|
|
32
|
+
* @param createMatcherLogic - функция для создания логики матчера
|
|
33
|
+
* @param createMessage - функция для создания сообщения
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], BaseComponent>(
|
|
37
|
+
* 'toExampleEx',
|
|
38
|
+
* component => component[toExampleExLocator](),
|
|
39
|
+
* async ({ isNot, locator, component }, options) => {
|
|
40
|
+
* await component.waitFor();
|
|
41
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
42
|
+
* await expectation.toBeEmpty();
|
|
43
|
+
* },
|
|
44
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
45
|
+
* );
|
|
46
|
+
*/
|
|
47
|
+
export declare function createAsyncMatcher<TLocatorSymbolInterface, TArgs extends unknown[], TComponent = unknown>(matcherName: string, getLocator: (component: TComponent & TLocatorSymbolInterface) => LocatorType, createMatcherLogic: (params: CreateMatcherLogicParams<TComponent>, ...args: TArgs) => Promise<void>, createMessage?: (isNot: boolean, ...args: TArgs) => string): (this: ExpectMatcherState, component: TComponent & TLocatorSymbolInterface, ...args: TArgs) => Promise<MatcherReturnType>;
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.createComponentAsyncMatcher = createComponentAsyncMatcher;
|
|
49
|
+
exports.createAsyncMatcher = createAsyncMatcher;
|
|
50
|
+
var makeMatcher_1 = require("../utils/makeMatcher");
|
|
51
|
+
var toMatchMessage_1 = require("../utils/toMatchMessage");
|
|
52
|
+
/**
|
|
53
|
+
* Создает асинхронный матчер для конкретного компонента
|
|
54
|
+
* @param matcherName - имя матчера
|
|
55
|
+
* @param getLocator - функция для получения локатора
|
|
56
|
+
* @param createMatcherLogic - функция для создания логики матчера
|
|
57
|
+
* @param createMessage - функция для создания сообщения
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const toExampleEx = createComponentAsyncMatcher<Component, [AttributeOptions?]>(
|
|
61
|
+
* 'toExampleEx',
|
|
62
|
+
* component => component.rootLocator,
|
|
63
|
+
* async ({ isNot, locator, component }, options) => {
|
|
64
|
+
* await component.waitFor();
|
|
65
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
66
|
+
* await expectation.toBeEmpty();
|
|
67
|
+
* },
|
|
68
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
69
|
+
* );
|
|
70
|
+
*/
|
|
71
|
+
function createComponentAsyncMatcher(matcherName, getLocator, createMatcherLogic, createMessage) {
|
|
72
|
+
return function matcher(component) {
|
|
73
|
+
var args = [];
|
|
74
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
75
|
+
args[_i - 1] = arguments[_i];
|
|
76
|
+
}
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
var _this = this;
|
|
80
|
+
return __generator(this, function (_c) {
|
|
81
|
+
switch (_c.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
_a = toMatchMessage_1.toMatchMessage;
|
|
84
|
+
_b = [this,
|
|
85
|
+
matcherName];
|
|
86
|
+
return [4 /*yield*/, getLocator(component)];
|
|
87
|
+
case 1: return [2 /*return*/, _a.apply(void 0, _b.concat([_c.sent(), function (isNot, locator) {
|
|
88
|
+
return (0, makeMatcher_1.makeMatcher)(isNot, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0: return [4 /*yield*/, createMatcherLogic.apply(void 0, __spreadArray([{ isNot: isNot, locator: locator, component: component }], args, false))];
|
|
92
|
+
case 1:
|
|
93
|
+
_a.sent();
|
|
94
|
+
return [2 /*return*/];
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}); });
|
|
98
|
+
}, createMessage === null || createMessage === void 0 ? void 0 : createMessage.apply(void 0, __spreadArray([this.isNot], args, false))]))];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Создает асинхронный типизированный матчер для компонента с символом локатора
|
|
106
|
+
* @param matcherName - имя матчера
|
|
107
|
+
* @param getLocator - функция для получения локатора
|
|
108
|
+
* @param createMatcherLogic - функция для создания логики матчера
|
|
109
|
+
* @param createMessage - функция для создания сообщения
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* const toExampleEx = createAsyncMatcher<ToExampleExLocator, [AttributeOptions?], BaseComponent>(
|
|
113
|
+
* 'toExampleEx',
|
|
114
|
+
* component => component[toExampleExLocator](),
|
|
115
|
+
* async ({ isNot, locator, component }, options) => {
|
|
116
|
+
* await component.waitFor();
|
|
117
|
+
* const expectation = isNot ? baseExpect(locator).not : baseExpect(locator);
|
|
118
|
+
* await expectation.toBeEmpty();
|
|
119
|
+
* },
|
|
120
|
+
* isNot => (isNot ? 'not to be example' : 'to be example'),
|
|
121
|
+
* );
|
|
122
|
+
*/
|
|
123
|
+
function createAsyncMatcher(matcherName, getLocator, createMatcherLogic, createMessage) {
|
|
124
|
+
return function matcher(component) {
|
|
125
|
+
var args = [];
|
|
126
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
127
|
+
args[_i - 1] = arguments[_i];
|
|
128
|
+
}
|
|
129
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
var _this = this;
|
|
132
|
+
return __generator(this, function (_c) {
|
|
133
|
+
switch (_c.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
_a = toMatchMessage_1.toMatchMessage;
|
|
136
|
+
_b = [this,
|
|
137
|
+
matcherName];
|
|
138
|
+
return [4 /*yield*/, getLocator(component)];
|
|
139
|
+
case 1: return [2 /*return*/, _a.apply(void 0, _b.concat([_c.sent(), function (isNot, locator) {
|
|
140
|
+
return (0, makeMatcher_1.makeMatcher)(isNot, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
141
|
+
return __generator(this, function (_a) {
|
|
142
|
+
switch (_a.label) {
|
|
143
|
+
case 0: return [4 /*yield*/, createMatcherLogic.apply(void 0, __spreadArray([{ isNot: isNot, locator: locator, component: component }], args, false))];
|
|
144
|
+
case 1:
|
|
145
|
+
_a.sent();
|
|
146
|
+
return [2 /*return*/];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}); });
|
|
150
|
+
}, createMessage === null || createMessage === void 0 ? void 0 : createMessage.apply(void 0, __spreadArray([this.isNot], args, false))]))];
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
}
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
import type { Locator, ExpectMatcherState } from '@playwright/test';
|
|
1
|
+
import type { Locator, ExpectMatcherState, MatcherReturnType } from '@playwright/test';
|
|
2
|
+
import type { TransformOptions } from '../options';
|
|
2
3
|
export type Transform = (value: string) => string;
|
|
4
|
+
declare const matchers: {
|
|
5
|
+
readonly toHaveFormattedValue: typeof toHaveFormattedValue;
|
|
6
|
+
readonly toHaveFormattedText: typeof toHaveFormattedText;
|
|
7
|
+
readonly toContainFormattedText: typeof toContainFormattedText;
|
|
8
|
+
};
|
|
9
|
+
export type FormattedMatchers = typeof matchers;
|
|
3
10
|
/**
|
|
4
11
|
* Набор проверок, которые игнорируют форматирование значения. По-умолчанию игнорируют пробелы.
|
|
5
12
|
*/
|
|
6
13
|
export declare const formattedMatchers: import("@playwright/test").Expect<{
|
|
7
|
-
toHaveFormattedValue
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}): Promise<{
|
|
11
|
-
message: () => string;
|
|
12
|
-
pass: boolean;
|
|
13
|
-
name: string;
|
|
14
|
-
expected: string;
|
|
15
|
-
actual: unknown;
|
|
16
|
-
}>;
|
|
17
|
-
toHaveFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: {
|
|
18
|
-
timeout?: number;
|
|
19
|
-
transform?: Transform;
|
|
20
|
-
}): Promise<{
|
|
21
|
-
message: () => string;
|
|
22
|
-
pass: boolean;
|
|
23
|
-
name: string;
|
|
24
|
-
expected: string;
|
|
25
|
-
actual: unknown;
|
|
26
|
-
}>;
|
|
27
|
-
toContainFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: {
|
|
28
|
-
timeout?: number;
|
|
29
|
-
transform?: Transform;
|
|
30
|
-
}): Promise<{
|
|
31
|
-
message: () => string;
|
|
32
|
-
pass: boolean;
|
|
33
|
-
name: string;
|
|
34
|
-
expected: string;
|
|
35
|
-
actual: unknown;
|
|
36
|
-
}>;
|
|
14
|
+
readonly toHaveFormattedValue: typeof toHaveFormattedValue;
|
|
15
|
+
readonly toHaveFormattedText: typeof toHaveFormattedText;
|
|
16
|
+
readonly toContainFormattedText: typeof toContainFormattedText;
|
|
37
17
|
}>;
|
|
18
|
+
declare function toHaveFormattedValue(this: ExpectMatcherState, locator: Locator, expected: string, options?: TransformOptions): Promise<MatcherReturnType>;
|
|
19
|
+
declare function toHaveFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: TransformOptions): Promise<MatcherReturnType>;
|
|
20
|
+
declare function toContainFormattedText(this: ExpectMatcherState, locator: Locator, expected: string, options?: TransformOptions): Promise<MatcherReturnType>;
|
|
21
|
+
export {};
|
|
@@ -39,21 +39,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.formattedMatchers = void 0;
|
|
40
40
|
var test_1 = require("@playwright/test");
|
|
41
41
|
var removeSpaces = function (value) { return value.replace(/\s/g, ''); };
|
|
42
|
+
var matchers = {
|
|
43
|
+
toHaveFormattedValue: toHaveFormattedValue,
|
|
44
|
+
toHaveFormattedText: toHaveFormattedText,
|
|
45
|
+
toContainFormattedText: toContainFormattedText,
|
|
46
|
+
};
|
|
42
47
|
/**
|
|
43
48
|
* Набор проверок, которые игнорируют форматирование значения. По-умолчанию игнорируют пробелы.
|
|
44
49
|
*/
|
|
45
|
-
exports.formattedMatchers = test_1.expect.extend(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
function toHaveFormatted(getter, assertionName, context, strictExpect) {
|
|
50
|
+
exports.formattedMatchers = test_1.expect.extend(matchers);
|
|
51
|
+
function toHaveFormattedValue(locator, expected, options) {
|
|
52
|
+
return toHaveFormatted(this, 'toHaveFormattedValue', function (locator) { return locator.inputValue(); })(locator, expected, options);
|
|
53
|
+
}
|
|
54
|
+
function toHaveFormattedText(locator, expected, options) {
|
|
55
|
+
return toHaveFormatted(this, 'toHaveFormattedText', function (locator) { return locator.textContent(); })(locator, expected, options);
|
|
56
|
+
}
|
|
57
|
+
function toContainFormattedText(locator, expected, options) {
|
|
58
|
+
return toHaveFormatted(this, 'toContainFormattedText', function (locator) { return locator.textContent(); }, false)(locator, expected, options);
|
|
59
|
+
}
|
|
60
|
+
function toHaveFormatted(context, matcherName, getter, strictExpect) {
|
|
57
61
|
var _this = this;
|
|
58
62
|
if (strictExpect === void 0) { strictExpect = true; }
|
|
59
63
|
return function (locator, expected, options) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -99,14 +103,14 @@ function toHaveFormatted(getter, assertionName, context, strictExpect) {
|
|
|
99
103
|
case 7:
|
|
100
104
|
message = pass
|
|
101
105
|
? function () {
|
|
102
|
-
return context.utils.matcherHint(
|
|
106
|
+
return context.utils.matcherHint(matcherName, undefined, undefined, { isNot: context.isNot }) +
|
|
103
107
|
'\n\n' +
|
|
104
108
|
"Locator: ".concat(locator, "\n") +
|
|
105
109
|
"Expected: ".concat(context.isNot ? 'not' : '').concat(context.utils.printExpected(expected), "\n") +
|
|
106
110
|
(actual ? "Received: ".concat(context.utils.printReceived(actual)) : '');
|
|
107
111
|
}
|
|
108
112
|
: function () {
|
|
109
|
-
return context.utils.matcherHint(
|
|
113
|
+
return context.utils.matcherHint(matcherName, undefined, undefined, { isNot: context.isNot }) +
|
|
110
114
|
'\n\n' +
|
|
111
115
|
"Locator: ".concat(locator, "\n") +
|
|
112
116
|
"Expected: ".concat(context.utils.printExpected(expected), "\n") +
|
|
@@ -115,7 +119,7 @@ function toHaveFormatted(getter, assertionName, context, strictExpect) {
|
|
|
115
119
|
return [2 /*return*/, {
|
|
116
120
|
message: message,
|
|
117
121
|
pass: pass,
|
|
118
|
-
name:
|
|
122
|
+
name: matcherName,
|
|
119
123
|
expected: expected,
|
|
120
124
|
actual: actual,
|
|
121
125
|
}];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './formattedMatchers';
|
|
2
|
-
export
|
|
2
|
+
export * from './componentMatchers';
|
|
@@ -14,7 +14,5 @@ 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
|
-
exports.mergedExpects = void 0;
|
|
18
17
|
__exportStar(require("./formattedMatchers"), exports);
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports, "mergedExpects", { enumerable: true, get: function () { return mergedExpects_1.mergedExpects; } });
|
|
18
|
+
__exportStar(require("./componentMatchers"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MatcherResult = {
|
|
2
|
+
message: string;
|
|
3
|
+
pass: boolean;
|
|
4
|
+
actual: string;
|
|
5
|
+
name: string;
|
|
6
|
+
expected: string;
|
|
7
|
+
log: string[];
|
|
8
|
+
stack: string;
|
|
9
|
+
} | string | undefined;
|
|
10
|
+
export type WithMatcherResult = {
|
|
11
|
+
matcherResult: MatcherResult;
|
|
12
|
+
};
|
|
13
|
+
export declare const getActualFromError: (e: unknown) => MatcherResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActualFromError = void 0;
|
|
4
|
+
var getActualFromError = function (e) {
|
|
5
|
+
if (e && typeof e === 'object' && 'matcherResult' in e && e.matcherResult) {
|
|
6
|
+
return e.matcherResult;
|
|
7
|
+
}
|
|
8
|
+
if (e && typeof e === 'object') {
|
|
9
|
+
return e.toString();
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
exports.getActualFromError = getActualFromError;
|
package/build/src/utils/index.js
CHANGED
|
@@ -18,3 +18,6 @@ exports.getTooltip = void 0;
|
|
|
18
18
|
var tooltipProvider_1 = require("./tooltipProvider");
|
|
19
19
|
Object.defineProperty(exports, "getTooltip", { enumerable: true, get: function () { return tooltipProvider_1.getTooltip; } });
|
|
20
20
|
__exportStar(require("./constants"), exports);
|
|
21
|
+
__exportStar(require("./toMatchMessage"), exports);
|
|
22
|
+
__exportStar(require("./getMarcherResult"), exports);
|
|
23
|
+
__exportStar(require("./makeMatcher"), exports);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import type { BaseComponent } from '../components';
|
|
3
|
+
export declare const isComponent: <T extends BaseComponent>(component: unknown, instance: new (rootLocator: Locator, itemsLocator: (rootLocator: Locator) => Locator, itemFactory: (locator: Locator) => BaseComponent) => T) => component is T;
|