testeranto 0.200.0 → 0.202.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/bundle.js +3 -2
- package/design-editor/DesignEditor.tsx +40 -241
- package/dist/common/design-editor/DesignEditor.js +33 -198
- package/dist/common/src/App.js +158 -16
- package/dist/common/src/PM/PM_WithBuild.js +135 -0
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +79 -67
- package/dist/common/src/PM/PM_WithGit.js +517 -0
- package/dist/common/src/PM/PM_WithProcesses.js +519 -0
- package/dist/common/src/PM/PM_WithWebSocket.js +535 -0
- package/dist/common/src/PM/base.js +62 -0
- package/dist/common/src/PM/main.js +533 -1676
- package/dist/common/src/PM/metafileOutputs.js +78 -0
- package/dist/common/src/PM/node.js +0 -6
- package/dist/common/src/PM/pure.js +0 -8
- package/dist/common/src/PM/types.js +1 -0
- package/dist/common/src/PM/utils.js +210 -0
- package/dist/common/src/PM/web.js +0 -6
- package/dist/common/src/ReportServer.js +0 -10
- package/dist/common/src/ReportServerLib.js +0 -140
- package/dist/common/src/components/pure/AppFrame.js +68 -56
- package/dist/common/src/components/pure/ArtifactTree.js +80 -0
- package/dist/common/src/components/pure/BuildLogViewer.js +106 -0
- package/dist/common/src/components/pure/DebugEnv.js +30 -0
- package/dist/common/src/components/pure/FileTree.js +34 -0
- package/dist/common/src/components/pure/FileTreeItem.js +29 -0
- package/dist/common/src/components/pure/GitHubLoginButton.js +18 -0
- package/dist/common/src/components/pure/GitIntegrationView.js +342 -0
- package/dist/common/src/components/pure/ProcessManager.js +1 -0
- package/dist/common/src/components/pure/ProcessManagerView.js +73 -74
- package/dist/common/src/components/pure/ProjectPageView.js +4 -117
- package/dist/common/src/components/pure/Settings.js +121 -0
- package/dist/common/src/components/pure/Settings.test.js +34 -0
- package/dist/common/src/components/pure/SignIn.js +22 -0
- package/dist/common/src/components/pure/SingleProcessView.js +166 -213
- package/dist/common/src/components/pure/TestPageView.js +113 -368
- package/dist/common/src/components/pure/TestPageView_utils.js +117 -0
- package/dist/common/src/components/pure/TestTable.js +33 -0
- package/dist/common/src/components/pure/ToastNotification.js +14 -0
- package/dist/common/src/components/pure/UserProfile.js +27 -0
- package/dist/common/src/components/stateful/AuthCallbackPage.js +51 -0
- package/dist/common/src/components/stateful/FeaturesReporter.js +2 -1
- package/dist/common/src/components/stateful/FileTree.js +58 -39
- package/dist/common/src/components/stateful/GitIntegrationPage.js +12 -0
- package/dist/common/src/components/stateful/ProcessManagerPage.js +13 -15
- package/dist/common/src/components/stateful/ProjectPage.js +6 -5
- package/dist/common/src/components/stateful/ProjectsPage.js +17 -19
- package/dist/common/src/components/stateful/SingleProcessPage.js +16 -26
- package/dist/common/src/components/stateful/TestPage.js +7 -5
- package/dist/common/src/hooks/useGitMode.js +21 -0
- package/dist/common/src/lib/BaseSuite.test/mock.js +15 -8
- package/dist/common/src/lib/BaseSuite.test/test.js +56 -80
- package/dist/common/src/lib/Tiposkripto.js +24 -0
- package/dist/common/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
- package/dist/common/src/lib/pmProxy.test/specification.js +167 -52
- package/dist/common/src/services/FileService.js +505 -0
- package/dist/common/src/services/GitHubAuthService.js +184 -0
- package/dist/common/src/testeranto.js +38 -97
- package/dist/common/src/utils/api.js +12 -8
- package/dist/common/src/utils/gitTest.js +27 -0
- package/dist/common/src/utils.js +23 -13
- package/dist/common/testeranto.config.js +21 -17
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/design-editor/DesignEditor.js +33 -199
- package/dist/module/src/App.js +121 -15
- package/dist/module/src/PM/PM_WithBuild.js +128 -0
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +79 -67
- package/dist/module/src/PM/PM_WithGit.js +477 -0
- package/dist/module/src/PM/PM_WithProcesses.js +479 -0
- package/dist/module/src/PM/PM_WithWebSocket.js +528 -0
- package/dist/module/src/PM/base.js +62 -0
- package/dist/module/src/PM/main.js +533 -1676
- package/dist/module/src/PM/metafileOutputs.js +78 -0
- package/dist/module/src/PM/node.js +0 -6
- package/dist/module/src/PM/pure.js +0 -8
- package/dist/module/src/PM/types.js +1 -1
- package/dist/module/src/PM/utils.js +196 -0
- package/dist/module/src/PM/web.js +0 -6
- package/dist/module/src/ReportServer.js +1 -9
- package/dist/module/src/ReportServerLib.js +1 -134
- package/dist/module/src/components/pure/AppFrame.js +66 -24
- package/dist/module/src/components/pure/ArtifactTree.js +80 -0
- package/dist/module/src/components/pure/BuildLogViewer.js +99 -0
- package/dist/module/src/components/pure/DebugEnv.js +23 -0
- package/dist/module/src/components/pure/FileTree.js +27 -0
- package/dist/module/src/components/pure/FileTreeItem.js +22 -0
- package/dist/module/src/components/pure/GitHubLoginButton.js +11 -0
- package/dist/module/src/components/pure/GitIntegrationView.js +305 -0
- package/dist/module/src/components/pure/ProcessManager.js +1 -0
- package/dist/module/src/components/pure/ProcessManagerView.js +74 -75
- package/dist/module/src/components/pure/ProjectPageView.js +5 -118
- package/dist/module/src/components/pure/Settings.js +84 -0
- package/dist/module/src/components/pure/Settings.test.js +29 -0
- package/dist/module/src/components/pure/SignIn.js +15 -0
- package/dist/module/src/components/pure/SingleProcessView.js +130 -214
- package/dist/module/src/components/pure/TestPageView.js +97 -352
- package/dist/module/src/components/pure/TestPageView_utils.js +109 -0
- package/dist/module/src/components/pure/TestTable.js +26 -0
- package/dist/module/src/components/pure/ToastNotification.js +7 -0
- package/dist/module/src/components/pure/UserProfile.js +20 -0
- package/dist/module/src/components/stateful/AuthCallbackPage.js +14 -0
- package/dist/module/src/components/stateful/FeaturesReporter.js +2 -1
- package/dist/module/src/components/stateful/FileTree.js +59 -33
- package/dist/module/src/components/stateful/GitIntegrationPage.js +5 -0
- package/dist/module/src/components/stateful/ProcessManagerPage.js +13 -15
- package/dist/module/src/components/stateful/ProjectPage.js +6 -5
- package/dist/module/src/components/stateful/ProjectsPage.js +16 -18
- package/dist/module/src/components/stateful/SingleProcessPage.js +16 -26
- package/dist/module/src/components/stateful/TestPage.js +8 -6
- package/dist/module/src/hooks/useGitMode.js +17 -0
- package/dist/module/src/lib/BaseSuite.test/mock.js +15 -8
- package/dist/module/src/lib/BaseSuite.test/test.js +56 -80
- package/dist/module/src/lib/Tiposkripto.js +24 -0
- package/dist/module/src/lib/Tiposkripto.test/MockTiposkripto.js +154 -10
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +6 -12
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +63 -23
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.specification.js +14 -6
- package/dist/module/src/lib/pmProxy.test/specification.js +167 -52
- package/dist/module/src/services/FileService.js +468 -0
- package/dist/module/src/services/GitHubAuthService.js +180 -0
- package/dist/module/src/testeranto.js +38 -97
- package/dist/module/src/utils/api.js +10 -7
- package/dist/module/src/utils/gitTest.js +23 -0
- package/dist/module/src/utils.js +21 -12
- package/dist/module/testeranto.config.js +21 -17
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.css +94 -121
- package/dist/prebuild/App.js +44601 -11225
- package/dist/prebuild/testeranto.mjs +4106 -0
- package/dist/types/design-editor/DesignEditor.d.ts +1 -18
- package/dist/types/src/App.d.ts +18 -0
- package/dist/types/src/PM/PM_WithBuild.d.ts +13 -0
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -4
- package/dist/types/src/PM/PM_WithGit.d.ts +27 -0
- package/dist/types/src/PM/PM_WithProcesses.d.ts +29 -0
- package/dist/types/src/PM/PM_WithWebSocket.d.ts +108 -0
- package/dist/types/src/PM/base.d.ts +1 -1
- package/dist/types/src/PM/index.d.ts +0 -2
- package/dist/types/src/PM/main.d.ts +6 -77
- package/dist/types/src/PM/metafileOutputs.d.ts +0 -0
- package/dist/types/src/PM/node.d.ts +0 -2
- package/dist/types/src/PM/pure.d.ts +0 -2
- package/dist/types/src/PM/types.d.ts +118 -0
- package/dist/types/src/PM/utils.d.ts +35 -0
- package/dist/types/src/PM/web.d.ts +0 -2
- package/dist/types/src/Pure.d.ts +6 -1
- package/dist/types/src/ReportServer.d.ts +0 -1
- package/dist/types/src/ReportServerLib.d.ts +0 -1
- package/dist/types/src/Types.d.ts +1 -0
- package/dist/types/src/components/pure/ArtifactTree.d.ts +0 -0
- package/dist/types/src/components/pure/BuildLogViewer.d.ts +7 -0
- package/dist/types/src/components/pure/DebugEnv.d.ts +2 -0
- package/dist/types/src/components/pure/FileTree.d.ts +6 -0
- package/dist/types/src/components/pure/FileTreeItem.d.ts +8 -0
- package/dist/types/src/components/pure/GitHubLoginButton.d.ts +8 -0
- package/dist/types/src/components/pure/GitIntegrationView.d.ts +1 -0
- package/dist/types/src/components/pure/Settings.d.ts +1 -0
- package/dist/types/src/components/pure/Settings.test.d.ts +1 -0
- package/dist/types/src/components/pure/SignIn.d.ts +1 -0
- package/dist/types/src/components/pure/SingleProcessView.d.ts +10 -0
- package/dist/types/src/components/pure/TestPageView.d.ts +2 -1
- package/dist/types/src/components/pure/TestPageView_utils.d.ts +23 -0
- package/dist/types/src/components/pure/TestTable.d.ts +16 -0
- package/dist/types/src/components/pure/ToastNotification.d.ts +6 -0
- package/dist/types/src/components/pure/UserProfile.d.ts +2 -0
- package/dist/types/src/components/stateful/AuthCallbackPage.d.ts +2 -0
- package/dist/types/src/components/stateful/FileTree.d.ts +0 -8
- package/dist/types/src/components/stateful/GitIntegrationPage.d.ts +1 -0
- package/dist/types/src/hooks/useGitMode.d.ts +7 -0
- package/dist/types/src/lib/BaseSuite.test/mock.d.ts +2 -2
- package/dist/types/src/lib/BaseSuite.test/test.d.ts +4 -3
- package/dist/types/src/lib/Tiposkripto.d.ts +2 -0
- package/dist/types/src/lib/Tiposkripto.test/MockTiposkripto.d.ts +3 -0
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.types.d.ts +5 -0
- package/dist/types/src/lib/index.d.ts +6 -0
- package/dist/types/src/services/FileService.d.ts +34 -0
- package/dist/types/src/services/GitHubAuthService.d.ts +32 -0
- package/dist/types/src/utils/api.d.ts +1 -0
- package/dist/types/src/utils/gitTest.d.ts +11 -0
- package/dist/types/src/utils.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/example/__pycache__/Calculator.cpython-313.pyc +0 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/README.md +187 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_given.go +163 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_suite.go +85 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_then.go +21 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/base_when.go +21 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/golingvu.go +554 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/test_adapter.go +33 -0
- package/example/vendor/github.com/adamwong246/testeranto/src/golingvu/types.go +72 -0
- package/example/vendor/modules.txt +5 -0
- package/git-integration-plan.md +395 -0
- package/package.json +26 -14
- package/src/App.tsx +169 -18
- package/src/PM/PM_WithBuild.ts +171 -0
- package/src/PM/PM_WithEslintAndTsc.ts +109 -86
- package/src/PM/PM_WithGit.ts +585 -0
- package/src/PM/PM_WithProcesses.ts +639 -0
- package/src/PM/PM_WithWebSocket.ts +631 -0
- package/src/PM/base.ts +63 -1
- package/src/PM/index.ts +8 -5
- package/src/PM/main.ts +672 -2050
- package/src/PM/metafileOutputs.ts +90 -0
- package/src/PM/node.ts +18 -18
- package/src/PM/pure.ts +5 -13
- package/src/PM/types.ts +145 -0
- package/src/PM/utils.ts +256 -0
- package/src/PM/web.ts +8 -8
- package/src/README.md +122 -0
- package/src/ReportServer.ts +0 -12
- package/src/ReportServerLib.ts +0 -147
- package/src/Types.ts +1 -0
- package/src/app.scss +14 -164
- package/src/components/pure/AppFrame.tsx +237 -71
- package/src/components/pure/ArtifactTree.tsx +82 -0
- package/src/components/pure/BuildLogViewer.tsx +168 -0
- package/src/components/pure/DebugEnv.tsx +30 -0
- package/src/components/pure/FileTree.tsx +58 -0
- package/src/components/pure/FileTreeItem.tsx +49 -0
- package/src/components/pure/GitHubLoginButton.tsx +31 -0
- package/src/components/pure/GitIntegrationView.tsx +443 -0
- package/src/components/pure/ProcessManager.tsx +6 -5
- package/src/components/pure/ProcessManagerView.tsx +162 -166
- package/src/components/pure/ProjectPageView.tsx +6 -224
- package/src/components/pure/Settings.test.tsx +34 -0
- package/src/components/pure/Settings.tsx +163 -0
- package/src/components/pure/SignIn.tsx +33 -0
- package/src/components/pure/SingleProcessView.tsx +231 -235
- package/src/components/pure/TestPageView.test/specification.ts +1 -0
- package/src/components/pure/TestPageView.tsx +317 -826
- package/src/components/pure/TestPageView_utils.tsx +285 -0
- package/src/components/pure/TestTable.tsx +88 -0
- package/src/components/pure/ToastNotification.tsx +19 -0
- package/src/components/pure/UserProfile.tsx +44 -0
- package/src/components/stateful/AuthCallbackPage.tsx +21 -0
- package/src/components/stateful/FeaturesReporter.tsx +3 -1
- package/src/components/stateful/FileTree.tsx +58 -58
- package/src/components/stateful/GitIntegrationPage.tsx +8 -0
- package/src/components/stateful/ProcessManagerPage.tsx +13 -17
- package/src/components/stateful/ProjectPage.tsx +6 -5
- package/src/components/stateful/ProjectsPage.tsx +17 -19
- package/src/components/stateful/SVGEditor/CircleForm.tsx +68 -0
- package/src/components/stateful/SVGEditor/GroupForm.tsx +56 -0
- package/src/components/stateful/SVGEditor/RectForm.tsx +74 -0
- package/src/components/stateful/SVGEditor/SVGAttributeField.tsx +29 -0
- package/src/components/stateful/SVGEditor/SVGAttributesEditor.tsx +73 -0
- package/src/components/stateful/SVGEditor/SVGEditorControls.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGElementForm.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGPreview.tsx +225 -0
- package/src/components/stateful/SVGEditor/SVGTextEditor.tsx +166 -0
- package/src/components/stateful/SVGEditor/SVGTree.tsx +159 -0
- package/src/components/stateful/SVGEditor/SVGTypes.ts +36 -0
- package/src/components/stateful/SVGEditor/svg.xsd.xml +3038 -0
- package/src/components/stateful/SVGEditorPage.tsx +503 -0
- package/src/components/stateful/SingleProcessPage.tsx +18 -31
- package/src/components/stateful/TestPage.tsx +25 -22
- package/src/golingvu/golingvu.go +38 -2
- package/src/hooks/useGitMode.ts +20 -0
- package/src/lib/BaseSuite.test/mock.ts +16 -10
- package/src/lib/BaseSuite.test/test.ts +144 -103
- package/src/lib/Tiposkripto.test/MockTiposkripto.ts +178 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.adapter.ts +9 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.implementation.ts +78 -38
- package/src/lib/Tiposkripto.test/Tiposkripto.specification.ts +51 -9
- package/src/lib/Tiposkripto.test/Tiposkripto.types.ts +5 -0
- package/src/lib/Tiposkripto.ts +27 -0
- package/src/lib/index.ts +7 -0
- package/src/lib/pmProxy.test/specification.ts +168 -166
- package/src/pitono/PM/__pycache__/python.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/Pitono.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_given.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_suite.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_then.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/base_when.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/core_generator.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/simple_adapter.cpython-313.pyc +0 -0
- package/src/pitono/__pycache__/types.cpython-313.pyc +0 -0
- package/src/services/FileService.ts +542 -0
- package/src/services/GitHubAuthService.ts +240 -0
- package/src/testeranto.ts +62 -140
- package/src/utils/api.ts +15 -13
- package/src/utils/gitTest.ts +29 -0
- package/src/utils.ts +21 -12
- package/testeranto/App.css +94 -121
- package/testeranto/App.js +44601 -11225
- package/testeranto/bundles/golang/core/Calculator.golingvu.go +53 -0
- package/testeranto/bundles/golang/core/Calculator.golingvu.golingvu.go +53 -0
- package/testeranto/bundles/node/core/chunk-RIM6RECA.mjs +1170 -0
- package/testeranto/bundles/node/core/chunk-VXVF7WFO.mjs +4321 -0
- package/testeranto/bundles/node/core/example/Calculator.test.mjs +503 -0
- package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +94 -1231
- package/testeranto/bundles/node/core/src/lib/TipoSkripto.test/TipoSkripto.mjs +574 -0
- package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +482 -0
- package/testeranto/bundles/pure/core/chunk-XYOCRDEQ.mjs +1080 -0
- package/testeranto/bundles/pure/core/src/Pure.test.mjs +410 -0
- package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +93 -1146
- package/testeranto/bundles/python/core/Calculator.pitono.test.py +24 -0
- package/testeranto/bundles/python/core/test_example.py +24 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
- package/testeranto/bundles/web/core/chunk-DFRN4SYZ.mjs +2297 -0
- package/testeranto/bundles/web/core/chunk-JMDLMADH.mjs +27996 -0
- package/testeranto/bundles/web/core/chunk-LQMU5NCG.mjs +3082 -0
- package/testeranto/bundles/web/core/chunk-Q5TONB2Z.mjs +6874 -0
- package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +164 -0
- package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.css +11697 -0
- package/testeranto/bundles/web/core/src/components/pure/ModalContent.test/index.mjs +336 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +11697 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +517 -0
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +107 -1134
- package/testeranto/metafiles/golang/core.json +3 -3
- package/testeranto/metafiles/node/core.json +474 -31
- package/testeranto/metafiles/pure/core.json +144 -28
- package/testeranto/metafiles/python/core.json +11 -0
- package/testeranto/metafiles/web/core.json +15829 -45
- package/testeranto/reports/core/config.json +40 -0
- package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +14 -0
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +73 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +91 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +1 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +2 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +68 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +30 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +1 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +2 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +88 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -6
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -11
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +1 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +1 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +35 -38
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -10
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +40 -38
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +1 -1
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +55 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +191 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +71 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +15 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +17 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +20 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +4 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +49 -0
- package/testeranto/reports/core/summary.json +34 -6
- package/testeranto.config.ts +26 -20
- package/tsc.log +141 -91
- package/tsconfig.json +6 -2
- package/dist/prebuild/ReportServer.mjs +0 -227
- package/dist/prebuild/mothership/index.mjs +0 -22
- package/dist/types/design-editor/server.d.ts +0 -1
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.html +0 -15
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -25
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -56
- /package/testeranto/reports/core/src/{lib/BaseSuite.test/web.test/web → Pure.test/pure}/message.txt +0 -0
|
@@ -1,977 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return subject;
|
|
10
|
-
},
|
|
11
|
-
afterEach: async (store, key, pm) => Promise.resolve(store),
|
|
12
|
-
afterAll: (store, pm) => void 0,
|
|
13
|
-
butThen: async (store, thenCb, testResource, pm) => {
|
|
14
|
-
return thenCb(store, pm);
|
|
15
|
-
},
|
|
16
|
-
andWhen: async (store, whenCB, testResource, pm) => {
|
|
17
|
-
return whenCB(store, pm);
|
|
18
|
-
},
|
|
19
|
-
assertThis: (x) => x
|
|
20
|
-
});
|
|
21
|
-
var DefaultAdapter = (p) => {
|
|
22
|
-
const base = BaseAdapter();
|
|
23
|
-
return {
|
|
24
|
-
...base,
|
|
25
|
-
...p
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
var defaultTestResourceRequirement = {
|
|
29
|
-
ports: 0
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// src/lib/pmProxy.ts
|
|
33
|
-
var baseProxy = function(pm, mappings) {
|
|
34
|
-
return new Proxy(pm, {
|
|
35
|
-
get: (target, prop, receiver) => {
|
|
36
|
-
for (const mapping of mappings) {
|
|
37
|
-
const method = mapping[0];
|
|
38
|
-
const arger = mapping[1];
|
|
39
|
-
if (prop === method) {
|
|
40
|
-
return (...x) => {
|
|
41
|
-
const modifiedArgs = arger(...x);
|
|
42
|
-
return target[prop](...modifiedArgs);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return (...x) => {
|
|
47
|
-
return target[prop](...x);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
var butThenProxy = (pm, filepath, addArtifact) => {
|
|
53
|
-
return baseProxy(pm, [
|
|
54
|
-
[
|
|
55
|
-
"screencast",
|
|
56
|
-
(opts, p) => {
|
|
57
|
-
const path = `${filepath}/butThen/${opts.path}`;
|
|
58
|
-
addArtifact(path);
|
|
59
|
-
return [
|
|
60
|
-
{
|
|
61
|
-
...opts,
|
|
62
|
-
path
|
|
63
|
-
},
|
|
64
|
-
p
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
"createWriteStream",
|
|
70
|
-
(fp) => {
|
|
71
|
-
const path = `${filepath}/butThen/${fp}`;
|
|
72
|
-
addArtifact(path);
|
|
73
|
-
return [path];
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
[
|
|
77
|
-
"writeFileSync",
|
|
78
|
-
(fp, contents, testName) => {
|
|
79
|
-
console.log(
|
|
80
|
-
`[DEBUG] butThenProxy writeFileSync: fp="${fp}" (type: ${typeof fp}), contents="${contents}" (type: ${typeof contents}), testName="${testName}" (type: ${typeof testName})`
|
|
81
|
-
);
|
|
82
|
-
if (typeof fp !== "string") {
|
|
83
|
-
console.log(`[ERROR] fp is not a string:`, fp);
|
|
84
|
-
if (Array.isArray(fp)) {
|
|
85
|
-
fp = fp.join("");
|
|
86
|
-
console.log(`[DEBUG] Converted array to string: "${fp}"`);
|
|
87
|
-
} else {
|
|
88
|
-
fp = String(fp);
|
|
89
|
-
console.log(`[DEBUG] Converted to string: "${fp}"`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const path = `${filepath}/butThen/${fp}`;
|
|
93
|
-
console.log(`[DEBUG] Generated path: "${path}"`);
|
|
94
|
-
addArtifact(path);
|
|
95
|
-
return [path, contents, testName];
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"customScreenShot",
|
|
100
|
-
(opts, p) => {
|
|
101
|
-
const path = `${filepath}/butThen/${opts.path}`;
|
|
102
|
-
addArtifact(path);
|
|
103
|
-
return [
|
|
104
|
-
{
|
|
105
|
-
...opts,
|
|
106
|
-
path
|
|
107
|
-
},
|
|
108
|
-
p
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
]);
|
|
113
|
-
};
|
|
114
|
-
var andWhenProxy = (pm, filepath, addArtifact) => {
|
|
115
|
-
return baseProxy(pm, [
|
|
116
|
-
[
|
|
117
|
-
"screencast",
|
|
118
|
-
(opts, p) => {
|
|
119
|
-
const path = `${filepath}/andWhen/${opts.path}`;
|
|
120
|
-
addArtifact(path);
|
|
121
|
-
return [
|
|
122
|
-
{
|
|
123
|
-
...opts,
|
|
124
|
-
path
|
|
125
|
-
},
|
|
126
|
-
p
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
[
|
|
131
|
-
"createWriteStream",
|
|
132
|
-
(fp) => {
|
|
133
|
-
const path = `${filepath}/andWhen/${fp}`;
|
|
134
|
-
addArtifact(path);
|
|
135
|
-
return [path];
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
[
|
|
139
|
-
"writeFileSync",
|
|
140
|
-
(fp, contents, testName) => {
|
|
141
|
-
const path = `${filepath}/andWhen/${fp}`;
|
|
142
|
-
addArtifact(path);
|
|
143
|
-
return [path, contents, testName];
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
[
|
|
147
|
-
"customScreenShot",
|
|
148
|
-
(opts, p) => {
|
|
149
|
-
const path = `${filepath}/andWhen/${opts.path}`;
|
|
150
|
-
addArtifact(path);
|
|
151
|
-
return [
|
|
152
|
-
{
|
|
153
|
-
...opts,
|
|
154
|
-
path
|
|
155
|
-
},
|
|
156
|
-
p
|
|
157
|
-
];
|
|
158
|
-
}
|
|
159
|
-
]
|
|
160
|
-
]);
|
|
161
|
-
};
|
|
162
|
-
var afterEachProxy = (pm, suite, given, addArtifact) => {
|
|
163
|
-
return baseProxy(pm, [
|
|
164
|
-
[
|
|
165
|
-
"screencast",
|
|
166
|
-
(opts, p) => {
|
|
167
|
-
const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
|
|
168
|
-
addArtifact(path);
|
|
169
|
-
return [
|
|
170
|
-
{
|
|
171
|
-
...opts,
|
|
172
|
-
path
|
|
173
|
-
},
|
|
174
|
-
p
|
|
175
|
-
];
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
[
|
|
179
|
-
"createWriteStream",
|
|
180
|
-
(fp) => {
|
|
181
|
-
const path = `suite-${suite}/afterEach/${fp}`;
|
|
182
|
-
addArtifact(path);
|
|
183
|
-
return [path];
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
[
|
|
187
|
-
"writeFileSync",
|
|
188
|
-
(fp, contents, testName) => {
|
|
189
|
-
const path = `suite-${suite}/given-${given}/afterEach/${fp}`;
|
|
190
|
-
addArtifact(path);
|
|
191
|
-
return [path, contents, testName];
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
[
|
|
195
|
-
"customScreenShot",
|
|
196
|
-
(opts, p) => {
|
|
197
|
-
const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
|
|
198
|
-
addArtifact(path);
|
|
199
|
-
return [
|
|
200
|
-
{
|
|
201
|
-
...opts,
|
|
202
|
-
path
|
|
203
|
-
},
|
|
204
|
-
p
|
|
205
|
-
];
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
]);
|
|
209
|
-
};
|
|
210
|
-
var beforeEachProxy = (pm, suite, addArtifact) => {
|
|
211
|
-
return baseProxy(pm, [
|
|
212
|
-
[
|
|
213
|
-
"screencast",
|
|
214
|
-
(opts, p) => {
|
|
215
|
-
const path = `suite-${suite}/beforeEach/${opts.path}`;
|
|
216
|
-
addArtifact(path);
|
|
217
|
-
return [
|
|
218
|
-
{
|
|
219
|
-
...opts,
|
|
220
|
-
path
|
|
221
|
-
},
|
|
222
|
-
p
|
|
223
|
-
];
|
|
224
|
-
}
|
|
225
|
-
],
|
|
226
|
-
[
|
|
227
|
-
"writeFileSync",
|
|
228
|
-
(fp, contents, testName) => {
|
|
229
|
-
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
230
|
-
addArtifact(path);
|
|
231
|
-
return [path, contents, testName];
|
|
232
|
-
}
|
|
233
|
-
],
|
|
234
|
-
[
|
|
235
|
-
"customScreenShot",
|
|
236
|
-
(opts, p) => {
|
|
237
|
-
const path = `suite-${suite}/beforeEach/${opts.path}`;
|
|
238
|
-
addArtifact(path);
|
|
239
|
-
return [
|
|
240
|
-
{
|
|
241
|
-
...opts,
|
|
242
|
-
path
|
|
243
|
-
},
|
|
244
|
-
p
|
|
245
|
-
];
|
|
246
|
-
}
|
|
247
|
-
],
|
|
248
|
-
[
|
|
249
|
-
"createWriteStream",
|
|
250
|
-
(fp) => {
|
|
251
|
-
const path = `suite-${suite}/beforeEach/${fp}`;
|
|
252
|
-
addArtifact(path);
|
|
253
|
-
return [path];
|
|
254
|
-
}
|
|
255
|
-
]
|
|
256
|
-
]);
|
|
257
|
-
};
|
|
258
|
-
var beforeAllProxy = (pm, suite, addArtifact) => {
|
|
259
|
-
return baseProxy(pm, [
|
|
260
|
-
[
|
|
261
|
-
"writeFileSync",
|
|
262
|
-
(fp, contents, testName) => {
|
|
263
|
-
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
264
|
-
addArtifact(path);
|
|
265
|
-
return [path, contents, testName];
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
[
|
|
269
|
-
"customScreenShot",
|
|
270
|
-
(opts, p) => {
|
|
271
|
-
const path = `suite-${suite}/beforeAll/${opts.path}`;
|
|
272
|
-
addArtifact(path);
|
|
273
|
-
return [
|
|
274
|
-
{
|
|
275
|
-
...opts,
|
|
276
|
-
path
|
|
277
|
-
},
|
|
278
|
-
p
|
|
279
|
-
];
|
|
280
|
-
}
|
|
281
|
-
],
|
|
282
|
-
[
|
|
283
|
-
"createWriteStream",
|
|
284
|
-
(fp) => {
|
|
285
|
-
const path = `suite-${suite}/beforeAll/${fp}`;
|
|
286
|
-
addArtifact(path);
|
|
287
|
-
return [path];
|
|
288
|
-
}
|
|
289
|
-
]
|
|
290
|
-
]);
|
|
291
|
-
};
|
|
292
|
-
var afterAllProxy = (pm, suite, addArtifact) => {
|
|
293
|
-
return baseProxy(pm, [
|
|
294
|
-
[
|
|
295
|
-
"createWriteStream",
|
|
296
|
-
(fp) => {
|
|
297
|
-
const path = `suite-${suite}/afterAll/${fp}`;
|
|
298
|
-
addArtifact(path);
|
|
299
|
-
return [path];
|
|
300
|
-
}
|
|
301
|
-
],
|
|
302
|
-
[
|
|
303
|
-
"writeFileSync",
|
|
304
|
-
(fp, contents, testName) => {
|
|
305
|
-
const path = `suite-${suite}/afterAll/${fp}`;
|
|
306
|
-
addArtifact(path);
|
|
307
|
-
return [path, contents, testName];
|
|
308
|
-
}
|
|
309
|
-
],
|
|
310
|
-
[
|
|
311
|
-
"customScreenShot",
|
|
312
|
-
(opts, p) => {
|
|
313
|
-
const path = `suite-${suite}/afterAll/${opts.path}`;
|
|
314
|
-
addArtifact(path);
|
|
315
|
-
return [
|
|
316
|
-
{
|
|
317
|
-
...opts,
|
|
318
|
-
path
|
|
319
|
-
},
|
|
320
|
-
p
|
|
321
|
-
];
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
|
-
]);
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
// src/lib/BaseGiven.ts
|
|
328
|
-
var BaseGiven = class {
|
|
329
|
-
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
330
|
-
this.artifacts = [];
|
|
331
|
-
this.name = name;
|
|
332
|
-
this.features = features || [];
|
|
333
|
-
this.whens = whens || [];
|
|
334
|
-
this.thens = thens || [];
|
|
335
|
-
this.givenCB = givenCB;
|
|
336
|
-
this.initialValues = initialValues;
|
|
337
|
-
}
|
|
338
|
-
addArtifact(path) {
|
|
339
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
340
|
-
this.artifacts.push(normalizedPath);
|
|
341
|
-
}
|
|
342
|
-
beforeAll(store) {
|
|
343
|
-
return store;
|
|
344
|
-
}
|
|
345
|
-
toObj() {
|
|
346
|
-
return {
|
|
347
|
-
key: this.key,
|
|
348
|
-
name: this.name,
|
|
349
|
-
whens: (this.whens || []).map((w) => {
|
|
350
|
-
if (w && w.toObj)
|
|
351
|
-
return w.toObj();
|
|
352
|
-
console.error("w is not as expected!", JSON.stringify(w));
|
|
353
|
-
return {};
|
|
354
|
-
}),
|
|
355
|
-
thens: (this.thens || []).map((t) => t && t.toObj ? t.toObj() : {}),
|
|
356
|
-
error: this.error ? [this.error, this.error.stack] : null,
|
|
357
|
-
failed: this.failed,
|
|
358
|
-
features: this.features || [],
|
|
359
|
-
artifacts: this.artifacts || []
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
async afterEach(store, key, artifactory, pm) {
|
|
363
|
-
return store;
|
|
364
|
-
}
|
|
365
|
-
async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
|
|
366
|
-
this.key = key;
|
|
367
|
-
tLog(`
|
|
368
|
-
${this.key}`);
|
|
369
|
-
tLog(`
|
|
370
|
-
Given: ${this.name}`);
|
|
371
|
-
const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
|
|
372
|
-
this.uberCatcher((e) => {
|
|
373
|
-
console.error(e.toString());
|
|
374
|
-
this.error = e.error;
|
|
375
|
-
tLog(e.stack);
|
|
376
|
-
});
|
|
377
|
-
try {
|
|
378
|
-
const addArtifact = this.addArtifact.bind(this);
|
|
379
|
-
const proxiedPm = beforeEachProxy(pm, suiteNdx.toString(), addArtifact);
|
|
380
|
-
this.store = await this.givenThat(
|
|
381
|
-
subject,
|
|
382
|
-
testResourceConfiguration,
|
|
383
|
-
givenArtifactory,
|
|
384
|
-
this.givenCB,
|
|
385
|
-
this.initialValues,
|
|
386
|
-
proxiedPm
|
|
387
|
-
);
|
|
388
|
-
} catch (e) {
|
|
389
|
-
this.failed = true;
|
|
390
|
-
this.error = e.stack;
|
|
391
|
-
}
|
|
392
|
-
try {
|
|
393
|
-
for (const [whenNdx, whenStep] of this.whens.entries()) {
|
|
394
|
-
await whenStep.test(
|
|
395
|
-
this.store,
|
|
396
|
-
testResourceConfiguration,
|
|
397
|
-
tLog,
|
|
398
|
-
pm,
|
|
399
|
-
`suite-${suiteNdx}/given-${key}/when/${whenNdx}`
|
|
400
|
-
);
|
|
401
|
-
}
|
|
402
|
-
for (const [thenNdx, thenStep] of this.thens.entries()) {
|
|
403
|
-
const t = await thenStep.test(
|
|
404
|
-
this.store,
|
|
405
|
-
testResourceConfiguration,
|
|
406
|
-
tLog,
|
|
407
|
-
pm,
|
|
408
|
-
`suite-${suiteNdx}/given-${key}/then-${thenNdx}`
|
|
409
|
-
);
|
|
410
|
-
tester(t);
|
|
411
|
-
}
|
|
412
|
-
} catch (e) {
|
|
413
|
-
this.error = e.stack;
|
|
414
|
-
this.failed = true;
|
|
415
|
-
} finally {
|
|
416
|
-
try {
|
|
417
|
-
const addArtifact = this.addArtifact.bind(this);
|
|
418
|
-
const proxiedPm = afterEachProxy(
|
|
419
|
-
pm,
|
|
420
|
-
suiteNdx.toString(),
|
|
421
|
-
key,
|
|
422
|
-
addArtifact
|
|
423
|
-
);
|
|
424
|
-
await this.afterEach(this.store, this.key, givenArtifactory, proxiedPm);
|
|
425
|
-
} catch (e) {
|
|
426
|
-
this.failed = e;
|
|
427
|
-
throw e;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
return this.store;
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
// src/lib/BaseWhen.ts
|
|
435
|
-
var BaseWhen = class {
|
|
436
|
-
constructor(name, whenCB) {
|
|
437
|
-
this.artifacts = [];
|
|
438
|
-
this.name = name;
|
|
439
|
-
this.whenCB = whenCB;
|
|
440
|
-
}
|
|
441
|
-
addArtifact(path) {
|
|
442
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
443
|
-
this.artifacts.push(normalizedPath);
|
|
444
|
-
}
|
|
445
|
-
toObj() {
|
|
446
|
-
const obj = {
|
|
447
|
-
name: this.name,
|
|
448
|
-
error: this.error ? `${this.error.name}: ${this.error.message}
|
|
449
|
-
${this.error.stack}` : null,
|
|
450
|
-
artifacts: this.artifacts || []
|
|
451
|
-
};
|
|
452
|
-
console.log(
|
|
453
|
-
`[TOOBJ] Serializing ${this.constructor.name} with artifacts:`,
|
|
454
|
-
obj.artifacts
|
|
455
|
-
);
|
|
456
|
-
return obj;
|
|
457
|
-
}
|
|
458
|
-
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
459
|
-
try {
|
|
460
|
-
const addArtifact = this.addArtifact.bind(this);
|
|
461
|
-
const proxiedPm = andWhenProxy(pm, filepath, addArtifact);
|
|
462
|
-
const result = await this.andWhen(
|
|
463
|
-
store,
|
|
464
|
-
this.whenCB,
|
|
465
|
-
testResourceConfiguration,
|
|
466
|
-
proxiedPm
|
|
467
|
-
);
|
|
468
|
-
return result;
|
|
469
|
-
} catch (e) {
|
|
470
|
-
console.error(
|
|
471
|
-
"[ERROR] When step failed:",
|
|
472
|
-
this.name.toString(),
|
|
473
|
-
e.toString()
|
|
474
|
-
);
|
|
475
|
-
this.error = e;
|
|
476
|
-
throw e;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
// src/lib/BaseThen.ts
|
|
482
|
-
var BaseThen = class {
|
|
483
|
-
constructor(name, thenCB) {
|
|
484
|
-
this.artifacts = [];
|
|
485
|
-
this.name = name;
|
|
486
|
-
this.thenCB = thenCB;
|
|
487
|
-
this.error = false;
|
|
488
|
-
this.artifacts = [];
|
|
489
|
-
}
|
|
490
|
-
addArtifact(path) {
|
|
491
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
492
|
-
this.artifacts.push(normalizedPath);
|
|
493
|
-
}
|
|
494
|
-
toObj() {
|
|
495
|
-
const obj = {
|
|
496
|
-
name: this.name,
|
|
497
|
-
error: this.error,
|
|
498
|
-
artifacts: this.artifacts
|
|
499
|
-
};
|
|
500
|
-
return obj;
|
|
501
|
-
}
|
|
502
|
-
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
503
|
-
const addArtifact = this.addArtifact.bind(this);
|
|
504
|
-
const proxiedPm = butThenProxy(pm, filepath, addArtifact);
|
|
505
|
-
return this.butThen(
|
|
506
|
-
store,
|
|
507
|
-
async (s) => {
|
|
508
|
-
try {
|
|
509
|
-
if (typeof this.thenCB === "function") {
|
|
510
|
-
const wrappedPm = new Proxy(proxiedPm, {
|
|
511
|
-
get: (target, prop, receiver) => {
|
|
512
|
-
if (prop === "writeFileSync") {
|
|
513
|
-
return (...args) => {
|
|
514
|
-
console.log(
|
|
515
|
-
`[DEBUG] writeFileSync called with args:`,
|
|
516
|
-
args
|
|
517
|
-
);
|
|
518
|
-
return target[prop](...args);
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
return target[prop];
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
const result = await this.thenCB(s, wrappedPm);
|
|
525
|
-
return result;
|
|
526
|
-
} else {
|
|
527
|
-
return this.thenCB;
|
|
528
|
-
}
|
|
529
|
-
} catch (e) {
|
|
530
|
-
console.error(e.stack);
|
|
531
|
-
}
|
|
532
|
-
},
|
|
533
|
-
testResourceConfiguration,
|
|
534
|
-
proxiedPm
|
|
535
|
-
).catch((e) => {
|
|
536
|
-
this.error = e.stack;
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
// src/lib/BaseSuite.ts
|
|
542
|
-
var BaseSuite = class {
|
|
543
|
-
constructor(name, index, givens = {}) {
|
|
544
|
-
this.artifacts = [];
|
|
545
|
-
const suiteName = name || "testSuite";
|
|
546
|
-
if (!suiteName) {
|
|
547
|
-
throw new Error("BaseSuite requires a non-empty name");
|
|
548
|
-
}
|
|
549
|
-
this.name = suiteName;
|
|
550
|
-
this.index = index;
|
|
551
|
-
this.givens = givens;
|
|
552
|
-
this.fails = 0;
|
|
553
|
-
}
|
|
554
|
-
addArtifact(path) {
|
|
555
|
-
const normalizedPath = path.replace(/\\/g, "/");
|
|
556
|
-
this.artifacts.push(normalizedPath);
|
|
557
|
-
}
|
|
558
|
-
features() {
|
|
559
|
-
try {
|
|
560
|
-
const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
|
|
561
|
-
return array.indexOf(value) === index;
|
|
562
|
-
});
|
|
563
|
-
return features || [];
|
|
564
|
-
} catch (e) {
|
|
565
|
-
console.error("[ERROR] Failed to extract features:", JSON.stringify(e));
|
|
566
|
-
return [];
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
toObj() {
|
|
570
|
-
const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
|
|
571
|
-
return {
|
|
572
|
-
name: this.name,
|
|
573
|
-
givens,
|
|
574
|
-
fails: this.fails,
|
|
575
|
-
failed: this.failed,
|
|
576
|
-
features: this.features()
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
setup(s, artifactory, tr, pm) {
|
|
580
|
-
return new Promise((res) => res(s));
|
|
581
|
-
}
|
|
582
|
-
assertThat(t) {
|
|
583
|
-
return !!t;
|
|
584
|
-
}
|
|
585
|
-
afterAll(store, artifactory, pm) {
|
|
586
|
-
return store;
|
|
587
|
-
}
|
|
588
|
-
async run(input, testResourceConfiguration, artifactory, tLog, pm) {
|
|
589
|
-
this.testResourceConfiguration = testResourceConfiguration;
|
|
590
|
-
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
591
|
-
const sNdx = this.index;
|
|
592
|
-
const addArtifact = this.addArtifact.bind(this);
|
|
593
|
-
const proxiedPm = beforeAllProxy(pm, sNdx.toString(), addArtifact);
|
|
594
|
-
const subject = await this.setup(
|
|
595
|
-
input,
|
|
596
|
-
suiteArtifactory,
|
|
597
|
-
testResourceConfiguration,
|
|
598
|
-
proxiedPm
|
|
599
|
-
);
|
|
600
|
-
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
601
|
-
const giver = this.givens[gKey];
|
|
602
|
-
this.store = await giver.give(
|
|
603
|
-
subject,
|
|
604
|
-
gKey,
|
|
605
|
-
testResourceConfiguration,
|
|
606
|
-
this.assertThat,
|
|
607
|
-
suiteArtifactory,
|
|
608
|
-
tLog,
|
|
609
|
-
pm,
|
|
610
|
-
sNdx
|
|
611
|
-
).catch((e) => {
|
|
612
|
-
this.failed = true;
|
|
613
|
-
this.fails = this.fails + 1;
|
|
614
|
-
throw e;
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
try {
|
|
618
|
-
const addArtifact2 = this.addArtifact.bind(this);
|
|
619
|
-
const afterAllPm = afterAllProxy(pm, sNdx.toString(), addArtifact2);
|
|
620
|
-
this.afterAll(this.store, artifactory, afterAllPm);
|
|
621
|
-
} catch (e) {
|
|
622
|
-
console.error(JSON.stringify(e));
|
|
623
|
-
}
|
|
624
|
-
return this;
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
|
|
628
|
-
// src/lib/Tiposkripto.ts
|
|
629
|
-
var Tiposkripto = class {
|
|
630
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter2 = {}, uberCatcher = (cb) => cb()) {
|
|
631
|
-
this.artifacts = [];
|
|
632
|
-
const fullAdapter = DefaultAdapter(testAdapter2);
|
|
633
|
-
const classySuites = Object.entries(testImplementation.suites).reduce(
|
|
634
|
-
(a, [key], index) => {
|
|
635
|
-
a[key] = (somestring, givens) => {
|
|
636
|
-
return new class extends BaseSuite {
|
|
637
|
-
afterAll(store, artifactory, pm) {
|
|
638
|
-
return fullAdapter.afterAll(store, pm);
|
|
639
|
-
}
|
|
640
|
-
assertThat(t) {
|
|
641
|
-
return fullAdapter.assertThis(t);
|
|
642
|
-
}
|
|
643
|
-
async setup(s, artifactory, tr, pm) {
|
|
644
|
-
return fullAdapter.beforeAll?.(s, tr, pm) ?? s;
|
|
645
|
-
}
|
|
646
|
-
}(somestring, index, givens);
|
|
647
|
-
};
|
|
648
|
-
return a;
|
|
649
|
-
},
|
|
650
|
-
{}
|
|
651
|
-
);
|
|
652
|
-
const classyGivens = Object.entries(testImplementation.givens).reduce(
|
|
653
|
-
(a, [key, g]) => {
|
|
654
|
-
a[key] = (name, features, whens, thens, gcb, initialValues) => {
|
|
655
|
-
return new class extends BaseGiven {
|
|
656
|
-
constructor() {
|
|
657
|
-
super(...arguments);
|
|
658
|
-
this.uberCatcher = uberCatcher;
|
|
659
|
-
}
|
|
660
|
-
async givenThat(subject, testResource, artifactory, initializer, initialValues2, pm) {
|
|
661
|
-
return fullAdapter.beforeEach(
|
|
662
|
-
subject,
|
|
663
|
-
initializer,
|
|
664
|
-
testResource,
|
|
665
|
-
initialValues2,
|
|
666
|
-
pm
|
|
667
|
-
);
|
|
668
|
-
}
|
|
669
|
-
afterEach(store, key2, artifactory, pm) {
|
|
670
|
-
return Promise.resolve(fullAdapter.afterEach(store, key2, pm));
|
|
671
|
-
}
|
|
672
|
-
}(
|
|
673
|
-
name,
|
|
674
|
-
features,
|
|
675
|
-
whens,
|
|
676
|
-
thens,
|
|
677
|
-
testImplementation.givens[key],
|
|
678
|
-
initialValues
|
|
679
|
-
);
|
|
680
|
-
};
|
|
681
|
-
return a;
|
|
682
|
-
},
|
|
683
|
-
{}
|
|
684
|
-
);
|
|
685
|
-
const classyWhens = Object.entries(testImplementation.whens).reduce(
|
|
686
|
-
(a, [key, whEn]) => {
|
|
687
|
-
a[key] = (...payload) => {
|
|
688
|
-
return new class extends BaseWhen {
|
|
689
|
-
async andWhen(store, whenCB, testResource, pm) {
|
|
690
|
-
return await fullAdapter.andWhen(store, whenCB, testResource, pm);
|
|
691
|
-
}
|
|
692
|
-
}(`${key}: ${payload && payload.toString()}`, whEn(...payload));
|
|
693
|
-
};
|
|
694
|
-
return a;
|
|
695
|
-
},
|
|
696
|
-
{}
|
|
697
|
-
);
|
|
698
|
-
const classyThens = Object.entries(testImplementation.thens).reduce(
|
|
699
|
-
(a, [key, thEn]) => {
|
|
700
|
-
a[key] = (...args) => {
|
|
701
|
-
return new class extends BaseThen {
|
|
702
|
-
async butThen(store, thenCB, testResource, pm) {
|
|
703
|
-
return await fullAdapter.butThen(store, thenCB, testResource, pm);
|
|
704
|
-
}
|
|
705
|
-
}(`${key}: ${args && args.toString()}`, thEn(...args));
|
|
706
|
-
};
|
|
707
|
-
return a;
|
|
708
|
-
},
|
|
709
|
-
{}
|
|
710
|
-
);
|
|
711
|
-
this.suitesOverrides = classySuites;
|
|
712
|
-
this.givenOverides = classyGivens;
|
|
713
|
-
this.whenOverides = classyWhens;
|
|
714
|
-
this.thenOverides = classyThens;
|
|
715
|
-
this.testResourceRequirement = testResourceRequirement;
|
|
716
|
-
this.testSpecification = testSpecification;
|
|
717
|
-
this.specs = testSpecification(
|
|
718
|
-
this.Suites(),
|
|
719
|
-
this.Given(),
|
|
720
|
-
this.When(),
|
|
721
|
-
this.Then()
|
|
722
|
-
);
|
|
723
|
-
this.testJobs = this.specs.map((suite) => {
|
|
724
|
-
const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
|
|
725
|
-
try {
|
|
726
|
-
const x = await suite2.run(
|
|
727
|
-
input,
|
|
728
|
-
puppetMaster.testResourceConfiguration,
|
|
729
|
-
(fPath, value) => puppetMaster.testArtiFactoryfileWriter(
|
|
730
|
-
tLog,
|
|
731
|
-
(p) => {
|
|
732
|
-
this.artifacts.push(p);
|
|
733
|
-
}
|
|
734
|
-
)(
|
|
735
|
-
puppetMaster.testResourceConfiguration.fs + "/" + fPath,
|
|
736
|
-
value
|
|
737
|
-
),
|
|
738
|
-
tLog,
|
|
739
|
-
puppetMaster
|
|
740
|
-
);
|
|
741
|
-
return x;
|
|
742
|
-
} catch (e) {
|
|
743
|
-
console.error(e.stack);
|
|
744
|
-
throw e;
|
|
745
|
-
}
|
|
746
|
-
};
|
|
747
|
-
const runner = suiteRunner(suite);
|
|
748
|
-
return {
|
|
749
|
-
test: suite,
|
|
750
|
-
toObj: () => {
|
|
751
|
-
return suite.toObj();
|
|
752
|
-
},
|
|
753
|
-
runner,
|
|
754
|
-
receiveTestResourceConfig: async function(puppetMaster) {
|
|
755
|
-
const tLog = async (...l) => {
|
|
756
|
-
};
|
|
757
|
-
try {
|
|
758
|
-
const suiteDone = await runner(puppetMaster, tLog);
|
|
759
|
-
const fails = suiteDone.fails;
|
|
760
|
-
await puppetMaster.writeFileSync(
|
|
761
|
-
`tests.json`,
|
|
762
|
-
JSON.stringify(this.toObj(), null, 2),
|
|
763
|
-
"test"
|
|
764
|
-
);
|
|
765
|
-
return {
|
|
766
|
-
failed: fails > 0,
|
|
767
|
-
fails,
|
|
768
|
-
artifacts: this.artifacts || [],
|
|
769
|
-
features: suiteDone.features()
|
|
770
|
-
};
|
|
771
|
-
} catch (e) {
|
|
772
|
-
console.error(e.stack);
|
|
773
|
-
return {
|
|
774
|
-
failed: true,
|
|
775
|
-
fails: -1,
|
|
776
|
-
artifacts: this.artifacts || [],
|
|
777
|
-
features: []
|
|
778
|
-
};
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
};
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
Specs() {
|
|
785
|
-
return this.specs;
|
|
786
|
-
}
|
|
787
|
-
Suites() {
|
|
788
|
-
return this.suitesOverrides;
|
|
789
|
-
}
|
|
790
|
-
Given() {
|
|
791
|
-
return this.givenOverides;
|
|
792
|
-
}
|
|
793
|
-
When() {
|
|
794
|
-
return this.whenOverides;
|
|
795
|
-
}
|
|
796
|
-
Then() {
|
|
797
|
-
return this.thenOverides;
|
|
798
|
-
}
|
|
799
|
-
// Add a method to access test jobs which can be used by receiveTestResourceConfig
|
|
800
|
-
getTestJobs() {
|
|
801
|
-
return this.testJobs;
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
// src/PM/index.ts
|
|
806
|
-
var PM = class {
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
// src/PM/pure.ts
|
|
810
|
-
var PM_Pure = class extends PM {
|
|
811
|
-
constructor(t) {
|
|
812
|
-
super();
|
|
813
|
-
this.server = {};
|
|
814
|
-
this.testResourceConfiguration = t;
|
|
815
|
-
}
|
|
816
|
-
getInnerHtml(selector, page) {
|
|
817
|
-
throw new Error("pure.ts getInnerHtml not implemented");
|
|
818
|
-
}
|
|
819
|
-
stopSideCar(uid) {
|
|
820
|
-
throw new Error("pure.ts stopSideCar not implemented");
|
|
821
|
-
}
|
|
822
|
-
trackCall(method, args) {
|
|
823
|
-
}
|
|
824
|
-
start() {
|
|
825
|
-
return new Promise((r) => r());
|
|
826
|
-
}
|
|
827
|
-
stop() {
|
|
828
|
-
return new Promise((r) => r());
|
|
829
|
-
}
|
|
830
|
-
async createWriteStream(filepath, testName) {
|
|
831
|
-
throw new Error("pure.ts createWriteStream not implemented");
|
|
832
|
-
return "";
|
|
833
|
-
}
|
|
834
|
-
launchSideCar(n) {
|
|
835
|
-
return globalThis["launchSideCar"](n, this.testResourceConfiguration.name);
|
|
836
|
-
}
|
|
837
|
-
pages() {
|
|
838
|
-
return globalThis["pages"]();
|
|
839
|
-
}
|
|
840
|
-
waitForSelector(p, s) {
|
|
841
|
-
return globalThis["waitForSelector"](p, s);
|
|
842
|
-
}
|
|
843
|
-
closePage(p) {
|
|
844
|
-
return globalThis["closePage"](p);
|
|
845
|
-
}
|
|
846
|
-
goto(cdpPage, url) {
|
|
847
|
-
return globalThis["goto"](cdpPage.mainFrame()._id, url);
|
|
848
|
-
}
|
|
849
|
-
newPage() {
|
|
850
|
-
return globalThis["newPage"]();
|
|
851
|
-
}
|
|
852
|
-
$(selector) {
|
|
853
|
-
return globalThis["$"](selector);
|
|
854
|
-
}
|
|
855
|
-
isDisabled(selector) {
|
|
856
|
-
return globalThis["isDisabled"](selector);
|
|
857
|
-
}
|
|
858
|
-
getAttribute(selector, attribute) {
|
|
859
|
-
return globalThis["getAttribute"](selector, attribute);
|
|
860
|
-
}
|
|
861
|
-
getValue(selector) {
|
|
862
|
-
return globalThis["getValue"](selector);
|
|
863
|
-
}
|
|
864
|
-
focusOn(selector) {
|
|
865
|
-
return globalThis["focusOn"](selector);
|
|
866
|
-
}
|
|
867
|
-
typeInto(selector, value) {
|
|
868
|
-
return globalThis["typeInto"](selector, value);
|
|
869
|
-
}
|
|
870
|
-
page() {
|
|
871
|
-
return globalThis["page"]();
|
|
872
|
-
}
|
|
873
|
-
click(selector) {
|
|
874
|
-
return globalThis["click"](selector);
|
|
875
|
-
}
|
|
876
|
-
screencast(opts, page) {
|
|
877
|
-
return globalThis["screencast"](
|
|
878
|
-
{
|
|
879
|
-
...opts,
|
|
880
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
881
|
-
},
|
|
882
|
-
page,
|
|
883
|
-
this.testResourceConfiguration.name
|
|
884
|
-
);
|
|
885
|
-
}
|
|
886
|
-
screencastStop(p) {
|
|
887
|
-
return globalThis["screencastStop"](p);
|
|
888
|
-
}
|
|
889
|
-
customScreenShot(opts, page) {
|
|
890
|
-
return globalThis["customScreenShot"](
|
|
891
|
-
{
|
|
892
|
-
...opts,
|
|
893
|
-
path: this.testResourceConfiguration.fs + "/" + opts.path
|
|
894
|
-
},
|
|
895
|
-
page,
|
|
896
|
-
this.testResourceConfiguration.name
|
|
897
|
-
);
|
|
898
|
-
}
|
|
899
|
-
// TODO: fix these
|
|
900
|
-
existsSync(destFolder) {
|
|
901
|
-
return Promise.resolve(true);
|
|
902
|
-
}
|
|
903
|
-
mkdirSync() {
|
|
904
|
-
return true;
|
|
905
|
-
}
|
|
906
|
-
write(uid, contents) {
|
|
907
|
-
return Promise.resolve(true);
|
|
908
|
-
}
|
|
909
|
-
writeFileSync() {
|
|
910
|
-
return Promise.resolve(true);
|
|
911
|
-
}
|
|
912
|
-
/////////////////////////////////////////////////////
|
|
913
|
-
end(uid) {
|
|
914
|
-
return globalThis["end"](uid);
|
|
915
|
-
}
|
|
916
|
-
customclose() {
|
|
917
|
-
globalThis["customclose"](
|
|
918
|
-
this.testResourceConfiguration.fs,
|
|
919
|
-
this.testResourceConfiguration.name
|
|
920
|
-
);
|
|
921
|
-
}
|
|
922
|
-
testArtiFactoryfileWriter(tLog, callback) {
|
|
923
|
-
return (fPath, value) => {
|
|
924
|
-
this.trackCall("testArtiFactoryfileWriter", { fPath, value });
|
|
925
|
-
callback(Promise.resolve());
|
|
926
|
-
};
|
|
927
|
-
}
|
|
928
|
-
// startPuppeteer(options?: any): any {
|
|
929
|
-
// // return puppeteer.connect(options).then((b) => {
|
|
930
|
-
// // this.browser = b;
|
|
931
|
-
// // });
|
|
932
|
-
// }
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
// src/Pure.ts
|
|
936
|
-
var PureTesteranto = class extends Tiposkripto {
|
|
937
|
-
constructor(input, testSpecification, testImplementation, testResourceRequirement, testAdapter2) {
|
|
938
|
-
super(
|
|
939
|
-
input,
|
|
940
|
-
testSpecification,
|
|
941
|
-
testImplementation,
|
|
942
|
-
testResourceRequirement,
|
|
943
|
-
testAdapter2,
|
|
944
|
-
() => {
|
|
945
|
-
}
|
|
946
|
-
);
|
|
947
|
-
}
|
|
948
|
-
async receiveTestResourceConfig(partialTestResource) {
|
|
949
|
-
const t = JSON.parse(partialTestResource);
|
|
950
|
-
const pm = new PM_Pure(t);
|
|
951
|
-
try {
|
|
952
|
-
const result = this.testJobs[0].receiveTestResourceConfig(pm);
|
|
953
|
-
return result;
|
|
954
|
-
} catch (e) {
|
|
955
|
-
console.error("[ERROR] Test job failed:", e);
|
|
956
|
-
return {
|
|
957
|
-
failed: true,
|
|
958
|
-
fails: -1,
|
|
959
|
-
artifacts: [],
|
|
960
|
-
// logPromise: Promise.resolve(),
|
|
961
|
-
features: []
|
|
962
|
-
};
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
};
|
|
966
|
-
var Pure_default = async (input, testSpecification, testImplementation, testAdapter2, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
967
|
-
return new PureTesteranto(
|
|
968
|
-
input,
|
|
969
|
-
testSpecification,
|
|
970
|
-
testImplementation,
|
|
971
|
-
testResourceRequirement,
|
|
972
|
-
testAdapter2
|
|
973
|
-
);
|
|
974
|
-
};
|
|
2
|
+
import {
|
|
3
|
+
BaseGiven,
|
|
4
|
+
BaseSuite,
|
|
5
|
+
BaseThen,
|
|
6
|
+
BaseWhen,
|
|
7
|
+
Pure_default
|
|
8
|
+
} from "../../../chunk-XYOCRDEQ.mjs";
|
|
975
9
|
|
|
976
10
|
// src/lib/BaseSuite.test/mock.ts
|
|
977
11
|
var MockGiven = class extends BaseGiven {
|
|
@@ -981,14 +15,14 @@ var MockGiven = class extends BaseGiven {
|
|
|
981
15
|
features,
|
|
982
16
|
whens,
|
|
983
17
|
thens,
|
|
984
|
-
async () => ({ testStore: true }),
|
|
18
|
+
async () => ({ testStore: true, testSelection: false }),
|
|
985
19
|
// givenCB
|
|
986
20
|
{}
|
|
987
21
|
// initialValues
|
|
988
22
|
);
|
|
989
23
|
}
|
|
990
24
|
async givenThat() {
|
|
991
|
-
return { testStore: true };
|
|
25
|
+
return { testStore: true, testSelection: false };
|
|
992
26
|
}
|
|
993
27
|
uberCatcher(e) {
|
|
994
28
|
console.error("Given error 2:", e);
|
|
@@ -996,16 +30,22 @@ var MockGiven = class extends BaseGiven {
|
|
|
996
30
|
};
|
|
997
31
|
var MockWhen = class extends BaseWhen {
|
|
998
32
|
async andWhen(store, whenCB, testResource, pm) {
|
|
999
|
-
const selection = {
|
|
1000
|
-
|
|
1001
|
-
|
|
33
|
+
const selection = {
|
|
34
|
+
testSelection: store.testStore,
|
|
35
|
+
testStore: store.testStore
|
|
36
|
+
};
|
|
37
|
+
await whenCB(selection);
|
|
38
|
+
return store;
|
|
1002
39
|
}
|
|
1003
40
|
addArtifact(path) {
|
|
1004
41
|
}
|
|
1005
42
|
};
|
|
1006
43
|
var MockThen = class extends BaseThen {
|
|
1007
|
-
async butThen(store, thenCB, testResourceConfiguration, pm
|
|
1008
|
-
const selection = {
|
|
44
|
+
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
45
|
+
const selection = {
|
|
46
|
+
testSelection: store.testStore,
|
|
47
|
+
testStore: store.testStore
|
|
48
|
+
};
|
|
1009
49
|
await thenCB(selection);
|
|
1010
50
|
return selection;
|
|
1011
51
|
}
|
|
@@ -1039,35 +79,35 @@ var MockSuite = class extends BaseSuite {
|
|
|
1039
79
|
|
|
1040
80
|
// src/lib/BaseSuite.test/test.ts
|
|
1041
81
|
var specification = (Suite, Given, When, Then) => [
|
|
1042
|
-
Suite.Default("BaseSuite Core
|
|
82
|
+
Suite.Default("BaseSuite Core Funct", {
|
|
1043
83
|
// Test initialization and basic properties
|
|
1044
84
|
initialization: Given.Default(
|
|
1045
85
|
["BaseSuite should initialize with correct name and index"],
|
|
1046
86
|
[],
|
|
1047
87
|
[Then.SuiteNameMatches("testSuite"), Then.SuiteIndexMatches(0)]
|
|
88
|
+
),
|
|
89
|
+
// Test execution flow
|
|
90
|
+
execution: Given.Default(
|
|
91
|
+
["BaseSuite should execute all phases successfully"],
|
|
92
|
+
[When.RunSuite()],
|
|
93
|
+
[Then.StoreValid()]
|
|
94
|
+
),
|
|
95
|
+
// Test multiple features
|
|
96
|
+
multipleFeatures: Given.Default(
|
|
97
|
+
["BaseSuite should handle multiple features"],
|
|
98
|
+
[When.AddFeature("additionalFeature")],
|
|
99
|
+
[
|
|
100
|
+
Then.FeaturesIncludes("testFeature"),
|
|
101
|
+
Then.FeaturesIncludes("additionalFeature"),
|
|
102
|
+
Then.FeatureCountMatches(2)
|
|
103
|
+
]
|
|
104
|
+
),
|
|
105
|
+
// Test error handling
|
|
106
|
+
errorHandling: Given.Default(
|
|
107
|
+
["BaseSuite should handle errors gracefully"],
|
|
108
|
+
[When.RunSuiteWithError()],
|
|
109
|
+
[Then.ErrorCountMatches(1), Then.FailedFlagSet()]
|
|
1048
110
|
)
|
|
1049
|
-
// // Test execution flow
|
|
1050
|
-
// execution: Given.Default(
|
|
1051
|
-
// ["BaseSuite should execute all phases successfully"],
|
|
1052
|
-
// [When.RunSuite()],
|
|
1053
|
-
// [Then.StoreValid()]
|
|
1054
|
-
// ),
|
|
1055
|
-
// // Test multiple features
|
|
1056
|
-
// multipleFeatures: Given.Default(
|
|
1057
|
-
// ["BaseSuite should handle multiple features"],
|
|
1058
|
-
// [When.AddFeature("additionalFeature")],
|
|
1059
|
-
// [
|
|
1060
|
-
// Then.FeaturesIncludes("testFeature"),
|
|
1061
|
-
// Then.FeaturesIncludes("additionalFeature"),
|
|
1062
|
-
// Then.FeatureCountMatches(2),
|
|
1063
|
-
// ]
|
|
1064
|
-
// ),
|
|
1065
|
-
// // Test error handling
|
|
1066
|
-
// errorHandling: Given.Default(
|
|
1067
|
-
// ["BaseSuite should handle errors gracefully"],
|
|
1068
|
-
// [When.RunSuiteWithError()],
|
|
1069
|
-
// [Then.ErrorCountMatches(1), Then.FailedFlagSet()]
|
|
1070
|
-
// ),
|
|
1071
111
|
})
|
|
1072
112
|
// Suite.Default("Comprehensive Integration", {
|
|
1073
113
|
// fullStackTest: Given.Default(
|
|
@@ -1103,170 +143,71 @@ var implementation = {
|
|
|
1103
143
|
}
|
|
1104
144
|
},
|
|
1105
145
|
whens: {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
return suite;
|
|
1109
|
-
},
|
|
1110
|
-
modifySpecs: (modifier) => (suite) => {
|
|
1111
|
-
suite.specs = modifier(suite.specs);
|
|
146
|
+
// Add TestWhen which is defined in O type
|
|
147
|
+
TestWhen: () => (suite) => {
|
|
1112
148
|
return suite;
|
|
1113
149
|
},
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
return suite;
|
|
1117
|
-
},
|
|
1118
|
-
RunSuite: () => async (suite) => {
|
|
1119
|
-
const mockConfig = {
|
|
1120
|
-
name: "test",
|
|
1121
|
-
fs: "/tmp",
|
|
1122
|
-
ports: [3e3],
|
|
1123
|
-
environment: {},
|
|
1124
|
-
timeout: 5e3,
|
|
1125
|
-
retries: 3
|
|
1126
|
-
};
|
|
1127
|
-
const mockArtifactory = (key, value) => {
|
|
1128
|
-
};
|
|
1129
|
-
const mockTLog = (...args) => {
|
|
1130
|
-
};
|
|
1131
|
-
const mockPM = {
|
|
1132
|
-
server: null,
|
|
1133
|
-
testResourceConfiguration: mockConfig,
|
|
1134
|
-
start: async () => {
|
|
1135
|
-
},
|
|
1136
|
-
stop: async () => {
|
|
1137
|
-
},
|
|
1138
|
-
testArtiFactoryfileWriter: () => {
|
|
1139
|
-
},
|
|
1140
|
-
$: () => {
|
|
1141
|
-
},
|
|
1142
|
-
click: () => {
|
|
1143
|
-
},
|
|
1144
|
-
closePage: () => {
|
|
1145
|
-
},
|
|
1146
|
-
createWriteStream: async () => ""
|
|
1147
|
-
};
|
|
1148
|
-
return await suite.run(
|
|
1149
|
-
null,
|
|
1150
|
-
mockConfig,
|
|
1151
|
-
mockArtifactory,
|
|
1152
|
-
mockTLog,
|
|
1153
|
-
mockPM
|
|
1154
|
-
);
|
|
1155
|
-
},
|
|
1156
|
-
RunSuiteWithError: () => async (suite) => {
|
|
1157
|
-
try {
|
|
1158
|
-
await suite.run(
|
|
1159
|
-
null,
|
|
1160
|
-
{},
|
|
1161
|
-
// Invalid config
|
|
1162
|
-
() => {
|
|
1163
|
-
},
|
|
1164
|
-
() => {
|
|
1165
|
-
},
|
|
1166
|
-
{}
|
|
1167
|
-
);
|
|
1168
|
-
} catch (e) {
|
|
1169
|
-
}
|
|
150
|
+
// Add RunSuite which is defined in O type
|
|
151
|
+
RunSuite: () => (suite) => {
|
|
1170
152
|
return suite;
|
|
1171
153
|
},
|
|
154
|
+
// Add AddFeature which is used in the specification
|
|
1172
155
|
AddFeature: (feature) => (suite) => {
|
|
1173
156
|
const firstGivenKey = Object.keys(suite.givens)[0];
|
|
1174
157
|
if (firstGivenKey) {
|
|
1175
158
|
suite.givens[firstGivenKey].features.push(feature);
|
|
1176
159
|
}
|
|
1177
160
|
return suite;
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
thens: {
|
|
1181
|
-
SuiteNameMatches: (expectedName) => (ssel, utils) => (store) => {
|
|
1182
|
-
if (store.name !== expectedName) {
|
|
1183
|
-
throw new Error(
|
|
1184
|
-
`Expected suite name '${expectedName}', got '${store.name}'`
|
|
1185
|
-
);
|
|
1186
|
-
}
|
|
1187
|
-
return Promise.resolve({ testSelection: true });
|
|
1188
161
|
},
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
throw new Error(
|
|
1192
|
-
`Expected suite index ${expectedIndex}, got ${store.index}`
|
|
1193
|
-
);
|
|
1194
|
-
}
|
|
1195
|
-
return Promise.resolve({ testSelection: true });
|
|
1196
|
-
},
|
|
1197
|
-
FeaturesIncludes: (feature) => (ssel, utils) => (store) => {
|
|
1198
|
-
return Promise.resolve({ testSelection: true });
|
|
1199
|
-
},
|
|
1200
|
-
FeatureCountMatches: (expectedCount) => (suite) => {
|
|
1201
|
-
const actualCount = suite.features().length;
|
|
1202
|
-
if (actualCount !== expectedCount) {
|
|
1203
|
-
throw new Error(
|
|
1204
|
-
`Expected ${expectedCount} features, got ${actualCount}`
|
|
1205
|
-
);
|
|
1206
|
-
}
|
|
162
|
+
// Add RunSuiteWithError which is used in the specification
|
|
163
|
+
RunSuiteWithError: () => (suite) => {
|
|
1207
164
|
return suite;
|
|
1208
165
|
},
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
}
|
|
166
|
+
// Keep other whens
|
|
167
|
+
addArtifact: (artifact) => (suite) => {
|
|
168
|
+
suite.artifacts.push(artifact);
|
|
1213
169
|
return suite;
|
|
1214
170
|
},
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
throw new Error("Expected no errors to occur during execution");
|
|
1218
|
-
}
|
|
171
|
+
modifySpecs: (modifier) => (suite) => {
|
|
172
|
+
suite.specs = modifier(suite.specs);
|
|
1219
173
|
return suite;
|
|
1220
174
|
},
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
throw new Error(
|
|
1224
|
-
`Expected ${expectedCount} errors, got ${suite.fails}`
|
|
1225
|
-
);
|
|
1226
|
-
}
|
|
175
|
+
modifyJobs: (modifier) => (suite) => {
|
|
176
|
+
suite.testJobs = modifier(suite.testJobs);
|
|
1227
177
|
return suite;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
thens: {
|
|
181
|
+
// Add StoreValid which is used in the specification
|
|
182
|
+
StoreValid: () => (ssel, utils) => async (s) => {
|
|
183
|
+
if (!s.testSelection) {
|
|
184
|
+
throw new Error("Store is not valid");
|
|
1232
185
|
}
|
|
1233
|
-
return
|
|
186
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1234
187
|
},
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
throw new Error("Expected all tests to be completed");
|
|
1238
|
-
}
|
|
1239
|
-
return suite;
|
|
188
|
+
SuiteNameMatches: (expectedName) => (ssel, utils) => async (s) => {
|
|
189
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1240
190
|
},
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
throw new Error("Expected clean exit state");
|
|
1244
|
-
}
|
|
1245
|
-
return suite;
|
|
191
|
+
SuiteIndexMatches: (expectedIndex) => (ssel, utils) => async (s) => {
|
|
192
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1246
193
|
},
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
throw new Error(`Expected ${expectedCount} modified specs`);
|
|
1250
|
-
}
|
|
1251
|
-
return suite;
|
|
194
|
+
FeaturesIncludes: (feature) => (ssel, utils) => async (s) => {
|
|
195
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1252
196
|
},
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1257
|
-
return suite;
|
|
197
|
+
// Add FeatureCountMatches which is used in the specification
|
|
198
|
+
FeatureCountMatches: (expectedCount) => (ssel, utils) => async (s) => {
|
|
199
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1258
200
|
},
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}
|
|
1263
|
-
return suite;
|
|
201
|
+
// Add ErrorCountMatches which is used in the specification
|
|
202
|
+
ErrorCountMatches: (expectedCount) => (ssel, utils) => async (s) => {
|
|
203
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1264
204
|
},
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
205
|
+
// Add FailedFlagSet which is used in the specification
|
|
206
|
+
FailedFlagSet: () => (ssel, utils) => async (s) => {
|
|
207
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
208
|
+
},
|
|
209
|
+
TestThen: () => (ssel, utils) => async (s) => {
|
|
210
|
+
return Promise.resolve(new BaseSuite("temp", 0, {}));
|
|
1270
211
|
}
|
|
1271
212
|
}
|
|
1272
213
|
};
|
|
@@ -1290,13 +231,19 @@ var testAdapter = {
|
|
|
1290
231
|
}
|
|
1291
232
|
},
|
|
1292
233
|
andWhen: async (store, whenCB, testResource, pm) => {
|
|
1293
|
-
const selection = {
|
|
1294
|
-
|
|
1295
|
-
|
|
234
|
+
const selection = {
|
|
235
|
+
testSelection: store.testStore,
|
|
236
|
+
testStore: store.testStore
|
|
237
|
+
};
|
|
238
|
+
await whenCB(selection);
|
|
239
|
+
return store;
|
|
1296
240
|
},
|
|
1297
241
|
butThen: async (store, thenCB, testResource, pm) => {
|
|
1298
242
|
try {
|
|
1299
|
-
const selection = {
|
|
243
|
+
const selection = {
|
|
244
|
+
testSelection: store.testStore,
|
|
245
|
+
testStore: store.testStore
|
|
246
|
+
};
|
|
1300
247
|
await thenCB(selection);
|
|
1301
248
|
return selection;
|
|
1302
249
|
} catch (e) {
|