@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,219 @@
|
|
|
1
|
+
import type { Locator, Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Scope that owns the list datagrid DOM — the full page or one managed host window.
|
|
4
|
+
*/
|
|
5
|
+
export type ListDatagridScope = Page | Locator;
|
|
6
|
+
/**
|
|
7
|
+
* Return the list datagrid container, anchored on the stable `grid` ARIA role so
|
|
8
|
+
* the locator survives the production preview bundle, where dev-only test ids are
|
|
9
|
+
* stripped.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getListDataGrid(scope: ListDatagridScope): Locator;
|
|
12
|
+
/**
|
|
13
|
+
* Return the rendered data rows of the list datagrid. Anchored on the stable ARIA
|
|
14
|
+
* roles emitted by react-data-grid in the production bundle: a data row is a
|
|
15
|
+
* `role="row"` that contains a `role="gridcell"`, which excludes the header row
|
|
16
|
+
* (whose cells are `columnheader`). Module-agnostic across every GClick list MF.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getListDataRows(scope: ListDatagridScope): Locator;
|
|
19
|
+
/**
|
|
20
|
+
* Return a data cell of the list datagrid by its exact accessible name. Anchored
|
|
21
|
+
* on the `gridcell` ARIA role so it survives the production bundle and stays
|
|
22
|
+
* module-agnostic. Exact matching keeps numeric values from colliding with dates
|
|
23
|
+
* or longer formatted values that merely contain the same digits.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getListCell(scope: ListDatagridScope, text: string): Locator;
|
|
26
|
+
/**
|
|
27
|
+
* Return one data row of the list datagrid by index (0-based, render order).
|
|
28
|
+
*/
|
|
29
|
+
export declare function getListRow(scope: ListDatagridScope, index?: number): Locator;
|
|
30
|
+
/**
|
|
31
|
+
* Open the row-actions menu of one data row by clicking its "menu-actions" button.
|
|
32
|
+
* The menu then exposes the row actions (Edit, Delete, ...) as `menuitem`s, which
|
|
33
|
+
* the caller clicks by their module-specific label.
|
|
34
|
+
*/
|
|
35
|
+
export declare function openListRowActionsMenu(scope: ListDatagridScope, index?: number): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Double-click one data row to trigger its default row action. The datagrid wires
|
|
38
|
+
* the default action to `onCellDoubleClick`, so the double-click targets a data
|
|
39
|
+
* cell (the first one after the menu-actions cell), not the row itself.
|
|
40
|
+
*/
|
|
41
|
+
export declare function doubleClickListRow(scope: ListDatagridScope, index?: number): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Select one data row by clicking a data cell (skipping the menu-actions cell), so
|
|
44
|
+
* the master-detail layout updates its detail panel to that record.
|
|
45
|
+
*/
|
|
46
|
+
export declare function selectListRow(scope: ListDatagridScope, index?: number): Promise<void>;
|
|
47
|
+
/** Position of one datagrid cell, as the table view publishes it through ARIA. */
|
|
48
|
+
export interface ListDatagridCellPosition {
|
|
49
|
+
/** `aria-rowindex` of the row owning the cell. */
|
|
50
|
+
rowIndex: number;
|
|
51
|
+
/** `aria-colindex` of the cell itself. */
|
|
52
|
+
columnIndex: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Return the position of the cell the table view currently has focused, read from the
|
|
56
|
+
* `aria-selected` marker react-data-grid puts on it.
|
|
57
|
+
*
|
|
58
|
+
* ⚠️ **Assert relative movement, never these absolute numbers.** Both indexes are
|
|
59
|
+
* 1-based and count every rendered row and column, including the header row and the
|
|
60
|
+
* filter row — so the first data row is `aria-rowindex` 3 in a grid with both, and 2 in
|
|
61
|
+
* a grid with only a header. Pinning an absolute value would tie a contract to a
|
|
62
|
+
* chrome layout that has nothing to do with the behavior under test; comparing a
|
|
63
|
+
* before/after pair is what proves the arrow keys moved the focus.
|
|
64
|
+
*
|
|
65
|
+
* Table view only: the cards and list views render no `gridcell` at all.
|
|
66
|
+
*/
|
|
67
|
+
export declare function getFocusedCellPositionListDataGrid(scope: ListDatagridScope): Promise<ListDatagridCellPosition>;
|
|
68
|
+
/**
|
|
69
|
+
* Return the header controls of the table view, one per visible column.
|
|
70
|
+
*
|
|
71
|
+
* Exposed as a locator so a contract can assert **how many** columns are visible —
|
|
72
|
+
* including none at all, which is a reachable state: hiding every column from the
|
|
73
|
+
* settings modal leaves the grid with no headers. The readers below cannot answer that
|
|
74
|
+
* question, because they wait for a first header to appear and a grid with zero columns
|
|
75
|
+
* never produces one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function getListColumnHeaderButtons(scope: ListDatagridScope): Locator;
|
|
78
|
+
/**
|
|
79
|
+
* Actions the column header popover always offers, whatever the module configured.
|
|
80
|
+
*
|
|
81
|
+
* Sort, filter and group entries come and go with the module's settings, but freezing
|
|
82
|
+
* and hiding a column are unconditional — they are the datagrid's own base actions. A
|
|
83
|
+
* contract that only needs to prove "the column configuration popover is open" should
|
|
84
|
+
* anchor on these, so it stays true for any list module.
|
|
85
|
+
*
|
|
86
|
+
* They are located by accessible name: the component publishes each action's test id as
|
|
87
|
+
* its `aria-label`, which names the action rather than its translated label.
|
|
88
|
+
*/
|
|
89
|
+
export declare const LIST_HEADER_POPOVER_BASE_ACTIONS: readonly ["toggle-freeze", "hide-column"];
|
|
90
|
+
/**
|
|
91
|
+
* Return the column header popover.
|
|
92
|
+
*
|
|
93
|
+
* Resolved from the page, never from the grid: the popover is rendered in a portal at
|
|
94
|
+
* the end of the document, so a locator scoped to the grid would never find it.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getListHeaderPopover(scope: ListDatagridScope): Locator;
|
|
97
|
+
/**
|
|
98
|
+
* Open the column configuration popover by clicking one column's header, and wait until
|
|
99
|
+
* its base actions are on screen.
|
|
100
|
+
*/
|
|
101
|
+
export declare function openListHeaderPopover(scope: ListDatagridScope, columnKey: string): Promise<void>;
|
|
102
|
+
/** One entry of the column header popover, with the state the user sees. */
|
|
103
|
+
export interface ListHeaderPopoverAction {
|
|
104
|
+
/** Action identity, from the entry's accessible name (`sort-ascending`, …). */
|
|
105
|
+
action: string;
|
|
106
|
+
/** Whether the entry is offered but not currently usable. */
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Return every action the open column header popover offers, in render order, each with
|
|
111
|
+
* whether it is currently usable.
|
|
112
|
+
*
|
|
113
|
+
* Offered and enabled are different questions and both matter: the popover always
|
|
114
|
+
* *offers* the same entries for a column, while their enabled state reflects what is
|
|
115
|
+
* already applied — after sorting a column ascending, that entry turns off and "remove
|
|
116
|
+
* sort" turns on. A contract that only counted entries would miss that entirely.
|
|
117
|
+
*/
|
|
118
|
+
export declare function getListHeaderPopoverActions(scope: ListDatagridScope): Promise<ListHeaderPopoverAction[]>;
|
|
119
|
+
/**
|
|
120
|
+
* Click one action of the open column header popover.
|
|
121
|
+
*/
|
|
122
|
+
export declare function clickListHeaderPopoverAction(scope: ListDatagridScope, action: string): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Dismiss the column header popover by clicking outside it, and wait until it is gone.
|
|
125
|
+
*
|
|
126
|
+
* Clicking the backdrop rather than pressing Escape, and the reason is a real defect:
|
|
127
|
+
* **opening the popover never moves focus into it**. Verified in a browser — after the
|
|
128
|
+
* header click the active element is still outside the popover, so Escape never reaches
|
|
129
|
+
* it and the popover stays open. Moving focus inside by hand and pressing Escape *does*
|
|
130
|
+
* close it, which pins the fault on the missing focus transfer, not on the key handler.
|
|
131
|
+
*
|
|
132
|
+
* Beyond breaking Escape, that leaves the popover unreachable by keyboard and
|
|
133
|
+
* unannounced to a screen reader. Clicking outside is what a pointer user does anyway,
|
|
134
|
+
* so this helper stays useful once the focus behavior is fixed.
|
|
135
|
+
*/
|
|
136
|
+
export declare function closeListHeaderPopover(scope: ListDatagridScope): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Return the header cell of one column of the table view, located through its stable
|
|
139
|
+
* `header-column-button-<key>` control rather than a positional index — so a contract
|
|
140
|
+
* keeps pointing at the same column when the order changes.
|
|
141
|
+
*/
|
|
142
|
+
export declare function getListColumnHeader(scope: ListDatagridScope, columnKey: string): Locator;
|
|
143
|
+
/**
|
|
144
|
+
* Return the rendered width of one column of the table view, in pixels.
|
|
145
|
+
*
|
|
146
|
+
* Read from the header cell's box rather than from the grid's inline
|
|
147
|
+
* `grid-template-columns`: the template is positional, so reading it would tie the
|
|
148
|
+
* assertion to a column order that the user can change.
|
|
149
|
+
*/
|
|
150
|
+
export declare function getListColumnWidth(scope: ListDatagridScope, columnKey: string): Promise<number>;
|
|
151
|
+
/**
|
|
152
|
+
* Drag one column's resize handle by `deltaPx` and return its new width.
|
|
153
|
+
*
|
|
154
|
+
* The handle is the header cell's last child — a 10px strip with `cursor: col-resize`
|
|
155
|
+
* that react-data-grid renders with a generated class name, so it is reached by
|
|
156
|
+
* geometry (the right edge of the header) instead of by selector. Resizing is a real
|
|
157
|
+
* pointer drag on purpose: it is the only way the component runs the same code path a
|
|
158
|
+
* user triggers, including the change callback that persists the new width.
|
|
159
|
+
*/
|
|
160
|
+
export declare function resizeListColumn(scope: ListDatagridScope, columnKey: string, deltaPx: number): Promise<number>;
|
|
161
|
+
/**
|
|
162
|
+
* Return the visible column keys of the list datagrid, in render order, read from
|
|
163
|
+
* the header buttons' stable aria-labels (`header-column-button-<key>`). Use it to
|
|
164
|
+
* assert the grid structure matches the module's expected column configuration.
|
|
165
|
+
*
|
|
166
|
+
* Assumes the grid has at least one visible column — it waits for a header to appear.
|
|
167
|
+
* To assert the empty case, use `getListColumnHeaderButtons` and count instead.
|
|
168
|
+
*/
|
|
169
|
+
export declare function getListColumnKeys(scope: ListDatagridScope): Promise<string[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Return each visible column's documented alignment, keyed by column key.
|
|
172
|
+
*
|
|
173
|
+
* The Notion Columns table declares an `Align` per column, and nothing asserted it until a
|
|
174
|
+
* real bug went unnoticed: two columns documented `Center` shipped left-aligned and every
|
|
175
|
+
* contract stayed green, because `REQ-LIST-DATAGRID-002` only compared column **keys**.
|
|
176
|
+
*
|
|
177
|
+
* The datagrid encodes alignment as `rdg-cell-align-left|center|right` on the column
|
|
178
|
+
* header. Those are **react-data-grid's own semantic class names**, not hashed build
|
|
179
|
+
* output, so anchoring on them does not break the selector policy the way a MUI generated
|
|
180
|
+
* class would — they are part of the library's stable DOM contract.
|
|
181
|
+
*
|
|
182
|
+
* Scrolls horizontally like `getAllColumnKeysViewTableDataGrid`, so virtualized columns
|
|
183
|
+
* off-screen are collected too.
|
|
184
|
+
*/
|
|
185
|
+
export declare function getAllColumnAlignmentsViewTableDataGrid(scope: ListDatagridScope): Promise<Record<string, string>>;
|
|
186
|
+
/**
|
|
187
|
+
* Return **every** column key of the datagrid in the **table** view, in order,
|
|
188
|
+
* scrolling horizontally to reach the ones column virtualization keeps out of the DOM.
|
|
189
|
+
*
|
|
190
|
+
* `getListColumnKeys` only sees the columns that currently fit the window, so it can
|
|
191
|
+
* never prove a grid renders *all* its documented columns — a module shipping fewer
|
|
192
|
+
* than documented would still match a subset. Use this one whenever the assertion is
|
|
193
|
+
* about completeness, no matter how many columns the module has or how wide the window
|
|
194
|
+
* is. The grid is scrolled back to the start before returning.
|
|
195
|
+
*
|
|
196
|
+
* Table view only: column headers do not exist in the cards or list views, where the
|
|
197
|
+
* fields live inside each record and virtualization runs vertically. Use
|
|
198
|
+
* `getAllFieldKeysViewCardsOrListDataGrid` for those.
|
|
199
|
+
*/
|
|
200
|
+
export declare function getAllColumnKeysViewTableDataGrid(scope: ListDatagridScope): Promise<string[]>;
|
|
201
|
+
/**
|
|
202
|
+
* Return the field keys rendered for one record in the **cards** or **list** view, in
|
|
203
|
+
* order, read from the stable `datagrid-field-<key>` anchors.
|
|
204
|
+
*
|
|
205
|
+
* No scrolling is needed: a single card or list row already contains every field of
|
|
206
|
+
* that record — what virtualization hides are the *other* records, not this one's
|
|
207
|
+
* fields. That is the opposite problem to
|
|
208
|
+
* `getAllColumnKeysViewTableDataGrid`, hence a separate helper.
|
|
209
|
+
*
|
|
210
|
+
* The anchor is a `data-testid` rather than an accessible name on purpose: each field
|
|
211
|
+
* already renders its own visible label, so putting the machine key into ARIA would
|
|
212
|
+
* replace a meaningful label with a machine string.
|
|
213
|
+
*
|
|
214
|
+
* Exercised in a browser by `REQ-LIST-DATAGRID-006` on the cards view. Still unproven
|
|
215
|
+
* against the **list** view, whose records are a different element; modules that boot
|
|
216
|
+
* into it and are therefore where to prove it: `operative_devices_list` (Master) and
|
|
217
|
+
* `shared_users_list` (Master).
|
|
218
|
+
*/
|
|
219
|
+
export declare function getAllFieldKeysViewCardsOrListDataGrid(scope: ListDatagridScope, recordIndex?: number): Promise<string[]>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Locator, Page, Request } from '@playwright/test';
|
|
2
|
+
import type { ListDatagridScope } from './listDatagrid';
|
|
3
|
+
/**
|
|
4
|
+
* Return the master-detail empty state ("no item selected"), shown before any
|
|
5
|
+
* master record is selected. Anchored on the stable `alert` role + accessible name.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getListDetailEmptyState(scope: ListDatagridScope): Locator;
|
|
8
|
+
/**
|
|
9
|
+
* Return a detail field of the master-detail panel by its visible text. The detail
|
|
10
|
+
* renders fields as `listitem`s (not datagrid `gridcell`s), so this is scoped to the
|
|
11
|
+
* detail panel and does not match values shown in the master grid. The field nests
|
|
12
|
+
* several `listitem`s; `.last()` is the innermost (the actual field row), which is
|
|
13
|
+
* the element that hides when its accordion collapses — so the same locator works
|
|
14
|
+
* both for "detail shows X" and "accordion collapsed → X hidden" assertions.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getListDetailField(scope: ListDatagridScope, text: string): Locator;
|
|
17
|
+
/**
|
|
18
|
+
* Return a detail accordion by its heading text (its `dictionaryId` label).
|
|
19
|
+
*/
|
|
20
|
+
export declare function getListDetailAccordion(scope: ListDatagridScope, name: string): Locator;
|
|
21
|
+
/**
|
|
22
|
+
* Toggle a detail accordion open/closed by clicking its heading. Collapsing hides
|
|
23
|
+
* the accordion content; expanding shows it again.
|
|
24
|
+
*/
|
|
25
|
+
export declare function toggleListDetailAccordion(scope: ListDatagridScope, name: string): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Return the OPEN accordion content regions (`role="region"`). An accordion's
|
|
28
|
+
* region exists only while expanded — collapsing removes it from the accessibility
|
|
29
|
+
* tree — so the count equals the number of currently-open accordions. Prefer this
|
|
30
|
+
* over a field's visibility for open/close assertions, because MUI clips collapsed
|
|
31
|
+
* content (a field can stay "visible" to Playwright while clipped).
|
|
32
|
+
*/
|
|
33
|
+
export declare function getListDetailAccordionRegions(scope: ListDatagridScope): Locator;
|
|
34
|
+
/**
|
|
35
|
+
* Return the field **labels** the detail panel renders, in order.
|
|
36
|
+
*
|
|
37
|
+
* `getListDetailField` answers "is this value on screen"; this answers "which fields does
|
|
38
|
+
* the panel offer at all". The Notion `props_*` table declares one row per field, so a
|
|
39
|
+
* field silently dropped from the accordion is a documented expectation going unmet — and
|
|
40
|
+
* nothing catches it if the contract only probes one value.
|
|
41
|
+
*
|
|
42
|
+
* ⚠️ **Scoped to the accordion regions, not the page.** A page-level `listitem` lookup also
|
|
43
|
+
* matches the host sidebar's module entries and the accordion headings, so the list comes
|
|
44
|
+
* back polluted with entries that are not fields at all.
|
|
45
|
+
*
|
|
46
|
+
* Each field renders as a `listitem` whose first text line is its label.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getListDetailFieldLabels(scope: ListDatagridScope): Promise<string[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Open the detail Logs tab and trigger its load, resolving with the logs request.
|
|
51
|
+
*
|
|
52
|
+
* The detail's Logs tab (ObjectLogs) is in manual mode (`fireOnFirstLoad: false`),
|
|
53
|
+
* so the logs load only when its DynamicFilter is applied via its "refresh" action.
|
|
54
|
+
* That refresh is the LAST `refresh` button on the page (it appears when the Logs
|
|
55
|
+
* tab opens, after the master list's own filter refresh). The request carries the
|
|
56
|
+
* applied filter (resource type/serial + the date range), so any list E2E can
|
|
57
|
+
* assert "logs load according to the applied filter".
|
|
58
|
+
*/
|
|
59
|
+
export declare function loadListDetailLogsAndCaptureRequest(options: {
|
|
60
|
+
page: Page;
|
|
61
|
+
/** Visible label of the Logs tab (the module's `tab_logs` value). */
|
|
62
|
+
logsTabName: string;
|
|
63
|
+
/** URL pattern of the logs endpoint (e.g. `/\/users\/resources\/logs/`). */
|
|
64
|
+
logsEndpointPattern: RegExp;
|
|
65
|
+
}): Promise<Request>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Request } from '@playwright/test';
|
|
2
|
+
import type { ApplyListFilterOptions, ApplyListFiltersOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Apply one list filter through the real DynamicFilter UI and resolve with the
|
|
5
|
+
* resulting list request, so any list E2E can assert the endpoint was called with
|
|
6
|
+
* the filter applied — regardless of the filter type.
|
|
7
|
+
*
|
|
8
|
+
* Interaction (all anchored on stable ARIA, the production bundle strips testids):
|
|
9
|
+
* open the field menu (`button[aria-label="searchbox"]`), pick the field by its
|
|
10
|
+
* visible `menuitem` label, enter the value (text input for string/number, the
|
|
11
|
+
* operand autocomplete for boolean — the operator already has a sensible default)
|
|
12
|
+
* and submit it with `Enter` (staging the filter), then trigger the network call
|
|
13
|
+
* with the filter-actions `button[aria-label="refresh"]` (the DynamicFilter is in
|
|
14
|
+
* manual mode: applying only stages the filter; refresh fires the request).
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyListFilterAndCaptureRequest(options: ApplyListFilterOptions): Promise<Request>;
|
|
17
|
+
/**
|
|
18
|
+
* Apply several filters in sequence and resolve with the final list request,
|
|
19
|
+
* which carries all of them (filters accumulate as chips). Used by the multiple
|
|
20
|
+
* filters contract.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyListFiltersAndCaptureRequest(options: ApplyListFiltersOptions): Promise<Request>;
|
|
23
|
+
/**
|
|
24
|
+
* Extract the filter field names from a captured list request, reading the nested
|
|
25
|
+
* `f[i][n]=...` query params (e.g. `['name']`, `['document_id', 'active']`).
|
|
26
|
+
*/
|
|
27
|
+
export declare function getListFilterFieldNames(request: Request): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Request } from '@playwright/test';
|
|
2
|
+
import type { ApplyListSortOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Sort a list by a column header and resolve with the resulting list request, so
|
|
5
|
+
* any list E2E can assert the endpoint was called with the sort criterion — for
|
|
6
|
+
* each sort field of the module.
|
|
7
|
+
*
|
|
8
|
+
* Interaction (stable ARIA only): click the column header
|
|
9
|
+
* (`button[aria-label="header-column-button-<columnKey>"]`) to open its menu, then
|
|
10
|
+
* the `menuitem[aria-label="sort-descending"]` option. Sorting is automatic, so the
|
|
11
|
+
* request fires immediately. `sort-descending` is used uniformly because it is
|
|
12
|
+
* always a change from the default sort, so it stays enabled for every field.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyListSortAndCaptureRequest(options: ApplyListSortOptions): Promise<Request>;
|
|
15
|
+
/**
|
|
16
|
+
* Extract the sort field names from a captured list request, reading the nested
|
|
17
|
+
* `s[i][n]=...` query params (e.g. `['name']`, `['name', 'id']`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getListSortFieldNames(request: Request): string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Page, Request } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Module-state cookie names the list DynamicFilterAndSort persists to. The list
|
|
4
|
+
* uses `prefixCookie: 'master'`, so applied filters/sorts are saved under these
|
|
5
|
+
* names. Module-agnostic across every GClick list microfrontend.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LIST_FILTERS_STATE_COOKIE = "master_applied_filters";
|
|
8
|
+
export declare const LIST_SORTS_STATE_COOKIE = "master_applied_sorts";
|
|
9
|
+
/**
|
|
10
|
+
* Resolve with the PUT request that persists the list's applied filters/sorts to
|
|
11
|
+
* the host module-state cookie (`PUT /cookies/<windowId>/<cookieName>`). Applying a
|
|
12
|
+
* filter or sort triggers this write, which the module reads back to restore the
|
|
13
|
+
* list state on reload.
|
|
14
|
+
*/
|
|
15
|
+
export declare function waitForListStatePersistence(page: Page, cookieName: string): Promise<Request>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenHostAccountMenuModuleOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Open a module from the host account popover the way a user does: click the avatar,
|
|
4
|
+
* then the popover entry.
|
|
5
|
+
*
|
|
6
|
+
* This is the real door for the user-scoped modules — the preferences forms the product
|
|
7
|
+
* never publishes in the sidebar. The rows come from the account menu endpoint
|
|
8
|
+
* (`menus?position=1`), so the suite must have installed them before calling this.
|
|
9
|
+
*/
|
|
10
|
+
export declare function openHostAccountMenuModule(options: OpenHostAccountMenuModuleOptions): Promise<void>;
|
package/types/packages/testing/playwright/src/helpers/openHostAuthenticatedMfPreviewModule.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OpenHostAuthenticatedMfPreviewModuleOptions, OpenHostAuthenticatedMfPreviewOpenTimingSnapshot } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Open an authenticated MF preview entry through the real host sidebar flow.
|
|
4
|
+
*/
|
|
5
|
+
export declare function openHostAuthenticatedMfPreviewModule(options: OpenHostAuthenticatedMfPreviewModuleOptions): Promise<OpenHostAuthenticatedMfPreviewOpenTimingSnapshot>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Accessible name of the host appbar hamburger toggle that opens the mobile nav
|
|
4
|
+
* drawer. The dictionary label is unmocked in preview, so it renders as this
|
|
5
|
+
* `N_D:[...]` placeholder; matched by accessible name (a CSS attribute selector
|
|
6
|
+
* would break on the `[`/`]` in the label).
|
|
7
|
+
*/
|
|
8
|
+
export declare const HOST_MOBILE_NAV_TOGGLE_NAME = "N_D:[appbar.tooltip_toogle_menu]";
|
|
9
|
+
/**
|
|
10
|
+
* Open a host-shell module on the MOBILE layout: click the appbar hamburger to
|
|
11
|
+
* reveal the nav drawer, then click the module's menu item. On mobile the host
|
|
12
|
+
* replaces the desktop sidebar with this drawer, so the desktop sidebar flow does
|
|
13
|
+
* not apply.
|
|
14
|
+
*/
|
|
15
|
+
export declare function openHostMobileSidebarModule(page: Page, moduleTitle: string): Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OpenHostSidebarModuleOptions, OpenHostSidebarModuleTimingSnapshot } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Open a host-shell sidebar entry by title, expanding the sidebar first when needed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function openHostSidebarModule(options: OpenHostSidebarModuleOptions): Promise<OpenHostSidebarModuleTimingSnapshot>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable browser argument used by page-side helpers that read realtime debug state.
|
|
3
|
+
*/
|
|
4
|
+
export interface BrowserRealtimePerformancePropertyArg {
|
|
5
|
+
/** Catalog-owned browser property that stores the realtime debug state. */
|
|
6
|
+
realtimePerformanceProperty: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Serializable browser argument used when a predicate expects multiple device ids.
|
|
10
|
+
*/
|
|
11
|
+
export interface BrowserRealtimeDeviceIdsArg extends BrowserRealtimePerformancePropertyArg {
|
|
12
|
+
/** Ordered device ids that should already exist in the realtime debug state. */
|
|
13
|
+
deviceIds: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Serializable browser argument used when a predicate targets one device id.
|
|
17
|
+
*/
|
|
18
|
+
export interface BrowserRealtimeDeviceIdArg extends BrowserRealtimePerformancePropertyArg {
|
|
19
|
+
/** Device id that should already be readable from the realtime debug state. */
|
|
20
|
+
deviceId: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Stable Node-side property name forwarded into browser-executable callbacks.
|
|
24
|
+
*/
|
|
25
|
+
export declare const realtimePerformanceDebugHandleProperty: "__M4L_REALTIME_PERFORMANCE__";
|
|
26
|
+
/**
|
|
27
|
+
* Minimal DOMRect-like payload returned by browser element sampling.
|
|
28
|
+
*/
|
|
29
|
+
export type BrowserBoundingClientRectLike = Record<string, unknown>;
|
|
30
|
+
/**
|
|
31
|
+
* Minimal element shape required inside `page.evaluate(...)`.
|
|
32
|
+
*/
|
|
33
|
+
export type BrowserElementLike = {
|
|
34
|
+
/** Returns the current layout box when the sampled node exists. */
|
|
35
|
+
getBoundingClientRect?: () => BrowserBoundingClientRectLike;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Shared realtime motion-authority state exposed by the M4L debug window object.
|
|
39
|
+
*/
|
|
40
|
+
export type BrowserRealtimePerformanceMotionAuthorityState = {
|
|
41
|
+
/** Active motion sessions keyed by internal marker or session id. */
|
|
42
|
+
activeSessions?: Record<string, Record<string, unknown>>;
|
|
43
|
+
/** Latest marker-context snapshots keyed by device or marker id. */
|
|
44
|
+
markerContexts?: Record<string, Record<string, unknown>>;
|
|
45
|
+
/** Recent visual marker applications measured after Leaflet accepted frames. */
|
|
46
|
+
recentVisualApplyFrames?: Array<Record<string, unknown>>;
|
|
47
|
+
/** Recent completed motion sessions kept for diagnostics. */
|
|
48
|
+
recentSessions?: Array<Record<string, unknown>>;
|
|
49
|
+
/** Aggregate summary payload emitted by the realtime debug module. */
|
|
50
|
+
summary?: Record<string, unknown> | null;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Motion metrics branch read from `window.__M4L_REALTIME_PERFORMANCE__`.
|
|
54
|
+
*/
|
|
55
|
+
export type BrowserRealtimePerformanceMotionMetrics = {
|
|
56
|
+
/** Motion authority diagnostics used by realtime browser probes. */
|
|
57
|
+
motionAuthority?: BrowserRealtimePerformanceMotionAuthorityState;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Minimal realtime debug state contract expected by M4L browser probes.
|
|
61
|
+
*/
|
|
62
|
+
export type BrowserRealtimePerformanceState = {
|
|
63
|
+
/** Motion metrics captured by the current app debug instrumentation. */
|
|
64
|
+
motionMetrics?: BrowserRealtimePerformanceMotionMetrics;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Minimal document body shape used for failure diagnostics.
|
|
68
|
+
*/
|
|
69
|
+
export type BrowserDocumentBodyLike = {
|
|
70
|
+
/** Flattened visible text used when the expected UI is missing. */
|
|
71
|
+
innerText?: string;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Minimal browser document contract used during page-side sampling.
|
|
75
|
+
*/
|
|
76
|
+
export type BrowserDocumentLike = {
|
|
77
|
+
/** Body text snapshot used when selection or rendering fails. */
|
|
78
|
+
body?: BrowserDocumentBodyLike;
|
|
79
|
+
/** DOM query API used to find map markers and related status nodes. */
|
|
80
|
+
querySelector?: (selector: string) => BrowserElementLike | null;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Minimal computed-style payload used to read CSS transforms.
|
|
84
|
+
*/
|
|
85
|
+
export type BrowserComputedStyleLike = {
|
|
86
|
+
/** Serialized CSS transform matrix or transform function list. */
|
|
87
|
+
transform?: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Minimal performance API contract used for time-based browser sampling.
|
|
91
|
+
*/
|
|
92
|
+
export type BrowserPerformanceLike = {
|
|
93
|
+
/** High-resolution timestamp provider used by polling helpers. */
|
|
94
|
+
now?: () => number;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Minimal browser global contract used inside `page.evaluate(...)`.
|
|
98
|
+
*/
|
|
99
|
+
export type BrowserGlobalLike = Record<string, unknown> & {
|
|
100
|
+
/** DOM entry points required by browser collectors and wait helpers. */
|
|
101
|
+
document?: BrowserDocumentLike;
|
|
102
|
+
/** Style reader used to inspect marker transforms on map-based views. */
|
|
103
|
+
getComputedStyle?: (element: unknown) => BrowserComputedStyleLike | null;
|
|
104
|
+
/** Timing entry point used by browser sampling loops. */
|
|
105
|
+
performance?: BrowserPerformanceLike;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Read the realtime motion-authority state exposed by the current page runtime.
|
|
109
|
+
*
|
|
110
|
+
* This helper is browser-executable and can be passed directly to
|
|
111
|
+
* `page.evaluate(...)`.
|
|
112
|
+
*/
|
|
113
|
+
export declare function readRealtimeMotionAuthorityState(arg: BrowserRealtimePerformancePropertyArg): BrowserRealtimePerformanceMotionAuthorityState | null;
|
|
114
|
+
/**
|
|
115
|
+
* Check whether all requested device ids exist in the realtime marker-context map.
|
|
116
|
+
*
|
|
117
|
+
* This helper is browser-executable and can be passed directly to
|
|
118
|
+
* `page.waitForFunction(...)`.
|
|
119
|
+
*
|
|
120
|
+
* @param deviceIds Ordered device ids that should already exist in the debug state.
|
|
121
|
+
* @returns `true` once every requested device id has one marker context entry.
|
|
122
|
+
*/
|
|
123
|
+
export declare function hasRealtimeMarkerContexts(arg: BrowserRealtimeDeviceIdsArg): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Check whether one realtime device is selected or the debug panel is already visible.
|
|
126
|
+
*
|
|
127
|
+
* This helper is browser-executable and can be passed directly to
|
|
128
|
+
* `page.waitForFunction(...)`.
|
|
129
|
+
*
|
|
130
|
+
* @param deviceId Device id expected to become selected in the debug state.
|
|
131
|
+
* @returns `true` when the device is selected or the current debug report panel is visible.
|
|
132
|
+
*/
|
|
133
|
+
export declare function isRealtimeDeviceSelectedOrDebugPanelVisible(arg: BrowserRealtimeDeviceIdArg): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Check whether one realtime device is explicitly selected in the browser debug state.
|
|
136
|
+
*
|
|
137
|
+
* Unlike the broader fallback helper above, this predicate does not accept the
|
|
138
|
+
* device panel alone as sufficient evidence. Use it when one probe depends on
|
|
139
|
+
* the selected marker follow loop being armed from the actual target device.
|
|
140
|
+
*
|
|
141
|
+
* @param deviceId Device id expected to become selected in the debug state.
|
|
142
|
+
* @returns `true` only when the marker context reports an explicit selected state.
|
|
143
|
+
*/
|
|
144
|
+
export declare function isRealtimeDeviceSelected(arg: BrowserRealtimeDeviceIdArg): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type Locator } from '@playwright/test';
|
|
2
|
+
import { type ListDatagridScope } from './listDatagrid';
|
|
3
|
+
/**
|
|
4
|
+
* The three view modes a GClick datagrid can render, mirroring the component
|
|
5
|
+
* `ViewMode` union (`'table' | 'cards' | 'list'`).
|
|
6
|
+
*/
|
|
7
|
+
export type ViewModeDataGrid = 'table' | 'cards' | 'list';
|
|
8
|
+
/**
|
|
9
|
+
* Return the view mode the datagrid is currently rendering, read from the active
|
|
10
|
+
* view's accessible name. Waits for a view to be attached before resolving.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getViewModeDataGrid(scope: ListDatagridScope): Promise<ViewModeDataGrid>;
|
|
13
|
+
/**
|
|
14
|
+
* Assert the datagrid renders in the expected view mode, failing with the mode it
|
|
15
|
+
* actually rendered so a wrong-view regression is immediately readable.
|
|
16
|
+
*/
|
|
17
|
+
export declare function expectViewModeDataGrid(scope: ListDatagridScope, expectedMode: ViewModeDataGrid): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Open the datagrid's view-mode switcher popover. The trigger only renders when the
|
|
20
|
+
* module configures at least one alternative view, so a module offering table alone
|
|
21
|
+
* has no switcher at all.
|
|
22
|
+
*/
|
|
23
|
+
export declare function openViewModeSwitcherDataGrid(scope: ListDatagridScope): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Return the view modes the module actually offers, read from the switcher popover.
|
|
26
|
+
*
|
|
27
|
+
* Anchored on each option's `data-testid` rather than its label: the labels are
|
|
28
|
+
* dictionary values that say nothing about which view they switch to, so a
|
|
29
|
+
* translation change would break the locator while the behavior is intact. The test
|
|
30
|
+
* id encodes the view identity itself, which is what matters here.
|
|
31
|
+
*
|
|
32
|
+
* Reading the offered set instead of assuming it is what lets a contract prove it
|
|
33
|
+
* covered **every** configured view — a hardcoded list silently stops covering a view
|
|
34
|
+
* the module adds later.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getAvailableViewModesDataGrid(scope: ListDatagridScope): Promise<ViewModeDataGrid[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Dismiss the view-mode switcher popover without changing the current view.
|
|
39
|
+
*/
|
|
40
|
+
export declare function closeViewModeSwitcherDataGrid(scope: ListDatagridScope): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Switch the datagrid to a view mode through the real switcher, and wait until that
|
|
43
|
+
* view is the one rendering.
|
|
44
|
+
*/
|
|
45
|
+
export declare function switchViewModeDataGrid(scope: ListDatagridScope, mode: ViewModeDataGrid): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Open the datagrid's column-settings modal for the **currently active** view. Each
|
|
48
|
+
* view owns its own configuration, so which modal opens depends on the active view.
|
|
49
|
+
*/
|
|
50
|
+
export declare function openColumnSettingsDataGrid(scope: ListDatagridScope): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Hide every column of the active view from its settings modal, and apply.
|
|
53
|
+
*
|
|
54
|
+
* A blunt edit on purpose: a contract proving one view's configuration does not leak
|
|
55
|
+
* into another needs a change that is impossible to miss, and "no columns left" cannot
|
|
56
|
+
* be confused with a rendering coincidence.
|
|
57
|
+
*/
|
|
58
|
+
export declare function hideAllColumnsDataGrid(scope: ListDatagridScope): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Return the rendered record elements of the **currently active** view, so a contract
|
|
61
|
+
* can count records without caring which view is on screen.
|
|
62
|
+
*
|
|
63
|
+
* Each view renders records as a different element, and only the table view exposes
|
|
64
|
+
* them through ARIA rows. Cards and list rows are anchored on their `data-testid`
|
|
65
|
+
* because they carry no role that identifies them as one record.
|
|
66
|
+
*/
|
|
67
|
+
export declare function getRenderedRecordsDataGrid(scope: ListDatagridScope, mode: ViewModeDataGrid): Locator;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Reusable browser-condition callback signature accepted by Playwright wait helpers.
|
|
4
|
+
*/
|
|
5
|
+
export type BrowserConditionFunction<TArg> = (arg: TArg) => boolean | Promise<boolean>;
|
|
6
|
+
/**
|
|
7
|
+
* Shared input used by browser-condition polling helpers.
|
|
8
|
+
*/
|
|
9
|
+
export interface BrowserConditionOptions<TArg> {
|
|
10
|
+
/** Serializable argument forwarded into the browser-side condition function. */
|
|
11
|
+
arg: TArg;
|
|
12
|
+
/** Browser-executable predicate passed directly to `page.waitForFunction(...)`. */
|
|
13
|
+
pageFunction: BrowserConditionFunction<TArg>;
|
|
14
|
+
/** Timeout in milliseconds for the browser-side polling loop. */
|
|
15
|
+
timeoutMs: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Shared input used by the throwing browser-condition wait helper.
|
|
19
|
+
*/
|
|
20
|
+
export interface WaitForBrowserConditionOptions<TArg> extends BrowserConditionOptions<TArg> {
|
|
21
|
+
/** Error message thrown when the browser condition does not resolve in time. */
|
|
22
|
+
timeoutMessage: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolve whether one browser-side condition becomes true within the given timeout.
|
|
26
|
+
*
|
|
27
|
+
* @param page Playwright page that owns the current browser runtime.
|
|
28
|
+
* @param options Serializable browser predicate, argument, and timeout.
|
|
29
|
+
* @returns `true` when the predicate resolved before the timeout, otherwise `false`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function tryWaitForBrowserCondition<TArg>(page: Page, options: BrowserConditionOptions<TArg>): Promise<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Wait for one browser-side condition and throw one caller-owned error on timeout.
|
|
34
|
+
*
|
|
35
|
+
* @param page Playwright page that owns the current browser runtime.
|
|
36
|
+
* @param options Serializable browser predicate, argument, timeout, and failure message.
|
|
37
|
+
*/
|
|
38
|
+
export declare function waitForBrowserCondition<TArg>(page: Page, options: WaitForBrowserConditionOptions<TArg>): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Playwright helpers that can be reused across multiple apps belong here.
|
|
3
|
+
*
|
|
4
|
+
* Keep app-specific selectors, page objects, and one-off flows local to each
|
|
5
|
+
* `apps/*-e2e` project, and promote only reusable Playwright contracts into
|
|
6
|
+
* `@m4l/testing/playwright`.
|
|
7
|
+
*/
|
|
8
|
+
export * from './fixtures';
|
|
9
|
+
export * from './helpers';
|
|
10
|
+
export * from './installers';
|
|
11
|
+
export type * from './types';
|