@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,6 +1,37 @@
|
|
|
1
1
|
import type { Test } from '../types/Test.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright page-extension that makes every generated subject class available
|
|
4
|
+
* on the `page.subject` proxy during tests.
|
|
5
|
+
*
|
|
6
|
+
* **What it does:** At test startup it reads the registered subject list and
|
|
7
|
+
* wires up a `page.subject` property. Accessing `page.subject.EmployeeMain`
|
|
8
|
+
* returns an instance of the generated `EmployeeMain` class, which exposes
|
|
9
|
+
* typed component properties (`form`, `grid`, `actionBar`, etc.) and a
|
|
10
|
+
* `goTo()` method that navigates to that screen.
|
|
11
|
+
*
|
|
12
|
+
* **Important — do not edit this file directly.** The real implementation is
|
|
13
|
+
* generated from `templates/SubjectRegistry.template.ts` by the
|
|
14
|
+
* `SubjectRegistration` pipeline step. Any changes made here will be
|
|
15
|
+
* overwritten on the next `testwise sync`. Edit the template instead.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // In a test:
|
|
20
|
+
* const employee = await page.subject.EmployeeEditable1Main.goTo();
|
|
21
|
+
* await employee.form.firstNameField.fill('Jane');
|
|
22
|
+
* await employee.actionBar.save();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
2
25
|
export declare class SubjectRegistry {
|
|
3
26
|
private _test;
|
|
27
|
+
/**
|
|
28
|
+
* Stores the provided `Test` instance. The full implementation of this class is
|
|
29
|
+
* generated from the template in the templates folder — do not edit here directly.
|
|
30
|
+
* @param test - The Playwright `Test` fixture.
|
|
31
|
+
*/
|
|
4
32
|
constructor(test: Test);
|
|
33
|
+
/**
|
|
34
|
+
* Returns the stored `Test` fixture.
|
|
35
|
+
*/
|
|
5
36
|
get test(): Test;
|
|
6
37
|
}
|
|
@@ -1,8 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playwright page-extension that makes every generated subject class available
|
|
3
|
+
* on the `page.subject` proxy during tests.
|
|
4
|
+
*
|
|
5
|
+
* **What it does:** At test startup it reads the registered subject list and
|
|
6
|
+
* wires up a `page.subject` property. Accessing `page.subject.EmployeeMain`
|
|
7
|
+
* returns an instance of the generated `EmployeeMain` class, which exposes
|
|
8
|
+
* typed component properties (`form`, `grid`, `actionBar`, etc.) and a
|
|
9
|
+
* `goTo()` method that navigates to that screen.
|
|
10
|
+
*
|
|
11
|
+
* **Important — do not edit this file directly.** The real implementation is
|
|
12
|
+
* generated from `templates/SubjectRegistry.template.ts` by the
|
|
13
|
+
* `SubjectRegistration` pipeline step. Any changes made here will be
|
|
14
|
+
* overwritten on the next `testwise sync`. Edit the template instead.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // In a test:
|
|
19
|
+
* const employee = await page.subject.EmployeeEditable1Main.goTo();
|
|
20
|
+
* await employee.form.firstNameField.fill('Jane');
|
|
21
|
+
* await employee.actionBar.save();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
1
24
|
export class SubjectRegistry {
|
|
25
|
+
/**
|
|
26
|
+
* Stores the provided `Test` instance. The full implementation of this class is
|
|
27
|
+
* generated from the template in the templates folder — do not edit here directly.
|
|
28
|
+
* @param test - The Playwright `Test` fixture.
|
|
29
|
+
*/
|
|
2
30
|
constructor(test) {
|
|
3
31
|
// Implementation of this class is in the templates folder, don't edit here
|
|
4
32
|
this._test = test;
|
|
5
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns the stored `Test` fixture.
|
|
36
|
+
*/
|
|
6
37
|
get test() {
|
|
7
38
|
return this._test;
|
|
8
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubjectRegistry.js","sourceRoot":"","sources":["../../page-extensions/SubjectRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubjectRegistry.js","sourceRoot":"","sources":["../../page-extensions/SubjectRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,eAAe;IAG1B;;;;OAIG;IACH,YAAY,IAAU;QACpB,2EAA2E;QAC3E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -6,10 +6,31 @@ declare module '@playwright/test' {
|
|
|
6
6
|
stopSimulation(): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Playwright fixture layer that adds user-simulation methods to the page:
|
|
11
|
+
* `page.simulateUser(username)`, `page.getSimulatedUser()`, and
|
|
12
|
+
* `page.stopSimulation()`.
|
|
13
|
+
*
|
|
14
|
+
* These methods switch the active identity inside the running Thinkwise
|
|
15
|
+
* application without a full logout/login cycle, enabling RBAC tests.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* await page.simulateUser('manager@example.com');
|
|
19
|
+
* // assert manager-only visibility ...
|
|
20
|
+
* await page.stopSimulation();
|
|
21
|
+
*/
|
|
9
22
|
export declare class UserSimulation {
|
|
10
23
|
private _userSimulationHelper;
|
|
11
24
|
private _test;
|
|
25
|
+
/**
|
|
26
|
+
* Extends the Playwright `Test` fixture to attach `simulateUser`, `getSimulatedUser`,
|
|
27
|
+
* and `stopSimulation` methods to the page, backed by `UserSimulationHelper`.
|
|
28
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
29
|
+
*/
|
|
12
30
|
constructor(test: Test);
|
|
13
31
|
private get userSimulationHelper();
|
|
32
|
+
/**
|
|
33
|
+
* Returns the extended `Test` fixture with user simulation methods wired up on `page`.
|
|
34
|
+
*/
|
|
14
35
|
get test(): Test;
|
|
15
36
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { UserSimulationHelper } from '../helpers/UserSimulationHelper.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright fixture layer that adds user-simulation methods to the page:
|
|
4
|
+
* `page.simulateUser(username)`, `page.getSimulatedUser()`, and
|
|
5
|
+
* `page.stopSimulation()`.
|
|
6
|
+
*
|
|
7
|
+
* These methods switch the active identity inside the running Thinkwise
|
|
8
|
+
* application without a full logout/login cycle, enabling RBAC tests.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* await page.simulateUser('manager@example.com');
|
|
12
|
+
* // assert manager-only visibility ...
|
|
13
|
+
* await page.stopSimulation();
|
|
14
|
+
*/
|
|
2
15
|
export class UserSimulation {
|
|
16
|
+
/**
|
|
17
|
+
* Extends the Playwright `Test` fixture to attach `simulateUser`, `getSimulatedUser`,
|
|
18
|
+
* and `stopSimulation` methods to the page, backed by `UserSimulationHelper`.
|
|
19
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
20
|
+
*/
|
|
3
21
|
constructor(test) {
|
|
4
22
|
this._test = test.extend({
|
|
5
23
|
page: async ({ page }, use) => {
|
|
@@ -23,6 +41,9 @@ export class UserSimulation {
|
|
|
23
41
|
}
|
|
24
42
|
return this._userSimulationHelper;
|
|
25
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns the extended `Test` fixture with user simulation methods wired up on `page`.
|
|
46
|
+
*/
|
|
26
47
|
get test() {
|
|
27
48
|
return this._test;
|
|
28
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSimulation.js","sourceRoot":"","sources":["../../page-extensions/UserSimulation.ts"],"names":[],"mappings":"AAAA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O,cAAc;IAIzB;;;;OAIG;IACH,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,IAAI,CAAC,qBAAqB,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;gBAE5D,IAAI,CAAC,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAE,EAAE;oBAC7C,MAAM,IAAI,CAAC,oBAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBACzD,CAAC,CAAC;gBAEF,IAAI,CAAC,gBAAgB,GAAG,KAAK,IAAI,EAAE;oBACjC,OAAO,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,CAAC;gBAC5D,CAAC,CAAC;gBAEF,IAAI,CAAC,cAAc,GAAG,KAAK,IAAI,EAAE;oBAC/B,MAAM,IAAI,CAAC,oBAAoB,CAAC,cAAc,EAAE,CAAC;gBACnD,CAAC,CAAC;gBAEF,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAY,oBAAoB;QAC9B,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -5,8 +5,28 @@ declare module '@playwright/test' {
|
|
|
5
5
|
waitEventHandler: GlobalWaitEventHandler;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Playwright fixture layer that attaches a `GlobalWaitEventHandler` instance
|
|
10
|
+
* to `page.waitEventHandler` before each test.
|
|
11
|
+
*
|
|
12
|
+
* Use `page.waitEventHandler` when you need to block test execution until a
|
|
13
|
+
* specific URL pattern has been responded to — for example, waiting for a
|
|
14
|
+
* background data-load endpoint before asserting on results.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* await page.waitEventHandler.waitForUrl('/api/employees/load');
|
|
18
|
+
* await expect(subject.grid.rows()).toHaveCount(10);
|
|
19
|
+
*/
|
|
8
20
|
export declare class WaitEventHandler {
|
|
9
21
|
private _test;
|
|
22
|
+
/**
|
|
23
|
+
* Extends the Playwright `Test` fixture to attach a `GlobalWaitEventHandler` instance
|
|
24
|
+
* to `page.waitEventHandler` before each test.
|
|
25
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
26
|
+
*/
|
|
10
27
|
constructor(test: Test);
|
|
28
|
+
/**
|
|
29
|
+
* Returns the extended `Test` fixture with `page.waitEventHandler` wired up.
|
|
30
|
+
*/
|
|
11
31
|
get test(): Test;
|
|
12
32
|
}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { GlobalWaitEventHandler } from '../helpers/GlobalWaitEventHandler.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright fixture layer that attaches a `GlobalWaitEventHandler` instance
|
|
4
|
+
* to `page.waitEventHandler` before each test.
|
|
5
|
+
*
|
|
6
|
+
* Use `page.waitEventHandler` when you need to block test execution until a
|
|
7
|
+
* specific URL pattern has been responded to — for example, waiting for a
|
|
8
|
+
* background data-load endpoint before asserting on results.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* await page.waitEventHandler.waitForUrl('/api/employees/load');
|
|
12
|
+
* await expect(subject.grid.rows()).toHaveCount(10);
|
|
13
|
+
*/
|
|
2
14
|
export class WaitEventHandler {
|
|
15
|
+
/**
|
|
16
|
+
* Extends the Playwright `Test` fixture to attach a `GlobalWaitEventHandler` instance
|
|
17
|
+
* to `page.waitEventHandler` before each test.
|
|
18
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
19
|
+
*/
|
|
3
20
|
constructor(test) {
|
|
4
21
|
this._test = test.extend({
|
|
5
22
|
page: async ({ page }, use) => {
|
|
@@ -8,6 +25,9 @@ export class WaitEventHandler {
|
|
|
8
25
|
}
|
|
9
26
|
});
|
|
10
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the extended `Test` fixture with `page.waitEventHandler` wired up.
|
|
30
|
+
*/
|
|
11
31
|
get test() {
|
|
12
32
|
return this._test;
|
|
13
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaitEventHandler.js","sourceRoot":"","sources":["../../page-extensions/WaitEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,MAAM,OAAO,gBAAgB;IAG3B,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;gBAEzD,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"WaitEventHandler.js","sourceRoot":"","sources":["../../page-extensions/WaitEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAS9E;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAG3B;;;;OAIG;IACH,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,IAAI,CAAC,gBAAgB,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC;gBAEzD,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import type { Test } from '../types/Test.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright fixture layer that wraps every Locator `click()` call to wait
|
|
4
|
+
* for in-flight XHR requests to settle before returning control to the test.
|
|
5
|
+
*
|
|
6
|
+
* **Why this exists:** The Thinkwise application fires XHR calls immediately
|
|
7
|
+
* after a click (save, navigation, data load). Without this override a test
|
|
8
|
+
* that clicks a button and then immediately reads a value races against the
|
|
9
|
+
* server response. `ClickOverride` uses `FlightTracker` under the hood to
|
|
10
|
+
* block until all relevant requests finish.
|
|
11
|
+
*
|
|
12
|
+
* **How to disable** (if a specific test must opt out):
|
|
13
|
+
* Set `featureSettings.InflightRequests.waitForRequestsToComplete: false` in
|
|
14
|
+
* `Testwise.json` — but this is rarely needed.
|
|
15
|
+
*/
|
|
2
16
|
export declare class ClickOverride {
|
|
3
17
|
private _test;
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Extends the Playwright `Test` fixture to wrap every locator's `click` method with
|
|
20
|
+
* in-flight XHR tracking via `FlightTracker`, waiting for all relevant requests to
|
|
21
|
+
* settle after each click. Behaviour is configurable via `featureSettings.InflightRequests`.
|
|
22
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
23
|
+
*/
|
|
6
24
|
constructor(test: Test);
|
|
25
|
+
/**
|
|
26
|
+
* Returns the extended `Test` fixture with the click override active.
|
|
27
|
+
*/
|
|
7
28
|
get test(): Test;
|
|
8
29
|
}
|
|
@@ -1,65 +1,46 @@
|
|
|
1
1
|
import { FlightTracker } from '../helpers/FlightTracker.js';
|
|
2
2
|
import { testwiseConfig } from '../services/ConfigBuilder.js';
|
|
3
3
|
const waitForRequestsToComplete = testwiseConfig().get('featureSettings.InflightRequests.waitForRequestsToComplete') ?? true;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Playwright fixture layer that wraps every Locator `click()` call to wait
|
|
6
|
+
* for in-flight XHR requests to settle before returning control to the test.
|
|
7
|
+
*
|
|
8
|
+
* **Why this exists:** The Thinkwise application fires XHR calls immediately
|
|
9
|
+
* after a click (save, navigation, data load). Without this override a test
|
|
10
|
+
* that clicks a button and then immediately reads a value races against the
|
|
11
|
+
* server response. `ClickOverride` uses `FlightTracker` under the hood to
|
|
12
|
+
* block until all relevant requests finish.
|
|
13
|
+
*
|
|
14
|
+
* **How to disable** (if a specific test must opt out):
|
|
15
|
+
* Set `featureSettings.InflightRequests.waitForRequestsToComplete: false` in
|
|
16
|
+
* `Testwise.json` — but this is rarely needed.
|
|
17
|
+
*/
|
|
5
18
|
export class ClickOverride {
|
|
19
|
+
/**
|
|
20
|
+
* Extends the Playwright `Test` fixture to wrap every locator's `click` method with
|
|
21
|
+
* in-flight XHR tracking via `FlightTracker`, waiting for all relevant requests to
|
|
22
|
+
* settle after each click. Behaviour is configurable via `featureSettings.InflightRequests`.
|
|
23
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
24
|
+
*/
|
|
6
25
|
constructor(test) {
|
|
7
|
-
this._page = null;
|
|
8
|
-
this.flightTracker = new FlightTracker();
|
|
9
26
|
this._test = test.extend({
|
|
10
27
|
page: async ({ page }, use) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
28
|
+
const flightTracker = new FlightTracker();
|
|
29
|
+
page.on('request', (request) => {
|
|
30
|
+
flightTracker.handleRequestStarted(request.url(), request.resourceType());
|
|
31
|
+
});
|
|
32
|
+
page.on('response', (response) => {
|
|
33
|
+
flightTracker.handleRequestFinished(response.request().url());
|
|
34
|
+
});
|
|
35
|
+
page.on('requestfailed', (request) => {
|
|
36
|
+
flightTracker.handleRequestFailed(request.url());
|
|
37
|
+
});
|
|
21
38
|
const overrideClickMethod = (locator) => {
|
|
22
39
|
const originalClickMethod = locator.click.bind(locator);
|
|
23
|
-
page.on('request', (request) => {
|
|
24
|
-
if (isTrackable(request.url(), request.resourceType())) {
|
|
25
|
-
this.flightTracker.requestsInFlight++;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
page.on('response', (response) => {
|
|
29
|
-
if (isTrackable(response.request().url(), response.request().resourceType())) {
|
|
30
|
-
if (this.flightTracker.requestsInFlight > 0) {
|
|
31
|
-
this.flightTracker.requestsInFlight--;
|
|
32
|
-
}
|
|
33
|
-
if (this.flightTracker.requestsInFlight === 0) {
|
|
34
|
-
this.flightTracker.eventEmitter.emit('idle');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
40
|
locator.click = async (options) => {
|
|
39
41
|
await originalClickMethod(options);
|
|
40
42
|
if (waitForRequestsToComplete) {
|
|
41
|
-
|
|
42
|
-
await this.flightTracker.waitToContinue();
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.warn('Exception while waiting for inflight requests to finish:', error);
|
|
46
|
-
if (this._page) {
|
|
47
|
-
const inflightRequests = await this._page.evaluate(() => {
|
|
48
|
-
return performance
|
|
49
|
-
.getEntriesByType('resource')
|
|
50
|
-
.filter((entry) => {
|
|
51
|
-
const res = entry;
|
|
52
|
-
return (res.initiatorType === 'xmlhttprequest' &&
|
|
53
|
-
!res.name.includes('/detect_change(') &&
|
|
54
|
-
!res.name.includes('/set_gui_start_use_log_session'));
|
|
55
|
-
})
|
|
56
|
-
.map((entry) => entry.name);
|
|
57
|
-
});
|
|
58
|
-
console.debug('Current inflight XHR requests:', inflightRequests);
|
|
59
|
-
}
|
|
60
|
-
if (!continueOnError)
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
43
|
+
await flightTracker.waitToContinue();
|
|
63
44
|
}
|
|
64
45
|
return;
|
|
65
46
|
};
|
|
@@ -98,6 +79,9 @@ export class ClickOverride {
|
|
|
98
79
|
}
|
|
99
80
|
});
|
|
100
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns the extended `Test` fixture with the click override active.
|
|
84
|
+
*/
|
|
101
85
|
get test() {
|
|
102
86
|
return this._test;
|
|
103
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClickOverride.js","sourceRoot":"","sources":["../../page-overrides/ClickOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,MAAM,yBAAyB,GAC7B,cAAc,EAAE,CAAC,GAAG,CAAU,4DAA4D,CAAC,IAAI,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ClickOverride.js","sourceRoot":"","sources":["../../page-overrides/ClickOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,MAAM,yBAAyB,GAC7B,cAAc,EAAE,CAAC,GAAG,CAAU,4DAA4D,CAAC,IAAI,IAAI,CAAC;AAEtG;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAa;IAGxB;;;;;OAKG;IACH,YAAY,IAAU;QACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;gBAC5B,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;gBAE1C,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;oBAC7B,aAAa,CAA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AAC,CAAC;oBAC3C,CAAC;oBAED,OAAO,OAAO,CAAC;gBACjB,CAAC,CAAC;gBAEF,MAAM,WAAW,GAAG;oBAClB,SAAS;oBACT,aAAa;oBACb,cAAc;oBACd,YAAY;oBACZ,WAAW;oBACX,kBAAkB;oBAClB,WAAW;oBACX,YAAY;iBACJ,CAAC;gBAEX,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;oBACjC,MAAM,QAAQ,GAAI,IAAI,CAAC,MAAM,CAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7E,IAAmE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE,CACpG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC3C,CAAC;gBAED,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import type { Test } from '../types/Test.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playwright fixture layer that wraps every Locator `fill()` call to wait
|
|
4
|
+
* for in-flight XHR requests to settle before returning control to the test.
|
|
5
|
+
*
|
|
6
|
+
* **Why this exists:** After filling a lookup or auto-complete field the
|
|
7
|
+
* Thinkwise application fires XHR calls to search/resolve the typed value.
|
|
8
|
+
* Without this override, subsequent assertions or interactions race against
|
|
9
|
+
* those server responses. `FillOverride` uses `FlightTracker` to block until
|
|
10
|
+
* all relevant requests on the watchlist finish.
|
|
11
|
+
*
|
|
12
|
+
* The `featureSettings.InflightRequests.paths` list in `Testwise.json`
|
|
13
|
+
* controls which API endpoints are watched during fill operations.
|
|
14
|
+
*/
|
|
2
15
|
export declare class FillOverride {
|
|
3
16
|
private _test;
|
|
4
17
|
private flightTracker;
|
|
18
|
+
/**
|
|
19
|
+
* Extends the Playwright `Test` fixture to wrap every locator's `fill` method:
|
|
20
|
+
* waits for watched in-flight requests to settle, fills the element, and — for
|
|
21
|
+
* qualifying form fields — triggers a `/staged` response wait and blurs the element
|
|
22
|
+
* if the value changed. Watchlist and behaviour are configurable via `featureSettings`.
|
|
23
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
24
|
+
*/
|
|
5
25
|
constructor(test: Test);
|
|
26
|
+
/**
|
|
27
|
+
* Returns the extended `Test` fixture with the fill override active.
|
|
28
|
+
*/
|
|
6
29
|
get test(): Test;
|
|
7
30
|
}
|
|
@@ -2,7 +2,37 @@ import { FlightTracker } from '../helpers/FlightTracker.js';
|
|
|
2
2
|
import { testwiseConfig } from '../services/ConfigBuilder.js';
|
|
3
3
|
const requestWatchlist = testwiseConfig().get('featureSettings.InflightRequests.paths') ?? [];
|
|
4
4
|
const waitForRequestsToComplete = testwiseConfig().get('featureSettings.InflightRequests.waitForRequestsToComplete') ?? true;
|
|
5
|
+
const locatorMethods = [
|
|
6
|
+
'locator',
|
|
7
|
+
'getByText',
|
|
8
|
+
'getByTestId',
|
|
9
|
+
'getByAltText',
|
|
10
|
+
'getByLabel',
|
|
11
|
+
'getByRole',
|
|
12
|
+
'getByPlaceholder',
|
|
13
|
+
'getByTitle'
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Playwright fixture layer that wraps every Locator `fill()` call to wait
|
|
17
|
+
* for in-flight XHR requests to settle before returning control to the test.
|
|
18
|
+
*
|
|
19
|
+
* **Why this exists:** After filling a lookup or auto-complete field the
|
|
20
|
+
* Thinkwise application fires XHR calls to search/resolve the typed value.
|
|
21
|
+
* Without this override, subsequent assertions or interactions race against
|
|
22
|
+
* those server responses. `FillOverride` uses `FlightTracker` to block until
|
|
23
|
+
* all relevant requests on the watchlist finish.
|
|
24
|
+
*
|
|
25
|
+
* The `featureSettings.InflightRequests.paths` list in `Testwise.json`
|
|
26
|
+
* controls which API endpoints are watched during fill operations.
|
|
27
|
+
*/
|
|
5
28
|
export class FillOverride {
|
|
29
|
+
/**
|
|
30
|
+
* Extends the Playwright `Test` fixture to wrap every locator's `fill` method:
|
|
31
|
+
* waits for watched in-flight requests to settle, fills the element, and — for
|
|
32
|
+
* qualifying form fields — triggers a `/staged` response wait and blurs the element
|
|
33
|
+
* if the value changed. Watchlist and behaviour are configurable via `featureSettings`.
|
|
34
|
+
* @param test - The Playwright `Test` fixture to extend.
|
|
35
|
+
*/
|
|
6
36
|
constructor(test) {
|
|
7
37
|
this.flightTracker = new FlightTracker();
|
|
8
38
|
this._test = test.extend({
|
|
@@ -26,80 +56,45 @@ export class FillOverride {
|
|
|
26
56
|
});
|
|
27
57
|
}
|
|
28
58
|
const overrideFillMethod = (locator) => {
|
|
29
|
-
const
|
|
59
|
+
const originalFill = locator.fill.bind(locator);
|
|
30
60
|
locator.fill = async (value, options) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const isQualifyingFormField = await locator.evaluate((el, formFieldTestIdPrefix) => {
|
|
43
|
-
const elementTestId = el.getAttribute('data-testid');
|
|
44
|
-
const parentWithFormSectionTestId = el.closest('[data-testid^="form-section__"]');
|
|
45
|
-
if (elementTestId) {
|
|
46
|
-
return elementTestId.includes(formFieldTestIdPrefix) && parentWithFormSectionTestId !== null;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}, formFieldTestIdPrefix);
|
|
50
|
-
if (valueIsDifferent && isQualifyingFormField) {
|
|
51
|
-
await page.waitEventHandler.waitForCanContinue();
|
|
52
|
-
page.waitEventHandler.waitForResponse('/staged');
|
|
53
|
-
}
|
|
54
|
-
await originalFillMethod(value, options);
|
|
61
|
+
if (waitForRequestsToComplete)
|
|
62
|
+
await this.flightTracker.waitToContinue();
|
|
63
|
+
const [valueIsDifferent, isQualifyingFormField] = await Promise.all([
|
|
64
|
+
locator.inputValue().then((v) => v !== value),
|
|
65
|
+
locator.evaluate((el) => {
|
|
66
|
+
const testId = el.getAttribute('data-testid');
|
|
67
|
+
return (!!testId && testId.includes('form-field__') && el.closest('[data-testid^="form-section__"]') !== null);
|
|
68
|
+
})
|
|
69
|
+
]);
|
|
70
|
+
await page.waitEventHandler.waitForCanContinue();
|
|
71
|
+
await originalFill(value, options);
|
|
55
72
|
if (isQualifyingFormField) {
|
|
73
|
+
if (valueIsDifferent)
|
|
74
|
+
page.waitEventHandler.waitForResponse('/staged');
|
|
56
75
|
await locator.evaluate((el) => {
|
|
57
|
-
|
|
58
|
-
if (!ariaExpanded)
|
|
76
|
+
if (!el.getAttribute('aria-expanded'))
|
|
59
77
|
el.blur();
|
|
60
78
|
});
|
|
61
79
|
}
|
|
62
80
|
};
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const originalGetByTestIdMethod = locator.getByTestId.bind(locator);
|
|
68
|
-
locator.getByTestId = (...args) => overrideFillMethod(originalGetByTestIdMethod(...args));
|
|
69
|
-
const originalGetByAltTextMethod = locator.getByAltText.bind(locator);
|
|
70
|
-
locator.getByAltText = (...args) => overrideFillMethod(originalGetByAltTextMethod(...args));
|
|
71
|
-
const originalGetByLabelMethod = locator.getByLabel.bind(locator);
|
|
72
|
-
locator.getByLabel = (...args) => overrideFillMethod(originalGetByLabelMethod(...args));
|
|
73
|
-
const originalGetByRoleMethod = locator.getByRole.bind(locator);
|
|
74
|
-
locator.getByRole = (...args) => overrideFillMethod(originalGetByRoleMethod(...args));
|
|
75
|
-
const originalGetByPlaceholderMethod = locator.getByPlaceholder.bind(locator);
|
|
76
|
-
locator.getByPlaceholder = (...args) => overrideFillMethod(originalGetByPlaceholderMethod(...args));
|
|
77
|
-
const originalGetByTitleMethod = locator.getByTitle.bind(locator);
|
|
78
|
-
locator.getByTitle = (...args) => overrideFillMethod(originalGetByTitleMethod(...args));
|
|
81
|
+
for (const method of locatorMethods) {
|
|
82
|
+
const original = locator[method].bind(locator);
|
|
83
|
+
locator[method] = (...args) => overrideFillMethod(original(...args));
|
|
84
|
+
}
|
|
79
85
|
return locator;
|
|
80
86
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const originalGetByAltText = page.getByAltText.bind(page);
|
|
86
|
-
const originalGetByLabel = page.getByLabel.bind(page);
|
|
87
|
-
const originalGetByRole = page.getByRole.bind(page);
|
|
88
|
-
const originalGetByPlaceholder = page.getByPlaceholder.bind(page);
|
|
89
|
-
const originalGetByText = page.getByText.bind(page);
|
|
90
|
-
const originalGetByTitle = page.getByTitle.bind(page);
|
|
91
|
-
// Override other top-level methods as before
|
|
92
|
-
page.getByTestId = (...args) => overrideFillMethod(originalGetByTestId(...args));
|
|
93
|
-
page.getByAltText = (...args) => overrideFillMethod(originalGetByAltText(...args));
|
|
94
|
-
page.getByLabel = (...args) => overrideFillMethod(originalGetByLabel(...args));
|
|
95
|
-
page.getByRole = (...args) => overrideFillMethod(originalGetByRole(...args));
|
|
96
|
-
page.getByPlaceholder = (...args) => overrideFillMethod(originalGetByPlaceholder(...args));
|
|
97
|
-
page.getByText = (...args) => overrideFillMethod(originalGetByText(...args));
|
|
98
|
-
page.getByTitle = (...args) => overrideFillMethod(originalGetByTitle(...args));
|
|
87
|
+
for (const method of locatorMethods) {
|
|
88
|
+
const original = page[method].bind(page);
|
|
89
|
+
page[method] = (...args) => overrideFillMethod(original(...args));
|
|
90
|
+
}
|
|
99
91
|
await use(page);
|
|
100
92
|
}
|
|
101
93
|
});
|
|
102
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Returns the extended `Test` fixture with the fill override active.
|
|
97
|
+
*/
|
|
103
98
|
get test() {
|
|
104
99
|
return this._test;
|
|
105
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FillOverride.js","sourceRoot":"","sources":["../../page-overrides/FillOverride.ts"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BAAkB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC1C,CAAC;gBAED,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads and exposes the consumer project's `Testwise.json` configuration file
|
|
3
|
+
* and any `.env` files found in the project root.
|
|
4
|
+
*
|
|
5
|
+
* **What it does:**
|
|
6
|
+
* - Locates `Testwise.json` relative to `process.env.INIT_CWD` (the directory
|
|
7
|
+
* from which `npm run` was invoked — i.e. the consumer project root).
|
|
8
|
+
* - Parses and applies every `.env` file found in that directory into
|
|
9
|
+
* `process.env` so environment variables are available to all pipeline steps
|
|
10
|
+
* and helpers before they construct.
|
|
11
|
+
* - Exposes a dot-notation `get<T>(key)` accessor to retrieve deeply nested
|
|
12
|
+
* config values without needing to cast or navigate the raw JSON.
|
|
13
|
+
*
|
|
14
|
+
* **How to use it in tests or helpers:**
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { testwiseConfig } from '../services/ConfigBuilder.js';
|
|
17
|
+
*
|
|
18
|
+
* const baseUrl = testwiseConfig().get<string>('application.baseUrl');
|
|
19
|
+
* const timeout = testwiseConfig().get<number>('featureSettings.InflightRequests.waitTimeout');
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* The exported `testwiseConfig()` function returns a singleton—the file is
|
|
23
|
+
* only read once per process.
|
|
24
|
+
*/
|
|
1
25
|
declare class ConfigBuilder {
|
|
2
26
|
private config;
|
|
3
27
|
constructor();
|