create-appraisejs 0.3.1-alpha.0 → 0.3.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/cli.e2e.test.d.ts +2 -2
- package/dist/cli.e2e.test.js +74 -72
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -2
- package/dist/config.test.js +64 -64
- package/dist/copy-template.test.d.ts +2 -2
- package/dist/copy-template.test.js +70 -70
- package/dist/download-repo.test.d.ts +2 -2
- package/dist/download-repo.test.js +15 -13
- package/dist/install.test.d.ts +2 -2
- package/dist/install.test.js +115 -114
- package/dist/prepare-template-utils.d.ts.map +1 -1
- package/dist/prepare-template-utils.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -2
- package/dist/prompts.js.map +1 -1
- package/dist/prompts.test.d.ts +2 -2
- package/dist/prompts.test.js +54 -54
- package/dist/sync-templates-utils.d.ts.map +1 -1
- package/dist/sync-templates-utils.js +1 -5
- package/dist/sync-templates-utils.js.map +1 -1
- package/package.json +1 -1
- package/templates/blank/.editorconfig +11 -0
- package/templates/blank/.gitattributes +21 -0
- package/templates/blank/.gitconfig.appraise +14 -0
- package/templates/blank/.prettierrc +13 -0
- package/templates/blank/.vscode/settings.json +2 -0
- package/templates/blank/README.md +12 -12
- package/templates/blank/components.json +24 -24
- package/templates/blank/cucumber.mjs +16 -16
- package/templates/blank/e2e/README.md +56 -0
- package/templates/blank/e2e/apply-migrations.mjs +76 -0
- package/templates/blank/e2e/appraise-smoke.spec.ts +78 -0
- package/templates/blank/e2e/authoring.spec.ts +53 -0
- package/templates/blank/e2e/crud-configuration.spec.ts +138 -0
- package/templates/blank/e2e/crud-tests.spec.ts +76 -0
- package/templates/blank/e2e/helpers/forms.ts +186 -0
- package/templates/blank/e2e/helpers/navigation.ts +27 -0
- package/templates/blank/e2e/helpers/table.ts +45 -0
- package/templates/blank/e2e/helpers/test-data.ts +549 -0
- package/templates/blank/e2e/helpers/ui.ts +41 -0
- package/templates/blank/e2e/navigation.spec.ts +101 -0
- package/templates/blank/e2e/runs-and-reports.spec.ts +82 -0
- package/templates/blank/e2e/settings-sync.spec.ts +39 -0
- package/templates/blank/e2e/start-server.mjs +61 -0
- package/templates/blank/eslint.config.mjs +4 -4
- package/templates/blank/gitignore +0 -3
- package/templates/blank/next-env.d.ts +1 -1
- package/templates/blank/package-lock.json +58 -102
- package/templates/blank/package.json +10 -9
- package/templates/blank/packages/cucumber-runtime/package.json +13 -13
- package/templates/blank/packages/cucumber-runtime/src/cache.util.ts +93 -93
- package/templates/blank/packages/cucumber-runtime/src/cli.ts +77 -68
- package/templates/blank/packages/cucumber-runtime/src/environment.util.ts +21 -21
- package/templates/blank/packages/cucumber-runtime/src/executor.ts +32 -32
- package/templates/blank/packages/cucumber-runtime/src/index.ts +17 -17
- package/templates/blank/packages/cucumber-runtime/src/locator.util.ts +234 -234
- package/templates/blank/packages/cucumber-runtime/src/parameter-types.ts +7 -7
- package/templates/blank/packages/cucumber-runtime/src/random-data.util.ts +35 -35
- package/templates/blank/packages/cucumber-runtime/src/types.ts +13 -13
- package/templates/blank/packages/cucumber-runtime/src/world.ts +44 -44
- package/templates/blank/packages/cucumber-runtime/tsconfig.json +11 -11
- package/templates/blank/packages/locator-picker-companion/dist/cli.js +1 -1
- package/templates/blank/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/blank/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/blank/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
- package/templates/blank/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/blank/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/blank/packages/locator-picker-companion/src/cli.ts +1 -7
- package/templates/blank/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
- package/templates/blank/packages/locator-picker-companion/src/launcher.ts +1 -3
- package/templates/blank/packages/locator-picker-companion/src/session-file.ts +4 -15
- package/templates/blank/packages/locator-picker-companion/src/types.ts +1 -8
- package/templates/blank/playwright.config.ts +46 -0
- package/templates/blank/postcss.config.mjs +8 -8
- package/templates/blank/prisma/dev.db +0 -0
- package/templates/blank/scripts/configure-git-line-endings.mjs +91 -0
- package/templates/blank/scripts/install-template-step.ts +5 -1
- package/templates/blank/scripts/lib/step-matcher.test.ts +3 -3
- package/templates/blank/scripts/lib/step-matcher.ts +5 -1
- package/templates/blank/scripts/lib/template-step-installer.test.ts +4 -2
- package/templates/blank/scripts/lib/template-step-installer.ts +16 -4
- package/templates/blank/scripts/lib/template-step-registry.test.ts +1 -1
- package/templates/blank/scripts/lib/template-step-registry.ts +4 -1
- package/templates/blank/scripts/run-fallow-commit.mjs +4 -6
- package/templates/blank/scripts/sync-all.ts +7 -6
- package/templates/blank/scripts/sync-appraise-base-template.ts +84 -77
- package/templates/blank/scripts/sync-environments.ts +47 -44
- package/templates/blank/scripts/sync-locator-groups.ts +67 -76
- package/templates/blank/scripts/sync-locators.ts +50 -53
- package/templates/blank/scripts/sync-modules.ts +42 -42
- package/templates/blank/scripts/sync-tags.ts +51 -51
- package/templates/blank/scripts/sync-template-step-groups.ts +34 -32
- package/templates/blank/scripts/sync-template-steps.ts +97 -97
- package/templates/blank/scripts/sync-test-cases.ts +65 -74
- package/templates/blank/scripts/sync-test-suites.ts +85 -80
- package/templates/blank/src/actions/server-action-boundary.test.ts +1 -7
- package/templates/blank/src/actions/settings/sync-actions.ts +3 -1
- package/templates/blank/src/actions/tags/tag-actions.ts +1 -7
- package/templates/blank/src/actions/template-test-case/template-test-case-actions.ts +3 -1
- package/templates/blank/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/blank/src/app/(base)/environments/environment-form.tsx +3 -2
- package/templates/blank/src/app/(base)/environments/environment-helpers.ts +4 -1
- package/templates/blank/src/app/(base)/layout.tsx +10 -10
- package/templates/blank/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
- package/templates/blank/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
- package/templates/blank/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
- package/templates/blank/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
- package/templates/blank/src/app/(base)/locator-groups/page.tsx +9 -19
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
- package/templates/blank/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
- package/templates/blank/src/app/(base)/locators/locator-file-sync.ts +1 -5
- package/templates/blank/src/app/(base)/locators/locator-helpers.ts +2 -12
- package/templates/blank/src/app/(base)/locators/locator-table-columns.tsx +59 -60
- package/templates/blank/src/app/(base)/modules/module-form.tsx +3 -1
- package/templates/blank/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
- package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
- package/templates/blank/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
- package/templates/blank/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
- package/templates/blank/src/app/(base)/tags/tag-form.test.tsx +2 -10
- package/templates/blank/src/app/(base)/tags/tag-form.tsx +5 -3
- package/templates/blank/src/app/(base)/tags/tag-table-columns.tsx +63 -63
- package/templates/blank/src/app/(base)/tags/tag-table.tsx +29 -29
- package/templates/blank/src/app/(base)/template-step-groups/create/page.tsx +28 -28
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
- package/templates/blank/src/app/(base)/template-steps/paramChip.tsx +6 -10
- package/templates/blank/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
- package/templates/blank/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
- package/templates/blank/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
- package/templates/blank/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
- package/templates/blank/src/app/(base)/template-steps/template-step-types.ts +1 -5
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
- package/templates/blank/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
- package/templates/blank/src/app/(base)/test-cases/create/page.tsx +1 -5
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
- package/templates/blank/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
- package/templates/blank/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
- package/templates/blank/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
- package/templates/blank/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
- package/templates/blank/src/app/(base)/test-cases/test-case-form.tsx +63 -78
- package/templates/blank/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
- package/templates/blank/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
- package/templates/blank/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
- package/templates/blank/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
- package/templates/blank/src/app/api/test-runs/[runId]/download/route.ts +1 -4
- package/templates/blank/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
- package/templates/blank/src/assets/icons/empty-tube.tsx +23 -23
- package/templates/blank/src/assets/icons/tube-plus.tsx +29 -29
- package/templates/blank/src/components/data-visualization/info-card.tsx +56 -70
- package/templates/blank/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/blank/src/components/diagram/add-node-prompt-node.tsx +1 -1
- package/templates/blank/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
- package/templates/blank/src/components/diagram/dynamic-parameters.test.tsx +4 -1
- package/templates/blank/src/components/diagram/dynamic-parameters.tsx +0 -1
- package/templates/blank/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
- package/templates/blank/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
- package/templates/blank/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
- package/templates/blank/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
- package/templates/blank/src/components/diagram/flow-diagram-node-search.tsx +65 -65
- package/templates/blank/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
- package/templates/blank/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/blank/src/components/diagram/flow-node-data-helpers.ts +1 -1
- package/templates/blank/src/components/diagram/node-form-fields-content.tsx +9 -2
- package/templates/blank/src/components/diagram/node-form-helpers.test.ts +3 -1
- package/templates/blank/src/components/diagram/node-form-helpers.ts +1 -4
- package/templates/blank/src/components/diagram/node-form-template-step-selection.ts +1 -4
- package/templates/blank/src/components/diagram/node-form.test.tsx +25 -0
- package/templates/blank/src/components/diagram/node-form.tsx +2 -12
- package/templates/blank/src/components/diagram/options-header-node.test.tsx +4 -1
- package/templates/blank/src/components/diagram/options-header-node.tsx +140 -130
- package/templates/blank/src/components/diagram/use-flow-diagram.ts +1 -2
- package/templates/blank/src/components/form/error-message.tsx +7 -7
- package/templates/blank/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/blank/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
- package/templates/blank/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
- package/templates/blank/src/components/navigation/entity-search-command.tsx +3 -9
- package/templates/blank/src/components/navigation/nav-link.tsx +60 -60
- package/templates/blank/src/components/test-case/test-case-form-helpers.test.ts +1 -5
- package/templates/blank/src/components/test-case/test-case-form-helpers.ts +1 -5
- package/templates/blank/src/components/test-case/test-case-picker-helpers.ts +8 -7
- package/templates/blank/src/components/test-case/test-case-picker.tsx +2 -6
- package/templates/blank/src/components/test-run/log-viewer.test.tsx +25 -0
- package/templates/blank/src/components/test-run/log-viewer.tsx +2 -2
- package/templates/blank/src/components/test-run/test-run-details-guards.ts +10 -1
- package/templates/blank/src/components/test-run/test-run-details.test.tsx +9 -19
- package/templates/blank/src/components/test-run/use-log-viewer.ts +2 -8
- package/templates/blank/src/components/test-run/use-test-run-header.ts +1 -4
- package/templates/blank/src/components/test-suite/test-suite-picker.tsx +1 -1
- package/templates/blank/src/components/theme/theme-provider.tsx +7 -1
- package/templates/blank/src/components/typography/page-header-subtitle.tsx +7 -7
- package/templates/blank/src/components/typography/page-header.tsx +7 -7
- package/templates/blank/src/components/ui/chart.tsx +2 -8
- package/templates/blank/src/components/ui/command.tsx +2 -5
- package/templates/blank/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/blank/src/components/ui/data-table.test.tsx +1 -8
- package/templates/blank/src/components/ui/dialog.tsx +1 -4
- package/templates/blank/src/components/ui/select.tsx +2 -2
- package/templates/blank/src/components/ui/separator.tsx +5 -1
- package/templates/blank/src/components/ui/skeleton.tsx +7 -7
- package/templates/blank/src/components/ui/table.tsx +1 -1
- package/templates/blank/src/components/ui/toaster.tsx +26 -26
- package/templates/blank/src/components/ui/tooltip.tsx +1 -1
- package/templates/blank/src/constants/form-opts/locator-group-form-opts.ts +1 -1
- package/templates/blank/src/lib/locator-group-file-utils.ts +5 -1
- package/templates/blank/src/lib/locator-picker/session-manager.ts +1 -2
- package/templates/blank/src/lib/metrics/metric-calculator.test.ts +105 -6
- package/templates/blank/src/lib/metrics/metric-calculator.ts +39 -40
- package/templates/blank/src/lib/sync/sync-executor.ts +1 -4
- package/templates/blank/src/lib/sync/sync-pending-counts.test.ts +201 -7
- package/templates/blank/src/lib/sync/sync-pending-counts.ts +81 -13
- package/templates/blank/src/lib/template-automation-paths.ts +1 -1
- package/templates/blank/src/lib/template-sync-utils.d.ts +14 -7
- package/templates/blank/src/lib/test-case-utils.ts +6 -6
- package/templates/blank/src/lib/test-run/log-formatter.ts +82 -83
- package/templates/blank/src/lib/test-run/report-parser.ts +352 -352
- package/templates/blank/src/lib/transformers/gherkin-converter.ts +42 -42
- package/templates/blank/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
- package/templates/blank/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/blank/src/lib/utils/template-step-file-generator.ts +5 -3
- package/templates/blank/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
- package/templates/blank/src/services/dashboard/dashboard-service.test.ts +28 -1
- package/templates/blank/src/services/dashboard/dashboard-service.ts +2 -0
- package/templates/blank/src/services/locator/locator-service.test.ts +1 -3
- package/templates/blank/src/services/locator/locator-service.ts +3 -1
- package/templates/blank/src/services/locator/locator-sync-utils.test.ts +1 -4
- package/templates/blank/src/services/module/module-service.ts +1 -4
- package/templates/blank/src/services/report/report-service.test.ts +70 -6
- package/templates/blank/src/services/report/report-service.ts +52 -9
- package/templates/blank/src/services/shared/errors.ts +2 -4
- package/templates/blank/src/services/template-step/template-step-service.ts +3 -1
- package/templates/blank/src/services/template-step-group/template-step-group-service.ts +3 -1
- package/templates/blank/src/services/test-case/test-case-service.ts +0 -5
- package/templates/blank/src/services/test-run/test-run-service.test.ts +3 -6
- package/templates/blank/src/services/test-run/test-run-service.ts +12 -7
- package/templates/blank/src/services/test-suite/test-suite-service.test.ts +1 -5
- package/templates/blank/src/services/test-suite/test-suite-service.ts +2 -4
- package/templates/blank/src/types/form/actionHandler.ts +1 -5
- package/templates/blank/tsconfig.json +8 -8
- package/templates/default/packages/locator-picker-companion/dist/cli.d.ts +1 -1
- package/templates/default/packages/locator-picker-companion/dist/cli.js +313 -279
- package/templates/default/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/default/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.d.ts +1 -1
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.js +526 -481
- package/templates/default/packages/locator-picker-companion/dist/launcher.d.ts +13 -10
- package/templates/default/packages/locator-picker-companion/dist/launcher.js +47 -48
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/default/packages/locator-picker-companion/dist/session-file.d.ts +30 -22
- package/templates/default/packages/locator-picker-companion/dist/session-file.js +116 -104
- package/templates/default/packages/locator-picker-companion/dist/types.d.ts +25 -25
- package/templates/default/packages/locator-picker-companion/dist/types.js +1 -1
- package/templates/starter/.editorconfig +11 -0
- package/templates/starter/.gitattributes +21 -0
- package/templates/starter/.gitconfig.appraise +14 -0
- package/templates/starter/.prettierrc +13 -0
- package/templates/starter/.vscode/settings.json +2 -0
- package/templates/starter/README.md +12 -12
- package/templates/starter/automation/steps/actions/click.step.ts +56 -58
- package/templates/starter/automation/steps/actions/hover.step.ts +25 -27
- package/templates/starter/automation/steps/actions/input.step.ts +85 -108
- package/templates/starter/automation/steps/actions/navigation.step.ts +67 -70
- package/templates/starter/automation/steps/actions/random_data.step.ts +149 -143
- package/templates/starter/automation/steps/actions/store.step.ts +69 -1
- package/templates/starter/automation/steps/actions/wait.step.ts +84 -1
- package/templates/starter/automation/steps/validations/active_state_assertion.step.ts +28 -30
- package/templates/starter/automation/steps/validations/navigation_assertion.step.ts +20 -22
- package/templates/starter/automation/steps/validations/text_assertion.step.ts +67 -107
- package/templates/starter/automation/steps/validations/visibility_assertion.step.ts +24 -26
- package/templates/starter/components.json +24 -24
- package/templates/starter/cucumber.mjs +16 -16
- package/templates/starter/e2e/README.md +56 -0
- package/templates/starter/e2e/apply-migrations.mjs +76 -0
- package/templates/starter/e2e/appraise-smoke.spec.ts +78 -0
- package/templates/starter/e2e/authoring.spec.ts +53 -0
- package/templates/starter/e2e/crud-configuration.spec.ts +138 -0
- package/templates/starter/e2e/crud-tests.spec.ts +76 -0
- package/templates/starter/e2e/helpers/forms.ts +186 -0
- package/templates/starter/e2e/helpers/navigation.ts +27 -0
- package/templates/starter/e2e/helpers/table.ts +45 -0
- package/templates/starter/e2e/helpers/test-data.ts +549 -0
- package/templates/starter/e2e/helpers/ui.ts +41 -0
- package/templates/starter/e2e/navigation.spec.ts +101 -0
- package/templates/starter/e2e/runs-and-reports.spec.ts +82 -0
- package/templates/starter/e2e/settings-sync.spec.ts +39 -0
- package/templates/starter/e2e/start-server.mjs +61 -0
- package/templates/starter/eslint.config.mjs +4 -4
- package/templates/starter/gitignore +0 -3
- package/templates/starter/next-env.d.ts +1 -1
- package/templates/starter/package-lock.json +58 -102
- package/templates/starter/package.json +10 -9
- package/templates/starter/packages/cucumber-runtime/package.json +13 -13
- package/templates/starter/packages/cucumber-runtime/src/cache.util.ts +93 -93
- package/templates/starter/packages/cucumber-runtime/src/cli.ts +77 -68
- package/templates/starter/packages/cucumber-runtime/src/environment.util.ts +21 -21
- package/templates/starter/packages/cucumber-runtime/src/executor.ts +32 -32
- package/templates/starter/packages/cucumber-runtime/src/index.ts +17 -17
- package/templates/starter/packages/cucumber-runtime/src/locator.util.ts +234 -234
- package/templates/starter/packages/cucumber-runtime/src/parameter-types.ts +7 -7
- package/templates/starter/packages/cucumber-runtime/src/random-data.util.ts +35 -35
- package/templates/starter/packages/cucumber-runtime/src/types.ts +13 -13
- package/templates/starter/packages/cucumber-runtime/src/world.ts +44 -44
- package/templates/starter/packages/cucumber-runtime/tsconfig.json +11 -11
- package/templates/starter/packages/locator-picker-companion/dist/cli.js +1 -1
- package/templates/starter/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/starter/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/starter/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
- package/templates/starter/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/starter/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/starter/packages/locator-picker-companion/src/cli.ts +1 -7
- package/templates/starter/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
- package/templates/starter/packages/locator-picker-companion/src/launcher.ts +1 -3
- package/templates/starter/packages/locator-picker-companion/src/session-file.ts +4 -15
- package/templates/starter/packages/locator-picker-companion/src/types.ts +1 -8
- package/templates/starter/playwright.config.ts +46 -0
- package/templates/starter/postcss.config.mjs +8 -8
- package/templates/starter/prisma/dev.db +0 -0
- package/templates/starter/scripts/configure-git-line-endings.mjs +91 -0
- package/templates/starter/scripts/install-template-step.ts +5 -1
- package/templates/starter/scripts/lib/step-matcher.test.ts +3 -3
- package/templates/starter/scripts/lib/step-matcher.ts +5 -1
- package/templates/starter/scripts/lib/template-step-installer.test.ts +4 -2
- package/templates/starter/scripts/lib/template-step-installer.ts +16 -4
- package/templates/starter/scripts/lib/template-step-registry.test.ts +1 -1
- package/templates/starter/scripts/lib/template-step-registry.ts +4 -1
- package/templates/starter/scripts/run-fallow-commit.mjs +4 -6
- package/templates/starter/scripts/sync-all.ts +7 -6
- package/templates/starter/scripts/sync-appraise-base-template.ts +84 -77
- package/templates/starter/scripts/sync-environments.ts +47 -44
- package/templates/starter/scripts/sync-locator-groups.ts +67 -76
- package/templates/starter/scripts/sync-locators.ts +50 -53
- package/templates/starter/scripts/sync-modules.ts +42 -42
- package/templates/starter/scripts/sync-tags.ts +51 -51
- package/templates/starter/scripts/sync-template-step-groups.ts +34 -32
- package/templates/starter/scripts/sync-template-steps.ts +97 -97
- package/templates/starter/scripts/sync-test-cases.ts +65 -74
- package/templates/starter/scripts/sync-test-suites.ts +85 -80
- package/templates/starter/src/actions/server-action-boundary.test.ts +1 -7
- package/templates/starter/src/actions/settings/sync-actions.ts +3 -1
- package/templates/starter/src/actions/tags/tag-actions.ts +1 -7
- package/templates/starter/src/actions/template-test-case/template-test-case-actions.ts +3 -1
- package/templates/starter/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/starter/src/app/(base)/environments/environment-form.tsx +3 -2
- package/templates/starter/src/app/(base)/environments/environment-helpers.ts +4 -1
- package/templates/starter/src/app/(base)/layout.tsx +10 -10
- package/templates/starter/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
- package/templates/starter/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
- package/templates/starter/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
- package/templates/starter/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
- package/templates/starter/src/app/(base)/locator-groups/page.tsx +9 -19
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
- package/templates/starter/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
- package/templates/starter/src/app/(base)/locators/locator-file-sync.ts +1 -5
- package/templates/starter/src/app/(base)/locators/locator-helpers.ts +2 -12
- package/templates/starter/src/app/(base)/locators/locator-table-columns.tsx +59 -60
- package/templates/starter/src/app/(base)/modules/module-form.tsx +3 -1
- package/templates/starter/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
- package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
- package/templates/starter/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
- package/templates/starter/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
- package/templates/starter/src/app/(base)/tags/tag-form.test.tsx +2 -10
- package/templates/starter/src/app/(base)/tags/tag-form.tsx +5 -3
- package/templates/starter/src/app/(base)/tags/tag-table-columns.tsx +63 -63
- package/templates/starter/src/app/(base)/tags/tag-table.tsx +29 -29
- package/templates/starter/src/app/(base)/template-step-groups/create/page.tsx +28 -28
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
- package/templates/starter/src/app/(base)/template-steps/paramChip.tsx +6 -10
- package/templates/starter/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
- package/templates/starter/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
- package/templates/starter/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
- package/templates/starter/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
- package/templates/starter/src/app/(base)/template-steps/template-step-types.ts +1 -5
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
- package/templates/starter/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
- package/templates/starter/src/app/(base)/test-cases/create/page.tsx +1 -5
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
- package/templates/starter/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
- package/templates/starter/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
- package/templates/starter/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
- package/templates/starter/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
- package/templates/starter/src/app/(base)/test-cases/test-case-form.tsx +63 -78
- package/templates/starter/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
- package/templates/starter/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
- package/templates/starter/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
- package/templates/starter/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
- package/templates/starter/src/app/api/test-runs/[runId]/download/route.ts +1 -4
- package/templates/starter/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
- package/templates/starter/src/assets/icons/empty-tube.tsx +23 -23
- package/templates/starter/src/assets/icons/tube-plus.tsx +29 -29
- package/templates/starter/src/components/data-visualization/info-card.tsx +56 -70
- package/templates/starter/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/starter/src/components/diagram/add-node-prompt-node.tsx +1 -1
- package/templates/starter/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
- package/templates/starter/src/components/diagram/dynamic-parameters.test.tsx +4 -1
- package/templates/starter/src/components/diagram/dynamic-parameters.tsx +0 -1
- package/templates/starter/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
- package/templates/starter/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
- package/templates/starter/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
- package/templates/starter/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
- package/templates/starter/src/components/diagram/flow-diagram-node-search.tsx +65 -65
- package/templates/starter/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
- package/templates/starter/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/starter/src/components/diagram/flow-node-data-helpers.ts +1 -1
- package/templates/starter/src/components/diagram/node-form-fields-content.tsx +9 -2
- package/templates/starter/src/components/diagram/node-form-helpers.test.ts +3 -1
- package/templates/starter/src/components/diagram/node-form-helpers.ts +1 -4
- package/templates/starter/src/components/diagram/node-form-template-step-selection.ts +1 -4
- package/templates/starter/src/components/diagram/node-form.test.tsx +25 -0
- package/templates/starter/src/components/diagram/node-form.tsx +2 -12
- package/templates/starter/src/components/diagram/options-header-node.test.tsx +4 -1
- package/templates/starter/src/components/diagram/options-header-node.tsx +140 -130
- package/templates/starter/src/components/diagram/use-flow-diagram.ts +1 -2
- package/templates/starter/src/components/form/error-message.tsx +7 -7
- package/templates/starter/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/starter/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
- package/templates/starter/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
- package/templates/starter/src/components/navigation/entity-search-command.tsx +3 -9
- package/templates/starter/src/components/navigation/nav-link.tsx +60 -60
- package/templates/starter/src/components/test-case/test-case-form-helpers.test.ts +1 -5
- package/templates/starter/src/components/test-case/test-case-form-helpers.ts +1 -5
- package/templates/starter/src/components/test-case/test-case-picker-helpers.ts +8 -7
- package/templates/starter/src/components/test-case/test-case-picker.tsx +2 -6
- package/templates/starter/src/components/test-run/log-viewer.test.tsx +25 -0
- package/templates/starter/src/components/test-run/log-viewer.tsx +2 -2
- package/templates/starter/src/components/test-run/test-run-details-guards.ts +10 -1
- package/templates/starter/src/components/test-run/test-run-details.test.tsx +9 -19
- package/templates/starter/src/components/test-run/use-log-viewer.ts +2 -8
- package/templates/starter/src/components/test-run/use-test-run-header.ts +1 -4
- package/templates/starter/src/components/test-suite/test-suite-picker.tsx +1 -1
- package/templates/starter/src/components/theme/theme-provider.tsx +7 -1
- package/templates/starter/src/components/typography/page-header-subtitle.tsx +7 -7
- package/templates/starter/src/components/typography/page-header.tsx +7 -7
- package/templates/starter/src/components/ui/chart.tsx +2 -8
- package/templates/starter/src/components/ui/command.tsx +2 -5
- package/templates/starter/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/starter/src/components/ui/data-table.test.tsx +1 -8
- package/templates/starter/src/components/ui/dialog.tsx +1 -4
- package/templates/starter/src/components/ui/select.tsx +2 -2
- package/templates/starter/src/components/ui/separator.tsx +5 -1
- package/templates/starter/src/components/ui/skeleton.tsx +7 -7
- package/templates/starter/src/components/ui/table.tsx +1 -1
- package/templates/starter/src/components/ui/toaster.tsx +26 -26
- package/templates/starter/src/components/ui/tooltip.tsx +1 -1
- package/templates/starter/src/constants/form-opts/locator-group-form-opts.ts +1 -1
- package/templates/starter/src/lib/locator-group-file-utils.ts +5 -1
- package/templates/starter/src/lib/locator-picker/session-manager.ts +1 -2
- package/templates/starter/src/lib/metrics/metric-calculator.test.ts +105 -6
- package/templates/starter/src/lib/metrics/metric-calculator.ts +39 -40
- package/templates/starter/src/lib/sync/sync-executor.ts +1 -4
- package/templates/starter/src/lib/sync/sync-pending-counts.test.ts +201 -7
- package/templates/starter/src/lib/sync/sync-pending-counts.ts +81 -13
- package/templates/starter/src/lib/template-automation-paths.ts +1 -1
- package/templates/starter/src/lib/template-sync-utils.d.ts +14 -7
- package/templates/starter/src/lib/test-case-utils.ts +6 -6
- package/templates/starter/src/lib/test-run/log-formatter.ts +82 -83
- package/templates/starter/src/lib/test-run/report-parser.ts +352 -352
- package/templates/starter/src/lib/transformers/gherkin-converter.ts +42 -42
- package/templates/starter/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
- package/templates/starter/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/starter/src/lib/utils/template-step-file-generator.ts +5 -3
- package/templates/starter/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
- package/templates/starter/src/services/dashboard/dashboard-service.test.ts +28 -1
- package/templates/starter/src/services/dashboard/dashboard-service.ts +2 -0
- package/templates/starter/src/services/locator/locator-service.test.ts +1 -3
- package/templates/starter/src/services/locator/locator-service.ts +3 -1
- package/templates/starter/src/services/locator/locator-sync-utils.test.ts +1 -4
- package/templates/starter/src/services/module/module-service.ts +1 -4
- package/templates/starter/src/services/report/report-service.test.ts +70 -6
- package/templates/starter/src/services/report/report-service.ts +52 -9
- package/templates/starter/src/services/shared/errors.ts +2 -4
- package/templates/starter/src/services/template-step/template-step-service.ts +3 -1
- package/templates/starter/src/services/template-step-group/template-step-group-service.ts +3 -1
- package/templates/starter/src/services/test-case/test-case-service.ts +0 -5
- package/templates/starter/src/services/test-run/test-run-service.test.ts +3 -6
- package/templates/starter/src/services/test-run/test-run-service.ts +12 -7
- package/templates/starter/src/services/test-suite/test-suite-service.test.ts +1 -5
- package/templates/starter/src/services/test-suite/test-suite-service.ts +2 -4
- package/templates/starter/src/types/form/actionHandler.ts +1 -5
- package/templates/starter/tsconfig.json +8 -8
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { TemplateStepType } from '@prisma/client'
|
|
2
|
-
|
|
3
|
-
export const generateGherkinStep = (
|
|
4
|
-
type: TemplateStepType,
|
|
5
|
-
signature: string,
|
|
6
|
-
parameters: { value: string; order: number }[],
|
|
7
|
-
) => {
|
|
8
|
-
const signatureParts = signature.split(' ')
|
|
9
|
-
const sortedParameters = parameters.sort((a, b) => a.order - b.order)
|
|
10
|
-
|
|
11
|
-
const gherkinStep = signatureParts
|
|
12
|
-
.map(part => {
|
|
13
|
-
// Check if this part is a parameter placeholder
|
|
14
|
-
if (part.startsWith('{') && part.endsWith('}')) {
|
|
15
|
-
const parameter = sortedParameters.shift()
|
|
16
|
-
|
|
17
|
-
// If no parameter or missing value, return the placeholder to indicate incompleteness
|
|
18
|
-
if (!parameter || !parameter.value || parameter.value.trim() === '') {
|
|
19
|
-
return part
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Format the parameter value based on its type
|
|
23
|
-
switch (part) {
|
|
24
|
-
case '{string}':
|
|
25
|
-
return `"${parameter.value}"`
|
|
26
|
-
case '{int}':
|
|
27
|
-
return parameter.value
|
|
28
|
-
case '{boolean}':
|
|
29
|
-
return parameter.value
|
|
30
|
-
default:
|
|
31
|
-
return parameter.value
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return part
|
|
36
|
-
})
|
|
37
|
-
.join(' ')
|
|
38
|
-
|
|
39
|
-
// Prepend the appropriate Gherkin keyword based on type
|
|
40
|
-
const keyword = type === 'ACTION' ? 'When' : 'Then'
|
|
41
|
-
return `${keyword} ${gherkinStep}`
|
|
42
|
-
}
|
|
1
|
+
import { TemplateStepType } from '@prisma/client'
|
|
2
|
+
|
|
3
|
+
export const generateGherkinStep = (
|
|
4
|
+
type: TemplateStepType,
|
|
5
|
+
signature: string,
|
|
6
|
+
parameters: { value: string; order: number }[],
|
|
7
|
+
) => {
|
|
8
|
+
const signatureParts = signature.split(' ')
|
|
9
|
+
const sortedParameters = parameters.sort((a, b) => a.order - b.order)
|
|
10
|
+
|
|
11
|
+
const gherkinStep = signatureParts
|
|
12
|
+
.map(part => {
|
|
13
|
+
// Check if this part is a parameter placeholder
|
|
14
|
+
if (part.startsWith('{') && part.endsWith('}')) {
|
|
15
|
+
const parameter = sortedParameters.shift()
|
|
16
|
+
|
|
17
|
+
// If no parameter or missing value, return the placeholder to indicate incompleteness
|
|
18
|
+
if (!parameter || !parameter.value || parameter.value.trim() === '') {
|
|
19
|
+
return part
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Format the parameter value based on its type
|
|
23
|
+
switch (part) {
|
|
24
|
+
case '{string}':
|
|
25
|
+
return `"${parameter.value}"`
|
|
26
|
+
case '{int}':
|
|
27
|
+
return parameter.value
|
|
28
|
+
case '{boolean}':
|
|
29
|
+
return parameter.value
|
|
30
|
+
default:
|
|
31
|
+
return parameter.value
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return part
|
|
36
|
+
})
|
|
37
|
+
.join(' ')
|
|
38
|
+
|
|
39
|
+
// Prepend the appropriate Gherkin keyword based on type
|
|
40
|
+
const keyword = type === 'ACTION' ? 'When' : 'Then'
|
|
41
|
+
return `${keyword} ${gherkinStep}`
|
|
42
|
+
}
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import { TemplateStepIcon } from '@prisma/client'
|
|
2
|
-
import {
|
|
3
|
-
ALargeSmall,
|
|
4
|
-
BugPlay,
|
|
5
|
-
Database,
|
|
6
|
-
Download,
|
|
7
|
-
Globe,
|
|
8
|
-
Keyboard,
|
|
9
|
-
MousePointerClick,
|
|
10
|
-
Save,
|
|
11
|
-
Server,
|
|
12
|
-
Upload,
|
|
13
|
-
Loader,
|
|
14
|
-
CheckCheck,
|
|
15
|
-
LucideIcon,
|
|
16
|
-
} from 'lucide-react'
|
|
17
|
-
import { ReactElement } from 'react'
|
|
18
|
-
|
|
19
|
-
export const KeyToIconTransformer = (key: TemplateStepIcon, className?: string) => {
|
|
20
|
-
switch (key) {
|
|
21
|
-
case 'MOUSE':
|
|
22
|
-
return <MousePointerClick className={className} />
|
|
23
|
-
case 'NAVIGATION':
|
|
24
|
-
return <Globe className={className} />
|
|
25
|
-
case 'INPUT':
|
|
26
|
-
return <Keyboard className={className} />
|
|
27
|
-
case 'DOWNLOAD':
|
|
28
|
-
return <Download className={className} />
|
|
29
|
-
case 'API':
|
|
30
|
-
return <Server className={className} />
|
|
31
|
-
case 'STORE':
|
|
32
|
-
return <Save className={className} />
|
|
33
|
-
case 'FORMAT':
|
|
34
|
-
return <ALargeSmall className={className} />
|
|
35
|
-
case 'DATA':
|
|
36
|
-
return <Database className={className} />
|
|
37
|
-
case 'UPLOAD':
|
|
38
|
-
return <Upload className={className} />
|
|
39
|
-
case 'WAIT':
|
|
40
|
-
return <Loader className={className} />
|
|
41
|
-
case 'VALIDATION':
|
|
42
|
-
return <CheckCheck className={className} />
|
|
43
|
-
case 'DEBUG':
|
|
44
|
-
return <BugPlay className={className} />
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Map of component types to TemplateStepIcon values
|
|
49
|
-
const componentToIconMap = new Map<LucideIcon, TemplateStepIcon>([
|
|
50
|
-
[MousePointerClick, 'MOUSE'],
|
|
51
|
-
[Globe, 'NAVIGATION'],
|
|
52
|
-
[Keyboard, 'INPUT'],
|
|
53
|
-
[Download, 'DOWNLOAD'],
|
|
54
|
-
[Server, 'API'],
|
|
55
|
-
[Save, 'STORE'],
|
|
56
|
-
[ALargeSmall, 'FORMAT'],
|
|
57
|
-
[Database, 'DATA'],
|
|
58
|
-
[Upload, 'UPLOAD'],
|
|
59
|
-
[Loader, 'WAIT'],
|
|
60
|
-
[CheckCheck, 'VALIDATION'],
|
|
61
|
-
[BugPlay, 'DEBUG'],
|
|
62
|
-
])
|
|
63
|
-
|
|
64
|
-
// Map of string values to TemplateStepIcon values
|
|
65
|
-
const stringToIconMap = new Map<string, TemplateStepIcon>([
|
|
66
|
-
['MOUSE', 'MOUSE'],
|
|
67
|
-
['NAVIGATION', 'NAVIGATION'],
|
|
68
|
-
['INPUT', 'INPUT'],
|
|
69
|
-
['DOWNLOAD', 'DOWNLOAD'],
|
|
70
|
-
['API', 'API'],
|
|
71
|
-
['STORE', 'STORE'],
|
|
72
|
-
['FORMAT', 'FORMAT'],
|
|
73
|
-
['DATA', 'DATA'],
|
|
74
|
-
['UPLOAD', 'UPLOAD'],
|
|
75
|
-
['WAIT', 'WAIT'],
|
|
76
|
-
['VALIDATION', 'VALIDATION'],
|
|
77
|
-
['DEBUG', 'DEBUG'],
|
|
78
|
-
])
|
|
79
|
-
|
|
80
|
-
export const IconToKeyTransformer = (icon: React.ReactNode | string): TemplateStepIcon | undefined => {
|
|
81
|
-
// Handle string input
|
|
82
|
-
if (typeof icon === 'string') {
|
|
83
|
-
return stringToIconMap.get(icon)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Handle React component input
|
|
87
|
-
if (!icon || typeof icon !== 'object') return undefined
|
|
88
|
-
|
|
89
|
-
// Get the component type from the React element
|
|
90
|
-
const componentType = (icon as ReactElement)?.type
|
|
91
|
-
if (!componentType) return undefined
|
|
92
|
-
|
|
93
|
-
// Look up the icon in our map
|
|
94
|
-
return componentToIconMap.get(componentType as LucideIcon)
|
|
95
|
-
}
|
|
1
|
+
import { TemplateStepIcon } from '@prisma/client'
|
|
2
|
+
import {
|
|
3
|
+
ALargeSmall,
|
|
4
|
+
BugPlay,
|
|
5
|
+
Database,
|
|
6
|
+
Download,
|
|
7
|
+
Globe,
|
|
8
|
+
Keyboard,
|
|
9
|
+
MousePointerClick,
|
|
10
|
+
Save,
|
|
11
|
+
Server,
|
|
12
|
+
Upload,
|
|
13
|
+
Loader,
|
|
14
|
+
CheckCheck,
|
|
15
|
+
LucideIcon,
|
|
16
|
+
} from 'lucide-react'
|
|
17
|
+
import { ReactElement } from 'react'
|
|
18
|
+
|
|
19
|
+
export const KeyToIconTransformer = (key: TemplateStepIcon, className?: string) => {
|
|
20
|
+
switch (key) {
|
|
21
|
+
case 'MOUSE':
|
|
22
|
+
return <MousePointerClick className={className} />
|
|
23
|
+
case 'NAVIGATION':
|
|
24
|
+
return <Globe className={className} />
|
|
25
|
+
case 'INPUT':
|
|
26
|
+
return <Keyboard className={className} />
|
|
27
|
+
case 'DOWNLOAD':
|
|
28
|
+
return <Download className={className} />
|
|
29
|
+
case 'API':
|
|
30
|
+
return <Server className={className} />
|
|
31
|
+
case 'STORE':
|
|
32
|
+
return <Save className={className} />
|
|
33
|
+
case 'FORMAT':
|
|
34
|
+
return <ALargeSmall className={className} />
|
|
35
|
+
case 'DATA':
|
|
36
|
+
return <Database className={className} />
|
|
37
|
+
case 'UPLOAD':
|
|
38
|
+
return <Upload className={className} />
|
|
39
|
+
case 'WAIT':
|
|
40
|
+
return <Loader className={className} />
|
|
41
|
+
case 'VALIDATION':
|
|
42
|
+
return <CheckCheck className={className} />
|
|
43
|
+
case 'DEBUG':
|
|
44
|
+
return <BugPlay className={className} />
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Map of component types to TemplateStepIcon values
|
|
49
|
+
const componentToIconMap = new Map<LucideIcon, TemplateStepIcon>([
|
|
50
|
+
[MousePointerClick, 'MOUSE'],
|
|
51
|
+
[Globe, 'NAVIGATION'],
|
|
52
|
+
[Keyboard, 'INPUT'],
|
|
53
|
+
[Download, 'DOWNLOAD'],
|
|
54
|
+
[Server, 'API'],
|
|
55
|
+
[Save, 'STORE'],
|
|
56
|
+
[ALargeSmall, 'FORMAT'],
|
|
57
|
+
[Database, 'DATA'],
|
|
58
|
+
[Upload, 'UPLOAD'],
|
|
59
|
+
[Loader, 'WAIT'],
|
|
60
|
+
[CheckCheck, 'VALIDATION'],
|
|
61
|
+
[BugPlay, 'DEBUG'],
|
|
62
|
+
])
|
|
63
|
+
|
|
64
|
+
// Map of string values to TemplateStepIcon values
|
|
65
|
+
const stringToIconMap = new Map<string, TemplateStepIcon>([
|
|
66
|
+
['MOUSE', 'MOUSE'],
|
|
67
|
+
['NAVIGATION', 'NAVIGATION'],
|
|
68
|
+
['INPUT', 'INPUT'],
|
|
69
|
+
['DOWNLOAD', 'DOWNLOAD'],
|
|
70
|
+
['API', 'API'],
|
|
71
|
+
['STORE', 'STORE'],
|
|
72
|
+
['FORMAT', 'FORMAT'],
|
|
73
|
+
['DATA', 'DATA'],
|
|
74
|
+
['UPLOAD', 'UPLOAD'],
|
|
75
|
+
['WAIT', 'WAIT'],
|
|
76
|
+
['VALIDATION', 'VALIDATION'],
|
|
77
|
+
['DEBUG', 'DEBUG'],
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
export const IconToKeyTransformer = (icon: React.ReactNode | string): TemplateStepIcon | undefined => {
|
|
81
|
+
// Handle string input
|
|
82
|
+
if (typeof icon === 'string') {
|
|
83
|
+
return stringToIconMap.get(icon)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Handle React component input
|
|
87
|
+
if (!icon || typeof icon !== 'object') return undefined
|
|
88
|
+
|
|
89
|
+
// Get the component type from the React element
|
|
90
|
+
const componentType = (icon as ReactElement)?.type
|
|
91
|
+
if (!componentType) return undefined
|
|
92
|
+
|
|
93
|
+
// Look up the icon in our map
|
|
94
|
+
return componentToIconMap.get(componentType as LucideIcon)
|
|
95
|
+
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { StepParameterType, TemplateStepParameter } from '@prisma/client'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Type for node data with parameters needed for validation
|
|
5
|
-
*/
|
|
6
|
-
type NodeDataForValidation = {
|
|
7
|
-
templateStepId: string
|
|
8
|
-
parameters: {
|
|
9
|
-
name: string
|
|
10
|
-
value: string
|
|
11
|
-
type: StepParameterType
|
|
12
|
-
order: number
|
|
13
|
-
}[]
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Checks if a node has missing mandatory parameters
|
|
18
|
-
* @param nodeData - The node data to validate (must have templateStepId and parameters)
|
|
19
|
-
* @param templateStepParams - All available template step parameters
|
|
20
|
-
* @param defaultValueInput - If true, all parameters are optional (skip validation)
|
|
21
|
-
* @returns true if any mandatory parameter is missing, false otherwise
|
|
22
|
-
*/
|
|
23
|
-
export function checkMissingMandatoryParams(
|
|
24
|
-
nodeData: NodeDataForValidation,
|
|
25
|
-
templateStepParams: TemplateStepParameter[],
|
|
26
|
-
defaultValueInput: boolean,
|
|
27
|
-
): boolean {
|
|
28
|
-
// Skip all validation if defaultValueInput is true (all fields are optional)
|
|
29
|
-
if (defaultValueInput) {
|
|
30
|
-
return false
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Get all template step parameters for this node's templateStepId
|
|
34
|
-
const nodeParams = templateStepParams.filter(param => param.templateStepId === nodeData.templateStepId)
|
|
35
|
-
|
|
36
|
-
// Create a map of node parameters by name for quick lookup
|
|
37
|
-
const nodeParamMap = new Map(nodeData.parameters.map(param => [param.name, param.value]))
|
|
38
|
-
|
|
39
|
-
// Check each required parameter
|
|
40
|
-
for (const param of nodeParams) {
|
|
41
|
-
const value = nodeParamMap.get(param.name)
|
|
42
|
-
|
|
43
|
-
// LOCATOR: Check if value is empty (we can't check locator group selection from node data)
|
|
44
|
-
if (param.type === 'LOCATOR') {
|
|
45
|
-
if (!value || value.trim() === '') {
|
|
46
|
-
return true
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// STRING: Check if value is empty
|
|
51
|
-
if (param.type === 'STRING') {
|
|
52
|
-
if (!value || value.trim() === '') {
|
|
53
|
-
return true
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// NUMBER: Check if value is empty
|
|
58
|
-
if (param.type === 'NUMBER') {
|
|
59
|
-
if (!value || value.trim() === '') {
|
|
60
|
-
return true
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// DATE: Check if value is empty or invalid
|
|
65
|
-
if (param.type === 'DATE') {
|
|
66
|
-
if (!value || value.trim() === '') {
|
|
67
|
-
return true
|
|
68
|
-
}
|
|
69
|
-
// Try to parse the date to check if it's valid
|
|
70
|
-
const date = new Date(value)
|
|
71
|
-
if (isNaN(date.getTime())) {
|
|
72
|
-
return true
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// BOOLEAN: Always has a value (true/false), so skip validation
|
|
77
|
-
// No validation needed for BOOLEAN type
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return false
|
|
81
|
-
}
|
|
1
|
+
import { StepParameterType, TemplateStepParameter } from '@prisma/client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type for node data with parameters needed for validation
|
|
5
|
+
*/
|
|
6
|
+
type NodeDataForValidation = {
|
|
7
|
+
templateStepId: string
|
|
8
|
+
parameters: {
|
|
9
|
+
name: string
|
|
10
|
+
value: string
|
|
11
|
+
type: StepParameterType
|
|
12
|
+
order: number
|
|
13
|
+
}[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a node has missing mandatory parameters
|
|
18
|
+
* @param nodeData - The node data to validate (must have templateStepId and parameters)
|
|
19
|
+
* @param templateStepParams - All available template step parameters
|
|
20
|
+
* @param defaultValueInput - If true, all parameters are optional (skip validation)
|
|
21
|
+
* @returns true if any mandatory parameter is missing, false otherwise
|
|
22
|
+
*/
|
|
23
|
+
export function checkMissingMandatoryParams(
|
|
24
|
+
nodeData: NodeDataForValidation,
|
|
25
|
+
templateStepParams: TemplateStepParameter[],
|
|
26
|
+
defaultValueInput: boolean,
|
|
27
|
+
): boolean {
|
|
28
|
+
// Skip all validation if defaultValueInput is true (all fields are optional)
|
|
29
|
+
if (defaultValueInput) {
|
|
30
|
+
return false
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Get all template step parameters for this node's templateStepId
|
|
34
|
+
const nodeParams = templateStepParams.filter(param => param.templateStepId === nodeData.templateStepId)
|
|
35
|
+
|
|
36
|
+
// Create a map of node parameters by name for quick lookup
|
|
37
|
+
const nodeParamMap = new Map(nodeData.parameters.map(param => [param.name, param.value]))
|
|
38
|
+
|
|
39
|
+
// Check each required parameter
|
|
40
|
+
for (const param of nodeParams) {
|
|
41
|
+
const value = nodeParamMap.get(param.name)
|
|
42
|
+
|
|
43
|
+
// LOCATOR: Check if value is empty (we can't check locator group selection from node data)
|
|
44
|
+
if (param.type === 'LOCATOR') {
|
|
45
|
+
if (!value || value.trim() === '') {
|
|
46
|
+
return true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// STRING: Check if value is empty
|
|
51
|
+
if (param.type === 'STRING') {
|
|
52
|
+
if (!value || value.trim() === '') {
|
|
53
|
+
return true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// NUMBER: Check if value is empty
|
|
58
|
+
if (param.type === 'NUMBER') {
|
|
59
|
+
if (!value || value.trim() === '') {
|
|
60
|
+
return true
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// DATE: Check if value is empty or invalid
|
|
65
|
+
if (param.type === 'DATE') {
|
|
66
|
+
if (!value || value.trim() === '') {
|
|
67
|
+
return true
|
|
68
|
+
}
|
|
69
|
+
// Try to parse the date to check if it's valid
|
|
70
|
+
const date = new Date(value)
|
|
71
|
+
if (isNaN(date.getTime())) {
|
|
72
|
+
return true
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// BOOLEAN: Always has a value (true/false), so skip validation
|
|
77
|
+
// No validation needed for BOOLEAN type
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
import { ensureAutomationWorkspaceReady } from '@/lib/automation/automation-workspace'
|
|
11
11
|
|
|
12
12
|
const RUNTIME_IMPORT = '../../../packages/cucumber-runtime/src/index.js'
|
|
13
|
-
const REQUIRED_RUNTIME_IMPORT =
|
|
14
|
-
`import { When, Then, CustomWorld, expect, SelectorName, resolveLocator, getEnvironment, generateRandomData, RandomDataType } from '${RUNTIME_IMPORT}';\n\n`
|
|
13
|
+
const REQUIRED_RUNTIME_IMPORT = `import { When, Then, CustomWorld, expect, SelectorName, resolveLocator, getEnvironment, generateRandomData, RandomDataType } from '${RUNTIME_IMPORT}';\n\n`
|
|
15
14
|
|
|
16
15
|
function generateStepJSDoc(templateStep: Pick<TemplateStep, 'name' | 'description' | 'icon'>): string {
|
|
17
16
|
const lines = ['/**']
|
|
@@ -47,7 +46,10 @@ function sanitizeFileName(groupName: string): string {
|
|
|
47
46
|
|
|
48
47
|
export function generateFileContent(templateSteps: TemplateStep[]): string {
|
|
49
48
|
if (!templateSteps || templateSteps.length === 0) {
|
|
50
|
-
return
|
|
49
|
+
return (
|
|
50
|
+
REQUIRED_RUNTIME_IMPORT +
|
|
51
|
+
'// This file is generated automatically. Add template steps to this group to generate content.'
|
|
52
|
+
)
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
const functionDefinitions = templateSteps
|
|
@@ -103,7 +103,17 @@ interface RequiredImport {
|
|
|
103
103
|
const REQUIRED_IMPORTS: RequiredImport[] = [
|
|
104
104
|
{
|
|
105
105
|
module: '../../../packages/cucumber-runtime/src/index',
|
|
106
|
-
namedExports: [
|
|
106
|
+
namedExports: [
|
|
107
|
+
'When',
|
|
108
|
+
'Then',
|
|
109
|
+
'CustomWorld',
|
|
110
|
+
'expect',
|
|
111
|
+
'SelectorName',
|
|
112
|
+
'resolveLocator',
|
|
113
|
+
'getEnvironment',
|
|
114
|
+
'generateRandomData',
|
|
115
|
+
'RandomDataType',
|
|
116
|
+
],
|
|
107
117
|
from: '../../../packages/cucumber-runtime/src/index.js',
|
|
108
118
|
},
|
|
109
119
|
]
|
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest'
|
|
2
2
|
import { TestRunTestCaseResult } from '@prisma/client'
|
|
3
|
-
import { getTestSuiteExecutionData } from './dashboard-service'
|
|
3
|
+
import { getDashboardMetrics, getTestSuiteExecutionData } from './dashboard-service'
|
|
4
|
+
|
|
5
|
+
const { updateDashboardMetricsMock } = vi.hoisted(() => ({
|
|
6
|
+
updateDashboardMetricsMock: vi.fn(),
|
|
7
|
+
}))
|
|
4
8
|
|
|
5
9
|
vi.mock('@/config/db-config', () => ({
|
|
6
10
|
default: {
|
|
7
11
|
testRun: { findMany: vi.fn() },
|
|
8
12
|
report: { findMany: vi.fn() },
|
|
13
|
+
dashboardMetrics: { findFirst: vi.fn() },
|
|
9
14
|
},
|
|
10
15
|
}))
|
|
11
16
|
|
|
17
|
+
vi.mock('@/lib/metrics/metric-calculator', () => ({
|
|
18
|
+
updateDashboardMetrics: updateDashboardMetricsMock,
|
|
19
|
+
}))
|
|
20
|
+
|
|
12
21
|
import prisma from '@/config/db-config'
|
|
13
22
|
|
|
23
|
+
describe('getDashboardMetrics', () => {
|
|
24
|
+
it('refreshes dashboard aggregates before returning the persisted row', async () => {
|
|
25
|
+
const metrics = {
|
|
26
|
+
failedRecentRunsCount: 0,
|
|
27
|
+
repeatedlyFailingTestsCount: 0,
|
|
28
|
+
flakyTestsCount: 0,
|
|
29
|
+
suitesNotExecutedRecentlyCount: 0,
|
|
30
|
+
}
|
|
31
|
+
updateDashboardMetricsMock.mockResolvedValue(undefined)
|
|
32
|
+
vi.mocked(prisma.dashboardMetrics.findFirst).mockResolvedValue(metrics as never)
|
|
33
|
+
|
|
34
|
+
await expect(getDashboardMetrics()).resolves.toBe(metrics)
|
|
35
|
+
|
|
36
|
+
expect(updateDashboardMetricsMock).toHaveBeenCalledOnce()
|
|
37
|
+
expect(prisma.dashboardMetrics.findFirst).toHaveBeenCalledOnce()
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
14
41
|
describe('getTestSuiteExecutionData', () => {
|
|
15
42
|
it('returns empty array when no completed test runs', async () => {
|
|
16
43
|
vi.mocked(prisma.testRun.findMany).mockResolvedValue([] as never)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import prisma from '@/config/db-config'
|
|
2
|
+
import { updateDashboardMetrics } from '@/lib/metrics/metric-calculator'
|
|
2
3
|
import { TestRunStatus, TestRunTestCaseResult } from '@prisma/client'
|
|
3
4
|
|
|
4
5
|
/** Stacked bar segments are raw counts; `total` matches passed+failed+cancelled+unknown. */
|
|
@@ -19,6 +20,7 @@ export type EntityMetrics = {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export async function getDashboardMetrics() {
|
|
23
|
+
await updateDashboardMetrics()
|
|
22
24
|
return prisma.dashboardMetrics.findFirst()
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -37,9 +37,7 @@ describe('detectAndCreateConflicts', () => {
|
|
|
37
37
|
it('returns 0 when no other locators in group', async () => {
|
|
38
38
|
vi.mocked(prisma.locator.findMany).mockResolvedValue([])
|
|
39
39
|
|
|
40
|
-
await expect(
|
|
41
|
-
detectAndCreateConflicts('loc-1', 'btn', '//x', 'group-1'),
|
|
42
|
-
).resolves.toBe(0)
|
|
40
|
+
await expect(detectAndCreateConflicts('loc-1', 'btn', '//x', 'group-1')).resolves.toBe(0)
|
|
43
41
|
expect(prisma.conflictResolution.create).not.toHaveBeenCalled()
|
|
44
42
|
})
|
|
45
43
|
})
|
|
@@ -352,7 +352,9 @@ export type SavePickedLocatorOutcome =
|
|
|
352
352
|
}
|
|
353
353
|
| { kind: 'error'; status: number; message: string }
|
|
354
354
|
|
|
355
|
-
export async function savePickedLocatorFromRequest(
|
|
355
|
+
export async function savePickedLocatorFromRequest(
|
|
356
|
+
request: SavePickedLocatorRequest,
|
|
357
|
+
): Promise<SavePickedLocatorOutcome> {
|
|
356
358
|
const value = savePickedLocatorSchema.parse(request)
|
|
357
359
|
const session = value.sessionId ? await locatorPickerSessionManager.getSession(value.sessionId) : null
|
|
358
360
|
|
|
@@ -3,10 +3,7 @@ import { mergeMissingLocators } from './locator-sync-utils'
|
|
|
3
3
|
|
|
4
4
|
describe('mergeMissingLocators', () => {
|
|
5
5
|
it('adds keys only from locatorsToEnsure that are missing in base', () => {
|
|
6
|
-
const { mergedLocators, addedCount } = mergeMissingLocators(
|
|
7
|
-
{ a: '1', b: '2' },
|
|
8
|
-
{ b: 'x', c: '3' },
|
|
9
|
-
)
|
|
6
|
+
const { mergedLocators, addedCount } = mergeMissingLocators({ a: '1', b: '2' }, { b: 'x', c: '3' })
|
|
10
7
|
expect(mergedLocators).toEqual({ a: '1', b: '2', c: '3' })
|
|
11
8
|
expect(addedCount).toBe(1)
|
|
12
9
|
})
|
|
@@ -46,10 +46,7 @@ export async function getModuleByIdOrThrow(id: string): Promise<ModuleWithParent
|
|
|
46
46
|
return moduleData
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export async function updateModule(
|
|
50
|
-
id: string | undefined,
|
|
51
|
-
value: z.infer<typeof moduleSchema>,
|
|
52
|
-
): Promise<Module> {
|
|
49
|
+
export async function updateModule(id: string | undefined, value: z.infer<typeof moduleSchema>): Promise<Module> {
|
|
53
50
|
if (!id) {
|
|
54
51
|
throw new ServiceError('Module id is required', 'VALIDATION', 400)
|
|
55
52
|
}
|