@m4l/testing 0.0.24 → 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.
Files changed (235) hide show
  1. package/README.md +679 -0
  2. package/chunks/reactLeaflet-Cffkauof.js +1846 -0
  3. package/chunks/render-CsuV8xqo.js +17 -0
  4. package/chunks/userPreferences-BmOgRaIX.js +493 -0
  5. package/index.js +76 -25
  6. package/mocks/index.js +41 -0
  7. package/package.json +84 -69
  8. package/playwright/index.js +2041 -0
  9. package/rtl/index.js +180 -0
  10. package/types/libs/observability/mf/src/browserRuntimeHandles.d.ts +112 -0
  11. package/types/libs/observability/mf/src/diagnosticLogging.d.ts +2 -0
  12. package/types/libs/observability/mf/src/diagnosticPolicies/catalog.d.ts +267 -0
  13. package/types/libs/observability/mf/src/diagnosticPolicies/contracts.d.ts +64 -0
  14. package/types/libs/observability/mf/src/diagnosticPolicies/host.d.ts +139 -0
  15. package/types/libs/observability/mf/src/diagnosticPolicies/index.d.ts +6 -0
  16. package/types/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.d.ts +104 -0
  17. package/types/libs/observability/mf/src/diagnosticPolicies/sharedReportsList.d.ts +44 -0
  18. package/types/libs/observability/mf/src/diagnosticPolicyKeys.d.ts +34 -0
  19. package/types/libs/observability/mf/src/index.d.ts +14 -0
  20. package/types/libs/observability/mf/src/runtimeSmoke.d.ts +13 -0
  21. package/types/libs/observability/mf/src/telemetry.d.ts +2 -0
  22. package/types/libs/observability/shared/src/diagnosticLogging.d.ts +97 -0
  23. package/types/libs/observability/shared/src/index.d.ts +6 -0
  24. package/types/libs/observability/shared/src/runtimeHandles.d.ts +27 -0
  25. package/types/libs/observability/shared/src/telemetry.d.ts +179 -0
  26. package/types/packages/testing/mocks/src/constants.d.ts +10 -0
  27. package/types/packages/testing/mocks/src/fixtures.d.ts +258 -0
  28. package/types/packages/testing/mocks/src/helpers/environment.d.ts +44 -0
  29. package/types/packages/testing/mocks/src/helpers/hostTools.d.ts +10 -0
  30. package/types/packages/testing/mocks/src/helpers/index.d.ts +5 -0
  31. package/types/packages/testing/mocks/src/helpers/moduleDictionary.d.ts +9 -0
  32. package/types/packages/testing/mocks/src/helpers/toaster.d.ts +9 -0
  33. package/types/packages/testing/mocks/src/helpers/userPreferences.d.ts +17 -0
  34. package/types/packages/testing/mocks/src/index.d.ts +4 -0
  35. package/types/packages/testing/mocks/src/types.d.ts +233 -0
  36. package/types/packages/testing/playwright/src/fixtures/createHostAreaFixture.d.ts +5 -0
  37. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfMenuFixture.d.ts +5 -0
  38. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfModuleDictionaryFixture.d.ts +5 -0
  39. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedSessionFixture.d.ts +6 -0
  40. package/types/packages/testing/playwright/src/fixtures/createHostCookieFixture.d.ts +5 -0
  41. package/types/packages/testing/playwright/src/fixtures/createHostGuestSessionFixture.d.ts +5 -0
  42. package/types/packages/testing/playwright/src/fixtures/createHostLocaleFixture.d.ts +5 -0
  43. package/types/packages/testing/playwright/src/fixtures/createHostMfPreviewDynamicParamsFixture.d.ts +5 -0
  44. package/types/packages/testing/playwright/src/fixtures/createHostModuleDictionaryFixture.d.ts +11 -0
  45. package/types/packages/testing/playwright/src/fixtures/createHostUiConfigFixture.d.ts +7 -0
  46. package/types/packages/testing/playwright/src/fixtures/createHostUserPreferencesFixture.d.ts +6 -0
  47. package/types/packages/testing/playwright/src/fixtures/createListResponseFixture.d.ts +6 -0
  48. package/types/packages/testing/playwright/src/fixtures/index.d.ts +12 -0
  49. package/types/packages/testing/playwright/src/helpers/attachJson.d.ts +9 -0
  50. package/types/packages/testing/playwright/src/helpers/formAccess.d.ts +53 -0
  51. package/types/packages/testing/playwright/src/helpers/formSelect.d.ts +51 -0
  52. package/types/packages/testing/playwright/src/helpers/formatFailedChecks.d.ts +18 -0
  53. package/types/packages/testing/playwright/src/helpers/index.d.ts +16 -0
  54. package/types/packages/testing/playwright/src/helpers/listDatagrid.d.ts +219 -0
  55. package/types/packages/testing/playwright/src/helpers/listDetail.d.ts +65 -0
  56. package/types/packages/testing/playwright/src/helpers/listFilter.d.ts +27 -0
  57. package/types/packages/testing/playwright/src/helpers/listSort.d.ts +19 -0
  58. package/types/packages/testing/playwright/src/helpers/listStatePersistence.d.ts +15 -0
  59. package/types/packages/testing/playwright/src/helpers/openHostAccountMenuModule.d.ts +10 -0
  60. package/types/packages/testing/playwright/src/helpers/openHostAuthenticatedMfPreviewModule.d.ts +5 -0
  61. package/types/packages/testing/playwright/src/helpers/openHostMobileSidebarModule.d.ts +15 -0
  62. package/types/packages/testing/playwright/src/helpers/openHostSidebarModule.d.ts +5 -0
  63. package/types/packages/testing/playwright/src/helpers/realtimePerformanceBrowser.d.ts +144 -0
  64. package/types/packages/testing/playwright/src/helpers/viewModeDataGrid.d.ts +67 -0
  65. package/types/packages/testing/playwright/src/helpers/waitForBrowserCondition.d.ts +38 -0
  66. package/types/packages/testing/playwright/src/index.d.ts +11 -0
  67. package/types/packages/testing/playwright/src/installers/index.d.ts +20 -0
  68. package/types/packages/testing/playwright/src/installers/installHostAlarmsCountRoute.d.ts +5 -0
  69. package/types/packages/testing/playwright/src/installers/installHostAreasRoute.d.ts +5 -0
  70. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedBootstrapRoutes.d.ts +6 -0
  71. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfModuleDictionaryRoute.d.ts +5 -0
  72. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfPreviewBootstrap.d.ts +11 -0
  73. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedSessionRoute.d.ts +6 -0
  74. package/types/packages/testing/playwright/src/installers/installHostCookiesRoute.d.ts +8 -0
  75. package/types/packages/testing/playwright/src/installers/installHostGuestBootstrapRoutes.d.ts +7 -0
  76. package/types/packages/testing/playwright/src/installers/installHostGuestSessionRoute.d.ts +7 -0
  77. package/types/packages/testing/playwright/src/installers/installHostLocaleRoute.d.ts +5 -0
  78. package/types/packages/testing/playwright/src/installers/installHostMenusRoute.d.ts +11 -0
  79. package/types/packages/testing/playwright/src/installers/installHostModuleDictionaryRoute.d.ts +6 -0
  80. package/types/packages/testing/playwright/src/installers/installHostPasswordNewRoute.d.ts +6 -0
  81. package/types/packages/testing/playwright/src/installers/installHostPasswordResetRoute.d.ts +6 -0
  82. package/types/packages/testing/playwright/src/installers/installHostUiConfigAssetRoutes.d.ts +9 -0
  83. package/types/packages/testing/playwright/src/installers/installHostUiConfigRoute.d.ts +7 -0
  84. package/types/packages/testing/playwright/src/installers/installHostUserPreferencesRoute.d.ts +6 -0
  85. package/types/packages/testing/playwright/src/installers/installListEndpointRoute.d.ts +7 -0
  86. package/types/packages/testing/playwright/src/installers/installMicrofrontendRenderStub.d.ts +9 -0
  87. package/types/packages/testing/playwright/src/installers/installModulePrivilegesRoute.d.ts +11 -0
  88. package/types/packages/testing/playwright/src/types.d.ts +598 -0
  89. package/types/packages/testing/rtl/src/index.d.ts +4 -0
  90. package/types/packages/testing/rtl/src/matchMedia.d.ts +10 -0
  91. package/types/packages/testing/rtl/src/render.d.ts +17 -0
  92. package/types/packages/testing/rtl/src/resizeObserver.d.ts +33 -0
  93. package/types/packages/testing/rtl/src/storage.d.ts +10 -0
  94. package/types/packages/testing/src/index.d.ts +6 -0
  95. package/types/packages/testing/vitest/src/constants.d.ts +24 -0
  96. package/types/packages/testing/vitest/src/factories/app/index.d.ts +5 -0
  97. package/types/packages/testing/vitest/src/factories/app/m4lAppBase.d.ts +9 -0
  98. package/types/packages/testing/vitest/src/factories/app/m4lAppComponents.d.ts +20 -0
  99. package/types/packages/testing/vitest/src/factories/app/m4lAppCore.d.ts +12 -0
  100. package/types/packages/testing/vitest/src/factories/app/m4lAppGraphics.d.ts +10 -0
  101. package/types/packages/testing/vitest/src/factories/app/m4lAppLayouts.d.ts +18 -0
  102. package/types/packages/testing/vitest/src/factories/base/index.d.ts +1 -0
  103. package/types/packages/testing/vitest/src/factories/base/m4lBaseComponents.d.ts +13 -0
  104. package/types/packages/testing/vitest/src/factories/index.d.ts +7 -0
  105. package/types/packages/testing/vitest/src/factories/leaflet.d.ts +10 -0
  106. package/types/packages/testing/vitest/src/factories/packages/index.d.ts +7 -0
  107. package/types/packages/testing/vitest/src/factories/packages/m4lPackageBase.d.ts +11 -0
  108. package/types/packages/testing/vitest/src/factories/packages/m4lPackageComponents.d.ts +11 -0
  109. package/types/packages/testing/vitest/src/factories/packages/m4lPackageCore.d.ts +11 -0
  110. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclick.d.ts +10 -0
  111. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclickRealtime.d.ts +6 -0
  112. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGraphics.d.ts +9 -0
  113. package/types/packages/testing/vitest/src/factories/packages/m4lPackageLayouts.d.ts +10 -0
  114. package/types/packages/testing/vitest/src/factories/reResizable.d.ts +6 -0
  115. package/types/packages/testing/vitest/src/factories/reactHookForm.d.ts +10 -0
  116. package/types/packages/testing/vitest/src/factories/reactLeaflet.d.ts +10 -0
  117. package/types/packages/testing/vitest/src/fixtures.d.ts +71 -0
  118. package/types/packages/testing/vitest/src/helpers/columnConfigs.d.ts +184 -0
  119. package/types/packages/testing/vitest/src/helpers/elementMocks.d.ts +166 -0
  120. package/types/packages/testing/vitest/src/helpers/filterFields.d.ts +37 -0
  121. package/types/packages/testing/vitest/src/helpers/index.d.ts +9 -0
  122. package/types/packages/testing/vitest/src/helpers/mapStore.d.ts +9 -0
  123. package/types/packages/testing/vitest/src/helpers/moduleContract.d.ts +15 -0
  124. package/types/packages/testing/vitest/src/helpers/rhf.d.ts +8 -0
  125. package/types/packages/testing/vitest/src/helpers/serialization.d.ts +7 -0
  126. package/types/packages/testing/vitest/src/helpers/sortFields.d.ts +28 -0
  127. package/types/packages/testing/vitest/src/helpers/windowSizes.d.ts +1 -0
  128. package/types/packages/testing/vitest/src/index.d.ts +6 -0
  129. package/types/packages/testing/vitest/src/installers/consoleError.d.ts +9 -0
  130. package/types/packages/testing/vitest/src/installers/index.d.ts +2 -0
  131. package/types/packages/testing/vitest/src/installers/rhfSubmit.d.ts +9 -0
  132. package/types/packages/testing/vitest/src/types.d.ts +116 -0
  133. package/vitest/index.js +55 -0
  134. package/e2e/commands/components/Accordions/commands.d.ts +0 -4
  135. package/e2e/commands/components/Accordions/commands.js +0 -19
  136. package/e2e/commands/components/Accordions/types.d.ts +0 -63
  137. package/e2e/commands/components/CommonActions/commands.d.ts +0 -4
  138. package/e2e/commands/components/CommonActions/commands.js +0 -11
  139. package/e2e/commands/components/CommonActions/types.d.ts +0 -20
  140. package/e2e/commands/components/DataGrid/commands.d.ts +0 -4
  141. package/e2e/commands/components/DataGrid/commands.js +0 -42
  142. package/e2e/commands/components/DataGrid/types.d.ts +0 -140
  143. package/e2e/commands/components/DynamicFilter/commands.d.ts +0 -4
  144. package/e2e/commands/components/DynamicFilter/commands.js +0 -12
  145. package/e2e/commands/components/DynamicFilter/types.d.ts +0 -27
  146. package/e2e/commands/components/DynamicSort/commands.d.ts +0 -4
  147. package/e2e/commands/components/DynamicSort/commands.js +0 -10
  148. package/e2e/commands/components/DynamicSort/types.d.ts +0 -26
  149. package/e2e/commands/components/Filters/commands.d.ts +0 -4
  150. package/e2e/commands/components/Filters/commands.js +0 -24
  151. package/e2e/commands/components/Filters/types.d.ts +0 -91
  152. package/e2e/commands/components/Form/commands.d.ts +0 -4
  153. package/e2e/commands/components/Form/commands.js +0 -11
  154. package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.d.ts +0 -5
  155. package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.js +0 -20
  156. package/e2e/commands/components/Form/cypress/assertInitialFormState/type.d.ts +0 -105
  157. package/e2e/commands/components/Form/cypress/assertInitialFormState/type.js +0 -1
  158. package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.d.ts +0 -17
  159. package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.js +0 -14
  160. package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.d.ts +0 -28
  161. package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.js +0 -1
  162. package/e2e/commands/components/Form/cypress/constants.d.ts +0 -3
  163. package/e2e/commands/components/Form/cypress/constants.js +0 -6
  164. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.d.ts +0 -8
  165. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.js +0 -29
  166. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.d.ts +0 -5
  167. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.js +0 -1
  168. package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.d.ts +0 -20
  169. package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.js +0 -8
  170. package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.d.ts +0 -10
  171. package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.js +0 -6
  172. package/e2e/commands/components/Form/cypress/proceedFormStep/type.d.ts +0 -13
  173. package/e2e/commands/components/Form/helpers/getFieldNameDomElement.d.ts +0 -7
  174. package/e2e/commands/components/Form/helpers/getFieldNameDomElement.js +0 -13
  175. package/e2e/commands/components/Form/types.d.ts +0 -88
  176. package/e2e/commands/components/MenuActions/commands.d.ts +0 -4
  177. package/e2e/commands/components/MenuActions/commands.js +0 -8
  178. package/e2e/commands/components/MenuActions/types.d.ts +0 -24
  179. package/e2e/commands/components/Popover/commands.d.ts +0 -4
  180. package/e2e/commands/components/Popover/commands.js +0 -8
  181. package/e2e/commands/components/Popover/types.d.ts +0 -15
  182. package/e2e/commands/components/PropertyValue/commands.d.ts +0 -4
  183. package/e2e/commands/components/PropertyValue/commands.js +0 -8
  184. package/e2e/commands/components/PropertyValue/types.d.ts +0 -19
  185. package/e2e/commands/components/Tab/commands.d.ts +0 -4
  186. package/e2e/commands/components/Tab/commands.js +0 -9
  187. package/e2e/commands/components/Tab/types.d.ts +0 -29
  188. package/e2e/commands/components/WindowBase/commands.d.ts +0 -4
  189. package/e2e/commands/components/WindowBase/commands.js +0 -24
  190. package/e2e/commands/components/WindowBase/types.d.ts +0 -100
  191. package/e2e/commands/components/index.d.ts +0 -12
  192. package/e2e/commands/components/index.js +0 -1
  193. package/e2e/commands/index.d.ts +0 -7
  194. package/e2e/commands/index.js +0 -1
  195. package/e2e/commands/intercepts/index.d.ts +0 -2
  196. package/e2e/commands/intercepts/index.js +0 -1
  197. package/e2e/commands/intercepts/noPrivileges/interceptCommands.d.ts +0 -5
  198. package/e2e/commands/intercepts/noPrivileges/interceptCommands.js +0 -15
  199. package/e2e/commands/intercepts/noPrivileges/types.d.ts +0 -8
  200. package/e2e/commands/intercepts/noPrivileges/types.js +0 -1
  201. package/e2e/commands/register.d.ts +0 -4
  202. package/e2e/commands/register.js +0 -19
  203. package/e2e/cypress.d.js +0 -1
  204. package/e2e/cypress.d.ts +0 -24
  205. package/e2e/index.d.ts +0 -1
  206. package/e2e/types.d.ts +0 -4
  207. package/index.d.ts +0 -4
  208. package/index.test.d.ts +0 -1
  209. package/testComponents/DataGrid/helpers.d.ts +0 -5
  210. package/testComponents/DataGrid/helpers.js +0 -95
  211. package/testComponents/DataGrid/index.d.ts +0 -2
  212. package/testComponents/DataGrid/index.js +0 -1
  213. package/testComponents/DataGrid/types.d.ts +0 -54
  214. package/testComponents/DataGrid/types.js +0 -1
  215. package/testComponents/DynamicFilter/helpers.d.ts +0 -5
  216. package/testComponents/DynamicFilter/helpers.js +0 -18
  217. package/testComponents/DynamicFilter/index.d.ts +0 -1
  218. package/testComponents/DynamicFilter/index.js +0 -1
  219. package/testComponents/DynamicFilter/types.d.ts +0 -0
  220. package/testComponents/DynamicSort/helpers.d.ts +0 -5
  221. package/testComponents/DynamicSort/helpers.js +0 -16
  222. package/testComponents/DynamicSort/index.d.ts +0 -1
  223. package/testComponents/DynamicSort/index.js +0 -1
  224. package/testComponents/index.d.ts +0 -3
  225. package/testComponents/index.js +0 -1
  226. package/testTools/constants.d.ts +0 -0
  227. package/testTools/index.d.ts +0 -1
  228. package/testTools/index.js +0 -1
  229. package/testTools/mocks.d.ts +0 -0
  230. package/testTools/setup.d.ts +0 -0
  231. package/testTools/setup.js +0 -1
  232. package/testTools/types.d.ts +0 -0
  233. package/testTools/utils.d.ts +0 -11
  234. package/testTools/utils.js +0 -23
  235. package/vite-env.d.ts +0 -5
