@thinkwise/testwise 0.2.67 → 0.2.103
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/Testwise.ts +35 -0
- package/artifact-builder/ArtifactManager.ts +25 -2
- package/artifact-builder/ComponentClassModelBuilder.ts +148 -0
- package/artifact-builder/InterfaceGenerator.ts +31 -33
- package/artifact-builder/ModelDataBuilder.ts +18 -20
- package/artifact-builder/ModelDataRefiner.ts +23 -3
- package/artifact-builder/SchemaGenerator.ts +45 -35
- package/artifact-builder/ScreenInterfaceRefiner.ts +25 -10
- package/artifact-builder/SelectorBuilder.ts +30 -24
- package/artifact-builder/SubjectClassModelBuilder.ts +209 -0
- package/artifact-builder/SubjectComponentGenerator.ts +67 -246
- package/artifact-builder/SubjectGenerator.ts +117 -230
- package/artifact-builder/SubjectRegistration.ts +41 -32
- package/artifact-builder/TsFileModel.ts +94 -0
- package/artifact-builder/TsFileSerializer.ts +247 -0
- package/artifact-builder/helpers/DataRetriever.ts +64 -27
- package/artifact-builder/helpers/NamingHandler.ts +23 -78
- package/artifact-builder/helpers/PipelinePaths.ts +123 -0
- package/artifact-builder/helpers/Stopwatch.ts +10 -0
- package/artifact-builder/helpers/index.ts +1 -0
- package/artifact-builder/index.ts +4 -0
- package/components/BaseComponentObjects.ts +17 -0
- package/components/action-bar/ActionBar.ts +35 -47
- package/components/action-bar/ActionBarObjects.ts +2 -0
- package/components/action-bar/CustomActionBar.ts +6 -0
- package/components/cardlist/Cardlist.ts +6 -0
- package/components/chart/Chart.ts +6 -0
- package/components/combined-filter/CombinedFilter.ts +9 -0
- package/components/cube-view-bar/CubeViewBar.ts +6 -0
- package/components/export/ExportComponent.ts +12 -0
- package/components/filter/ExcelStyleFilterPopup.ts +35 -2
- package/components/filter/FilterForm.ts +10 -0
- package/components/filter/FilterPopup.ts +30 -9
- package/components/filter/FilterPopupObjects.ts +10 -3
- package/components/filter/FindForm.ts +7 -0
- package/components/filter/ManagePrefilterPopup.ts +11 -0
- package/components/form/Form.ts +16 -0
- package/components/grid/Grid.ts +18 -1
- package/components/maps/Maps.ts +6 -0
- package/components/menu/ListBarMenuComponent.ts +10 -0
- package/components/pivot-grid/PivotGrid.ts +6 -0
- package/components/pivot-grid/PivotGridFieldList.ts +7 -0
- package/components/pop-up/AllRowsPopUp.ts +12 -0
- package/components/pop-up/PopUpComponent.ts +11 -0
- package/components/prefilter-list/PrefilterList.ts +9 -0
- package/components/preview/Preview.ts +6 -0
- package/components/report-bar/ReportBar.ts +6 -0
- package/components/report-tiles/ReportTiles.ts +6 -0
- package/components/scheduler/Scheduler.ts +6 -0
- package/components/snackbar/SnackBar.ts +12 -0
- package/components/splitter/Splitter.ts +6 -0
- package/components/tab/BaseTab.ts +5 -0
- package/components/tab/DetailTabPage.ts +11 -0
- package/components/tab/Tab.ts +10 -0
- package/components/task/TaskBar.ts +13 -3
- package/components/task/TaskTiles.ts +12 -3
- package/components/topbar/TopBar.ts +10 -0
- package/components/tree-view/TreeView.ts +9 -0
- package/controls/DateControl.ts +40 -1
- package/controls/FormComboBox.ts +30 -0
- package/controls/GridColumnControl.ts +34 -3
- package/controls/InputFieldControl.ts +49 -0
- package/controls/LookupDropdown.ts +29 -0
- package/dist/Testwise.js +35 -0
- package/dist/Testwise.js.map +1 -1
- package/dist/artifact-builder/ArtifactManager.d.ts +18 -1
- package/dist/artifact-builder/ArtifactManager.js +24 -2
- package/dist/artifact-builder/ArtifactManager.js.map +1 -1
- package/dist/artifact-builder/ComponentClassModelBuilder.d.ts +22 -0
- package/dist/artifact-builder/ComponentClassModelBuilder.js +115 -0
- package/dist/artifact-builder/ComponentClassModelBuilder.js.map +1 -0
- package/dist/artifact-builder/InterfaceGenerator.d.ts +15 -6
- package/dist/artifact-builder/InterfaceGenerator.js +27 -26
- package/dist/artifact-builder/InterfaceGenerator.js.map +1 -1
- package/dist/artifact-builder/ModelDataBuilder.d.ts +7 -0
- package/dist/artifact-builder/ModelDataBuilder.js +13 -5
- package/dist/artifact-builder/ModelDataBuilder.js.map +1 -1
- package/dist/artifact-builder/ModelDataRefiner.d.ts +18 -1
- package/dist/artifact-builder/ModelDataRefiner.js +18 -3
- package/dist/artifact-builder/ModelDataRefiner.js.map +1 -1
- package/dist/artifact-builder/SchemaGenerator.d.ts +21 -5
- package/dist/artifact-builder/SchemaGenerator.js +38 -26
- package/dist/artifact-builder/SchemaGenerator.js.map +1 -1
- package/dist/artifact-builder/ScreenInterfaceRefiner.d.ts +18 -1
- package/dist/artifact-builder/ScreenInterfaceRefiner.js +23 -9
- package/dist/artifact-builder/ScreenInterfaceRefiner.js.map +1 -1
- package/dist/artifact-builder/SelectorBuilder.d.ts +18 -5
- package/dist/artifact-builder/SelectorBuilder.js +29 -14
- package/dist/artifact-builder/SelectorBuilder.js.map +1 -1
- package/dist/artifact-builder/SubjectClassModelBuilder.d.ts +38 -0
- package/dist/artifact-builder/SubjectClassModelBuilder.js +158 -0
- package/dist/artifact-builder/SubjectClassModelBuilder.js.map +1 -0
- package/dist/artifact-builder/SubjectComponentGenerator.d.ts +25 -14
- package/dist/artifact-builder/SubjectComponentGenerator.js +65 -189
- package/dist/artifact-builder/SubjectComponentGenerator.js.map +1 -1
- package/dist/artifact-builder/SubjectGenerator.d.ts +32 -13
- package/dist/artifact-builder/SubjectGenerator.js +81 -165
- package/dist/artifact-builder/SubjectGenerator.js.map +1 -1
- package/dist/artifact-builder/SubjectRegistration.d.ts +22 -8
- package/dist/artifact-builder/SubjectRegistration.js +29 -14
- package/dist/artifact-builder/SubjectRegistration.js.map +1 -1
- package/dist/artifact-builder/TsFileModel.d.ts +86 -0
- package/dist/artifact-builder/TsFileModel.js +2 -0
- package/dist/artifact-builder/TsFileModel.js.map +1 -0
- package/dist/artifact-builder/TsFileSerializer.d.ts +19 -0
- package/dist/artifact-builder/TsFileSerializer.js +225 -0
- package/dist/artifact-builder/TsFileSerializer.js.map +1 -0
- package/dist/artifact-builder/helpers/DataRetriever.d.ts +22 -3
- package/dist/artifact-builder/helpers/DataRetriever.js +56 -26
- package/dist/artifact-builder/helpers/DataRetriever.js.map +1 -1
- package/dist/artifact-builder/helpers/NamingHandler.d.ts +18 -6
- package/dist/artifact-builder/helpers/NamingHandler.js +20 -61
- package/dist/artifact-builder/helpers/NamingHandler.js.map +1 -1
- package/dist/artifact-builder/helpers/PipelinePaths.d.ts +52 -0
- package/dist/artifact-builder/helpers/PipelinePaths.js +99 -0
- package/dist/artifact-builder/helpers/PipelinePaths.js.map +1 -0
- package/dist/artifact-builder/helpers/Stopwatch.d.ts +10 -0
- package/dist/artifact-builder/helpers/Stopwatch.js +10 -0
- package/dist/artifact-builder/helpers/Stopwatch.js.map +1 -1
- package/dist/artifact-builder/helpers/index.d.ts +1 -0
- package/dist/artifact-builder/helpers/index.js +1 -0
- package/dist/artifact-builder/helpers/index.js.map +1 -1
- package/dist/artifact-builder/index.d.ts +4 -0
- package/dist/artifact-builder/index.js +4 -0
- package/dist/artifact-builder/index.js.map +1 -1
- package/dist/components/BaseComponentObjects.d.ts +17 -0
- package/dist/components/BaseComponentObjects.js +17 -0
- package/dist/components/BaseComponentObjects.js.map +1 -1
- package/dist/components/action-bar/ActionBar.d.ts +21 -24
- package/dist/components/action-bar/ActionBar.js +31 -24
- package/dist/components/action-bar/ActionBar.js.map +1 -1
- package/dist/components/action-bar/ActionBarObjects.d.ts +1 -0
- package/dist/components/action-bar/ActionBarObjects.js +1 -0
- package/dist/components/action-bar/ActionBarObjects.js.map +1 -1
- package/dist/components/action-bar/CustomActionBar.d.ts +6 -0
- package/dist/components/action-bar/CustomActionBar.js +6 -0
- package/dist/components/action-bar/CustomActionBar.js.map +1 -1
- package/dist/components/cardlist/Cardlist.d.ts +6 -0
- package/dist/components/cardlist/Cardlist.js +6 -0
- package/dist/components/cardlist/Cardlist.js.map +1 -1
- package/dist/components/chart/Chart.d.ts +6 -0
- package/dist/components/chart/Chart.js +6 -0
- package/dist/components/chart/Chart.js.map +1 -1
- package/dist/components/combined-filter/CombinedFilter.d.ts +9 -0
- package/dist/components/combined-filter/CombinedFilter.js +9 -0
- package/dist/components/combined-filter/CombinedFilter.js.map +1 -1
- package/dist/components/cube-view-bar/CubeViewBar.d.ts +6 -0
- package/dist/components/cube-view-bar/CubeViewBar.js +6 -0
- package/dist/components/cube-view-bar/CubeViewBar.js.map +1 -1
- package/dist/components/export/ExportComponent.d.ts +12 -0
- package/dist/components/export/ExportComponent.js +12 -0
- package/dist/components/export/ExportComponent.js.map +1 -1
- package/dist/components/filter/ExcelStyleFilterPopup.d.ts +17 -4
- package/dist/components/filter/ExcelStyleFilterPopup.js +35 -23
- package/dist/components/filter/ExcelStyleFilterPopup.js.map +1 -1
- package/dist/components/filter/ExcelStyleFilterPopupObjects.d.ts +1 -1
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js +2 -2
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js.map +1 -1
- package/dist/components/filter/FilterForm.d.ts +10 -0
- package/dist/components/filter/FilterForm.js +10 -0
- package/dist/components/filter/FilterForm.js.map +1 -1
- package/dist/components/filter/FilterPopup.d.ts +22 -4
- package/dist/components/filter/FilterPopup.js +17 -9
- package/dist/components/filter/FilterPopup.js.map +1 -1
- package/dist/components/filter/FilterPopupObjects.d.ts +5 -2
- package/dist/components/filter/FilterPopupObjects.js +5 -2
- package/dist/components/filter/FilterPopupObjects.js.map +1 -1
- package/dist/components/filter/FindForm.d.ts +7 -0
- package/dist/components/filter/FindForm.js +7 -0
- package/dist/components/filter/FindForm.js.map +1 -1
- package/dist/components/filter/ManagePrefilterPopup.d.ts +11 -0
- package/dist/components/filter/ManagePrefilterPopup.js +11 -0
- package/dist/components/filter/ManagePrefilterPopup.js.map +1 -1
- package/dist/components/form/Form.d.ts +16 -0
- package/dist/components/form/Form.js +16 -0
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/grid/Grid.d.ts +17 -0
- package/dist/components/grid/Grid.js +18 -1
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/maps/Maps.d.ts +6 -0
- package/dist/components/maps/Maps.js +6 -0
- package/dist/components/maps/Maps.js.map +1 -1
- package/dist/components/menu/ListBarMenuComponent.d.ts +10 -0
- package/dist/components/menu/ListBarMenuComponent.js +10 -0
- package/dist/components/menu/ListBarMenuComponent.js.map +1 -1
- package/dist/components/pivot-grid/PivotGrid.d.ts +6 -0
- package/dist/components/pivot-grid/PivotGrid.js +6 -0
- package/dist/components/pivot-grid/PivotGrid.js.map +1 -1
- package/dist/components/pivot-grid/PivotGridFieldList.d.ts +7 -0
- package/dist/components/pivot-grid/PivotGridFieldList.js +7 -0
- package/dist/components/pivot-grid/PivotGridFieldList.js.map +1 -1
- package/dist/components/pop-up/AllRowsPopUp.d.ts +12 -0
- package/dist/components/pop-up/AllRowsPopUp.js +12 -0
- package/dist/components/pop-up/AllRowsPopUp.js.map +1 -1
- package/dist/components/pop-up/PopUpComponent.d.ts +11 -0
- package/dist/components/pop-up/PopUpComponent.js +11 -0
- package/dist/components/pop-up/PopUpComponent.js.map +1 -1
- package/dist/components/prefilter-list/PrefilterList.d.ts +9 -0
- package/dist/components/prefilter-list/PrefilterList.js +9 -0
- package/dist/components/prefilter-list/PrefilterList.js.map +1 -1
- package/dist/components/preview/Preview.d.ts +6 -0
- package/dist/components/preview/Preview.js +6 -0
- package/dist/components/preview/Preview.js.map +1 -1
- package/dist/components/report-bar/ReportBar.d.ts +6 -0
- package/dist/components/report-bar/ReportBar.js +6 -0
- package/dist/components/report-bar/ReportBar.js.map +1 -1
- package/dist/components/report-tiles/ReportTiles.d.ts +6 -0
- package/dist/components/report-tiles/ReportTiles.js +6 -0
- package/dist/components/report-tiles/ReportTiles.js.map +1 -1
- package/dist/components/scheduler/Scheduler.d.ts +6 -0
- package/dist/components/scheduler/Scheduler.js +6 -0
- package/dist/components/scheduler/Scheduler.js.map +1 -1
- package/dist/components/snackbar/SnackBar.d.ts +12 -0
- package/dist/components/snackbar/SnackBar.js +12 -0
- package/dist/components/snackbar/SnackBar.js.map +1 -1
- package/dist/components/splitter/Splitter.d.ts +6 -0
- package/dist/components/splitter/Splitter.js +6 -0
- package/dist/components/splitter/Splitter.js.map +1 -1
- package/dist/components/tab/BaseTab.d.ts +5 -0
- package/dist/components/tab/BaseTab.js +5 -0
- package/dist/components/tab/BaseTab.js.map +1 -1
- package/dist/components/tab/DetailTabPage.d.ts +11 -0
- package/dist/components/tab/DetailTabPage.js +11 -0
- package/dist/components/tab/DetailTabPage.js.map +1 -1
- package/dist/components/tab/Tab.d.ts +10 -0
- package/dist/components/tab/Tab.js +10 -0
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/task/TaskBar.d.ts +12 -2
- package/dist/components/task/TaskBar.js +13 -3
- package/dist/components/task/TaskBar.js.map +1 -1
- package/dist/components/task/TaskTiles.d.ts +11 -2
- package/dist/components/task/TaskTiles.js +12 -3
- package/dist/components/task/TaskTiles.js.map +1 -1
- package/dist/components/topbar/TopBar.d.ts +10 -0
- package/dist/components/topbar/TopBar.js +10 -0
- package/dist/components/topbar/TopBar.js.map +1 -1
- package/dist/components/tree-view/TreeView.d.ts +9 -0
- package/dist/components/tree-view/TreeView.js +9 -0
- package/dist/components/tree-view/TreeView.js.map +1 -1
- package/dist/controls/DateControl.d.ts +39 -0
- package/dist/controls/DateControl.js +18 -1
- package/dist/controls/DateControl.js.map +1 -1
- package/dist/controls/FormComboBox.d.ts +30 -0
- package/dist/controls/FormComboBox.js +8 -0
- package/dist/controls/FormComboBox.js.map +1 -1
- package/dist/controls/GridColumnControl.d.ts +30 -0
- package/dist/controls/GridColumnControl.js +12 -3
- package/dist/controls/GridColumnControl.js.map +1 -1
- package/dist/controls/InputFieldControl.d.ts +49 -0
- package/dist/controls/InputFieldControl.js +30 -0
- package/dist/controls/InputFieldControl.js.map +1 -1
- package/dist/controls/LookupDropdown.d.ts +29 -0
- package/dist/controls/LookupDropdown.js +8 -0
- package/dist/controls/LookupDropdown.js.map +1 -1
- package/dist/enums/ElementTypes.d.ts +18 -0
- package/dist/enums/ElementTypes.js +18 -0
- package/dist/enums/ElementTypes.js.map +1 -1
- package/dist/enums/ExportFormat.d.ts +8 -0
- package/dist/enums/ExportFormat.js +8 -0
- package/dist/enums/ExportFormat.js.map +1 -1
- package/dist/enums/LogLevel.d.ts +17 -0
- package/dist/enums/LogLevel.js +17 -1
- package/dist/enums/LogLevel.js.map +1 -1
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.js +1 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/helpers/ConfigChecker.d.ts +13 -0
- package/dist/helpers/ConfigChecker.js +13 -0
- package/dist/helpers/ConfigChecker.js.map +1 -1
- package/dist/helpers/Ensure.d.ts +13 -0
- package/dist/helpers/Ensure.js +13 -0
- package/dist/helpers/Ensure.js.map +1 -1
- package/dist/helpers/FlightTracker.d.ts +13 -3
- package/dist/helpers/FlightTracker.js +103 -17
- package/dist/helpers/FlightTracker.js.map +1 -1
- package/dist/helpers/GlobalWaitEventHandler.d.ts +13 -0
- package/dist/helpers/GlobalWaitEventHandler.js +13 -0
- package/dist/helpers/GlobalWaitEventHandler.js.map +1 -1
- package/dist/helpers/LoginHelper.d.ts +35 -1
- package/dist/helpers/LoginHelper.js +46 -11
- package/dist/helpers/LoginHelper.js.map +1 -1
- package/dist/helpers/PathResolver.d.ts +22 -0
- package/dist/helpers/PathResolver.js +22 -0
- package/dist/helpers/PathResolver.js.map +1 -1
- package/dist/helpers/Poll.d.ts +13 -1
- package/dist/helpers/Poll.js +12 -0
- package/dist/helpers/Poll.js.map +1 -1
- package/dist/helpers/RegexHelper.d.ts +15 -0
- package/dist/helpers/RegexHelper.js +15 -3
- package/dist/helpers/RegexHelper.js.map +1 -1
- package/dist/helpers/SubjectNavigator.d.ts +26 -0
- package/dist/helpers/SubjectNavigator.js +51 -0
- package/dist/helpers/SubjectNavigator.js.map +1 -0
- package/dist/helpers/UserSimulationHelper.d.ts +14 -0
- package/dist/helpers/UserSimulationHelper.js +14 -0
- package/dist/helpers/UserSimulationHelper.js.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +1 -0
- package/dist/helpers/index.js.map +1 -1
- package/dist/index.d.ts +6 -20
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IComponentObjects.d.ts +12 -0
- package/dist/interfaces/IComponentSchemaMeta.d.ts +15 -0
- package/dist/interfaces/IComponentSchemaMeta.js +2 -0
- package/dist/interfaces/IComponentSchemaMeta.js.map +1 -0
- package/dist/interfaces/IProperty.d.ts +13 -0
- package/dist/interfaces/IRegisteredSubjects.d.ts +12 -0
- package/dist/interfaces/ISeedSubjectDraft.d.ts +16 -0
- package/dist/interfaces/ISeedSubjectDraft.js +2 -0
- package/dist/interfaces/ISeedSubjectDraft.js.map +1 -0
- package/dist/interfaces/ISubject.d.ts +13 -0
- package/dist/interfaces/ISubjectDetail.d.ts +11 -0
- package/dist/interfaces/ISubjectDetail.js +2 -0
- package/dist/interfaces/ISubjectDetail.js.map +1 -0
- package/dist/mcp/ArtifactResolver.d.ts +152 -0
- package/dist/mcp/ArtifactResolver.js +232 -0
- package/dist/mcp/ArtifactResolver.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/page-extensions/GlobalComponents.d.ts +30 -0
- package/dist/page-extensions/GlobalComponents.js +30 -0
- package/dist/page-extensions/GlobalComponents.js.map +1 -1
- package/dist/page-extensions/GoToDeepLink.d.ts +9 -0
- package/dist/page-extensions/GoToDeepLink.js +9 -0
- package/dist/page-extensions/GoToDeepLink.js.map +1 -1
- package/dist/page-extensions/LoginFeatures.d.ts +8 -0
- package/dist/page-extensions/LoginFeatures.js +8 -0
- package/dist/page-extensions/LoginFeatures.js.map +1 -1
- package/dist/page-extensions/SubjectRegistry.d.ts +31 -0
- package/dist/page-extensions/SubjectRegistry.js +31 -0
- package/dist/page-extensions/SubjectRegistry.js.map +1 -1
- package/dist/page-extensions/UserSimulation.d.ts +21 -0
- package/dist/page-extensions/UserSimulation.js +21 -0
- package/dist/page-extensions/UserSimulation.js.map +1 -1
- package/dist/page-extensions/WaitEventHandler.d.ts +20 -0
- package/dist/page-extensions/WaitEventHandler.js +20 -0
- package/dist/page-extensions/WaitEventHandler.js.map +1 -1
- package/dist/page-overrides/ClickOverride.d.ts +23 -2
- package/dist/page-overrides/ClickOverride.js +34 -50
- package/dist/page-overrides/ClickOverride.js.map +1 -1
- package/dist/page-overrides/FillOverride.d.ts +23 -0
- package/dist/page-overrides/FillOverride.js +56 -61
- package/dist/page-overrides/FillOverride.js.map +1 -1
- package/dist/services/ConfigBuilder.d.ts +24 -0
- package/dist/services/ConfigBuilder.js +24 -0
- package/dist/services/ConfigBuilder.js.map +1 -1
- package/dist/services/IndiciumApi.service.d.ts +26 -0
- package/dist/services/IndiciumApi.service.js +40 -5
- package/dist/services/IndiciumApi.service.js.map +1 -1
- package/dist/services/Logger.d.ts +13 -0
- package/dist/services/Logger.js +39 -0
- package/dist/services/Logger.js.map +1 -1
- package/dist/types/Components.d.ts +18 -1
- package/dist/types/Components.js +0 -1
- package/dist/types/Components.js.map +1 -1
- package/dist/types/LocatorType.d.ts +5 -0
- package/dist/types/LocatorType.js +2 -0
- package/dist/types/LocatorType.js.map +1 -0
- package/dist/types/PollTypes.d.ts +8 -0
- package/dist/types/Test.d.ts +18 -0
- package/dist/types/Universal.d.ts +12 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/enums/ElementTypes.ts +18 -0
- package/enums/ExportFormat.ts +8 -0
- package/enums/LogLevel.ts +17 -1
- package/enums/index.ts +1 -0
- package/helpers/ConfigChecker.ts +13 -0
- package/helpers/Ensure.ts +13 -0
- package/helpers/FlightTracker.ts +109 -20
- package/helpers/GlobalWaitEventHandler.ts +13 -0
- package/helpers/LoginHelper.ts +49 -12
- package/helpers/PathResolver.ts +22 -0
- package/helpers/Poll.ts +13 -1
- package/helpers/RegexHelper.ts +15 -3
- package/helpers/SubjectNavigator.ts +57 -0
- package/helpers/UserSimulationHelper.ts +14 -0
- package/helpers/index.ts +1 -0
- package/index.ts +1 -0
- package/interfaces/IComponentObjects.ts +12 -0
- package/interfaces/IComponentSchemaMeta.ts +17 -0
- package/interfaces/IProperty.ts +13 -0
- package/interfaces/IRegisteredSubjects.ts +12 -0
- package/interfaces/ISeedSubjectDraft.ts +17 -0
- package/interfaces/ISubject.ts +13 -0
- package/interfaces/ISubjectDetail.ts +12 -0
- package/mcp/ArtifactResolver.ts +296 -0
- package/mcp/index.ts +2 -0
- package/package.json +20 -8
- package/page-extensions/GlobalComponents.ts +30 -0
- package/page-extensions/GoToDeepLink.ts +9 -0
- package/page-extensions/LoginFeatures.ts +8 -0
- package/page-extensions/SubjectRegistry.ts +32 -0
- package/page-extensions/UserSimulation.ts +21 -0
- package/page-extensions/WaitEventHandler.ts +20 -0
- package/page-overrides/ClickOverride.ts +36 -55
- package/page-overrides/FillOverride.ts +59 -73
- package/promptCredentials.js +1 -1
- package/scripts/Testwise.template.json +1 -1
- package/scripts/diagram.js +2267 -0
- package/scripts/main.js +84 -63
- package/scripts/postinstall.js +55 -42
- package/scripts/setup.js +91 -37
- package/scripts/sync.js +767 -748
- package/services/ConfigBuilder.ts +24 -0
- package/services/IndiciumApi.service.ts +44 -6
- package/services/Logger.ts +40 -0
- package/templates/copilot-instructions.md +130 -0
- package/templates/mcp.json +9 -0
- package/templates/testwise-test-expert.agent.md +453 -0
- package/tests/tsconfig.json +12 -0
- package/tsconfig.json +6 -2
- package/types/Components.ts +17 -2
- package/types/LocatorType.ts +5 -0
- package/types/PollTypes.ts +8 -0
- package/types/Test.ts +18 -0
- package/types/Universal.ts +12 -0
- package/types/index.ts +2 -0
- package/dist/interfaces/IStoredTestResults.d.ts +0 -5
- package/dist/interfaces/IStoredTestResults.js +0 -2
- package/dist/interfaces/IStoredTestResults.js.map +0 -1
- package/dist/templates/test-artifacts/SubjectPageBase.d.ts +0 -5
- package/dist/templates/test-artifacts/SubjectPageBase.js +0 -6
- package/dist/templates/test-artifacts/SubjectPageBase.js.map +0 -1
- package/dist/templates/test-artifacts/screens/index.d.ts +0 -1
- package/dist/templates/test-artifacts/screens/index.js +0 -2
- package/dist/templates/test-artifacts/screens/index.js.map +0 -1
- package/dist/templates/test-artifacts/subjects/index.d.ts +0 -1
- package/dist/templates/test-artifacts/subjects/index.js +0 -2
- package/dist/templates/test-artifacts/subjects/index.js.map +0 -1
- package/interfaces/IStoredTestResults.ts +0 -6
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { DataRetriever, NamingHandler } from '../index.js';
|
|
6
|
-
import { coreComponents, screenComponents } from '../types/Components.js';
|
|
3
|
+
import { DataRetriever, NamingHandler, PipelinePaths } from './helpers/index.js';
|
|
7
4
|
import { SelectorBuilder } from './SelectorBuilder.js';
|
|
5
|
+
import { SubjectClassModelBuilder } from './SubjectClassModelBuilder.js';
|
|
6
|
+
import { serializeTsFile } from './TsFileSerializer.js';
|
|
7
|
+
/**
|
|
8
|
+
* **Pipeline Step 6** — Generates typed TypeScript subject class files under
|
|
9
|
+
* `test-artifacts/subjects/<SubjectName>/`.
|
|
10
|
+
*
|
|
11
|
+
* **What it does:**
|
|
12
|
+
* - Reads `seed-data/subjectsToBuild.json` to get the list of subjects to
|
|
13
|
+
* generate.
|
|
14
|
+
* - For each subject, uses `SubjectClassModelBuilder` to produce an in-memory
|
|
15
|
+
* model of the class, then hands it to `TsFileSerializer` to write the
|
|
16
|
+
* TypeScript file to disk.
|
|
17
|
+
* - Each generated class extends `SubjectPageBase`, imports the matching
|
|
18
|
+
* screen interface, and declares typed component properties.
|
|
19
|
+
* - After generating all class files, writes an `index.ts` barrel file for
|
|
20
|
+
* each subject folder.
|
|
21
|
+
*
|
|
22
|
+
* **When it runs:** Step 6 of `testwise sync`, after `SubjectComponentGenerator`
|
|
23
|
+
* has written the component interface files.
|
|
24
|
+
*/
|
|
8
25
|
export class SubjectGenerator {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
26
|
+
constructor(paths) {
|
|
27
|
+
this._paths = paths ?? new PipelinePaths();
|
|
28
|
+
this._subjectsDirectory = this._paths.subjects;
|
|
29
|
+
this._screensDirectory = this._paths.screens;
|
|
13
30
|
this._namingHandler = new NamingHandler();
|
|
14
31
|
this._selectorBuilder = new SelectorBuilder();
|
|
32
|
+
this._modelBuilder = new SubjectClassModelBuilder(this._namingHandler, this._selectorBuilder);
|
|
15
33
|
}
|
|
16
34
|
run() {
|
|
17
35
|
this.generateSubjectClasses();
|
|
18
36
|
this.indexGeneratedSubjects();
|
|
19
37
|
}
|
|
20
38
|
generateSubjectClasses() {
|
|
21
|
-
const subjects = new DataRetriever().getSubjectsToBuild();
|
|
39
|
+
const subjects = new DataRetriever(this._paths).getSubjectsToBuild();
|
|
22
40
|
subjects.forEach((subject) => {
|
|
23
41
|
this.createSubjectClass(subject);
|
|
24
42
|
});
|
|
@@ -53,29 +71,14 @@ export class SubjectGenerator {
|
|
|
53
71
|
const screenInterfaceName = this._namingHandler.generateScreenInterfaceName(subject.screentype_id);
|
|
54
72
|
const screenInterfacePath = this.getScreenInterfacePath(screenInterfaceName);
|
|
55
73
|
const screenFileContent = fs.readFileSync(screenInterfacePath, 'utf-8');
|
|
56
|
-
const subjectFolderName = this._namingHandler.
|
|
74
|
+
const subjectFolderName = this._namingHandler.toSubjectPascalCase(subject.subject);
|
|
57
75
|
const subjectFolderPath = this.getSubjectFolderRelativePath(subjectFolderName);
|
|
58
|
-
const subjectClass = {
|
|
59
|
-
content: `import type { Page } from '@playwright/test';\nimport { SubjectPageBase } from '../../SubjectPageBase.js';\n`,
|
|
60
|
-
name: this._namingHandler.generateSubjectClassName(subject)
|
|
61
|
-
};
|
|
62
76
|
const componentDictionary = this.getAllComponentsFromInterface(screenFileContent, screenInterfaceName, subject);
|
|
63
|
-
this.
|
|
64
|
-
|
|
65
|
-
this.addCoreComponentImports(componentDictionary, subjectFolderName, subjectClass);
|
|
66
|
-
this.addClassExport(subjectClass, screenInterfaceName);
|
|
67
|
-
this.addComponentDeclarations(subjectClass, componentDictionary, subjectFolderName);
|
|
68
|
-
this.addConstructor(subjectClass, componentDictionary, subjectFolderName, subject);
|
|
69
|
-
this.addGoToMethod(subjectClass, subject);
|
|
70
|
-
this.addSubjectClassLineEndings(subjectClass);
|
|
77
|
+
const model = this._modelBuilder.build(subject, screenInterfaceName, componentDictionary, subjectFolderName);
|
|
78
|
+
const content = serializeTsFile(model);
|
|
71
79
|
this.verifyDirectoryExists(subjectFolderPath);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
addGoToMethod(subjectClass, subject) {
|
|
75
|
-
let url = `subject=${subject.subject}`;
|
|
76
|
-
if (subject.variant !== '')
|
|
77
|
-
url = `${url}/subjectVariant=${subject.variant}`;
|
|
78
|
-
subjectClass.content += `\n public async goTo() {\n await this._subjectPage.goToDeepLink(\`${url}\`);\n await this._subjectPage.waitForLoadState('networkidle');\n }\n`;
|
|
80
|
+
const className = this._namingHandler.generateSubjectClassName(subject);
|
|
81
|
+
fs.writeFileSync(path.join(subjectFolderPath, `${className}.ts`), content, 'utf-8');
|
|
79
82
|
}
|
|
80
83
|
getAllComponentsFromInterface(screenFileContent, screenInterfaceName, subject) {
|
|
81
84
|
let componentDictionary = [];
|
|
@@ -83,165 +86,78 @@ export class SubjectGenerator {
|
|
|
83
86
|
if (interfaceMatches) {
|
|
84
87
|
const propertyMatches = interfaceMatches[1].match(/^\s*([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_]+);/gm);
|
|
85
88
|
if (propertyMatches) {
|
|
89
|
+
const screenMeta = new DataRetriever(this._paths).getScreenComponentMeta(subject.screentype_id);
|
|
86
90
|
componentDictionary = propertyMatches.map((line) => {
|
|
87
91
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
88
92
|
const [_, name, type] = line.match(/^\s*([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_]+);/) || [];
|
|
89
|
-
const context = this.generateComponentContextLocatorString(type, name, subject);
|
|
93
|
+
const context = this.generateComponentContextLocatorString(type, name, subject, screenMeta);
|
|
90
94
|
return { name, type, context };
|
|
91
95
|
});
|
|
92
96
|
}
|
|
93
97
|
}
|
|
94
98
|
return componentDictionary;
|
|
95
99
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const componentId = this._namingHandler.getComponentIdFromName(componentName, componentType);
|
|
99
|
-
const screentypeId = subject.screentype_id.replace(/_/g, '-');
|
|
100
|
-
const locatorString = {
|
|
101
|
-
prefix: '',
|
|
102
|
-
suffix: '',
|
|
103
|
-
locatorType: 'getByTestId'
|
|
104
|
-
};
|
|
105
|
-
switch (componentType) {
|
|
106
|
-
case 'Form':
|
|
107
|
-
case 'Grid':
|
|
108
|
-
case 'Splitter':
|
|
109
|
-
case 'FilterForm':
|
|
110
|
-
case 'Scheduler':
|
|
111
|
-
locatorString.prefix = `screen__${screentypeId}__`;
|
|
112
|
-
break;
|
|
113
|
-
case 'ActionBar':
|
|
114
|
-
case 'CustomActionBar':
|
|
115
|
-
locatorString.prefix = '.';
|
|
116
|
-
locatorString.locatorType = 'locator';
|
|
117
|
-
break;
|
|
118
|
-
case 'Tab':
|
|
119
|
-
locatorString.prefix = '.Tab.';
|
|
120
|
-
locatorString.locatorType = 'locator';
|
|
121
|
-
break;
|
|
122
|
-
case 'DetailTabPage':
|
|
123
|
-
return `this.context`;
|
|
124
|
-
}
|
|
125
|
-
return `this.context.${locatorString.locatorType}('${locatorString.prefix}${componentId}${locatorString.suffix}')`;
|
|
100
|
+
generateComponentContextLocatorString(componentType, componentName, subject, screenMeta) {
|
|
101
|
+
return generateComponentContextLocatorString(componentType, componentName, subject, screenMeta, this._namingHandler);
|
|
126
102
|
}
|
|
103
|
+
// ── Helpers ───────────────────────────────────────────────────────────────
|
|
127
104
|
verifyDirectoryExists(directoryPath) {
|
|
128
105
|
if (!fs.existsSync(directoryPath)) {
|
|
129
106
|
fs.mkdirSync(directoryPath, { recursive: true });
|
|
130
107
|
}
|
|
131
108
|
}
|
|
132
109
|
getScreenInterfacePath(screenInterfaceName) {
|
|
133
|
-
const screenInterfacePath = path.
|
|
110
|
+
const screenInterfacePath = path.join(this._screensDirectory, `${screenInterfaceName}.ts`);
|
|
134
111
|
if (!fs.existsSync(screenInterfacePath)) {
|
|
135
112
|
throw new Error(`Screen interface file not found: ${screenInterfacePath}`);
|
|
136
113
|
}
|
|
137
114
|
return screenInterfacePath;
|
|
138
115
|
}
|
|
139
116
|
getSubjectFolderRelativePath(subjectFolderName) {
|
|
140
|
-
|
|
141
|
-
return subjectFolderPath;
|
|
142
|
-
}
|
|
143
|
-
addCoreComponentImports(componentDictionary, subjectFolderName, subjectClass) {
|
|
144
|
-
const coreComponentImports = new Set();
|
|
145
|
-
componentDictionary.forEach((component) => {
|
|
146
|
-
if (!screenComponents.includes(component.type))
|
|
147
|
-
return;
|
|
148
|
-
if (coreComponents.includes(component.type)) {
|
|
149
|
-
const importRegex = new RegExp(`import \\{[^}]*\\b${component.type}\\b[^}]*\\} from '../../../components/index.js';`);
|
|
150
|
-
if (importRegex.test(subjectClass.content)) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
coreComponentImports.add(component.type);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const componentName = component.type;
|
|
157
|
-
const componentImport = `import { type ${subjectFolderName}${componentName}, ${subjectFolderName}${componentName}Component } from './Components/${subjectFolderName}${componentName}.js';`;
|
|
158
|
-
if (!subjectClass.content.includes(componentImport)) {
|
|
159
|
-
subjectClass.content = `${componentImport}\n${subjectClass.content}`;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
if (coreComponentImports.size > 0) {
|
|
163
|
-
subjectClass.content = `import { ${Array.from(coreComponentImports).join(', ')} } from '../../../components/index.js';\n${subjectClass.content}`;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
removeComponentImports(subjectClass) {
|
|
167
|
-
subjectClass.content = subjectClass.content.replace(/import \{[^}]+\} from '\.\.\/\.\.\/components\/index\.js';\n?/g, '');
|
|
168
|
-
}
|
|
169
|
-
addClassExport(subjectClass, screenInterfaceName) {
|
|
170
|
-
subjectClass.content += `\nexport class ${subjectClass.name} extends SubjectPageBase implements ${screenInterfaceName} {\n`;
|
|
171
|
-
}
|
|
172
|
-
addScreenInterfaceImport(subjectClass, screenInterfaceName) {
|
|
173
|
-
if (subjectClass.content.includes(`import type { ${screenInterfaceName} }`)) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
subjectClass.content = `import type { ${screenInterfaceName} } from '../../screens/index.js';\n${subjectClass.content}`;
|
|
117
|
+
return this._paths.subjectFolder(subjectFolderName);
|
|
177
118
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
const componentName = component.type;
|
|
205
|
-
subjectClass.content += ` this.${propertyName} = new ${subjectFolderName}${componentName}Component(${component.context});\n`;
|
|
206
|
-
});
|
|
207
|
-
subjectClass.content += ` this._subjectPage = this.context.page();\n`;
|
|
208
|
-
subjectClass.content += ` }\n`;
|
|
209
|
-
}
|
|
210
|
-
getComponentInitializer(component, componentId) {
|
|
211
|
-
const componentNamePascal = this._namingHandler.toPascalCase(component.type);
|
|
212
|
-
switch (component.type) {
|
|
213
|
-
case 'Cardlist':
|
|
214
|
-
case 'TaskTiles':
|
|
215
|
-
case 'PrefilterList':
|
|
216
|
-
case 'Chart':
|
|
217
|
-
case 'CubeViewBar':
|
|
218
|
-
case 'PivotGrid':
|
|
219
|
-
case 'PivotGridFieldList':
|
|
220
|
-
case 'Maps':
|
|
221
|
-
case 'ReportBar':
|
|
222
|
-
case 'ReportTiles':
|
|
223
|
-
case 'Preview':
|
|
224
|
-
return `new ${component.type}(this.context.locator('.${component.type}.${componentNamePascal}'))`;
|
|
225
|
-
case 'CombinedFilter':
|
|
226
|
-
case 'CustomActionBar':
|
|
227
|
-
case 'ActionBar':
|
|
228
|
-
case 'Splitter':
|
|
229
|
-
case 'DetailTabPage':
|
|
230
|
-
case 'Tab':
|
|
231
|
-
case 'FilterForm':
|
|
232
|
-
case 'Scheduler':
|
|
233
|
-
return `new ${component.type}(${component.context})`;
|
|
234
|
-
case 'TreeView':
|
|
235
|
-
return `new ${component.type}(this.context.locator('.Tree.${componentNamePascal}'))`;
|
|
236
|
-
case 'TaskBar':
|
|
237
|
-
return `new ${component.type}(this.context.locator('.ActionBar.${componentId}'))`;
|
|
238
|
-
default:
|
|
239
|
-
throw new Error(`Unknown core component type: ${component.type}`);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Builds the Playwright locator expression string for a given screen component.
|
|
122
|
+
*
|
|
123
|
+
* Exported as a standalone function so that it can be unit-tested independently
|
|
124
|
+
* of the file-I/O-coupled {@link SubjectGenerator} class.
|
|
125
|
+
*/
|
|
126
|
+
export function generateComponentContextLocatorString(componentType, componentName, subject, screenMeta, namingHandler) {
|
|
127
|
+
// Normalize the quicktype property name to the same form used as key in the meta map.
|
|
128
|
+
const normalizedName = componentName.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
129
|
+
const originalId = screenMeta[normalizedName];
|
|
130
|
+
const screentypeId = subject.screentype_id.replace(/_/g, '-');
|
|
131
|
+
const locatorString = {
|
|
132
|
+
prefix: '',
|
|
133
|
+
locatorType: 'getByTestId'
|
|
134
|
+
};
|
|
135
|
+
switch (componentType) {
|
|
136
|
+
case 'Form':
|
|
137
|
+
case 'Grid':
|
|
138
|
+
case 'Splitter':
|
|
139
|
+
case 'FilterForm':
|
|
140
|
+
case 'Scheduler': {
|
|
141
|
+
// data-testid uses lowercase with hyphens: e.g. Grid_QT3UL7F8 → grid-qt3ul7f8
|
|
142
|
+
const testId = originalId ? originalId.toLowerCase().replace(/_/g, '-') : componentName.toLowerCase();
|
|
143
|
+
locatorString.prefix = `screen__${screentypeId}__`;
|
|
144
|
+
return `this.context.getByTestId('${locatorString.prefix}${testId}')`;
|
|
240
145
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
146
|
+
case 'ActionBar':
|
|
147
|
+
case 'CustomActionBar':
|
|
148
|
+
locatorString.prefix = '.';
|
|
149
|
+
locatorString.locatorType = 'locator';
|
|
150
|
+
break;
|
|
151
|
+
case 'Tab':
|
|
152
|
+
locatorString.prefix = '.Tab.';
|
|
153
|
+
locatorString.locatorType = 'locator';
|
|
154
|
+
break;
|
|
155
|
+
case 'DetailTabPage':
|
|
156
|
+
return `this.context`;
|
|
157
|
+
}
|
|
158
|
+
// For CSS class selectors (ActionBar, Tab): use the original ID as-is, fall back to
|
|
159
|
+
// capitalizing the first letter (handles consolidated 'tab' / 'detailTab' properties).
|
|
160
|
+
const cssId = originalId ?? namingHandler.capitalizeFirstLetter(componentName);
|
|
161
|
+
return `this.context.${locatorString.locatorType}('${locatorString.prefix}${cssId}')`;
|
|
245
162
|
}
|
|
246
|
-
SubjectGenerator.SUBJECTS_RELATIVE_PATH = 'test-artifacts/subjects';
|
|
247
163
|
//# sourceMappingURL=SubjectGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectGenerator.js","sourceRoot":"","sources":["../../artifact-builder/SubjectGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS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AC,CAAC,CAAC;YACjB,8EAA8E;YAC9E,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;YACtG,aAAa,CAAC,MAAM,GAAG,WAAW,YAAY,IAAI,CAAC;YACnD,OAAO,6BAA6B,aAAa,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;QACxE,CAAC;QACD,KAAK,WAAW,CAAC;QACjB,KAAK,iBAAiB;YACpB,aAAa,CAAC,MAAM,GAAG,GAAG,CAAC;YAC3B,aAAa,CAAC,WAAW,GAAG,SAAS,CAAC;YACtC,MAAM;QACR,KAAK,KAAK;YACR,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC;YAC/B,aAAa,CAAC,WAAW,GAAG,SAAS,CAAC;YACtC,MAAM;QACR,KAAK,eAAe;YAClB,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,oFAAoF;IACpF,uFAAuF;IACvF,MAAM,KAAK,GAAG,UAAU,IAAI,aAAa,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC/E,OAAO,gBAAgB,aAAa,CAAC,WAAW,KAAK,aAAa,CAAC,MAAM,GAAG,KAAK,IAAI,CAAC;AACxF,CAAC"}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
import { PipelinePaths } from './helpers/PipelinePaths.js';
|
|
2
|
+
/**
|
|
3
|
+
* **Pipeline Step 7** — Registers all generated subject classes into
|
|
4
|
+
* `page-extensions/SubjectRegistry.ts` so they are available on
|
|
5
|
+
* `page.subject.<ClassName>` during tests.
|
|
6
|
+
*
|
|
7
|
+
* **What it does:**
|
|
8
|
+
* - Scans `test-artifacts/subjects/` to discover every generated class file.
|
|
9
|
+
* - Reads `templates/SubjectRegistry.template.ts` as the implementation skeleton.
|
|
10
|
+
* - Injects import statements and property declarations for every discovered
|
|
11
|
+
* class into the template and writes the result to
|
|
12
|
+
* `page-extensions/SubjectRegistry.ts`.
|
|
13
|
+
* - Runs `prettier` over the output so the generated file passes lint.
|
|
14
|
+
*
|
|
15
|
+
* **Important:** Never edit `SubjectRegistry.ts` directly — it is
|
|
16
|
+
* overwritten on every `testwise sync`. Edit the template instead.
|
|
17
|
+
*
|
|
18
|
+
* **When it runs:** The final step (step 7) of `testwise sync`.
|
|
19
|
+
*/
|
|
1
20
|
export declare class SubjectRegistration {
|
|
2
21
|
private static readonly IMPORT_MATCH_REGEX;
|
|
3
|
-
private readonly _currentFilename;
|
|
4
|
-
private readonly _currentDirname;
|
|
5
22
|
private readonly _subjectTypePath;
|
|
6
|
-
|
|
23
|
+
private readonly _subjectsDirectory;
|
|
24
|
+
private readonly _registryTemplatePath;
|
|
25
|
+
constructor(paths?: PipelinePaths);
|
|
7
26
|
run(): Promise<void>;
|
|
8
27
|
resetSubjectRegistry(): void;
|
|
9
28
|
private registerGeneratedSubjectsAsSubjectTypes;
|
|
@@ -15,8 +34,3 @@ export declare class SubjectRegistration {
|
|
|
15
34
|
private buildPathRecordsString;
|
|
16
35
|
private getAllSubjectDetails;
|
|
17
36
|
}
|
|
18
|
-
export interface SubjectDetail {
|
|
19
|
-
subject: string;
|
|
20
|
-
variant?: string;
|
|
21
|
-
screen: 'Main' | 'Popup' | 'Zoom' | 'Detail';
|
|
22
|
-
}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { dirname } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
3
|
import * as prettier from 'prettier';
|
|
4
|
+
import { PipelinePaths } from './helpers/PipelinePaths.js';
|
|
5
|
+
/**
|
|
6
|
+
* **Pipeline Step 7** — Registers all generated subject classes into
|
|
7
|
+
* `page-extensions/SubjectRegistry.ts` so they are available on
|
|
8
|
+
* `page.subject.<ClassName>` during tests.
|
|
9
|
+
*
|
|
10
|
+
* **What it does:**
|
|
11
|
+
* - Scans `test-artifacts/subjects/` to discover every generated class file.
|
|
12
|
+
* - Reads `templates/SubjectRegistry.template.ts` as the implementation skeleton.
|
|
13
|
+
* - Injects import statements and property declarations for every discovered
|
|
14
|
+
* class into the template and writes the result to
|
|
15
|
+
* `page-extensions/SubjectRegistry.ts`.
|
|
16
|
+
* - Runs `prettier` over the output so the generated file passes lint.
|
|
17
|
+
*
|
|
18
|
+
* **Important:** Never edit `SubjectRegistry.ts` directly — it is
|
|
19
|
+
* overwritten on every `testwise sync`. Edit the template instead.
|
|
20
|
+
*
|
|
21
|
+
* **When it runs:** The final step (step 7) of `testwise sync`.
|
|
22
|
+
*/
|
|
6
23
|
export class SubjectRegistration {
|
|
7
|
-
constructor() {
|
|
8
|
-
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
24
|
+
constructor(paths) {
|
|
25
|
+
const p = paths ?? new PipelinePaths();
|
|
26
|
+
this._subjectTypePath = p.subjectRegistry;
|
|
27
|
+
this._subjectsDirectory = p.subjects;
|
|
28
|
+
this._registryTemplatePath = p.subjectRegistryTemplate;
|
|
11
29
|
}
|
|
12
30
|
async run() {
|
|
13
31
|
const subjectDetails = this.getAllSubjectDetails();
|
|
14
32
|
await this.registerGeneratedSubjectsAsSubjectTypes(subjectDetails);
|
|
15
33
|
}
|
|
16
34
|
resetSubjectRegistry() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const templatePath = path.join(root, 'templates', 'SubjectRegistry.template.ts');
|
|
20
|
-
if (fs.existsSync(registryPath)) {
|
|
21
|
-
fs.rmSync(registryPath, { force: true });
|
|
35
|
+
if (fs.existsSync(this._subjectTypePath)) {
|
|
36
|
+
fs.rmSync(this._subjectTypePath, { force: true });
|
|
22
37
|
}
|
|
23
|
-
if (fs.existsSync(
|
|
24
|
-
fs.copyFileSync(
|
|
38
|
+
if (fs.existsSync(this._registryTemplatePath)) {
|
|
39
|
+
fs.copyFileSync(this._registryTemplatePath, this._subjectTypePath);
|
|
25
40
|
}
|
|
26
41
|
}
|
|
27
42
|
async registerGeneratedSubjectsAsSubjectTypes(subjectDetails) {
|
|
@@ -76,7 +91,7 @@ export class SubjectRegistration {
|
|
|
76
91
|
.join('\n ');
|
|
77
92
|
}
|
|
78
93
|
getAllSubjectDetails() {
|
|
79
|
-
const subjectsDir =
|
|
94
|
+
const subjectsDir = this._subjectsDirectory;
|
|
80
95
|
const subjectFolders = fs.readdirSync(subjectsDir).filter((file) => {
|
|
81
96
|
return fs.statSync(path.join(subjectsDir, file)).isDirectory();
|
|
82
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectRegistration.js","sourceRoot":"","sources":["../../artifact-builder/SubjectRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"SubjectRegistration.js","sourceRoot":"","sources":["../../artifact-builder/SubjectRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAmB;IAO9B,YAAY,KAAqB;QAC/B,MAAM,CAAC,GAAG,KAAK,IAAI,IAAI,aAAa,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,eAAe,CAAC;QAC1C,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,qBAAqB,GAAG,CAAC,CAAC,uBAAuB,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,cAAc,GAAG,IAAI,CAAC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yBAAyB,CAAC,CAAC;gBAEtE,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;oBACjC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;oBAC3B,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,KAAK,MAAM,gCAAgC,CAAC,CAAC;oBACxE,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAE9C,IAAI,YAAY,EAAE,CAAC;wBACjB,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;wBACjC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;4BACjC,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;4BACtC,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAkB,CAAC;4BAEhD,cAAc,CAAC,IAAI,CAAC;gCAClB,OAAO,EAAE,MAAM;gCACf,OAAO,EAAE,OAAO;gCAChB,MAAM,EAAE,MAAM;6BACf,CAAC,CAAC;4BACH,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;wBAC9B,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC;;AA5IuB,sCAAkB,GAAG,2DAA2D,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single named import member.
|
|
3
|
+
* Set `isTypeOnly` for inline `type` keyword, e.g. `import { type IFoo, Bar }`.
|
|
4
|
+
*/
|
|
5
|
+
export interface TsNamedImport {
|
|
6
|
+
name: string;
|
|
7
|
+
isTypeOnly?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Represents a single import statement in a TypeScript file.
|
|
11
|
+
* Set `isTypeOnly` at the top level for `import type { ... }`.
|
|
12
|
+
*/
|
|
13
|
+
export interface TsImport {
|
|
14
|
+
namedImports: TsNamedImport[];
|
|
15
|
+
isTypeOnly: boolean;
|
|
16
|
+
from: string;
|
|
17
|
+
}
|
|
18
|
+
/** Represents a class property declaration. */
|
|
19
|
+
export interface TsProperty {
|
|
20
|
+
access?: 'private';
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}
|
|
24
|
+
/** Represents a `this.x = value;` assignment inside a constructor. */
|
|
25
|
+
export interface TsConstructorAssignment {
|
|
26
|
+
property: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
/** Represents a class constructor. */
|
|
30
|
+
export interface TsConstructor {
|
|
31
|
+
params: Array<{
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}>;
|
|
35
|
+
superCall: string;
|
|
36
|
+
assignments: TsConstructorAssignment[];
|
|
37
|
+
extraLines: string[];
|
|
38
|
+
}
|
|
39
|
+
/** Represents a class method. */
|
|
40
|
+
export interface TsMethod {
|
|
41
|
+
isAsync: boolean;
|
|
42
|
+
name: string;
|
|
43
|
+
returnType: string;
|
|
44
|
+
bodyLines: string[];
|
|
45
|
+
}
|
|
46
|
+
/** Represents a TypeScript class declaration. */
|
|
47
|
+
export interface TsClass {
|
|
48
|
+
name: string;
|
|
49
|
+
extendsClass: string;
|
|
50
|
+
implementsInterface: string;
|
|
51
|
+
properties: TsProperty[];
|
|
52
|
+
constructor: TsConstructor;
|
|
53
|
+
methods?: TsMethod[];
|
|
54
|
+
}
|
|
55
|
+
/** Top-level model for a generated TypeScript subject class file. */
|
|
56
|
+
export interface TsFileModel {
|
|
57
|
+
imports: TsImport[];
|
|
58
|
+
classModel: TsClass;
|
|
59
|
+
}
|
|
60
|
+
/** Represents a typed property in a component class. */
|
|
61
|
+
export interface ComponentPropertyModel {
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}
|
|
65
|
+
/** Represents a `this.x = value;` assignment in a component class constructor. */
|
|
66
|
+
export interface ComponentAssignmentModel {
|
|
67
|
+
property: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}
|
|
70
|
+
/** Represents a getter in a Grid component class. */
|
|
71
|
+
export interface ComponentGetterModel {
|
|
72
|
+
name: string;
|
|
73
|
+
returnType: string;
|
|
74
|
+
bodyLine: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Represents the class body to append to a component interface file.
|
|
78
|
+
* Properties and assignments apply to Form; getters apply to Grid.
|
|
79
|
+
*/
|
|
80
|
+
export interface ComponentClassModel {
|
|
81
|
+
interfaceName: string;
|
|
82
|
+
componentType: string;
|
|
83
|
+
properties: ComponentPropertyModel[];
|
|
84
|
+
assignments: ComponentAssignmentModel[];
|
|
85
|
+
getters: ComponentGetterModel[];
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsFileModel.js","sourceRoot":"","sources":["../../artifact-builder/TsFileModel.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SubjectComponents } from '../types/Components.js';
|
|
2
|
+
import type { ComponentClassModel, TsFileModel } from './TsFileModel.js';
|
|
3
|
+
/** Builds a subject class file from a typed model. No string templates. */
|
|
4
|
+
export declare function serializeTsFile(model: TsFileModel): string;
|
|
5
|
+
/**
|
|
6
|
+
* Parses an existing component interface file, appends the component class and
|
|
7
|
+
* any required control imports, and returns the complete printed file.
|
|
8
|
+
* Replaces string-template-based class body generation — no string templates.
|
|
9
|
+
*/
|
|
10
|
+
export declare function appendComponentClass(existingContent: string, model: ComponentClassModel): string;
|
|
11
|
+
/**
|
|
12
|
+
* Transforms a raw quicktype-generated interface file into a refined component
|
|
13
|
+
* interface file using ts-morph AST manipulation — no string templates.
|
|
14
|
+
*
|
|
15
|
+
* Replaces the five string-manipulation methods previously in SubjectComponentGenerator:
|
|
16
|
+
* removeLocatorInterface, addComponentImports, setSubjectExtendsComponent,
|
|
17
|
+
* transformGridInterface, transformInterfaceTypes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function refineComponentInterface(rawContent: string, componentType: SubjectComponents): string;
|