@m4l/testing 0.0.23 → 1.0.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/README.md +679 -0
- package/chunks/reactLeaflet-Cffkauof.js +1846 -0
- package/chunks/render-CsuV8xqo.js +17 -0
- package/chunks/userPreferences-BmOgRaIX.js +493 -0
- package/index.js +76 -25
- package/mocks/index.js +41 -0
- package/package.json +85 -102
- package/playwright/index.js +2041 -0
- package/rtl/index.js +180 -0
- package/types/libs/observability/mf/src/browserRuntimeHandles.d.ts +112 -0
- package/types/libs/observability/mf/src/diagnosticLogging.d.ts +2 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/catalog.d.ts +267 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/contracts.d.ts +64 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/host.d.ts +139 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/index.d.ts +6 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.d.ts +104 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/sharedReportsList.d.ts +44 -0
- package/types/libs/observability/mf/src/diagnosticPolicyKeys.d.ts +34 -0
- package/types/libs/observability/mf/src/index.d.ts +14 -0
- package/types/libs/observability/mf/src/runtimeSmoke.d.ts +13 -0
- package/types/libs/observability/mf/src/telemetry.d.ts +2 -0
- package/types/libs/observability/shared/src/diagnosticLogging.d.ts +97 -0
- package/types/libs/observability/shared/src/index.d.ts +6 -0
- package/types/libs/observability/shared/src/runtimeHandles.d.ts +27 -0
- package/types/libs/observability/shared/src/telemetry.d.ts +179 -0
- package/types/packages/testing/mocks/src/constants.d.ts +10 -0
- package/types/packages/testing/mocks/src/fixtures.d.ts +258 -0
- package/types/packages/testing/mocks/src/helpers/environment.d.ts +44 -0
- package/types/packages/testing/mocks/src/helpers/hostTools.d.ts +10 -0
- package/types/packages/testing/mocks/src/helpers/index.d.ts +5 -0
- package/types/packages/testing/mocks/src/helpers/moduleDictionary.d.ts +9 -0
- package/types/packages/testing/mocks/src/helpers/toaster.d.ts +9 -0
- package/types/packages/testing/mocks/src/helpers/userPreferences.d.ts +17 -0
- package/types/packages/testing/mocks/src/index.d.ts +4 -0
- package/types/packages/testing/mocks/src/types.d.ts +233 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAreaFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfMenuFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfModuleDictionaryFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedSessionFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/createHostCookieFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostGuestSessionFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostLocaleFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostMfPreviewDynamicParamsFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostModuleDictionaryFixture.d.ts +11 -0
- package/types/packages/testing/playwright/src/fixtures/createHostUiConfigFixture.d.ts +7 -0
- package/types/packages/testing/playwright/src/fixtures/createHostUserPreferencesFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/createListResponseFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/index.d.ts +12 -0
- package/types/packages/testing/playwright/src/helpers/attachJson.d.ts +9 -0
- package/types/packages/testing/playwright/src/helpers/formAccess.d.ts +53 -0
- package/types/packages/testing/playwright/src/helpers/formSelect.d.ts +51 -0
- package/types/packages/testing/playwright/src/helpers/formatFailedChecks.d.ts +18 -0
- package/types/packages/testing/playwright/src/helpers/index.d.ts +16 -0
- package/types/packages/testing/playwright/src/helpers/listDatagrid.d.ts +219 -0
- package/types/packages/testing/playwright/src/helpers/listDetail.d.ts +65 -0
- package/types/packages/testing/playwright/src/helpers/listFilter.d.ts +27 -0
- package/types/packages/testing/playwright/src/helpers/listSort.d.ts +19 -0
- package/types/packages/testing/playwright/src/helpers/listStatePersistence.d.ts +15 -0
- package/types/packages/testing/playwright/src/helpers/openHostAccountMenuModule.d.ts +10 -0
- package/types/packages/testing/playwright/src/helpers/openHostAuthenticatedMfPreviewModule.d.ts +5 -0
- package/types/packages/testing/playwright/src/helpers/openHostMobileSidebarModule.d.ts +15 -0
- package/types/packages/testing/playwright/src/helpers/openHostSidebarModule.d.ts +5 -0
- package/types/packages/testing/playwright/src/helpers/realtimePerformanceBrowser.d.ts +144 -0
- package/types/packages/testing/playwright/src/helpers/viewModeDataGrid.d.ts +67 -0
- package/types/packages/testing/playwright/src/helpers/waitForBrowserCondition.d.ts +38 -0
- package/types/packages/testing/playwright/src/index.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/index.d.ts +20 -0
- package/types/packages/testing/playwright/src/installers/installHostAlarmsCountRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAreasRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedBootstrapRoutes.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfModuleDictionaryRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfPreviewBootstrap.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedSessionRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostCookiesRoute.d.ts +8 -0
- package/types/packages/testing/playwright/src/installers/installHostGuestBootstrapRoutes.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostGuestSessionRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostLocaleRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostMenusRoute.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/installHostModuleDictionaryRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostPasswordNewRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostPasswordResetRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostUiConfigAssetRoutes.d.ts +9 -0
- package/types/packages/testing/playwright/src/installers/installHostUiConfigRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostUserPreferencesRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installListEndpointRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installMicrofrontendRenderStub.d.ts +9 -0
- package/types/packages/testing/playwright/src/installers/installModulePrivilegesRoute.d.ts +11 -0
- package/types/packages/testing/playwright/src/types.d.ts +598 -0
- package/types/packages/testing/rtl/src/index.d.ts +4 -0
- package/types/packages/testing/rtl/src/matchMedia.d.ts +10 -0
- package/types/packages/testing/rtl/src/render.d.ts +17 -0
- package/types/packages/testing/rtl/src/resizeObserver.d.ts +33 -0
- package/types/packages/testing/rtl/src/storage.d.ts +10 -0
- package/types/packages/testing/src/index.d.ts +6 -0
- package/types/packages/testing/vitest/src/constants.d.ts +24 -0
- package/types/packages/testing/vitest/src/factories/app/index.d.ts +5 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppBase.d.ts +9 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppComponents.d.ts +20 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppCore.d.ts +12 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppGraphics.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppLayouts.d.ts +18 -0
- package/types/packages/testing/vitest/src/factories/base/index.d.ts +1 -0
- package/types/packages/testing/vitest/src/factories/base/m4lBaseComponents.d.ts +13 -0
- package/types/packages/testing/vitest/src/factories/index.d.ts +7 -0
- package/types/packages/testing/vitest/src/factories/leaflet.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/packages/index.d.ts +7 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageBase.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageComponents.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageCore.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclick.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclickRealtime.d.ts +6 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGraphics.d.ts +9 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageLayouts.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/reResizable.d.ts +6 -0
- package/types/packages/testing/vitest/src/factories/reactHookForm.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/reactLeaflet.d.ts +10 -0
- package/types/packages/testing/vitest/src/fixtures.d.ts +71 -0
- package/types/packages/testing/vitest/src/helpers/columnConfigs.d.ts +184 -0
- package/types/packages/testing/vitest/src/helpers/elementMocks.d.ts +166 -0
- package/types/packages/testing/vitest/src/helpers/filterFields.d.ts +37 -0
- package/types/packages/testing/vitest/src/helpers/index.d.ts +9 -0
- package/types/packages/testing/vitest/src/helpers/mapStore.d.ts +9 -0
- package/types/packages/testing/vitest/src/helpers/moduleContract.d.ts +15 -0
- package/types/packages/testing/vitest/src/helpers/rhf.d.ts +8 -0
- package/types/packages/testing/vitest/src/helpers/serialization.d.ts +7 -0
- package/types/packages/testing/vitest/src/helpers/sortFields.d.ts +28 -0
- package/types/packages/testing/vitest/src/helpers/windowSizes.d.ts +1 -0
- package/types/packages/testing/vitest/src/index.d.ts +6 -0
- package/types/packages/testing/vitest/src/installers/consoleError.d.ts +9 -0
- package/types/packages/testing/vitest/src/installers/index.d.ts +2 -0
- package/types/packages/testing/vitest/src/installers/rhfSubmit.d.ts +9 -0
- package/types/packages/testing/vitest/src/types.d.ts +116 -0
- package/vitest/index.js +55 -0
- package/e2e/commands/components/Accordions/commands.d.ts +0 -4
- package/e2e/commands/components/Accordions/commands.js +0 -19
- package/e2e/commands/components/Accordions/types.d.ts +0 -63
- package/e2e/commands/components/CommonActions/commands.d.ts +0 -4
- package/e2e/commands/components/CommonActions/commands.js +0 -11
- package/e2e/commands/components/CommonActions/types.d.ts +0 -20
- package/e2e/commands/components/DataGrid/commands.d.ts +0 -4
- package/e2e/commands/components/DataGrid/commands.js +0 -42
- package/e2e/commands/components/DataGrid/types.d.ts +0 -140
- package/e2e/commands/components/DynamicFilter/commands.d.ts +0 -4
- package/e2e/commands/components/DynamicFilter/commands.js +0 -12
- package/e2e/commands/components/DynamicFilter/types.d.ts +0 -27
- package/e2e/commands/components/DynamicSort/commands.d.ts +0 -4
- package/e2e/commands/components/DynamicSort/commands.js +0 -10
- package/e2e/commands/components/DynamicSort/types.d.ts +0 -26
- package/e2e/commands/components/Filters/commands.d.ts +0 -4
- package/e2e/commands/components/Filters/commands.js +0 -24
- package/e2e/commands/components/Filters/types.d.ts +0 -91
- package/e2e/commands/components/MenuActions/commands.d.ts +0 -4
- package/e2e/commands/components/MenuActions/commands.js +0 -8
- package/e2e/commands/components/MenuActions/types.d.ts +0 -24
- package/e2e/commands/components/Popover/commands.d.ts +0 -4
- package/e2e/commands/components/Popover/commands.js +0 -8
- package/e2e/commands/components/Popover/types.d.ts +0 -15
- package/e2e/commands/components/PropertyValue/commands.d.ts +0 -4
- package/e2e/commands/components/PropertyValue/commands.js +0 -8
- package/e2e/commands/components/PropertyValue/types.d.ts +0 -19
- package/e2e/commands/components/Tab/commands.d.ts +0 -4
- package/e2e/commands/components/Tab/commands.js +0 -9
- package/e2e/commands/components/Tab/types.d.ts +0 -29
- package/e2e/commands/components/WindowBase/commands.d.ts +0 -4
- package/e2e/commands/components/WindowBase/commands.js +0 -20
- package/e2e/commands/components/WindowBase/types.d.ts +0 -84
- package/e2e/commands/components/index.d.ts +0 -11
- package/e2e/commands/components/index.js +0 -1
- package/e2e/commands/index.d.ts +0 -4
- package/e2e/commands/index.js +0 -1
- package/e2e/commands/intercepts/index.d.ts +0 -2
- package/e2e/commands/intercepts/index.js +0 -1
- package/e2e/commands/intercepts/noPrivileges/interceptCommands.d.ts +0 -5
- package/e2e/commands/intercepts/noPrivileges/interceptCommands.js +0 -15
- package/e2e/commands/intercepts/noPrivileges/types.d.ts +0 -8
- package/e2e/commands/intercepts/noPrivileges/types.js +0 -1
- package/e2e/commands/register.d.ts +0 -4
- package/e2e/commands/register.js +0 -18
- package/e2e/cypress.d.js +0 -1
- package/e2e/cypress.d.ts +0 -23
- package/e2e/index.d.ts +0 -1
- package/e2e/types.d.ts +0 -4
- package/index.d.ts +0 -4
- package/index.test.d.ts +0 -1
- package/testComponents/DataGrid/helpers.d.ts +0 -5
- package/testComponents/DataGrid/helpers.js +0 -95
- package/testComponents/DataGrid/index.d.ts +0 -2
- package/testComponents/DataGrid/index.js +0 -1
- package/testComponents/DataGrid/types.d.ts +0 -54
- package/testComponents/DataGrid/types.js +0 -1
- package/testComponents/DynamicFilter/helpers.d.ts +0 -5
- package/testComponents/DynamicFilter/helpers.js +0 -18
- package/testComponents/DynamicFilter/index.d.ts +0 -1
- package/testComponents/DynamicFilter/index.js +0 -1
- package/testComponents/DynamicFilter/types.d.ts +0 -0
- package/testComponents/DynamicSort/helpers.d.ts +0 -5
- package/testComponents/DynamicSort/helpers.js +0 -16
- package/testComponents/DynamicSort/index.d.ts +0 -1
- package/testComponents/DynamicSort/index.js +0 -1
- package/testComponents/index.d.ts +0 -3
- package/testComponents/index.js +0 -1
- package/testTools/constants.d.ts +0 -0
- package/testTools/index.d.ts +0 -1
- package/testTools/index.js +0 -1
- package/testTools/mocks.d.ts +0 -0
- package/testTools/setup.d.ts +0 -0
- package/testTools/setup.js +0 -1
- package/testTools/types.d.ts +0 -0
- package/testTools/utils.d.ts +0 -11
- package/testTools/utils.js +0 -23
- package/vite-env.d.ts +0 -5
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { BrowserHistory } from 'history';
|
|
2
|
+
export type TestCallback<T = unknown> = (...args: unknown[]) => T;
|
|
3
|
+
export type ToasterFixture = TestCallback<number> & {
|
|
4
|
+
error: TestCallback<number>;
|
|
5
|
+
info: TestCallback<number>;
|
|
6
|
+
success: TestCallback<number>;
|
|
7
|
+
warning: TestCallback<number>;
|
|
8
|
+
};
|
|
9
|
+
export interface HostToolsFixture {
|
|
10
|
+
events_add_listener: TestCallback;
|
|
11
|
+
events_emit: TestCallback;
|
|
12
|
+
events_remove_listener: TestCallback;
|
|
13
|
+
history: BrowserHistory;
|
|
14
|
+
startProgress: TestCallback;
|
|
15
|
+
stopProgress: TestCallback;
|
|
16
|
+
toast: ToasterFixture;
|
|
17
|
+
}
|
|
18
|
+
export interface HostToolsFixtureOverrides {
|
|
19
|
+
events_add_listener?: TestCallback;
|
|
20
|
+
events_emit?: TestCallback;
|
|
21
|
+
events_remove_listener?: TestCallback;
|
|
22
|
+
history?: BrowserHistory;
|
|
23
|
+
startProgress?: TestCallback;
|
|
24
|
+
stopProgress?: TestCallback;
|
|
25
|
+
toast?: ToasterFixture;
|
|
26
|
+
}
|
|
27
|
+
export interface EnvironmentFixture {
|
|
28
|
+
isLocalhost: boolean;
|
|
29
|
+
host: string;
|
|
30
|
+
database: string;
|
|
31
|
+
domain_token: string;
|
|
32
|
+
domainToken: string;
|
|
33
|
+
host_api_local: string;
|
|
34
|
+
hostApiLocal: string;
|
|
35
|
+
host_api_remote: string;
|
|
36
|
+
hostApiRemote: string;
|
|
37
|
+
hostRemote: string;
|
|
38
|
+
hostApiIcons: string;
|
|
39
|
+
host_static_assets: string;
|
|
40
|
+
environment_assets: string;
|
|
41
|
+
isIsolatation: boolean;
|
|
42
|
+
isMicroFrontend: boolean;
|
|
43
|
+
getModuleUrlIconAsset: () => string;
|
|
44
|
+
}
|
|
45
|
+
export interface UseEnvironmentValueFixture {
|
|
46
|
+
host_static_assets: string;
|
|
47
|
+
environment_assets: string;
|
|
48
|
+
host_api_local: string;
|
|
49
|
+
hostApiLocal: string;
|
|
50
|
+
host_api_remote: string;
|
|
51
|
+
hostApiRemote: string;
|
|
52
|
+
domain_token: string;
|
|
53
|
+
domainToken: string;
|
|
54
|
+
hostRemote: string;
|
|
55
|
+
hostApiIcons: string;
|
|
56
|
+
}
|
|
57
|
+
export interface UseModuleDictionaryValueFixture {
|
|
58
|
+
getLabel: (key: string, value?: string) => string;
|
|
59
|
+
getModuleLabel: () => string;
|
|
60
|
+
}
|
|
61
|
+
export interface CreateUseModuleDictionaryValueFixtureOptions {
|
|
62
|
+
fallbackToKey?: boolean;
|
|
63
|
+
getLabel?: (key: string, value?: string) => string;
|
|
64
|
+
labels?: Record<string, string>;
|
|
65
|
+
moduleLabel?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface ModuleDictionaryFixture {
|
|
68
|
+
data: Record<string, string>;
|
|
69
|
+
[section: string]: Record<string, string>;
|
|
70
|
+
}
|
|
71
|
+
export interface PrivilegesResponseFixture {
|
|
72
|
+
data: Record<string, boolean>;
|
|
73
|
+
}
|
|
74
|
+
export interface DomainFixture {
|
|
75
|
+
data: {
|
|
76
|
+
name: string;
|
|
77
|
+
company_logo_small_url: string;
|
|
78
|
+
company_logo_normal_url: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export interface DomainCountryFixture {
|
|
82
|
+
id: number;
|
|
83
|
+
currency: string;
|
|
84
|
+
currency_decimal_digits: number;
|
|
85
|
+
decimal_symbol: string;
|
|
86
|
+
thousands_symbol: string;
|
|
87
|
+
}
|
|
88
|
+
export interface UserPreferencesMagnitudeUnitFixture {
|
|
89
|
+
id: string;
|
|
90
|
+
symbol: string;
|
|
91
|
+
}
|
|
92
|
+
export interface UserPreferencesMagnitudeFactorFixture {
|
|
93
|
+
factorX0: number;
|
|
94
|
+
factorX1: number;
|
|
95
|
+
factorX2: number;
|
|
96
|
+
}
|
|
97
|
+
export interface UserPreferencesMagnitudePropertyFixture {
|
|
98
|
+
baseMagnitudeId: string;
|
|
99
|
+
id: string;
|
|
100
|
+
magnitudeUnitBase: UserPreferencesMagnitudeUnitFixture;
|
|
101
|
+
magnitudeUnitUser: UserPreferencesMagnitudeUnitFixture;
|
|
102
|
+
factor: UserPreferencesMagnitudeFactorFixture;
|
|
103
|
+
}
|
|
104
|
+
export interface UserPreferencesTimeZoneFixture {
|
|
105
|
+
id: number;
|
|
106
|
+
name: string;
|
|
107
|
+
title?: string;
|
|
108
|
+
baseOffset: number;
|
|
109
|
+
dstOffset: number;
|
|
110
|
+
countryCode?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface UserPreferencesFixture {
|
|
113
|
+
decimalSymbol: string;
|
|
114
|
+
thousandsSymbol: string;
|
|
115
|
+
dateFormat: string;
|
|
116
|
+
timeFormat: string;
|
|
117
|
+
timeZone: UserPreferencesTimeZoneFixture | null;
|
|
118
|
+
locale: string | null;
|
|
119
|
+
magnitudesSystemId: number | null;
|
|
120
|
+
properties: UserPreferencesMagnitudePropertyFixture[];
|
|
121
|
+
currency: string;
|
|
122
|
+
currencyDecimalDigits: number;
|
|
123
|
+
}
|
|
124
|
+
export interface UserPreferencesMagnitudePropertySelectorFixture {
|
|
125
|
+
propertyId?: string;
|
|
126
|
+
baseMagnitudeId?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ResolveNumberPresentationFixtureOptions {
|
|
129
|
+
value: number | null | undefined;
|
|
130
|
+
fallbackValue: string;
|
|
131
|
+
fractionDigits?: number;
|
|
132
|
+
formatValue?: (value: number) => string;
|
|
133
|
+
}
|
|
134
|
+
export interface ResolveMagnitudePresentationFixtureOptions extends UserPreferencesMagnitudePropertySelectorFixture {
|
|
135
|
+
baseValue: number | null | undefined;
|
|
136
|
+
fallbackSymbol?: string;
|
|
137
|
+
fallbackValue: string;
|
|
138
|
+
fractionDigits?: number;
|
|
139
|
+
formatValue?: (value: number) => string;
|
|
140
|
+
}
|
|
141
|
+
export interface UserPreferencesContextValueFixture extends UserPreferencesFixture {
|
|
142
|
+
changeUserPreferences: (newUserPreferences: UserPreferencesFixture) => void;
|
|
143
|
+
getMagnitudeProperty: (selector: UserPreferencesMagnitudePropertySelectorFixture) => UserPreferencesMagnitudePropertyFixture | undefined;
|
|
144
|
+
formatNumber: (options: ResolveNumberPresentationFixtureOptions) => string;
|
|
145
|
+
convertMagnitude: (options: ResolveMagnitudePresentationFixtureOptions) => {
|
|
146
|
+
source: 'fallback' | 'user-preference';
|
|
147
|
+
symbol?: string;
|
|
148
|
+
value: string;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export interface UserPreferencesApiDataFixture {
|
|
152
|
+
locale: {
|
|
153
|
+
id: string;
|
|
154
|
+
lang: string;
|
|
155
|
+
region: string | null;
|
|
156
|
+
script: string;
|
|
157
|
+
name: string;
|
|
158
|
+
url_icon: string;
|
|
159
|
+
} | null;
|
|
160
|
+
time_zone: {
|
|
161
|
+
id: number;
|
|
162
|
+
name: string;
|
|
163
|
+
title?: string;
|
|
164
|
+
base_offset: number;
|
|
165
|
+
dst_offset: number;
|
|
166
|
+
country_code?: string;
|
|
167
|
+
} | null;
|
|
168
|
+
magnitudes_system: {
|
|
169
|
+
id: number;
|
|
170
|
+
name: string;
|
|
171
|
+
} | null;
|
|
172
|
+
properties: Array<{
|
|
173
|
+
base_magnitude_id: string;
|
|
174
|
+
id: string;
|
|
175
|
+
value: {
|
|
176
|
+
magnitude_unit_base: UserPreferencesMagnitudeUnitFixture;
|
|
177
|
+
magnitude_unit_user: UserPreferencesMagnitudeUnitFixture;
|
|
178
|
+
factor: {
|
|
179
|
+
factor_x0: number;
|
|
180
|
+
factor_x1: number;
|
|
181
|
+
factor_x2: number;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
}>;
|
|
185
|
+
date_format: {
|
|
186
|
+
id: number;
|
|
187
|
+
format: string;
|
|
188
|
+
name: string;
|
|
189
|
+
};
|
|
190
|
+
time_format: {
|
|
191
|
+
id: number;
|
|
192
|
+
format: string;
|
|
193
|
+
name: string;
|
|
194
|
+
};
|
|
195
|
+
decimal_symbol: string;
|
|
196
|
+
thousands_symbol: string;
|
|
197
|
+
currency: string;
|
|
198
|
+
currency_decimal_digits: number;
|
|
199
|
+
}
|
|
200
|
+
export interface AxiosOperationResultFixture {
|
|
201
|
+
data: {
|
|
202
|
+
a: number;
|
|
203
|
+
b: string;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export interface NetworkRequestFixture {
|
|
207
|
+
method: string;
|
|
208
|
+
endPoint: string;
|
|
209
|
+
parms: Record<string, unknown>;
|
|
210
|
+
}
|
|
211
|
+
export interface BaseProviderValueFixture {
|
|
212
|
+
a: string;
|
|
213
|
+
b: number;
|
|
214
|
+
}
|
|
215
|
+
export interface FormatterValuesFixture {
|
|
216
|
+
currencyFormatter: {
|
|
217
|
+
decimalDigits: number;
|
|
218
|
+
code: string;
|
|
219
|
+
};
|
|
220
|
+
numberFormatter: {
|
|
221
|
+
decimalSymbol: string;
|
|
222
|
+
thousandsSymbol: string;
|
|
223
|
+
};
|
|
224
|
+
dateFormatter: {
|
|
225
|
+
dateFormat: string;
|
|
226
|
+
dateMask: string;
|
|
227
|
+
datetimeFormat: string;
|
|
228
|
+
datetimeMask: string;
|
|
229
|
+
timeFormat: string;
|
|
230
|
+
timeMask: string;
|
|
231
|
+
formatDate: (...args: Parameters<typeof import('date-fns').format>) => ReturnType<typeof import('date-fns').format>;
|
|
232
|
+
};
|
|
233
|
+
}
|
package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfMenuFixture.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreateHostAuthenticatedMfMenuFixtureOptions, HostMenuItemFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build the minimal authenticated host menu tree required to launch one MF.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createHostAuthenticatedMfMenuFixture(options: CreateHostAuthenticatedMfMenuFixtureOptions): HostMenuItemFixture[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreateHostAuthenticatedMfModuleDictionaryFixtureOptions, HostModuleDictionaryFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build the standard module-dictionary payload used by authenticated MF preview flows.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createHostAuthenticatedMfModuleDictionaryFixture(options: CreateHostAuthenticatedMfModuleDictionaryFixtureOptions): HostModuleDictionaryFixture;
|
package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedSessionFixture.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HostAuthenticatedSessionFixture, HostAuthenticatedSessionUserFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a deterministic authenticated session response for host platform
|
|
4
|
+
* flows.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createHostAuthenticatedSessionFixture(overrides?: Partial<HostAuthenticatedSessionUserFixture>): HostAuthenticatedSessionFixture;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HostGuestSessionFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a deterministic unauthenticated session response for host guest flows.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createHostGuestSessionFixture(overrides?: Partial<HostGuestSessionFixture>): HostGuestSessionFixture;
|
package/types/packages/testing/playwright/src/fixtures/createHostMfPreviewDynamicParamsFixture.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreateHostMfPreviewDynamicParamsFixtureOptions, HostMfPreviewDynamicParamsFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build shared dynamic parameters for authenticated MF preview scenarios.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createHostMfPreviewDynamicParamsFixture(options?: CreateHostMfPreviewDynamicParamsFixtureOptions): HostMfPreviewDynamicParamsFixture;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HostModuleDictionaryFixture } from '../types';
|
|
2
|
+
export interface CreateHostModuleDictionaryFixtureOptions {
|
|
3
|
+
data?: Record<string, string>;
|
|
4
|
+
sections?: Record<string, Record<string, string>>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Build a deterministic module-dictionary payload for host no-auth/auth shells.
|
|
8
|
+
* Keep feature-specific dictionary contents local to the consuming app E2E
|
|
9
|
+
* project when the labels do not model a reusable host-shell contract.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createHostModuleDictionaryFixture(options?: CreateHostModuleDictionaryFixtureOptions): HostModuleDictionaryFixture;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostUIConfigFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a deterministic UI-config payload for host bootstrap tests.
|
|
4
|
+
* Keep app-specific labels and selectors local; share only the host-shell
|
|
5
|
+
* contract that multiple E2E projects can consume.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createHostUiConfigFixture(overrides?: Partial<HostUIConfigFixture>): HostUIConfigFixture;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HostUserPreferencesFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a deterministic authenticated user-preferences payload for host-style
|
|
4
|
+
* preview bootstrap flows.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createHostUserPreferencesFixture(overrides?: Partial<HostUserPreferencesFixture>): HostUserPreferencesFixture;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CreateListResponseFixtureOptions, ListResponseFixture } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Build the deterministic `{ data, pager }` envelope returned by GClick list
|
|
4
|
+
* endpoints, filling pager defaults so any list E2E can mock rows with one call.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createListResponseFixture<TRow>(options: CreateListResponseFixtureOptions<TRow>): ListResponseFixture<TRow>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './createHostAreaFixture';
|
|
2
|
+
export * from './createListResponseFixture';
|
|
3
|
+
export * from './createHostAuthenticatedMfModuleDictionaryFixture';
|
|
4
|
+
export * from './createHostAuthenticatedMfMenuFixture';
|
|
5
|
+
export * from './createHostAuthenticatedSessionFixture';
|
|
6
|
+
export * from './createHostCookieFixture';
|
|
7
|
+
export * from './createHostGuestSessionFixture';
|
|
8
|
+
export * from './createHostLocaleFixture';
|
|
9
|
+
export * from './createHostMfPreviewDynamicParamsFixture';
|
|
10
|
+
export * from './createHostModuleDictionaryFixture';
|
|
11
|
+
export * from './createHostUiConfigFixture';
|
|
12
|
+
export * from './createHostUserPreferencesFixture';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TestInfo } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Attach one JSON payload to the current Playwright report entry.
|
|
4
|
+
*
|
|
5
|
+
* @param testInfo Current Playwright metadata used to persist attachments.
|
|
6
|
+
* @param name Stable attachment name shown in the HTML report.
|
|
7
|
+
* @param data Serializable payload written as formatted JSON.
|
|
8
|
+
*/
|
|
9
|
+
export declare function attachJson(testInfo: TestInfo, name: string, data: unknown): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* A form scope is either the whole page or a managed-window locator. The add/edit
|
|
4
|
+
* preview renders a single form, so scoping to the page is the safe default.
|
|
5
|
+
*/
|
|
6
|
+
export type FormScope = Page | Locator;
|
|
7
|
+
/**
|
|
8
|
+
* Locate the add/edit form container — the RHF `formContainer` region every
|
|
9
|
+
* `RHFormProvider` + `FormContainer` form renders once it finishes loading.
|
|
10
|
+
*
|
|
11
|
+
* Generic and reusable across ALL add/edit modules: the region accessible name
|
|
12
|
+
* is fixed by the shared `FormContainer` component, so no per-module config is
|
|
13
|
+
* needed. Its presence is the canonical "the form rendered correctly" signal.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getFormContainer(scope: FormScope): Locator;
|
|
16
|
+
/**
|
|
17
|
+
* Locate a form field by its react-hook-form `name`, scoped to the form container.
|
|
18
|
+
*
|
|
19
|
+
* Generic and reusable across ALL add/edit modules: RHF binds every control to a
|
|
20
|
+
* functional `name` attribute (`firstName`, `email`, `canReceiveAlarms`, …) that the
|
|
21
|
+
* form needs at runtime, so it **survives the production bundle** (unlike
|
|
22
|
+
* `data-testid`) and is stable regardless of the field's label or order. Scoping to
|
|
23
|
+
* the form container avoids matching host-shell inputs that share a `name`.
|
|
24
|
+
*
|
|
25
|
+
* Works for text inputs (assert with `toHaveValue`) and checkboxes/switches (assert
|
|
26
|
+
* with `toBeChecked`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFormField(scope: FormScope, name: string): Locator;
|
|
29
|
+
/**
|
|
30
|
+
* Locate the form actions container — the `actionsContainer` group that holds the
|
|
31
|
+
* cancel and submit buttons of every add/edit form.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getFormActionsContainer(scope: FormScope): Locator;
|
|
34
|
+
/**
|
|
35
|
+
* Locate a host toast (the shell's Toastify notification) by a substring of its
|
|
36
|
+
* text. Submit success/error feedback is shown by the host via `useHostTools().toast`
|
|
37
|
+
* and rendered as a `role="alert"` outside the MF window — so scope to `page`, not the
|
|
38
|
+
* form container. The `message` filter disambiguates it from other `alert` nodes.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getToast(scope: FormScope, message: string): Locator;
|
|
41
|
+
/**
|
|
42
|
+
* Locate the confirm dialog the form raises before abandoning unsaved changes
|
|
43
|
+
* (cancel / close-with-X on a dirty form) — the shared `WindowConfirm` modal,
|
|
44
|
+
* rendered as a `role="dialog"`. Scope to `page` (the modal portals to the body).
|
|
45
|
+
* Click its confirm/cancel button via `.getByRole('button', { name })`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getFormConfirmDialog(scope: FormScope): Locator;
|
|
48
|
+
/**
|
|
49
|
+
* Locate a form action button (submit/cancel) by its visible label, scoped to the
|
|
50
|
+
* form actions container. The label is module/dictionary-driven (e.g. `Create`,
|
|
51
|
+
* `Save`, `Cancel`), so the caller passes it; the lookup itself is generic.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getFormActionButton(scope: FormScope, label: string): Locator;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Locator, Page, Request } from '@playwright/test';
|
|
2
|
+
import { type FormScope } from './formAccess';
|
|
3
|
+
/**
|
|
4
|
+
* Form select helpers for `RHFAutocomplete` / `RHFAutocompleteAsync` fields.
|
|
5
|
+
*
|
|
6
|
+
* Derived from the real components (`packages/components/.../hook-form/RHFAutocompleteAsync`)
|
|
7
|
+
* and a real consumer (`operative_devices_edit`): the control renders an
|
|
8
|
+
* `input[role="combobox"]` carrying the react-hook-form `name`; the async variant
|
|
9
|
+
* loads its options via a GET request on first open (and on a typed, debounced
|
|
10
|
+
* search); options render as `role="option"` inside a `role="listbox"`; selecting
|
|
11
|
+
* one sets the input value to the option label.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: no add/edit module with a select field has wired these contracts yet, so
|
|
14
|
+
* the exact endpoint/option shapes must be confirmed against the consuming module
|
|
15
|
+
* (e.g. `operative_devices_edit`) the first time its E2E adds REQ-FORM-DATA-001/002.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Open a form async-select and capture the options request it fires. The async
|
|
19
|
+
* select fetches options via GET on first open (and again when a search term is
|
|
20
|
+
* typed). Returns the captured request so the test can assert the options endpoint
|
|
21
|
+
* was called (REQ-FORM-DATA-001 — "carga de opciones").
|
|
22
|
+
*/
|
|
23
|
+
export declare function openFormSelectAndCaptureRequest(options: {
|
|
24
|
+
page: Page;
|
|
25
|
+
/** The react-hook-form `name` of the select field. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Pattern matching the field's options endpoint. */
|
|
28
|
+
endpointPattern: RegExp;
|
|
29
|
+
/** Optional search term to type (triggers the search request). */
|
|
30
|
+
search?: string;
|
|
31
|
+
}): Promise<Request>;
|
|
32
|
+
/**
|
|
33
|
+
* Locate the options of the currently-open form select dropdown (the `option`s in
|
|
34
|
+
* the open `listbox`). Scope to `page` (the listbox portals to the body).
|
|
35
|
+
*/
|
|
36
|
+
export declare function getFormSelectOptions(scope: FormScope): Locator;
|
|
37
|
+
/**
|
|
38
|
+
* Open a form select and choose an option — by its visible label, or the first
|
|
39
|
+
* option when no label is given. The option is scoped to the open `listbox` and
|
|
40
|
+
* waited for before clicking (the dropdown can render a frame late). On success the
|
|
41
|
+
* field shows the chosen label (REQ-FORM-DATA-002 — "selección de valor").
|
|
42
|
+
*/
|
|
43
|
+
export declare function selectFormOption(options: {
|
|
44
|
+
page: Page;
|
|
45
|
+
/** The react-hook-form `name` of the select field. */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Visible label of the option to choose; defaults to the first option. */
|
|
48
|
+
optionLabel?: string;
|
|
49
|
+
/** Type this search term before picking (async selects that filter by input). */
|
|
50
|
+
search?: string;
|
|
51
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal failed-check shape accepted by the shared formatter.
|
|
3
|
+
*/
|
|
4
|
+
export interface FailedCheckLike {
|
|
5
|
+
/** Observed value captured for the failed check. */
|
|
6
|
+
actual: unknown;
|
|
7
|
+
/** Stable check key used in diagnostics and attachments. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** Human-readable threshold rendered in the failure message. */
|
|
10
|
+
threshold: unknown;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert failed checks into one readable multiline assertion message.
|
|
14
|
+
*
|
|
15
|
+
* @param checks Failed checks that should be rendered for one assertion.
|
|
16
|
+
* @returns Human-readable text ready to be passed as an `expect(...)` message.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatFailedChecks<TCheck extends FailedCheckLike>(checks: TCheck[]): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './attachJson';
|
|
2
|
+
export * from './formAccess';
|
|
3
|
+
export * from './formSelect';
|
|
4
|
+
export * from './formatFailedChecks';
|
|
5
|
+
export * from './listDatagrid';
|
|
6
|
+
export * from './listDetail';
|
|
7
|
+
export * from './listFilter';
|
|
8
|
+
export * from './listStatePersistence';
|
|
9
|
+
export * from './listSort';
|
|
10
|
+
export * from './viewModeDataGrid';
|
|
11
|
+
export * from './openHostAccountMenuModule';
|
|
12
|
+
export * from './openHostMobileSidebarModule';
|
|
13
|
+
export * from './openHostSidebarModule';
|
|
14
|
+
export * from './openHostAuthenticatedMfPreviewModule';
|
|
15
|
+
export * from './realtimePerformanceBrowser';
|
|
16
|
+
export * from './waitForBrowserCondition';
|