@kumologica/sdk 3.0.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 +1 -0
- package/bin/kl.js +3 -0
- package/cli/cli.js +6 -0
- package/cli/commands/build-commands/aws.js +49 -0
- package/cli/commands/build-commands/azure.js +43 -0
- package/cli/commands/build-commands/kumohub.js +7 -0
- package/cli/commands/build.js +6 -0
- package/cli/commands/create.js +32 -0
- package/cli/commands/deploy-commands/kumohub.js +114 -0
- package/cli/commands/deploy.js +6 -0
- package/cli/commands/doc-commands/html.js +61 -0
- package/cli/commands/doc.js +6 -0
- package/cli/commands/export-commands/cloudformation.js +338 -0
- package/cli/commands/export-commands/serverless.js +164 -0
- package/cli/commands/export-commands/terraform-commands/aws.js +193 -0
- package/cli/commands/export-commands/terraform-commands/azure.js +148 -0
- package/cli/commands/export-commands/terraform.js +6 -0
- package/cli/commands/export-commands/utils/validator.js +152 -0
- package/cli/commands/export.js +6 -0
- package/cli/commands/import-commands/mulesoft.js +61 -0
- package/cli/commands/import.js +6 -0
- package/cli/commands/open.js +46 -0
- package/cli/commands/test-utils/TestSuiteController.js +359 -0
- package/cli/commands/test-utils/TestSuiteController.test.js +171 -0
- package/cli/commands/test-utils/fixtures/example3-flow.json +148 -0
- package/cli/commands/test-utils/fixtures/package.json +6 -0
- package/cli/commands/test-utils/fixtures/s3-event.js +43 -0
- package/cli/commands/test-utils/util/output.js +14 -0
- package/cli/commands/test-utils/util/updates/index.js +17 -0
- package/cli/commands/test-utils/util/updates/pkg.js +13 -0
- package/cli/commands/test-utils/util/updates/templates/default-settings.js +209 -0
- package/cli/commands/test.js +66 -0
- package/cli/commands/utils.js +14 -0
- package/package.json +158 -0
- package/src/app/lib/aws/aws-profile.js +43 -0
- package/src/app/lib/aws/ca-alexa-api.js +29 -0
- package/src/app/lib/aws/ca-apigw-api.js +216 -0
- package/src/app/lib/aws/ca-cloudwatch-api.js +78 -0
- package/src/app/lib/aws/ca-codecommit-api.js +63 -0
- package/src/app/lib/aws/ca-dynamodb-api.js +27 -0
- package/src/app/lib/aws/ca-elb-api.js +44 -0
- package/src/app/lib/aws/ca-events-api.js +27 -0
- package/src/app/lib/aws/ca-iot-api.js +105 -0
- package/src/app/lib/aws/ca-s3-api.js +115 -0
- package/src/app/lib/aws/ca-sns-api.js +38 -0
- package/src/app/lib/aws/ca-sqs-api.js +51 -0
- package/src/app/lib/aws/cf.js +439 -0
- package/src/app/lib/aws/index.js +970 -0
- package/src/app/lib/aws/kl-iam-api.js +27 -0
- package/src/app/lib/aws/kl-rekognition-api.js +66 -0
- package/src/app/lib/aws/kl-ssm-api.js +24 -0
- package/src/app/lib/azure/index.js +80 -0
- package/src/app/lib/dependencies.js +50 -0
- package/src/app/lib/kumohub/index.js +201 -0
- package/src/app/lib/runtime-loader/index.js +42 -0
- package/src/app/lib/serverless/index.js +318 -0
- package/src/app/lib/stores/aws-cloud-config-store.js +35 -0
- package/src/app/lib/stores/azure-config-store.js +24 -0
- package/src/app/lib/stores/kumohub-config-store.js +24 -0
- package/src/app/lib/stores/project-info-config-store.js +26 -0
- package/src/app/lib/stores/settings-cloud-store.js +117 -0
- package/src/app/lib/stores/settings-cloud-store.spec.js +26 -0
- package/src/app/lib/stores/settings-network-store.js +119 -0
- package/src/app/lib/stores/settings-network-store.spec.js +27 -0
- package/src/app/lib/stores/store.js +97 -0
- package/src/app/lib/stores/test-config-store.js +26 -0
- package/src/app/lib/stores/user-preference-store.js +44 -0
- package/src/app/lib/utils/editor.js +98 -0
- package/src/app/lib/utils/fix-path.js +15 -0
- package/src/app/main-process/favicon.ico +0 -0
- package/src/app/main-process/main-window.js +209 -0
- package/src/app/main-process/menu.js +219 -0
- package/src/app/main-process/modal-home.js +118 -0
- package/src/app/main-process/modal-newproject.js +119 -0
- package/src/app/main-process/modal-nodelibrary.js +90 -0
- package/src/app/main-process/modal-welcome.js +114 -0
- package/src/app/main-process/runtime-manager.js +141 -0
- package/src/app/main.js +590 -0
- package/src/app/preload.js +633 -0
- package/src/app/ui/editor-api/lib/admin/context.js +42 -0
- package/src/app/ui/editor-api/lib/admin/flow.js +55 -0
- package/src/app/ui/editor-api/lib/admin/flows.js +53 -0
- package/src/app/ui/editor-api/lib/admin/index.js +155 -0
- package/src/app/ui/editor-api/lib/admin/nodes.js +164 -0
- package/src/app/ui/editor-api/lib/auth/clients.js +17 -0
- package/src/app/ui/editor-api/lib/auth/index.js +267 -0
- package/src/app/ui/editor-api/lib/auth/permissions.js +51 -0
- package/src/app/ui/editor-api/lib/auth/strategies.js +144 -0
- package/src/app/ui/editor-api/lib/auth/tokens.js +138 -0
- package/src/app/ui/editor-api/lib/auth/users.js +122 -0
- package/src/app/ui/editor-api/lib/editor/comms.js +247 -0
- package/src/app/ui/editor-api/lib/editor/credentials.js +22 -0
- package/src/app/ui/editor-api/lib/editor/index.js +234 -0
- package/src/app/ui/editor-api/lib/editor/library.js +69 -0
- package/src/app/ui/editor-api/lib/editor/locales.js +37 -0
- package/src/app/ui/editor-api/lib/editor/projects.js +497 -0
- package/src/app/ui/editor-api/lib/editor/settings.js +118 -0
- package/src/app/ui/editor-api/lib/editor/sshkeys.js +87 -0
- package/src/app/ui/editor-api/lib/editor/theme.js +184 -0
- package/src/app/ui/editor-api/lib/editor/ui.js +149 -0
- package/src/app/ui/editor-api/lib/index.js +149 -0
- package/src/app/ui/editor-api/lib/runner/index.js +81 -0
- package/src/app/ui/editor-api/lib/util.js +51 -0
- package/src/app/ui/editor-client/README.md +10 -0
- package/src/app/ui/editor-client/constants.js +5 -0
- package/src/app/ui/editor-client/index.js +3 -0
- package/src/app/ui/editor-client/public/favicon.ico +0 -0
- package/src/app/ui/editor-client/public/red/images/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/public/red/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/public/red/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/public/red/images/grip.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/public/red/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/public/red/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/public/red/images/node-red-icon-black.svg +9 -0
- package/src/app/ui/editor-client/public/red/images/node-red-icon.svg +33 -0
- package/src/app/ui/editor-client/public/red/images/node-red.png +0 -0
- package/src/app/ui/editor-client/public/red/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/public/red/images/spin.svg +41 -0
- package/src/app/ui/editor-client/public/red/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/public/red/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/public/red/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/public/red/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/public/red/keymap.json +54 -0
- package/src/app/ui/editor-client/public/red/main-modals.js +14 -0
- package/src/app/ui/editor-client/public/red/main-modals.min.js +16 -0
- package/src/app/ui/editor-client/public/red/main.js +10 -0
- package/src/app/ui/editor-client/public/red/main.min.js +16 -0
- package/src/app/ui/editor-client/public/red/red.js +44903 -0
- package/src/app/ui/editor-client/public/red/red.min.js +16 -0
- package/src/app/ui/editor-client/public/red/style.min.css +24 -0
- package/src/app/ui/editor-client/public/vendor/ace/LICENSE +24 -0
- package/src/app/ui/editor-client/public/vendor/ace/ace.js +17 -0
- package/src/app/ui/editor-client/public/vendor/ace/ext-language_tools.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/ext-searchbox.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-css.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-handlebars.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-html.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-javascript.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-json.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-jsonata.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-markdown.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-properties.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-python.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-sql.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-swift.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-text.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-xml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/mode-yaml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/css.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/handlebars.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/html.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/javascript.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/json.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/jsonata.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/markdown.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/properties.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/python.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/sql.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/swift.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/text.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/xml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/snippets/yaml.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/theme-chrome.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/theme-tomorrow.js +8 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-css.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-html.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-javascript.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-json.js +1 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-jsonata.js +2140 -0
- package/src/app/ui/editor-client/public/vendor/ace/worker-xml.js +1 -0
- package/src/app/ui/editor-client/public/vendor/beautifyjs/beautify.min.js +1 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/css/bootstrap.min.css +9 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/public/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/active-line.js +72 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-hint.js +157 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/javascript-lint.js +63 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/jshint.js +29591 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.css +73 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/lint.js +252 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.css +36 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/show-hint.js +460 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/addon/sql-hint.js +304 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.css +350 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/lib/codemirror.js +9800 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/javascript.js +927 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/mode/sql.js +494 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/base16-dark.css +38 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/monokai.css +42 -0
- package/src/app/ui/editor-client/public/vendor/code-mirror/theme/solarized.css +168 -0
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.css +43 -0
- package/src/app/ui/editor-client/public/vendor/d3-context-menu/d3-context-menu.js +87 -0
- package/src/app/ui/editor-client/public/vendor/easy-json-schema/index.js +88 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.svg +2105 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/public/vendor/icofont/icofont.min.css +7 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/public/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
- package/src/app/ui/editor-client/public/vendor/jsonata/jsonata.min.js +183 -0
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.css +181 -0
- package/src/app/ui/editor-client/public/vendor/misc/toggleswitch.js +48 -0
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.css +7 -0
- package/src/app/ui/editor-client/public/vendor/simplemde/simplemde.min.js +15 -0
- package/src/app/ui/editor-client/public/vendor/vendor.css +0 -0
- package/src/app/ui/editor-client/public/vendor/vendor.js +125 -0
- package/src/app/ui/editor-client/public/vendor/xterm/lib/xterm.js +2 -0
- package/src/app/ui/editor-client/src/ace/README.md +50 -0
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript.js +35 -0
- package/src/app/ui/editor-client/src/ace/mode/nrjavascript_worker.js +189 -0
- package/src/app/ui/editor-client/src/favicon.ico +0 -0
- package/src/app/ui/editor-client/src/images/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-full.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/continue-outline.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/pause.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/restart.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stepover.png +0 -0
- package/src/app/ui/editor-client/src/images/debugger/stop.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-flows.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-full.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes-o.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-nodes.png +0 -0
- package/src/app/ui/editor-client/src/images/deploy-reload.png +0 -0
- package/src/app/ui/editor-client/src/images/grip.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/arrow-in.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/bolt.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-changed.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-error.png +0 -0
- package/src/app/ui/editor-client/src/images/icons/node-play.png +0 -0
- package/src/app/ui/editor-client/src/images/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-256.png +0 -0
- package/src/app/ui/editor-client/src/images/node-red-icon-black.svg +9 -0
- package/src/app/ui/editor-client/src/images/node-red-icon.svg +33 -0
- package/src/app/ui/editor-client/src/images/node-red.png +0 -0
- package/src/app/ui/editor-client/src/images/pw_maze_white.png +0 -0
- package/src/app/ui/editor-client/src/images/spin.svg +41 -0
- package/src/app/ui/editor-client/src/images/spinner.gif +0 -0
- package/src/app/ui/editor-client/src/images/subflow_tab.png +0 -0
- package/src/app/ui/editor-client/src/images/test-icon.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/09.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/az.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bin.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/bool.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/env.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/expr.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/json.png +0 -0
- package/src/app/ui/editor-client/src/images/typedInput/re.png +0 -0
- package/src/app/ui/editor-client/src/js/comms.js +174 -0
- package/src/app/ui/editor-client/src/js/events.js +39 -0
- package/src/app/ui/editor-client/src/js/font-awesome.js +818 -0
- package/src/app/ui/editor-client/src/js/history.js +337 -0
- package/src/app/ui/editor-client/src/js/i18n.js +81 -0
- package/src/app/ui/editor-client/src/js/jquery-addons.js +21 -0
- package/src/app/ui/editor-client/src/js/keymap.json +54 -0
- package/src/app/ui/editor-client/src/js/main-modals.js +14 -0
- package/src/app/ui/editor-client/src/js/main.js +10 -0
- package/src/app/ui/editor-client/src/js/modals/modal-home.js +162 -0
- package/src/app/ui/editor-client/src/js/modals/modal-new-project.js +86 -0
- package/src/app/ui/editor-client/src/js/modals/modal-node-library.js +255 -0
- package/src/app/ui/editor-client/src/js/modals/modal-welcome.js +102 -0
- package/src/app/ui/editor-client/src/js/nodes.js +1736 -0
- package/src/app/ui/editor-client/src/js/red.js +704 -0
- package/src/app/ui/editor-client/src/js/settings.js +275 -0
- package/src/app/ui/editor-client/src/js/text/bidi.js +116 -0
- package/src/app/ui/editor-client/src/js/text/format.js +1316 -0
- package/src/app/ui/editor-client/src/js/ui/actions.js +39 -0
- package/src/app/ui/editor-client/src/js/ui/clipboard.js +510 -0
- package/src/app/ui/editor-client/src/js/ui/common/checkboxSet.js +117 -0
- package/src/app/ui/editor-client/src/js/ui/common/editableList.js +322 -0
- package/src/app/ui/editor-client/src/js/ui/common/menu.js +277 -0
- package/src/app/ui/editor-client/src/js/ui/common/panels.js +104 -0
- package/src/app/ui/editor-client/src/js/ui/common/popover.js +268 -0
- package/src/app/ui/editor-client/src/js/ui/common/searchBox.js +98 -0
- package/src/app/ui/editor-client/src/js/ui/common/stack.js +184 -0
- package/src/app/ui/editor-client/src/js/ui/common/tabs.js +730 -0
- package/src/app/ui/editor-client/src/js/ui/common/treeList.js +170 -0
- package/src/app/ui/editor-client/src/js/ui/common/typedInput.js +819 -0
- package/src/app/ui/editor-client/src/js/ui/common/typedInputLong.js +829 -0
- package/src/app/ui/editor-client/src/js/ui/deploy.js +422 -0
- package/src/app/ui/editor-client/src/js/ui/diff.js +2225 -0
- package/src/app/ui/editor-client/src/js/ui/editor.js +3020 -0
- package/src/app/ui/editor-client/src/js/ui/editors/buffer.js +195 -0
- package/src/app/ui/editor-client/src/js/ui/editors/expression.js +627 -0
- package/src/app/ui/editor-client/src/js/ui/editors/js.js +89 -0
- package/src/app/ui/editor-client/src/js/ui/editors/json.js +107 -0
- package/src/app/ui/editor-client/src/js/ui/editors/markdown.js +267 -0
- package/src/app/ui/editor-client/src/js/ui/editors/string.js +75 -0
- package/src/app/ui/editor-client/src/js/ui/event-log.js +107 -0
- package/src/app/ui/editor-client/src/js/ui/header.js +372 -0
- package/src/app/ui/editor-client/src/js/ui/keyboard.js +565 -0
- package/src/app/ui/editor-client/src/js/ui/library.js +570 -0
- package/src/app/ui/editor-client/src/js/ui/logviewer.js +116 -0
- package/src/app/ui/editor-client/src/js/ui/notifications.js +282 -0
- package/src/app/ui/editor-client/src/js/ui/palette-editor.js +1061 -0
- package/src/app/ui/editor-client/src/js/ui/palette.js +788 -0
- package/src/app/ui/editor-client/src/js/ui/project-info.js +232 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projectSettings.js +1651 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projectUserSettings.js +404 -0
- package/src/app/ui/editor-client/src/js/ui/projects/projects.js +2395 -0
- package/src/app/ui/editor-client/src/js/ui/projects/tab-versionControl.js +1383 -0
- package/src/app/ui/editor-client/src/js/ui/search.js +366 -0
- package/src/app/ui/editor-client/src/js/ui/sidebar.js +409 -0
- package/src/app/ui/editor-client/src/js/ui/state.js +14 -0
- package/src/app/ui/editor-client/src/js/ui/subflow.js +748 -0
- package/src/app/ui/editor-client/src/js/ui/tab-awsDeploy.js +1427 -0
- package/src/app/ui/editor-client/src/js/ui/tab-azure.js +852 -0
- package/src/app/ui/editor-client/src/js/ui/tab-config.js +452 -0
- package/src/app/ui/editor-client/src/js/ui/tab-context.js +406 -0
- package/src/app/ui/editor-client/src/js/ui/tab-info.js +661 -0
- package/src/app/ui/editor-client/src/js/ui/tab-kumohub.js +800 -0
- package/src/app/ui/editor-client/src/js/ui/tab-nodeInfo.js +60 -0
- package/src/app/ui/editor-client/src/js/ui/tab-test.js +915 -0
- package/src/app/ui/editor-client/src/js/ui/terminal.js +240 -0
- package/src/app/ui/editor-client/src/js/ui/touch/radialMenu.js +170 -0
- package/src/app/ui/editor-client/src/js/ui/tray.js +411 -0
- package/src/app/ui/editor-client/src/js/ui/typeSearch.js +411 -0
- package/src/app/ui/editor-client/src/js/ui/ui-settings.js +422 -0
- package/src/app/ui/editor-client/src/js/ui/update-panel.js +84 -0
- package/src/app/ui/editor-client/src/js/ui/userSettings.js +673 -0
- package/src/app/ui/editor-client/src/js/ui/utils.js +1287 -0
- package/src/app/ui/editor-client/src/js/ui/view-navigator.js +169 -0
- package/src/app/ui/editor-client/src/js/ui/view-tools.js +123 -0
- package/src/app/ui/editor-client/src/js/ui/view.js +5333 -0
- package/src/app/ui/editor-client/src/js/ui/workspaces.js +498 -0
- package/src/app/ui/editor-client/src/js/user.js +282 -0
- package/src/app/ui/editor-client/src/js/validators.js +54 -0
- package/src/app/ui/editor-client/src/kumologica-app.png +0 -0
- package/src/app/ui/editor-client/src/sass/ace.scss +29 -0
- package/src/app/ui/editor-client/src/sass/bootstrap.scss +21 -0
- package/src/app/ui/editor-client/src/sass/colors.scss +76 -0
- package/src/app/ui/editor-client/src/sass/debug.scss +383 -0
- package/src/app/ui/editor-client/src/sass/diff.scss +695 -0
- package/src/app/ui/editor-client/src/sass/dragdrop.scss +37 -0
- package/src/app/ui/editor-client/src/sass/dropdownMenu.scss +93 -0
- package/src/app/ui/editor-client/src/sass/editor.scss +683 -0
- package/src/app/ui/editor-client/src/sass/flow.scss +330 -0
- package/src/app/ui/editor-client/src/sass/forms.scss +1093 -0
- package/src/app/ui/editor-client/src/sass/header.scss +502 -0
- package/src/app/ui/editor-client/src/sass/jquery.scss +152 -0
- package/src/app/ui/editor-client/src/sass/keyboard.scss +136 -0
- package/src/app/ui/editor-client/src/sass/library.scss +54 -0
- package/src/app/ui/editor-client/src/sass/mixins.scss +283 -0
- package/src/app/ui/editor-client/src/sass/modals/modalHome.scss +138 -0
- package/src/app/ui/editor-client/src/sass/modals/modalNewProject.scss +96 -0
- package/src/app/ui/editor-client/src/sass/modals/modalNodeLibrary.scss +131 -0
- package/src/app/ui/editor-client/src/sass/modals/modalWelcome.scss +102 -0
- package/src/app/ui/editor-client/src/sass/notifications.scss +118 -0
- package/src/app/ui/editor-client/src/sass/palette-editor.scss +275 -0
- package/src/app/ui/editor-client/src/sass/palette.scss +279 -0
- package/src/app/ui/editor-client/src/sass/panels.scss +61 -0
- package/src/app/ui/editor-client/src/sass/popover.scss +166 -0
- package/src/app/ui/editor-client/src/sass/project-info.scss +74 -0
- package/src/app/ui/editor-client/src/sass/projects.scss +875 -0
- package/src/app/ui/editor-client/src/sass/search.scss +201 -0
- package/src/app/ui/editor-client/src/sass/sidebar.scss +201 -0
- package/src/app/ui/editor-client/src/sass/style.scss +170 -0
- package/src/app/ui/editor-client/src/sass/tab-azure.scss +68 -0
- package/src/app/ui/editor-client/src/sass/tab-cloud.scss +67 -0
- package/src/app/ui/editor-client/src/sass/tab-config.scss +100 -0
- package/src/app/ui/editor-client/src/sass/tab-context.scss +54 -0
- package/src/app/ui/editor-client/src/sass/tab-info.scss +307 -0
- package/src/app/ui/editor-client/src/sass/tab-kumohub.scss +68 -0
- package/src/app/ui/editor-client/src/sass/tab-test.scss +257 -0
- package/src/app/ui/editor-client/src/sass/tabs.scss +395 -0
- package/src/app/ui/editor-client/src/sass/terminal.scss +246 -0
- package/src/app/ui/editor-client/src/sass/ui/common/checkboxSet.scss +29 -0
- package/src/app/ui/editor-client/src/sass/ui/common/editableList.scss +81 -0
- package/src/app/ui/editor-client/src/sass/ui/common/nodeList.scss +65 -0
- package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +77 -0
- package/src/app/ui/editor-client/src/sass/ui/common/stack.scss +26 -0
- package/src/app/ui/editor-client/src/sass/ui/common/treeList.scss +108 -0
- package/src/app/ui/editor-client/src/sass/ui/common/typedInput.scss +181 -0
- package/src/app/ui/editor-client/src/sass/ui/common/typedInputLong.scss +183 -0
- package/src/app/ui/editor-client/src/sass/ui-settings.scss +119 -0
- package/src/app/ui/editor-client/src/sass/update-panel.scss +18 -0
- package/src/app/ui/editor-client/src/sass/userSettings.scss +93 -0
- package/src/app/ui/editor-client/src/sass/widgetStyle.scss +23 -0
- package/src/app/ui/editor-client/src/sass/workspace.scss +123 -0
- package/src/app/ui/editor-client/src/sass/workspaceToolbar.scss +85 -0
- package/src/app/ui/editor-client/src/vendor/ace/LICENSE +24 -0
- package/src/app/ui/editor-client/src/vendor/ace/ace.js +17 -0
- package/src/app/ui/editor-client/src/vendor/ace/ext-language_tools.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/ext-searchbox.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-css.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-handlebars.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-html.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-javascript.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-json.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-markdown.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-properties.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-python.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-sql.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-swift.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-text.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-xml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/mode-yaml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/css.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/handlebars.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/html.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/javascript.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/json.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/markdown.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/properties.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/python.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/sql.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/swift.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/text.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/xml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/snippets/yaml.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/theme-chrome.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/theme-tomorrow.js +8 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-css.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-html.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-javascript.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-json.js +1 -0
- package/src/app/ui/editor-client/src/vendor/ace/worker-xml.js +1 -0
- package/src/app/ui/editor-client/src/vendor/beautifyjs/beautify.min.js +1 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.css +5406 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/css/bootstrap.min.css +9 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/src/app/ui/editor-client/src/vendor/bootstrap/js/bootstrap.min.js +6 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/active-line.js +72 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/coffeescript-lint.js +47 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-hint.js +157 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/javascript-lint.js +63 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/jshint.js +29591 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.css +73 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/lint.js +252 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.css +36 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/show-hint.js +460 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/addon/sql-hint.js +304 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.css +350 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/lib/codemirror.js +9800 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/javascript.js +927 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/mode/sql.js +494 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/base16-dark.css +38 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/monokai.css +42 -0
- package/src/app/ui/editor-client/src/vendor/code-mirror/theme/solarized.css +168 -0
- package/src/app/ui/editor-client/src/vendor/d3/d3.v3.min.js +4 -0
- package/src/app/ui/editor-client/src/vendor/d3/d3.v4.min.js +2 -0
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.css +43 -0
- package/src/app/ui/editor-client/src/vendor/d3-context-menu/d3-context-menu.js +87 -0
- package/src/app/ui/editor-client/src/vendor/easy-json-schema/index.js +88 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.svg +2671 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/i18next/i18next.min.js +5 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.eot +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.svg +2105 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.ttf +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/fonts/icofont.woff2 +0 -0
- package/src/app/ui/editor-client/src/vendor/icofont/icofont.min.css +7 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/animated-overlay.gif +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- package/src/app/ui/editor-client/src/vendor/jquery/css/smoothness/jquery-ui-1.10.3.custom.min.css +5 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-1.11.3.min.js +5 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js +7 -0
- package/src/app/ui/editor-client/src/vendor/jquery/js/jquery.ui.touch-punch.min.js +11 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/formatter.js +183 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/mode-jsonata.js +134 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/snippets-jsonata.js +11 -0
- package/src/app/ui/editor-client/src/vendor/jsonata/worker-jsonata.js +2140 -0
- package/src/app/ui/editor-client/src/vendor/marked/marked.min.js +6 -0
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.css +181 -0
- package/src/app/ui/editor-client/src/vendor/misc/toggleswitch.js +48 -0
- package/src/app/ui/editor-client/templates/index.mst +314 -0
- package/src/app/ui/editor-client/templates/modals/modalHome.mst +107 -0
- package/src/app/ui/editor-client/templates/modals/modalNewProject.mst +104 -0
- package/src/app/ui/editor-client/templates/modals/modalNodeLibrary.mst +72 -0
- package/src/app/ui/editor-client/templates/modals/modalWelcome.mst +111 -0
- package/src/assets/eula.txt +170 -0
- package/src/assets/icon.icns +0 -0
- package/src/assets/kumologica-app.png +0 -0
- package/src/assets/license_en.txt +170 -0
|
@@ -0,0 +1,915 @@
|
|
|
1
|
+
RED.sidebar.test = (function() {
|
|
2
|
+
let editors = {};
|
|
3
|
+
|
|
4
|
+
// html anchors
|
|
5
|
+
let tabContent;
|
|
6
|
+
let sections;
|
|
7
|
+
let testCaseSection;
|
|
8
|
+
let stackContainer;
|
|
9
|
+
let testNodes;
|
|
10
|
+
let triggeredTest; // Flag to indicate when launch a test. As we dont want to launch test for every deployment
|
|
11
|
+
|
|
12
|
+
// control variables
|
|
13
|
+
let testCaseIdSelected; // nodeID | __runall | undefined
|
|
14
|
+
const RUN_ALL_TEST_CASES = '__runAll';
|
|
15
|
+
|
|
16
|
+
// properties section state
|
|
17
|
+
let propertiesOpened = false;
|
|
18
|
+
|
|
19
|
+
// references
|
|
20
|
+
let ipcRenderer = window.__kumologica.electron.ipcRenderer;
|
|
21
|
+
|
|
22
|
+
function updateTestCaseInit(event, msg) {
|
|
23
|
+
let { testCaseID, testCaseDescription } = msg.payload.testCase;
|
|
24
|
+
|
|
25
|
+
// sanitize the testCaseId, i.e. removing dots as jquery selector does not like it
|
|
26
|
+
let testCaseId = testCaseID.replace(/\./g, '_');
|
|
27
|
+
|
|
28
|
+
testCaseSection = sections.add({
|
|
29
|
+
title: testCaseDescription,
|
|
30
|
+
collapsible: true,
|
|
31
|
+
titleId: `section-${testCaseId}`
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
let wrapperTestCaseResults = $(`<div style="margin-top: 6px"></div>`);
|
|
35
|
+
wrapperTestCaseResults.appendTo(testCaseSection.content);
|
|
36
|
+
|
|
37
|
+
// Attach the tabs part selector for the testcase
|
|
38
|
+
let testcaseTabs = $(
|
|
39
|
+
`<div class="testcase-info-selector button-group"></div>`
|
|
40
|
+
);
|
|
41
|
+
testcaseTabs.appendTo(wrapperTestCaseResults);
|
|
42
|
+
|
|
43
|
+
// Response tab
|
|
44
|
+
$(
|
|
45
|
+
`<button id=testcase-tab-response-${testCaseId} href="#" class="editor-button-small testcase-tab selected">Response</button>`
|
|
46
|
+
)
|
|
47
|
+
.click((e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
selectTestcaseTab('response', testCaseId);
|
|
50
|
+
})
|
|
51
|
+
.appendTo(testcaseTabs);
|
|
52
|
+
|
|
53
|
+
// Assertion tab
|
|
54
|
+
$(
|
|
55
|
+
`<button id=testcase-tab-assertion-${testCaseId} href="#" class="editor-button-small testcase-tab" style="margin-right: -2px">Assertions</button>`
|
|
56
|
+
)
|
|
57
|
+
.click((e) => {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
selectTestcaseTab('assertion', testCaseId);
|
|
60
|
+
})
|
|
61
|
+
.appendTo(testcaseTabs);
|
|
62
|
+
|
|
63
|
+
// Traces tab
|
|
64
|
+
$(
|
|
65
|
+
`<button id=testcase-tab-traces-${testCaseId} href="#" class="editor-button-small testcase-tab">Traces</button>`
|
|
66
|
+
)
|
|
67
|
+
.click((e) => {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
// Go to main workspace when debug message is hovered
|
|
70
|
+
// $('#view-main-flow').click();
|
|
71
|
+
selectTestcaseTab('traces', testCaseId);
|
|
72
|
+
})
|
|
73
|
+
.appendTo(testcaseTabs);
|
|
74
|
+
|
|
75
|
+
// This is the dropzone for content that will be selected in the tabs
|
|
76
|
+
$(`<div class="testcase-info-container">
|
|
77
|
+
<div id="testcase-info-response-${testCaseId}" class="testcase-info selected">
|
|
78
|
+
<div style="display: flex; justify-content: flex-end; margin-right: 10px"><span class="testcase-resp-status">Status: </span><span id="testcase-status-${testCaseId}" style="font-size: 12px; color:#2979ff; margin-right: 4px"></span></div>
|
|
79
|
+
<div id="testcase-info-response-header">
|
|
80
|
+
<div id="testcase-info-response-bodyheaders">
|
|
81
|
+
<span id="tab-body-selected-${testCaseId}" class="tab-label-bh tab-separation selected">Body</span>
|
|
82
|
+
<span id="tab-headers-selected-${testCaseId}" class="tab-label-bh tab-separation">Headers</span>
|
|
83
|
+
</div>
|
|
84
|
+
<div id="testcase-info-response-bodyformat-container-${testCaseId}" class="testcase-info-response-bodyformat-container">
|
|
85
|
+
<select id="testcase-info-response-bodyformat-${testCaseId}" class="testcase-info-response-bodyformat">
|
|
86
|
+
<option value="text" selected="selected">Text</option>
|
|
87
|
+
<option value="json">JSON</option>
|
|
88
|
+
<option value="xml">XML</option>
|
|
89
|
+
<option value="html">HTML</option>
|
|
90
|
+
</select>
|
|
91
|
+
</div>
|
|
92
|
+
<div id="testcase-info-wrap-container-${testCaseId}" class="testcase-info-wrap-container">
|
|
93
|
+
<a id="testcase-wrap-btn-${testCaseId}" class="testcase-wrap-btn-clazz" href="#">
|
|
94
|
+
<i class="fa fa-paragraph"></i>
|
|
95
|
+
</a>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div id="testcase-info-copypaste-container-${testCaseId}" class="testcase-info-copypaste-container">
|
|
99
|
+
<a id="testcase-copypaste-btn-${testCaseId}" class="testcase-wrap-btn-clazz" href="#">
|
|
100
|
+
<i class="fa fa-copy"></i>
|
|
101
|
+
</a>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div id="testcase-resp-body-${testCaseId}" class="tab-content-bh selected selectable" style="height: 45vh"></div>
|
|
106
|
+
<div id="testcase-resp-headers-${testCaseId}" class="tab-content-bh selectable"></div>
|
|
107
|
+
</div>
|
|
108
|
+
<div id="testcase-info-assertion-${testCaseId}" class="testcase-info"></div>
|
|
109
|
+
<div id="testcase-info-traces-${testCaseId}" class="testcase-info testcase-info-traces"></div>
|
|
110
|
+
</div>`).appendTo(wrapperTestCaseResults);
|
|
111
|
+
|
|
112
|
+
// Put an ref element in place ready to attach debug messages from the nodes ...
|
|
113
|
+
$(`#test-debug-message-cache-${testCaseId}`).appendTo($(`#testcase-info-traces-${testCaseId}`));
|
|
114
|
+
|
|
115
|
+
// attach events to the selection of the tabs
|
|
116
|
+
$(`#tab-body-selected-${testCaseId}`).click(event => {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
changeTabSelection('body', testCaseId);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
$(`#tab-headers-selected-${testCaseId}`).click(event => {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
changeTabSelection('headers', testCaseId);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Create an editor the the response body
|
|
127
|
+
editors[testCaseId] = RED.editor.createEditor({
|
|
128
|
+
id: `testcase-resp-body-${testCaseId}`,
|
|
129
|
+
lineNumbers: true,
|
|
130
|
+
showFoldWidgets: true,
|
|
131
|
+
mode:"ace/mode/text",
|
|
132
|
+
options: {
|
|
133
|
+
wrap: true
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Listen for the editor format to be set
|
|
138
|
+
$(`#testcase-info-response-bodyformat-${testCaseId}`).on('change', function (e) {
|
|
139
|
+
var valueSelected = this.value;
|
|
140
|
+
switch (valueSelected) {
|
|
141
|
+
case 'json':
|
|
142
|
+
editors[testCaseId].getSession().setMode('ace/mode/json');
|
|
143
|
+
break;
|
|
144
|
+
case 'xml':
|
|
145
|
+
editors[testCaseId].getSession().setMode('ace/mode/xml');
|
|
146
|
+
let vxml = editors[testCaseId].getSession().getValue();
|
|
147
|
+
editors[testCaseId].getSession().setValue(formatXml(vxml));
|
|
148
|
+
break;
|
|
149
|
+
case 'html':
|
|
150
|
+
editors[testCaseId].getSession().setMode('ace/mode/html');
|
|
151
|
+
let vhtml = editors[testCaseId].getSession().getValue();
|
|
152
|
+
editors[testCaseId].getSession().setValue(formatXml(vhtml));
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
editors[testCaseId].getSession().setMode('ace/mode/text');
|
|
156
|
+
break
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Listen to wrap mode
|
|
161
|
+
$(`#testcase-wrap-btn-${testCaseId}`).click(e => {
|
|
162
|
+
editors[testCaseId].getSession().setOptions({
|
|
163
|
+
wrap: !editors[testCaseId].getSession().getUseWrapMode()
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
$(`#testcase-info-copypaste-container-${testCaseId}`).click(e=> {
|
|
168
|
+
RED.clipboard.copyText(
|
|
169
|
+
editors[testCaseId].getSession().getValue(),
|
|
170
|
+
$(`#testcase-info-copypaste-container-${testCaseId}`),
|
|
171
|
+
'Response Copied to Clipboard');
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
RED.popover.tooltip($(`#testcase-info-wrap-container-${testCaseId}`), 'Wrap Line');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function formatXml(xml, tab) { // tab = optional indent value, default is tab (\t)
|
|
178
|
+
var formatted = '', indent= '';
|
|
179
|
+
tab = tab || '\t';
|
|
180
|
+
xml.split(/>\s*</).forEach(function(node) {
|
|
181
|
+
if (node.match( /^\/\w/ )) indent = indent.substring(tab.length); // decrease indent by one 'tab'
|
|
182
|
+
formatted += indent + '<' + node + '>\r\n';
|
|
183
|
+
if (node.match( /^<?\w[^>]*[^\/]$/ )) indent += tab; // increase indent
|
|
184
|
+
});
|
|
185
|
+
return formatted.substring(1, formatted.length-3);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function updateTestCaseStart(event, msg) {
|
|
189
|
+
let { testCaseID, targetOutput } = msg.payload.testCaseResults;
|
|
190
|
+
|
|
191
|
+
// sanitize the testCaseId, i.e. removing dots as jquery selector does not like it
|
|
192
|
+
let testCaseId = testCaseID.replace(/\./g, '_')
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
let flowres = targetOutput.response;
|
|
196
|
+
|
|
197
|
+
// Attach the response and the status
|
|
198
|
+
$(`#testcase-status-${testCaseId}`).text(`${flowres.statusCode} ${flowres.statusMessage}`);
|
|
199
|
+
//$(`#testcase-resp-body-${testCaseId}`).text(convertBodyToString(flowres.body));
|
|
200
|
+
editors[testCaseId].getSession().setValue(convertBodyToString(flowres.body));
|
|
201
|
+
editors[testCaseId].resize();
|
|
202
|
+
// attach the response headers
|
|
203
|
+
attachHeaders(flowres.headers, testCaseId);
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function convertBodyToString(body){
|
|
208
|
+
let typeBody = typeof body;
|
|
209
|
+
|
|
210
|
+
if (typeBody === 'object'){
|
|
211
|
+
return JSON.stringify(body, null, 2);
|
|
212
|
+
}else if (typeBody === 'string') {
|
|
213
|
+
//return body.replace(/['"]+/g, '');;
|
|
214
|
+
return body;
|
|
215
|
+
} else {
|
|
216
|
+
return ""
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function attachHeaders(headers, testCaseId){
|
|
222
|
+
let headersContainerEl = $(`#testcase-resp-headers-${testCaseId}`);
|
|
223
|
+
for (let header in headers) {
|
|
224
|
+
$(`
|
|
225
|
+
<div>
|
|
226
|
+
<span class="testcase-resp-header" style="color: #757575; font-weight: 500">
|
|
227
|
+
${header} <i class="fa fa-long-arrow-right" style="color: #757575;"></i>
|
|
228
|
+
</span>
|
|
229
|
+
<span style="color: #757575;">
|
|
230
|
+
${headers[header]}
|
|
231
|
+
</span>
|
|
232
|
+
</div>`).appendTo(headersContainerEl)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function changeTabSelection(key, testCaseId){
|
|
237
|
+
// if headers selected, then disable the output format and wrap line option
|
|
238
|
+
if (key === 'headers') {
|
|
239
|
+
$(`#testcase-info-response-bodyformat-container-${testCaseId}`).hide();
|
|
240
|
+
$(`#testcase-info-wrap-container-${testCaseId}`).hide();
|
|
241
|
+
$(`#testcase-info-copypaste-container-${testCaseId}`).hide();
|
|
242
|
+
} else {
|
|
243
|
+
$(`#testcase-info-response-bodyformat-container-${testCaseId}`).show();
|
|
244
|
+
$(`#testcase-info-wrap-container-${testCaseId}`).show();
|
|
245
|
+
$(`#testcase-info-copypaste-container-${testCaseId}`).show();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
// Reset selectors
|
|
250
|
+
$(`#tab-body-selected-${testCaseId}`).removeClass('selected');
|
|
251
|
+
$(`#tab-headers-selected-${testCaseId}`).removeClass('selected');
|
|
252
|
+
|
|
253
|
+
// Reset containers
|
|
254
|
+
$(`#testcase-resp-body-${testCaseId}`).removeClass('selected');
|
|
255
|
+
$(`#testcase-resp-headers-${testCaseId}`).removeClass('selected');
|
|
256
|
+
|
|
257
|
+
// Mark it as selected
|
|
258
|
+
$(`#tab-${key}-selected-${testCaseId}`).addClass('selected');
|
|
259
|
+
$(`#testcase-resp-${key}-${testCaseId}`).addClass('selected');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function selectTestcaseTab(key, testCaseID){
|
|
263
|
+
// Reset the tabs
|
|
264
|
+
$(`#testcase-tab-assertion-${testCaseID}`).removeClass('selected');
|
|
265
|
+
$(`#testcase-tab-response-${testCaseID}`).removeClass('selected');
|
|
266
|
+
$(`#testcase-tab-traces-${testCaseID}`).removeClass('selected');
|
|
267
|
+
|
|
268
|
+
// Reset the content
|
|
269
|
+
$(`#testcase-info-assertion-${testCaseID}`).removeClass('selected');
|
|
270
|
+
$(`#testcase-info-response-${testCaseID}`).removeClass('selected');
|
|
271
|
+
$(`#testcase-info-traces-${testCaseID}`).removeClass('selected');
|
|
272
|
+
|
|
273
|
+
// Add the selection
|
|
274
|
+
$(`#testcase-tab-${key}-${testCaseID}`).addClass('selected');
|
|
275
|
+
$(`#testcase-info-${key}-${testCaseID}`).addClass('selected');
|
|
276
|
+
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function updateTestCaseEnd(event, msg) {
|
|
280
|
+
hideDebuggerControls();
|
|
281
|
+
let { testCaseID, assertionResults } = msg.payload.testCaseResults;
|
|
282
|
+
// sanitize the testCaseId, i.e. removing dots as jquery selector does not like it
|
|
283
|
+
let testCaseId = testCaseID.replace(/\./g, '_')
|
|
284
|
+
let status = 'passed';
|
|
285
|
+
|
|
286
|
+
// Check whether the testcase is failed or not ...
|
|
287
|
+
for (let i=0; i < assertionResults.length; i++){
|
|
288
|
+
if (assertionResults[i].status === 'failed') {
|
|
289
|
+
status = 'failed';
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Find the testcase section
|
|
294
|
+
if (status === 'failed'){
|
|
295
|
+
$(`#section-${testCaseId}`).parent().parent().addClass('failed');
|
|
296
|
+
} else {
|
|
297
|
+
$(`#section-${testCaseId}`).parent().parent().addClass('passed');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function updateTestCaseAssertion(event, msg) {
|
|
302
|
+
const { testCaseID, description, status, diffReported } = msg.payload;
|
|
303
|
+
// sanitize the testCaseId, i.e. removing dots as jquery selector does not like it
|
|
304
|
+
let testCaseId = testCaseID.replace(/\./g, '_')
|
|
305
|
+
|
|
306
|
+
let assertionSectionHtml
|
|
307
|
+
if (status === 'failed'){
|
|
308
|
+
assertionSectionHtml = `
|
|
309
|
+
<div class="assertion assertion-failed" style="display: flex; flex-direction: column;">
|
|
310
|
+
<div style="display:flex; align-items: center;">
|
|
311
|
+
<i class="fa fa-times" style="color:red"></i>
|
|
312
|
+
<span style="padding-left: 5px">${description}</span><br/>
|
|
313
|
+
</div>
|
|
314
|
+
<div style="font-size: 10px; padding-left: 17px; margin-top:-3px">${diffReported}</div>
|
|
315
|
+
</div>
|
|
316
|
+
`;
|
|
317
|
+
} else {
|
|
318
|
+
assertionSectionHtml = `
|
|
319
|
+
<div class="assertion assertion-passed">
|
|
320
|
+
<i class="fa fa-check" style="color:green"></i>
|
|
321
|
+
<span>${description}</span>
|
|
322
|
+
</div>
|
|
323
|
+
`;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
let testCaseAssertionsContainer = $(`#testcase-info-assertion-${testCaseId}`)
|
|
327
|
+
|
|
328
|
+
$(assertionSectionHtml).appendTo(testCaseAssertionsContainer);
|
|
329
|
+
testCaseSection.container.show();
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function onsame(){
|
|
333
|
+
RED.actions.invoke('core:hide-sidebar');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Refresh the test tab
|
|
337
|
+
// silently - if true, we will update the nodes if required, but do not show the sidebar. Used primarily for the save button
|
|
338
|
+
function refreshTab(silently) {
|
|
339
|
+
if (!silently){
|
|
340
|
+
RED.actions.invoke('core:show-sidebar');
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Append to the selector all testcases found in the project
|
|
344
|
+
let $testSidebarTestcases = $('#test-sidebar-testcases');
|
|
345
|
+
|
|
346
|
+
// Searching for all testcases in the test.flow node.
|
|
347
|
+
let testcasenodes = App.nodes.filterNodes({ z: 'test.flow', type: 'TestCase' });
|
|
348
|
+
// Searching for all HTTP testcases in the test.flow node.
|
|
349
|
+
let httptestcasenodes = App.nodes.filterNodes({ z: 'test.flow', type: 'HTTPTestCase' });
|
|
350
|
+
|
|
351
|
+
testNodes = testcasenodes.concat(httptestcasenodes);
|
|
352
|
+
if (testNodes && Array.isArray(testNodes) && testNodes.length > 0) {
|
|
353
|
+
$('#test-sidebar-notestfound-explainer').hide();
|
|
354
|
+
$testSidebarTestcases.empty();
|
|
355
|
+
|
|
356
|
+
testNodes.forEach(tn => {
|
|
357
|
+
$testSidebarTestcases.append(
|
|
358
|
+
`<option value=${tn.id}>${tn.name} (${tn.id})</option>`
|
|
359
|
+
);
|
|
360
|
+
});
|
|
361
|
+
$testSidebarTestcases.append(
|
|
362
|
+
`<option disabled>────────────────────</option>`
|
|
363
|
+
);
|
|
364
|
+
$testSidebarTestcases.append(
|
|
365
|
+
`<option value="${RUN_ALL_TEST_CASES}"> Run all TestCases</option>`
|
|
366
|
+
);
|
|
367
|
+
// Check which option will be selected
|
|
368
|
+
// a) If nothing was selected, select the empty
|
|
369
|
+
if (testCaseIdSelected === undefined || testCaseIdSelected === null) {
|
|
370
|
+
$('#test-sidebar-testcases').val('');
|
|
371
|
+
} else {
|
|
372
|
+
// b) Otherwise select the testcase previously selected
|
|
373
|
+
$(`#test-sidebar-testcases option[value="${testCaseIdSelected}"]`).attr(
|
|
374
|
+
'selected',
|
|
375
|
+
true
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
$testSidebarTestcases.empty();
|
|
380
|
+
$testSidebarTestcases.append(
|
|
381
|
+
`<option disabled>No testcases found</option>`
|
|
382
|
+
);
|
|
383
|
+
// Add image in the sidebar explaining why this space is empty
|
|
384
|
+
$('#test-sidebar-notestfound-explainer').show();
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function init() {
|
|
389
|
+
// Subcribe to runtime events for test
|
|
390
|
+
ipcRenderer.removeAllListeners('test:testcase-init');
|
|
391
|
+
ipcRenderer.removeAllListeners('test:testcase-start');
|
|
392
|
+
ipcRenderer.removeAllListeners('test:testcase-end');
|
|
393
|
+
ipcRenderer.removeAllListeners('test:testcase-start');
|
|
394
|
+
ipcRenderer.removeAllListeners('debugger:stopped');
|
|
395
|
+
|
|
396
|
+
ipcRenderer.on('test:testcase-init', updateTestCaseInit);
|
|
397
|
+
ipcRenderer.on('test:testcase-start', updateTestCaseStart);
|
|
398
|
+
ipcRenderer.on('test:testcase-end', updateTestCaseEnd);
|
|
399
|
+
ipcRenderer.on('test:assertion-report', updateTestCaseAssertion);
|
|
400
|
+
|
|
401
|
+
ipcRenderer.on('debugger:stopped', debuggerStoppedOnBreakpoint);
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
// Prepare the html wrappers
|
|
405
|
+
initHtml();
|
|
406
|
+
|
|
407
|
+
// Attach click event to the "run test" button
|
|
408
|
+
$('#test-sidebar-run-btn').click(triggerExecuteTestSuite);
|
|
409
|
+
|
|
410
|
+
// Attach a click event to the debu button
|
|
411
|
+
$('#test-sidebar-debug-btn').click(triggerDebugTestSuite);
|
|
412
|
+
|
|
413
|
+
// Attach click event to the "clear tests" button
|
|
414
|
+
$('#test-sidebar-clear').click(clearTestSuite)
|
|
415
|
+
|
|
416
|
+
// Attach the change event to the "testcase" select
|
|
417
|
+
$('#test-sidebar-testcases').change(e => {
|
|
418
|
+
testCaseIdSelected = e.target.value;
|
|
419
|
+
saveSettings();
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// Attach debugger events
|
|
423
|
+
$('#test-sidebar-debug-continue').click( async (e)=> {
|
|
424
|
+
await window.__kumologica.debugger.continue()
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
$('#test-sidebar-debug-terminate').click( async (e)=> {
|
|
428
|
+
await window.__kumologica.debugger.terminate();
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
$('#test-sidebar-debug-next').click( async (e)=> {
|
|
432
|
+
await window.__kumologica.debugger.next();
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
$('#test-sidebar-debug-restart').click( async (e)=> {
|
|
437
|
+
await window.__kumologica.debugger.terminate();
|
|
438
|
+
// give 1 sec to clean up the tab
|
|
439
|
+
setTimeout(async()=> {
|
|
440
|
+
await triggerDebugTestSuite();
|
|
441
|
+
}, 500);
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
RED.events.on('deploy:finished', async()=> {
|
|
445
|
+
if (triggeredTest){
|
|
446
|
+
await executeTestSuite();
|
|
447
|
+
triggeredTest = false;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function show() {
|
|
456
|
+
RED.sidebar.show('test');
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function clearTestSuite() {
|
|
460
|
+
$('#test-results-wrapper').empty();
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
async function triggerExecuteTestSuite(opts){
|
|
464
|
+
// Clean up the test results from the secion
|
|
465
|
+
if (sections) {
|
|
466
|
+
sections.removeAll();
|
|
467
|
+
}
|
|
468
|
+
// Enable debug?
|
|
469
|
+
if (opts && opts.debug) {
|
|
470
|
+
await window.__kumologica.debugger.enable();
|
|
471
|
+
} else {
|
|
472
|
+
await window.__kumologica.debugger.disable();
|
|
473
|
+
}
|
|
474
|
+
// The test will be triggered automatically, when the deployment is finished.
|
|
475
|
+
triggeredTest = true;
|
|
476
|
+
RED.deploy.save(); // onDeploy finished --> invoke `executeTestSuite()`;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
async function executeTestSuite() {
|
|
480
|
+
editors = {};
|
|
481
|
+
//Update the testCase selected
|
|
482
|
+
testCaseIdSelected = $(`#test-sidebar-testcases`).children("option:selected").val();
|
|
483
|
+
|
|
484
|
+
// Clean up the previous test results
|
|
485
|
+
$('#test-results-wrapper').empty();
|
|
486
|
+
|
|
487
|
+
// Show the terminal if close
|
|
488
|
+
let terminalOpen = $('#workspace-terminal').is(":visible");
|
|
489
|
+
if (!terminalOpen){
|
|
490
|
+
$('#shelve-middle').click();
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// Clear the cache of debug messages
|
|
494
|
+
$('#test-debug-messages-caches').empty();
|
|
495
|
+
|
|
496
|
+
// Check if traceability is enabled
|
|
497
|
+
let traceabilityEnabled = $('#isTraceabilitySelected').is(':checked');
|
|
498
|
+
|
|
499
|
+
// Run the selected case
|
|
500
|
+
// - check whether there is only one test case to run or we should run all of them
|
|
501
|
+
if (testCaseIdSelected) {
|
|
502
|
+
const environment = getValues().properties;
|
|
503
|
+
|
|
504
|
+
if (RUN_ALL_TEST_CASES === testCaseIdSelected) {
|
|
505
|
+
for (let i=0; i < testNodes.length; i++) {
|
|
506
|
+
createDebugMessageCache(testNodes[i].id);
|
|
507
|
+
try{
|
|
508
|
+
// console.log(`[tab-test] Running testcase: ${testNodes[i].id} ...`, )
|
|
509
|
+
await window.__kumologica.libs.testFlow('{}', testNodes[i].id, environment, traceabilityEnabled);
|
|
510
|
+
}catch(err){
|
|
511
|
+
console.log('[tab-test] error found: ', err);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
} else {
|
|
515
|
+
try {
|
|
516
|
+
createDebugMessageCache(testCaseIdSelected);
|
|
517
|
+
await window.__kumologica.libs.testFlow('{}', testCaseIdSelected, environment, traceabilityEnabled);
|
|
518
|
+
} catch(err) {
|
|
519
|
+
console.log('[tab-test] error found: ', err);
|
|
520
|
+
//App.notify(`Error found: ${JSON.stringify(err)}`, { type: 'error'});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
} else {
|
|
524
|
+
RED.notify('No selected Testcase', { type: 'warning' });
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function createDebugMessageCache(testCaseID){
|
|
529
|
+
let sanitizeTestCaseID = testCaseID.replace(/\./g, '_')
|
|
530
|
+
$(`<div id="test-debug-message-cache-${sanitizeTestCaseID}" style="margin-right: 2px"></div>`).appendTo($('#test-debug-messages-caches'));
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
function initHtml() {
|
|
534
|
+
tabContent = document.createElement('div');
|
|
535
|
+
tabContent.className = 'sidebar-test';
|
|
536
|
+
|
|
537
|
+
RED.actions.add('core:show-test-tab', show);
|
|
538
|
+
|
|
539
|
+
stackContainer = $('<div>', {
|
|
540
|
+
class: 'sidebar-node-info-stack'
|
|
541
|
+
}).appendTo(tabContent);
|
|
542
|
+
|
|
543
|
+
// Append the header
|
|
544
|
+
let headerContentHtml = `
|
|
545
|
+
<div class="sidebar-title-wrapper">
|
|
546
|
+
<span>Tests</span>
|
|
547
|
+
</div>
|
|
548
|
+
<div id="test-sidebar-header" class="sidebar-header">
|
|
549
|
+
<div id="test-info-wrapper" style="display:flex">
|
|
550
|
+
<div id="test-sidebar-header-wrapper-left">
|
|
551
|
+
<select id="test-sidebar-testcases" style="width: 100%; padding: 0px; height: 23px !important;" class="palette-textinput">
|
|
552
|
+
<option disabled>No Testcases Found</option>
|
|
553
|
+
</select>
|
|
554
|
+
</div>
|
|
555
|
+
<div id="test-sidebar-header-wrapper-right">
|
|
556
|
+
<!-- run btn -->
|
|
557
|
+
<a id="test-sidebar-run-btn" class="sidebar-header-button" href="#">
|
|
558
|
+
<i class="fa fa-play"></i>
|
|
559
|
+
Run
|
|
560
|
+
</a>
|
|
561
|
+
|
|
562
|
+
<!-- debug btn -->
|
|
563
|
+
<a id="test-sidebar-debug-btn" class="sidebar-header-button" href="#">
|
|
564
|
+
<i class="fa fa-bug"></i>
|
|
565
|
+
</a>
|
|
566
|
+
|
|
567
|
+
<!-- Environment properties btn -->
|
|
568
|
+
<a id="switchPropertiesBtn" class="sidebar-header-button" href="#">
|
|
569
|
+
<i class="icofont-eye-alt"></i>
|
|
570
|
+
</a>
|
|
571
|
+
|
|
572
|
+
<!-- clear btn -->
|
|
573
|
+
<a id="test-sidebar-clear" class="sidebar-header-button" href="#">
|
|
574
|
+
<i class="fa fa-trash"></i></a>
|
|
575
|
+
</div>
|
|
576
|
+
</div>
|
|
577
|
+
<div id="debugger-wrapper" style="display:none">
|
|
578
|
+
<div id="test-sidebar-debug-continue" class="sidebar-header-button debugger-button" href="#">
|
|
579
|
+
<img src="red/images/debugger/continue-full.png" width="20" height="20" style="filter: invert(55%)">
|
|
580
|
+
<span class="debug-button-label" style="margin-left:2px" >Continue</span>
|
|
581
|
+
</div>
|
|
582
|
+
<div id="test-sidebar-debug-next" class="sidebar-header-button debugger-button" href="#">
|
|
583
|
+
<img src="red/images/debugger/stepover.png" width="20" height="20" style="filter: invert(55%)">
|
|
584
|
+
<span class="debug-button-label">Next</span>
|
|
585
|
+
</div>
|
|
586
|
+
<div id="test-sidebar-debug-restart" class="sidebar-header-button debugger-button" href="#">
|
|
587
|
+
<img src="red/images/debugger/restart.png" width="20" height="20" style="filter: invert(55%)">
|
|
588
|
+
<span class="debug-button-label">Restart</span>
|
|
589
|
+
</div>
|
|
590
|
+
<div id="test-sidebar-debug-terminate" class="sidebar-header-button debugger-button" href="#">
|
|
591
|
+
<img src="red/images/debugger/stop.png" width="20" height="20" style="filter: invert(55%)">
|
|
592
|
+
<span class="debug-button-label">Stop</span>
|
|
593
|
+
</div>
|
|
594
|
+
</div>
|
|
595
|
+
<div id="properties-wrapper">
|
|
596
|
+
<div id="propertiesWrapperHeader" style="display: flex; padding-bottom: 10px;">
|
|
597
|
+
<div id="enableTraceabilityWrapper" style="width: 50%; padding: 5px 0px 5px 5px;">
|
|
598
|
+
<!--
|
|
599
|
+
<input type="checkbox" id="isTraceabilitySelected" style="margin-top:0px"> Enable traceability
|
|
600
|
+
</input>
|
|
601
|
+
-->
|
|
602
|
+
</div>
|
|
603
|
+
</div>
|
|
604
|
+
<div id="propertiesSection" style="display:none">
|
|
605
|
+
<div id="propertiesLabel">Environment Variables</div>
|
|
606
|
+
<div id="table-test-properties">
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
<div id="test-debug-messages-caches" style="display:none">
|
|
611
|
+
</div>
|
|
612
|
+
<div id="test-debug-messages-caches" style="display:none">
|
|
613
|
+
</div>
|
|
614
|
+
</div>
|
|
615
|
+
`;
|
|
616
|
+
|
|
617
|
+
$(headerContentHtml).appendTo(stackContainer);
|
|
618
|
+
|
|
619
|
+
// Append the testResults wrapper
|
|
620
|
+
let testResultsWrapperHtml = `
|
|
621
|
+
|
|
622
|
+
<div id="test-results-wrapper">
|
|
623
|
+
<div id="test-sidebar-notestfound-explainer" style="display:none">
|
|
624
|
+
<div style="display:flex; flex-direction: column; align-items: center; margin-top: 150px">
|
|
625
|
+
<img style="width: 80px" src="red/images/test-icon.png" />
|
|
626
|
+
<div style="font-weight: bold; font-size: 22px; margin-top: 15px;color: grey;">No test found</div>
|
|
627
|
+
<div style="margin-top: 5px; color: grey;">Add a new <b>TestCase</b> node into the <b>Test</b> tab.</div>
|
|
628
|
+
</div>
|
|
629
|
+
</div>
|
|
630
|
+
</div>`;
|
|
631
|
+
|
|
632
|
+
let testResultsWrapper = $(testResultsWrapperHtml).appendTo(stackContainer);
|
|
633
|
+
|
|
634
|
+
sections = RED.stack.create({
|
|
635
|
+
container: testResultsWrapper
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
RED.sidebar.addTab({
|
|
639
|
+
id: 'test',
|
|
640
|
+
label: ' Test',
|
|
641
|
+
name: 'Test Case Runner',
|
|
642
|
+
iconClass: 'fa fa-flask',
|
|
643
|
+
action: 'core:show-test-tab',
|
|
644
|
+
content: tabContent,
|
|
645
|
+
pinned: true,
|
|
646
|
+
enableOnEdit: true,
|
|
647
|
+
onchange: refreshTab,
|
|
648
|
+
onsame: onsame
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
// Attach events
|
|
652
|
+
|
|
653
|
+
// Click event for toggle properties
|
|
654
|
+
$('#switchPropertiesBtn').click(e => {
|
|
655
|
+
toggleProperties();
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// ==> Load initial data to the screen
|
|
659
|
+
// --> test config
|
|
660
|
+
// if config not loaded yet then test-config event handler will load it
|
|
661
|
+
//
|
|
662
|
+
let config = readPropertiesFromConfig();
|
|
663
|
+
attachProperties(config);
|
|
664
|
+
|
|
665
|
+
// Append to the list of properties a fake record to append a new property
|
|
666
|
+
attachAppendPropertyRow();
|
|
667
|
+
// Load the tooltips
|
|
668
|
+
RED.popover.tooltip($('#test-sidebar-header-wrapper-left'), 'Select Test Case to Run');
|
|
669
|
+
RED.popover.tooltip(
|
|
670
|
+
$('#test-sidebar-run-btn'),
|
|
671
|
+
'Run Test Case'
|
|
672
|
+
);
|
|
673
|
+
RED.popover.tooltip(
|
|
674
|
+
$('#test-sidebar-debug-btn'),
|
|
675
|
+
'Debug Test Case'
|
|
676
|
+
);
|
|
677
|
+
RED.popover.tooltip(
|
|
678
|
+
$('#test-sidebar-clear'),
|
|
679
|
+
'Clear Test Case Results'
|
|
680
|
+
);
|
|
681
|
+
RED.popover.tooltip(
|
|
682
|
+
$('#switchPropertiesBtn'),
|
|
683
|
+
'Environment Configuration'
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function readPropertiesFromConfig() {
|
|
688
|
+
if (window.__kumologica.settings.testConfig) {
|
|
689
|
+
return window.__kumologica.settings.testConfig.getTestConfig();
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// event triggered from header.js when test-config.json file has been loaded
|
|
694
|
+
// re-set properties in case they were not loaded during init
|
|
695
|
+
//
|
|
696
|
+
RED.events.on('test-config', function () {
|
|
697
|
+
let config = readPropertiesFromConfig();
|
|
698
|
+
attachProperties(config);
|
|
699
|
+
attachAppendPropertyRow();
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
function toggleProperties(){
|
|
703
|
+
if (propertiesOpened){
|
|
704
|
+
// close the properties window
|
|
705
|
+
$('#propertiesSection').hide();
|
|
706
|
+
} else {
|
|
707
|
+
// open the properties window
|
|
708
|
+
$('#propertiesSection').show();
|
|
709
|
+
}
|
|
710
|
+
// toggle the global switch
|
|
711
|
+
propertiesOpened = !propertiesOpened;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
*
|
|
716
|
+
* @param {object} properties - { key:value, key:value, key: value,... }
|
|
717
|
+
*/
|
|
718
|
+
function attachProperties(config) {
|
|
719
|
+
|
|
720
|
+
if (config) {
|
|
721
|
+
if(config.test) {
|
|
722
|
+
testCaseIdSelected = config.test;
|
|
723
|
+
$(`#test-sidebar-testcases option[value="${testCaseIdSelected}"]`).attr(
|
|
724
|
+
'selected',
|
|
725
|
+
true
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// Add properties (key, value)
|
|
730
|
+
// interacting with reverse order because attachPropertyRow
|
|
731
|
+
// calls prependTo so its always as first row.
|
|
732
|
+
// this to keep fake new row at the bottom.
|
|
733
|
+
//
|
|
734
|
+
|
|
735
|
+
let keys = Object.keys(config.properties || {});
|
|
736
|
+
for (var i = keys.length - 1; i >= 0; i--) {
|
|
737
|
+
attachPropertyRow(keys[i], config.properties[keys[i]]);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
function attachPropertyRow(key, value){
|
|
743
|
+
const s = key;
|
|
744
|
+
const keyid = s.replace(/[^a-zA-Z0-9-]/g, '_');
|
|
745
|
+
let propertyRow = `
|
|
746
|
+
<div class="table-row" id="row-${keyid}">
|
|
747
|
+
<div class="table-cell"><input id="key-${keyid}" class="palette-textinput" type="text" style="width:100%; font-size:12px"></input></div>
|
|
748
|
+
<div class="table-cell"><input id="value-${keyid}" class="palette-textinput" type="text" style="width:100%; font-size:12px"></input></div>
|
|
749
|
+
<div class="table-cell-btn" id="remove-property-${keyid}"><i class="fa fa-minus"></i></div>
|
|
750
|
+
</div>
|
|
751
|
+
`;
|
|
752
|
+
$(propertyRow).prependTo($('#table-test-properties'));
|
|
753
|
+
|
|
754
|
+
// Add values
|
|
755
|
+
$(`#key-${keyid}`).val(key);
|
|
756
|
+
$(`#value-${keyid}`).val(value);
|
|
757
|
+
|
|
758
|
+
// auto save post property update
|
|
759
|
+
$(`#key-${keyid}, #value-${keyid}`).change(function () {
|
|
760
|
+
saveSettings();
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
// remove property button click event
|
|
764
|
+
$(`#remove-property-${keyid}`).click((e) => {
|
|
765
|
+
deleteProperty(keyid);
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
function deleteProperty(key){
|
|
770
|
+
// detach the DOM element
|
|
771
|
+
$(`#row-${key}`).remove();
|
|
772
|
+
saveSettings();
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function addProperty(key, value){
|
|
776
|
+
// reset the errors have happened in the past,... pity we cannot do the same in real life
|
|
777
|
+
$('#new-prop-key').removeClass('wrong-value');
|
|
778
|
+
$('#new-prop-value').removeClass('wrong-value');
|
|
779
|
+
|
|
780
|
+
let errorsFound = false;
|
|
781
|
+
|
|
782
|
+
if (!key){
|
|
783
|
+
errorsFound = true;
|
|
784
|
+
$('#new-prop-key').addClass('wrong-value');
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
if (!value){
|
|
788
|
+
errorsFound = true;
|
|
789
|
+
$('#new-prop-value').addClass('wrong-value');
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
if (!errorsFound){
|
|
793
|
+
// remove the addPropertyRow...
|
|
794
|
+
$('#table-row-append').remove();
|
|
795
|
+
// Sanitize the key. As this will be used as a valid `id` property of the html element
|
|
796
|
+
key = key.trim();
|
|
797
|
+
|
|
798
|
+
// add the new property
|
|
799
|
+
attachPropertyRow(key, value);
|
|
800
|
+
attachAppendPropertyRow();
|
|
801
|
+
saveSettings();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
function getValues() {
|
|
806
|
+
// selected test case
|
|
807
|
+
// console.log('[tab-test] testCaseIdSelected=', testCaseIdSelected);
|
|
808
|
+
|
|
809
|
+
let fnTest = testCaseIdSelected || "";
|
|
810
|
+
|
|
811
|
+
// test properties
|
|
812
|
+
let properties = {};
|
|
813
|
+
let propRows = $('#table-test-properties .table-row');
|
|
814
|
+
|
|
815
|
+
propRows.map((index, row) => {
|
|
816
|
+
let prop = $(row).find('.table-cell').find('input');
|
|
817
|
+
let key = $(prop[0]).val();
|
|
818
|
+
let value = $(prop[1]).val();
|
|
819
|
+
properties[key] = value;
|
|
820
|
+
});
|
|
821
|
+
|
|
822
|
+
return {
|
|
823
|
+
test: fnTest,
|
|
824
|
+
properties: properties
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
function saveSettings() {
|
|
829
|
+
window.__kumologica.settings.testConfig.setTestConfig(getValues());
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function attachAppendPropertyRow() {
|
|
833
|
+
if ($('#table-row-append').length) {
|
|
834
|
+
return; // no need to add append row, already defined
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
// add property button click event
|
|
838
|
+
let addPropertyRow = `
|
|
839
|
+
<div id="table-row-append">
|
|
840
|
+
<div class="table-cell">
|
|
841
|
+
<input id="new-prop-key" class="palette-textinput" type="text" style="width:100%; font-size:12px" placeholder="key"></input>
|
|
842
|
+
</div>
|
|
843
|
+
<div class="table-cell">
|
|
844
|
+
<input id="new-prop-value" class="palette-textinput" type="text" style="width:100%; font-size:12px" placeholder="value"></input>
|
|
845
|
+
</div>
|
|
846
|
+
<div id="addSaveProperty" class="table-cell-btn"><i class="icofont-save"></i></div>
|
|
847
|
+
</div>
|
|
848
|
+
`;
|
|
849
|
+
$(addPropertyRow).appendTo($('#table-test-properties'));
|
|
850
|
+
|
|
851
|
+
// Attach the save event
|
|
852
|
+
$('#addSaveProperty').click(e => {
|
|
853
|
+
let key = $('#new-prop-key').val();
|
|
854
|
+
let value = $('#new-prop-value').val();
|
|
855
|
+
addProperty(key, value);
|
|
856
|
+
});
|
|
857
|
+
// Do not allow spaces on the key - replace if for dashes
|
|
858
|
+
$('#new-prop-key').on('input', () => {
|
|
859
|
+
let old = $('#new-prop-key').val();
|
|
860
|
+
$('#new-prop-key').val(old.replace(/\s+/g, '-') );
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// Debugger operations
|
|
865
|
+
async function triggerDebugTestSuite() {
|
|
866
|
+
// console.log('[tab-test] Debugger started ...');
|
|
867
|
+
let { body} = await window.__kumologica.debugger.listBreakpoints();
|
|
868
|
+
// console.log('[tab-test] Breakpoints =', body);
|
|
869
|
+
if ( body.length === 0 ) {
|
|
870
|
+
// case of no breakpoints found in the flow
|
|
871
|
+
await triggerExecuteTestSuite({ debug: false });
|
|
872
|
+
RED.notifications.notify('No breakpoints found in the flow', 'warning', undefined, 2000);
|
|
873
|
+
} else{
|
|
874
|
+
$('#test-info-wrapper').hide();
|
|
875
|
+
$('#properties-wrapper').hide();
|
|
876
|
+
$('#debugger-wrapper').show();
|
|
877
|
+
await triggerExecuteTestSuite({ debug: true });
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
async function hideDebuggerControls() {
|
|
883
|
+
// console.log('[tab-test] Hiding debugger controls...');
|
|
884
|
+
$('#test-info-wrapper').show();
|
|
885
|
+
$('#properties-wrapper').show();
|
|
886
|
+
$('#debugger-wrapper').hide();
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function showDebuggerControls() {
|
|
890
|
+
// console.log('[tab-test] Showing debugger controls ...');
|
|
891
|
+
$('#test-info-wrapper').hide();
|
|
892
|
+
$('#properties-wrapper').hide();
|
|
893
|
+
$('#debugger-wrapper').show();
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
function debuggerStoppedOnBreakpoint(e,msg) {
|
|
897
|
+
// console.log('[tab-test] Debugger stopped on breakpoint ...e=', e);
|
|
898
|
+
// console.log('[tab-test] Debugger stopped on breakpoint ...msg=', msg);
|
|
899
|
+
|
|
900
|
+
showDebuggerControls();
|
|
901
|
+
|
|
902
|
+
let universalNodeId = msg.payload.nodeId;
|
|
903
|
+
let testCaseID = universalNodeId.split('::')[0];
|
|
904
|
+
// sanitize the testCaseId, i.e. removing dots as jquery selector does not like it
|
|
905
|
+
testCaseId = testCaseID.replace(/\./g, '_');
|
|
906
|
+
|
|
907
|
+
sections.expandLastEntry();
|
|
908
|
+
selectTestcaseTab('traces', testCaseId);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
return {
|
|
912
|
+
init,
|
|
913
|
+
refreshTab,
|
|
914
|
+
};
|
|
915
|
+
})();
|