@@ -1,42 +0,0 @@
1
- const f = () => {
2
- Cypress.Commands.add("m4lDataGrid", (i) => cy.get(i).find('[class^="M4LDataGrid-root"]').filter(":visible").first()), Cypress.Commands.add("m4lDataGridValidateVisibleColumns", (i, n, a, o = 1) => {
3
- let l = 0, t = o;
4
- n(a).forEach((r) => {
5
- r.visible && (cy.log(`Validating visible column: ${r.headerText} , index: ${t}`), t++, cy.m4lDataGrid(i).find("[role=row]").find(`[role=columnheader][aria-colindex=${t}]`).should("have.text", r.headerText), cy.m4lDataGrid(i).find("[role=row]").find(`[role=gridcell][aria-colindex=${t}]`).should("contain", r.value), cy.m4lDataGrid(i).find("[role=row]").find(`[role=columnheader][aria-colindex=${t}]`).then((s) => {
6
- const d = s.width();
7
- d !== void 0 && (l += d), cy.m4lDataGrid(i).find("[role=grid]").scrollTo(l, 0, { duration: 100, ensureScrollable: !1 });
8
- }));
9
- });
10
- }), Cypress.Commands.add("m4lDataGridRow", (i, n, a) => {
11
- let o = 0, l = 0;
12
- const t = 10, r = n + 1;
13
- function s() {
14
- return cy.m4lDataGrid(i).find("[role=row]").not('[aria-rowindex="1"]').filter(`[aria-rowindex="${r}"]`).then((d) => {
15
- if (d.length > 0) {
16
- const e = d[0].getBoundingClientRect();
17
- if (e.top >= 0 && e.left >= 0 && e.bottom <= (window.innerHeight || document.documentElement.clientHeight) && e.right <= (window.innerWidth || document.documentElement.clientWidth))
18
- return cy.wrap(d);
19
- }
20
- if (l >= t)
21
- throw new Error(`Row ${r} was not found after ${t} attempts`);
22
- return l++, cy.m4lDataGrid(i).find("[role=row]").not('[aria-rowindex="1"]').filter((m, e) => {
23
- const c = e.getBoundingClientRect();
24
- return c.top >= 0 && c.left >= 0 && c.bottom <= (window.innerHeight || document.documentElement.clientHeight) && c.right <= (window.innerWidth || document.documentElement.clientWidth);
25
- }).first().then((m) => {
26
- const e = m.height() || 0;
27
- return o += e, cy.m4lDataGrid(i).find("[role=grid]").scrollTo(0, o, { duration: 100, ensureScrollable: !1 }).then(() => s());
28
- });
29
- });
30
- }
31
- return s().find(`[role=gridcell][aria-colindex="${a}"]`);
32
- }), Cypress.Commands.add("m4lDataGridRowAction", (i, n, a = 1, o = 1) => {
33
- cy.m4lDataGridRow(i, a, o).find("button").eq(0).should("be.visible", { timeout: 1e4 }).click(), cy.m4lMenuActionsItem(n);
34
- }), Cypress.Commands.add("m4lDataGridFindAllColumns", (i) => {
35
- cy.m4lDataGrid(i).find('[class^="M4LDataGrid-actionsConfigContainer"]').find("button").eq(2).click();
36
- }), Cypress.Commands.add("m4lDataGridOrCardViewMode", (i, n) => {
37
- cy.m4lDataGrid(i).find('[class*="M4LDataGrid-actionsConfigContainer"]').find('[class*="M4LDataGrid-containerLeftActions"]').find('button[aria-label="view-mode"]').click(), cy.get("[role=presentation]").find('[class^="MuiPaper-root"]').find("[role=button]").eq(n).click();
38
- });
39
- };
40
- export {
41
- f as r
42
- };
@@ -1,140 +0,0 @@
1
- /**
2
- * Column configuration for DataGrid in Cypress
3
- */
4
- export type M4LDataGridCypressColumn = {
5
- /**
6
- * @param key - The column key
7
- */
8
- key: string;
9
- /**
10
- * @param value - The column value
11
- */
12
- value: any;
13
- /**
14
- * @param headerText - The column header text
15
- */
16
- headerText: string;
17
- /**
18
- * @param visible - Indicates whether the column is visible
19
- */
20
- visible: boolean;
21
- };
22
-
23
- /**
24
- * Function that gets the DataGrid column configuration
25
- */
26
- export type M4LGetCypressDataGridColumnsConfig<T> = (data: T) => M4LDataGridCypressColumn[];
27
-
28
- declare global {
29
- namespace Cypress {
30
- interface Chainable {
31
- /**
32
- * Gets the grid. Returns the first visible M4LDataGrid under the selector.
33
- * @param selector grid selector
34
- * @returns the grid
35
- * @example
36
- * cy.m4lDataGrid('[class*="M4LDataGrid-root"]').find('[role=row]').should('have.length.at.least', 1);
37
- */
38
- m4lDataGrid(selector: string ): Chainable<JQuery<HTMLElement>>
39
- /**
40
- * Validates the visible columns of the grid. Scrolls horizontally as needed for each column.
41
- * @example
42
- * const getColumns = (data: MockItem) => [
43
- * { key: 'name', headerText: 'Name', value: data.name, visible: true },
44
- * { key: 'code', headerText: 'Code', value: data.code, visible: true },
45
- * ];
46
- * cy.m4lDataGridValidateVisibleColumns('[class*="M4LDataGrid-root"]', getColumns, mockItem, 1);
47
- */
48
- m4lDataGridValidateVisibleColumns<T>(
49
- /**
50
- * Grid selector
51
- */
52
- selector: string,
53
- /**
54
- * Function that gets the visible columns of the grid
55
- */
56
- getColumnsConfig: M4LGetCypressDataGridColumnsConfig<T>,
57
- /**
58
- * Grid data
59
- */
60
- mockData: T,
61
- /**
62
- * Column index to get
63
- */
64
- baseColumnIndex?: number
65
- ): Chainable<void>;
66
- /**
67
- * Gets the grid row specified by 1-based index, ensuring it is visible in the viewport.
68
- * @example
69
- * cy.m4lDataGridRow('[class*="M4LDataGrid-root"]', 2, 1).click(); // row 2, column 1
70
- */
71
- m4lDataGridRow(
72
- /**
73
- * Grid selector
74
- */
75
- selector: string,
76
- /**
77
- * Row index to get
78
- */
79
- targetRowBaseOneIndex: number,
80
- /**
81
- * Column index to get
82
- */
83
- baseOneColumnIndex: number
84
- ): Chainable<JQuery<HTMLElement>>;
85
- /**
86
- * Opens the row actions menu for the given row and selects the menu item by index.
87
- * @example
88
- * cy.m4lDataGridRowAction('[class*="M4LDataGrid-root"]', 0, 2, 1); // row 2, column 1, first menu item
89
- */
90
- m4lDataGridRowAction(
91
- /**
92
- * Grid selector
93
- */
94
- selector: string,
95
- /**
96
- * menuActions item index
97
- */
98
- menuItemIndex: number,
99
- /**
100
- * Row index to get
101
- */
102
- baseOnetargetRowIndex?: number,
103
- /**
104
- * Column index to get
105
- */
106
- baseOneColumnIndex?: number,
107
- ): Chainable<Element>
108
-
109
- /**
110
- * Finds and shows all columns of the main grid by opening the configurator (third button).
111
- * @example
112
- * cy.m4lDataGridFindAllColumns('[class*="M4LDataGrid-root"]');
113
- */
114
- m4lDataGridFindAllColumns(
115
- /**
116
- * Grid selector
117
- */
118
- selector: string,
119
- ): Chainable<Element>
120
- /**
121
- * Switches the grid view mode (e.g. Card vs Grid). Clicks the view-mode button and selects option by index.
122
- * @example
123
- * cy.m4lDataGridViewMode('[class*="M4LDataGrid-root"]', 0);
124
- * cy.m4lDataGridViewMode('[class*="M4LDataGrid-root"]', 1);
125
- */
126
- m4lDataGridOrCardViewMode(
127
- /**
128
- * Selector for the section to validate
129
- */
130
- section: string,
131
- /**
132
- * Card or Grid view mode
133
- */
134
- viewMode: number,
135
- ): Chainable<Element>;
136
- }
137
- }
138
- }
139
-
140
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Registers DynamicFilter commands
3
- */
4
- export declare const registerDynamicFilterCommands: () => void;
@@ -1,12 +0,0 @@
1
- const n = () => {
2
- Cypress.Commands.add("m4lDynamicFilterInputClick", () => {
3
- cy.get('[class*="M4LDynamicFilter-root"]').find('[class*="M4LDynamicFilter-inputFilter"]').find("input").click();
4
- }), Cypress.Commands.add("m4lDynamicFilterApplyedDateField", (i) => {
5
- cy.m4lDynamicFilterInputClick(), cy.m4lPopover().find("li").contains(i).click(), cy.m4lPopover().find("button").contains("N_D:[common_actions.intro]").click();
6
- }), Cypress.Commands.add("m4lDynamicFilterRefreshButton", (i) => {
7
- cy.get(i).find('[class*="M4LDynamicFilter-root"]').find('[class*="M4LDynamicFilter-actions"]').find('[class*="MuiButtonBase-root"]').eq(1);
8
- });
9
- };
10
- export {
11
- n as r
12
- };
@@ -1,27 +0,0 @@
1
- declare global {
2
- namespace Cypress {
3
- interface Chainable {
4
- /**
5
- * Clicks on the filter input to open the filter popover.
6
- * @example
7
- * cy.m4lDynamicFilterInputClick();
8
- * cy.m4lPopover().find('li').first().click();
9
- */
10
- m4lDynamicFilterInputClick(): Chainable<Element>;
11
- /**
12
- * Applies the date filter: opens filter input, selects the date field by label, then confirms.
13
- * @example
14
- * cy.m4lDynamicFilterApplyedDateField('Created at');
15
- */
16
- m4lDynamicFilterApplyedDateField(dateFieldLabel: string): Chainable<Element>;
17
- /**
18
- * Gets the refresh button (second button in the filter actions area).
19
- * @example
20
- * cy.m4lDynamicFilterRefreshButton('[class*="M4LSplitLayout-splitDetail"]').click();
21
- */
22
- m4lDynamicFilterRefreshButton(selector: string): Chainable<Element>;
23
- }
24
- }
25
- }
26
-
27
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Registers DynamicSort commands
3
- */
4
- export declare const registerDynamicSortCommands: () => void;
@@ -1,10 +0,0 @@
1
- const c = () => {
2
- Cypress.Commands.add("m4lDynamicSortInputClick", () => {
3
- cy.get('[class*="M4LDynamicSort-root"]').find('[class*="M4LDynamicSort-inputSort"]').find("input").click();
4
- }), Cypress.Commands.add("m4lDynamicSortApplyedField", (n) => {
5
- cy.m4lDynamicSortInputClick(), cy.m4lPopover().find("li").contains(n).click(), cy.m4lPopover().find("button").contains("N_D:[common_actions.intro]").click();
6
- });
7
- };
8
- export {
9
- c as r
10
- };
@@ -1,26 +0,0 @@
1
- declare global {
2
- namespace Cypress {
3
- interface Chainable {
4
- /**
5
- * Clicks on the sort input to open the sort popover.
6
- * @example
7
- * cy.m4lDynamicSortInputClick();
8
- * cy.m4lPopover().find('li').contains('Name').click();
9
- */
10
- m4lDynamicSortInputClick(): Chainable<Element>
11
- /**
12
- * Applies the sort for a field: opens sort input, selects the field by label, then confirms.
13
- * @example
14
- * cy.m4lDynamicSortApplyedField('Created at');
15
- */
16
- m4lDynamicSortApplyedField(
17
- /**
18
- * Date field label
19
- */
20
- dateFieldLabel: string,
21
- ): Chainable<Element>
22
- }
23
- }
24
- }
25
-
26
- export {};
@@ -1,4 +0,0 @@
1
- /**
2
- * Registers Filters and Sorts commands
3
- */
4
- export declare const registerFiltersCommands: () => void;
@@ -1,24 +0,0 @@
1
- const I = '[class*="M4LSplitLayout-splitDetail"]', y = () => {
2
- Cypress.Commands.add(
3
- "m4lFiltersAndSortsOptionsValidation",
4
- (i, t, n, s, c, l) => {
5
- const o = () => cy.get('[role="presentation"]', { timeout: 1e3 }).should("exist"), r = (e) => {
6
- o(), cy.get('[role="presentation"]', { timeout: 1e3 }).find("li").contains(e.key).click(), cy.get('[role="presentation"]', { timeout: 1e3 }).find('[class*="MuiPaper-root-MuiPopover-paper"]').should("be.visible").find("input").eq(e.inputIndex).click({ force: !0 });
7
- }, T = () => {
8
- cy.get("[role=presentation]").find("button").contains("N_D:[common_actions.intro]").click({ force: !0 });
9
- }, d = (e) => {
10
- ["select", "selectAsync", "boolean"].includes(e.type) ? (o(), cy.get('[role="presentation"]', { timeout: 1e3 }).find("li").eq(0).click({ force: !0 }), cy.get("[role=presentation]").find('[class*="MuiPaper-root-MuiPopover-paper"]').find('[class*="M4LWindowBase-headerWindowComponent"]').dblclick({ force: !0 })) : ["string", "number"].includes(e.type) && (o(), cy.get('[role="presentation"]', { timeout: 1e3 }).find("input").eq(1).type(e.value));
11
- }, a = (e, p, u, E) => {
12
- cy.log(`Validating filter ${e.key}`), cy.get(p, { timeout: 1e3 }).find(u).eq(E).click(), r(e), d(e), T();
13
- };
14
- i(t).forEach((e) => {
15
- l ? (a(e, n, s, c), cy.get(`${I} [class*="M4LDynamicFilter-actions"] button`).eq(1).click(), cy.wait(e.endpoint, { timeout: 1e3 })) : (a(e, n, s, c), cy.wait(e.endpoint, { timeout: 1e3 }).wait("@getList", { timeout: 1e3 }));
16
- });
17
- }
18
- ), Cypress.Commands.add("m4lFiltersAndSortsPersistValidation", (i, t, n) => {
19
- cy.get(i).find(`[class*="M4LDynamic${t}-applied${t}s"]`).find(`[class*="M4LDynamic${t}-applied${t}InnerContainer"]`).find("[role=button-chip]").should("have.length", n);
20
- });
21
- };
22
- export {
23
- y as r
24
- };
@@ -1,91 +0,0 @@
1
- /**
2
- * Filter and sort configuration for Filters
3
- */
4
- export type M4lFiltersAndSortsConfig = {
5
- /**
6
- * Filter type for string, number, select, selectAsync and boolean types
7
- */
8
- type: string;
9
- /**
10
- * Filter key for select, selectAsync and boolean types
11
- */
12
- key: string;
13
- /**
14
- * Filter value for string and number types
15
- */
16
- value: string;
17
- /**
18
- * Filter endpoint to wait for
19
- */
20
- endpoint: string;
21
- /**
22
- * Filter input index
23
- */
24
- inputIndex: number;
25
- };
26
-
27
- declare global {
28
- namespace Cypress {
29
- interface Chainable {
30
- /**
31
- * Validates filter and sort options for DynamicFilter. For each filter, selects it, applies value by type, sends input.
32
- * @example
33
- * const mockFilters: M4lDynamicFilterConfig[] = [
34
- * { type: 'string', key: 'Name', value: 'test', endpoint: '@getList', inputIndex: 1 },
35
- * ];
36
- * cy.intercept('GET', '/api/items*').as('getList');
37
- * cy.m4lDynamicFilterValidateFilterAndSortOptions(
38
- * (f) => f,
39
- * mockFilters,
40
- * '[class*="M4LDynamicFilter-root"]',
41
- * '[class*="M4LDynamicFilter-filterChip"]',
42
- * 0
43
- * );
44
- */
45
- m4lFiltersAndSortsOptionsValidation (
46
- filters: (mockFilters: M4lFiltersAndSortsConfig[]) => M4lFiltersAndSortsConfig[],
47
- /**
48
- * Mock of the filters to validate
49
- */
50
- mockFilters: M4lFiltersAndSortsConfig[],
51
- /**
52
- * Selector for the filters or sort to validate
53
- */
54
- filtersOrSort: string,
55
- /**
56
- * Selector for the section to validate
57
- */
58
- section: string,
59
- /**
60
- * Index of the filters or sort to validate
61
- */
62
- index: number,
63
- /**
64
- * If true, validates the filter in the logs tab
65
- */
66
- logs?: boolean,
67
- ): Chainable<Element>;
68
- /**
69
- * Asserts that the number of applied filter/sort chips matches the expected length.
70
- * @example
71
- * cy.m4lDynamicFilterAndSortsPersist('[class*="M4LSplitLayout-splitDetail"]', 'Filter', 2);
72
- */
73
- m4lFiltersAndSortsPersistValidation (
74
- /**
75
- * Selector for the section to validate
76
- */
77
- section: string,
78
- /**
79
- * Filter or sort type
80
- */
81
- type: 'Filter' | 'Sort',
82
- /**
83
- * Length of applied filters and sorts
84
- */
85
- length: number,
86
- ): Chainable<Element>;
87
- }
88
- }
89
- }
90
-
91
- export { };
@@ -1,4 +0,0 @@
1
- /**
2
- * Registers Form commands
3
- */
4
- export declare const registerFormCommands: () => void;
@@ -1,11 +0,0 @@
1
- import { a as s } from "./cypress/assertInitialFormState/assertInitialFormState.js";
2
- import { a as r } from "./cypress/assertMandatoryFields/assertMandatoryFields.js";
3
- import { f as m } from "./cypress/fillAndAssertFormFields/fillAndAssertFormFields.js";
4
- import { g as o } from "./cypress/getFormScope/getFormScope.js";
5
- import { p as e } from "./cypress/proceedFormStep/proceedFormStep.js";
6
- const l = () => {
7
- Cypress.Commands.add("m4lAssertInitialFormState", s), Cypress.Commands.add("m4lAssertMandatoryFields", r), Cypress.Commands.add("m4lGetFormScope", o), Cypress.Commands.add("m4lFillAndAssertFormFields", m), Cypress.Commands.add("m4lProceedFormStep", e);
8
- };
9
- export {
10
- l as r
11
- };
@@ -1,5 +0,0 @@
1
- import { AssertInitialFormState } from './type';
2
- /**
3
- * Assert initial state of a Form, with or without stepper.
4
- */
5
- export declare const assertInitialFormState: (params: AssertInitialFormState) => void;
@@ -1,20 +0,0 @@
1
- import { W as n, D as c } from "../constants.js";
2
- import { g as d } from "../../helpers/getFieldNameDomElement.js";
3
- import { g as h } from "../getFormScope/getFormScope.js";
4
- const a = (e, o, t) => h(t).find(d(e.typeElement)).eq(e.index ?? o), i = (e, o) => {
5
- e.forEach((t, s) => {
6
- a(t, s, o).should("be.visible"), a(t, s, o).should("have.value", t.expectedValue ?? ""), t.enabled === !1 ? a(t, s, o).should("have.attr", "readonly") : a(t, s, o).should("not.have.attr", "readonly");
7
- });
8
- }, f = (e) => "steps" in e, g = (e) => {
9
- const { endpointToWait: o } = e;
10
- if (o && cy.wait(o), cy.get(n).should("be.visible"), f(e)) {
11
- const { steps: t, labelNextButton: s = c } = e;
12
- t.sort((r, l) => r.stepperIndex - l.stepperIndex).forEach((r, l) => {
13
- l > 0 && cy.contains('[data-testid="M4LTypography-root"]', s).should("be.visible").click(), i(r.inputs, r.stepperIndex);
14
- });
15
- } else
16
- i(e.inputs);
17
- };
18
- export {
19
- g as a
20
- };
@@ -1,105 +0,0 @@
1
- interface BaseInput {
2
- /**
3
- * Index of the field in the form
4
- */
5
- index?: number;
6
- /**
7
- * Value of the field visible by default
8
- */
9
- valueVisibleByDefault?: string;
10
- }
11
- interface InputWithoutOptions extends BaseInput {
12
- /**
13
- * Type of the element in the form (input, textarea)
14
- */
15
- typeElement: 'input' | 'textarea';
16
- /**
17
- * Type of the value of the input (string, number)
18
- */
19
- typeValue?: 'string' | 'number';
20
- /**
21
- * Value to write in the input
22
- */
23
- valueToWrite?: string;
24
- }
25
- interface InputWithOptions extends BaseInput {
26
- typeElement: 'select';
27
- /**
28
- * Alias of the endpoint to wait for. (Cypress alias syntax with intercept)
29
- * Example: '@localesList'
30
- */
31
- endpointToWait: string;
32
- /**
33
- * Options of the autocomplete. Only used for autocompleteAsync or select type.
34
- */
35
- options: string[];
36
- /**
37
- * Index to select in the list of options
38
- * by default is index 0 (first option)
39
- */
40
- optionIndexToSelect?: number;
41
- }
42
- export type InputsForm = InputWithoutOptions | InputWithOptions;
43
- interface AssertInitialFormStateBaseParams {
44
- /**
45
- * Endpoint to wait for. (Cypress alias syntax with intercept)
46
- * Example: '@getForm'
47
- */
48
- endpointToWait?: string;
49
- }
50
- export type InitialField = Omit<InputsForm, 'valueToWrite' | 'optionIndexToSelect' | 'options' | 'valueVisibleByDefault'> & {
51
- /**
52
- * Expected value of the field when form is initially loaded. By default is empty string.
53
- * Example: 'demo_operative'
54
- */
55
- expectedValue?: string;
56
- /**
57
- * Whether the field should be enabled on initial load.
58
- * By default the assertion expects enabled.
59
- */
60
- enabled?: boolean;
61
- };
62
- /**
63
- * Step to validate.
64
- * Example:
65
- * {
66
- * stepperIndex: 1,
67
- * inputs: [{ typeElement: 'input', valueVisibleByDefault: '' }]
68
- * }
69
- */
70
- export interface Step {
71
- /**
72
- * Stepper index to validate.
73
- * Example: 1
74
- */
75
- stepperIndex: number;
76
- /**
77
- * Inputs to validate in the selected step.
78
- */
79
- inputs: InitialField[];
80
- }
81
- export interface AssertInitialFormStateWithStepper extends AssertInitialFormStateBaseParams {
82
- /**
83
- * Steps to validate.
84
- * Example:
85
- * [{ stepperIndex: 1, inputs: [{ typeElement: 'input', valueVisibleByDefault: '' }] }]
86
- */
87
- steps: Step[];
88
- /**
89
- * Label of the next button.
90
- * By default: 'N_D:[stepper.label_next_button]'
91
- */
92
- labelNextButton?: string;
93
- inputs?: never;
94
- }
95
- export interface AssertInitialFormStateWithoutStepper extends AssertInitialFormStateBaseParams {
96
- /**
97
- * Inputs to validate when the form has no stepper.
98
- * Example:
99
- * [{ typeElement: 'input', index: 0, expectedValue: '' }]
100
- */
101
- inputs: InitialField[];
102
- steps?: never;
103
- }
104
- export type AssertInitialFormState = AssertInitialFormStateWithStepper | AssertInitialFormStateWithoutStepper;
105
- export {};
@@ -1,17 +0,0 @@
1
- import { AssertMandatoryFields } from './type';
2
- /**
3
- * function to assert mandatory fields
4
- * @param props - The properties to assert mandatory fields
5
- * @example
6
- * {
7
- * formFieldItems: [
8
- * {
9
- * name: 'name',
10
- * evaluateField: true,
11
- * mandatory: true,
12
- * },
13
- * ],
14
- * propertyValueSelector: '[data-testid="m4l-property-value-root-name"]',
15
- * }
16
- */
17
- export declare const assertMandatoryFields: ({ formFieldItems, propertyValueSelector }: AssertMandatoryFields) => void;
@@ -1,14 +0,0 @@
1
- import { g as r } from "../getFormScope/getFormScope.js";
2
- const a = (s, e) => r().find(`${e}[data-testid*="${s}"]`), l = ({ formFieldItems: s, propertyValueSelector: e }) => {
3
- s.forEach((t) => {
4
- if (t.evaluateField !== !1)
5
- if (a(t.name, e).should("contain.text", t.label), t.mandatory === !0) {
6
- const o = a(t.name, e).find('[class*="M4LHelperError-root"]');
7
- o.should("exist"), o.should("be.visible");
8
- } else
9
- a(t.name, e).find('[class*="M4LHelperError-root"]').should("not.exist");
10
- });
11
- };
12
- export {
13
- l as a
14
- };
@@ -1,28 +0,0 @@
1
- export type FormConfig = {
2
- name: string;
3
- label: string;
4
- evaluateField: boolean;
5
- mandatory?: boolean;
6
- };
7
- export interface AssertMandatoryFields {
8
- /**
9
- * Form field items to assert if are mandatory
10
- * @example
11
- * [
12
- * {
13
- * name: 'name',
14
- * value: 'John Doe',
15
- * evaluateValue: true,
16
- * text: 'Name',
17
- * mandatory: true,
18
- * },
19
- * ]
20
- */
21
- formFieldItems: FormConfig[];
22
- /**
23
- * Property value selector to assert mandatory fields. This property containts the selector of the property value of the form field.
24
- * @example
25
- * '[data-testid="m4l-property-value-root-name"]'
26
- */
27
- propertyValueSelector: string;
28
- }
@@ -1,3 +0,0 @@
1
- export declare const WINDOW_BASE_SELECTOR = "[class*=\"M4LWindowBase-contentWindowBase\"]";
2
- export declare const PAPER_FORM_SELECTOR = "[class*=\"M4LPaperForm-containerContent\"]";
3
- export declare const DEFAULT_NEXT_LABEL = "N_D:[stepper.label_next_button]";
@@ -1,6 +0,0 @@
1
- const n = '[class*="M4LWindowBase-contentWindowBase"]', s = '[class*="M4LPaperForm-containerContent"]', t = "N_D:[stepper.label_next_button]";
2
- export {
3
- t as D,
4
- s as P,
5
- n as W
6
- };
@@ -1,8 +0,0 @@
1
- import { FillAndAssertFormFields } from './type';
2
- /**
3
- * Fill and validate the inputs of the form with the data of the form
4
- * @param inputs - The inputs to validate
5
- * @param stepIndex - The step index to get the scope of the form
6
- * @returns void
7
- */
8
- export declare const fillAndAssertFormFields: ({ inputs, stepIndex }: FillAndAssertFormFields) => void;