create-appraisejs 0.3.1-alpha.0 ā 0.4.0-alpha.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 +17 -17
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- 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/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/.env.example +2 -2
- 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 +27 -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 +559 -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 +6 -6
- package/templates/blank/package-lock.json +60 -104
- package/templates/blank/package.json +11 -10
- package/templates/blank/packages/cucumber-runtime/package.json +14 -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/paths.ts +22 -5
- 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/package.json +2 -1
- 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/prisma/migrations/20251104113456_add_type_for_template_step_groups/migration.sql +16 -16
- package/templates/blank/prisma/migrations/20251104170946_add_tags_to_test_suite_and_test_case/migration.sql +27 -27
- package/templates/blank/prisma/migrations/20251112190024_add_cascade_delete_to_test_run_test_case/migration.sql +17 -17
- package/templates/blank/prisma/migrations/20251113181100_add_test_run_log/migration.sql +12 -12
- package/templates/blank/prisma/migrations/20251119191838_add_tag_type/migration.sql +28 -28
- package/templates/blank/prisma/migrations/20251121164059_add_conflict_resolution/migration.sql +12 -12
- package/templates/blank/prisma/migrations/20251223183400_add_report_model_to_db_schema/migration.sql +10 -10
- package/templates/blank/prisma/migrations/20251223183637_add_report_test_case_entity_for_storing_test_results_for_individual_test_cases/migration.sql +10 -10
- package/templates/blank/prisma/migrations/20251224083549_add_comprehensive_report_storage/migration.sql +108 -108
- package/templates/blank/prisma/migrations/20251229194422_migrate_duration_to_string/migration.sql +55 -55
- package/templates/blank/prisma/migrations/20251230124637_add_unique_constraint_to_test_run_name/migration.sql +27 -27
- package/templates/blank/prisma/migrations/20260115094436_add_dashboard_metrics/migration.sql +59 -59
- package/templates/blank/prisma/migrations/20260127172022_add_cascade_delete_to_step_parameters/migration.sql +34 -34
- package/templates/blank/prisma/migrations/20260313093000_add_report_step_screenshot_path/migration.sql +1 -1
- 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/setup-env.ts +0 -0
- 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 +125 -84
- 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 +73 -66
- package/templates/blank/src/components/diagram/flow-diagram-toolbar.tsx +35 -3
- package/templates/blank/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/blank/src/components/diagram/flow-diagram.test.tsx +225 -0
- 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-search.ts +2 -0
- package/templates/blank/src/components/diagram/use-flow-diagram.ts +93 -1
- 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/appraise-test-case-metadata.test.ts +78 -0
- package/templates/blank/src/lib/appraise-test-case-metadata.ts +220 -0
- package/templates/blank/src/lib/automation/automation-path-roots.test.ts +14 -0
- package/templates/blank/src/lib/automation/automation-path-roots.ts +10 -2
- package/templates/blank/src/lib/database-sync.ts +166 -15
- package/templates/blank/src/lib/executor/local-executor-adapter.ts +6 -2
- package/templates/blank/src/lib/feature-file-generator.ts +54 -10
- package/templates/blank/src/lib/gherkin-parser.test.ts +52 -0
- package/templates/blank/src/lib/gherkin-parser.ts +39 -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/projected-feature-utils.ts +5 -1
- package/templates/blank/src/lib/sync/sync-executor.ts +1 -4
- package/templates/blank/src/lib/sync/sync-pending-counts.test.ts +316 -7
- package/templates/blank/src/lib/sync/sync-pending-counts.ts +189 -26
- 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 +13 -6
- package/templates/blank/src/services/test-run/test-run-service.ts +53 -8
- 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/starter/.editorconfig +11 -0
- package/templates/starter/.env.example +2 -2
- 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 +27 -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 +559 -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 +6 -6
- package/templates/starter/package-lock.json +60 -104
- package/templates/starter/package.json +11 -10
- package/templates/starter/packages/cucumber-runtime/package.json +14 -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/paths.ts +22 -5
- 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/package.json +2 -1
- 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/prisma/migrations/20251104113456_add_type_for_template_step_groups/migration.sql +16 -16
- package/templates/starter/prisma/migrations/20251104170946_add_tags_to_test_suite_and_test_case/migration.sql +27 -27
- package/templates/starter/prisma/migrations/20251112190024_add_cascade_delete_to_test_run_test_case/migration.sql +17 -17
- package/templates/starter/prisma/migrations/20251113181100_add_test_run_log/migration.sql +12 -12
- package/templates/starter/prisma/migrations/20251119191838_add_tag_type/migration.sql +28 -28
- package/templates/starter/prisma/migrations/20251121164059_add_conflict_resolution/migration.sql +12 -12
- package/templates/starter/prisma/migrations/20251223183400_add_report_model_to_db_schema/migration.sql +10 -10
- package/templates/starter/prisma/migrations/20251223183637_add_report_test_case_entity_for_storing_test_results_for_individual_test_cases/migration.sql +10 -10
- package/templates/starter/prisma/migrations/20251224083549_add_comprehensive_report_storage/migration.sql +108 -108
- package/templates/starter/prisma/migrations/20251229194422_migrate_duration_to_string/migration.sql +55 -55
- package/templates/starter/prisma/migrations/20251230124637_add_unique_constraint_to_test_run_name/migration.sql +27 -27
- package/templates/starter/prisma/migrations/20260115094436_add_dashboard_metrics/migration.sql +59 -59
- package/templates/starter/prisma/migrations/20260127172022_add_cascade_delete_to_step_parameters/migration.sql +34 -34
- package/templates/starter/prisma/migrations/20260313093000_add_report_step_screenshot_path/migration.sql +1 -1
- 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/setup-env.ts +0 -0
- 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 +125 -84
- 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 +73 -66
- package/templates/starter/src/components/diagram/flow-diagram-toolbar.tsx +35 -3
- package/templates/starter/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/starter/src/components/diagram/flow-diagram.test.tsx +225 -0
- 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-search.ts +2 -0
- package/templates/starter/src/components/diagram/use-flow-diagram.ts +93 -1
- 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/appraise-test-case-metadata.test.ts +78 -0
- package/templates/starter/src/lib/appraise-test-case-metadata.ts +220 -0
- package/templates/starter/src/lib/automation/automation-path-roots.test.ts +14 -0
- package/templates/starter/src/lib/automation/automation-path-roots.ts +10 -2
- package/templates/starter/src/lib/database-sync.ts +166 -15
- package/templates/starter/src/lib/executor/local-executor-adapter.ts +6 -2
- package/templates/starter/src/lib/feature-file-generator.ts +54 -10
- package/templates/starter/src/lib/gherkin-parser.test.ts +52 -0
- package/templates/starter/src/lib/gherkin-parser.ts +39 -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/projected-feature-utils.ts +5 -1
- package/templates/starter/src/lib/sync/sync-executor.ts +1 -4
- package/templates/starter/src/lib/sync/sync-pending-counts.test.ts +316 -7
- package/templates/starter/src/lib/sync/sync-pending-counts.ts +189 -26
- 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 +13 -6
- package/templates/starter/src/services/test-run/test-run-service.ts +53 -8
- 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
- package/dist/cli.e2e.test.d.ts +0 -2
- package/dist/cli.e2e.test.d.ts.map +0 -1
- package/dist/cli.e2e.test.js +0 -73
- package/dist/cli.e2e.test.js.map +0 -1
- package/dist/config.test.d.ts +0 -2
- package/dist/config.test.d.ts.map +0 -1
- package/dist/config.test.js +0 -65
- package/dist/config.test.js.map +0 -1
- package/dist/copy-template.test.d.ts +0 -2
- package/dist/copy-template.test.d.ts.map +0 -1
- package/dist/copy-template.test.js +0 -71
- package/dist/copy-template.test.js.map +0 -1
- package/dist/download-repo.test.d.ts +0 -2
- package/dist/download-repo.test.d.ts.map +0 -1
- package/dist/download-repo.test.js +0 -14
- package/dist/download-repo.test.js.map +0 -1
- package/dist/install.test.d.ts +0 -2
- package/dist/install.test.d.ts.map +0 -1
- package/dist/install.test.js +0 -119
- package/dist/install.test.js.map +0 -1
- package/dist/prompts.test.d.ts +0 -2
- package/dist/prompts.test.d.ts.map +0 -1
- package/dist/prompts.test.js +0 -58
- package/dist/prompts.test.js.map +0 -1
- package/templates/default/next-env.d.ts +0 -6
- package/templates/default/packages/locator-picker-companion/dist/cli.d.ts +0 -1
- package/templates/default/packages/locator-picker-companion/dist/cli.js +0 -302
- package/templates/default/packages/locator-picker-companion/dist/index.d.ts +0 -3
- package/templates/default/packages/locator-picker-companion/dist/index.js +0 -3
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.d.ts +0 -1
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.js +0 -615
- package/templates/default/packages/locator-picker-companion/dist/launcher.d.ts +0 -11
- package/templates/default/packages/locator-picker-companion/dist/launcher.js +0 -59
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.d.ts +0 -3
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.js +0 -257
- package/templates/default/packages/locator-picker-companion/dist/session-file.d.ts +0 -22
- package/templates/default/packages/locator-picker-companion/dist/session-file.js +0 -150
- package/templates/default/packages/locator-picker-companion/dist/types.d.ts +0 -31
- package/templates/default/packages/locator-picker-companion/dist/types.js +0 -1
- package/templates/default/prisma/dev.db +0 -0
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import prisma from '../src/config/db-config'
|
|
13
|
-
import {
|
|
14
|
-
scanFeatureFiles,
|
|
15
|
-
extractModulePathFromFilePath,
|
|
16
|
-
ParsedStep,
|
|
17
|
-
} from '../src/lib/gherkin-parser'
|
|
13
|
+
import { scanFeatureFiles, extractModulePathFromFilePath, ParsedStep } from '../src/lib/gherkin-parser'
|
|
18
14
|
import { buildModuleHierarchy, findModuleByPath } from '../src/lib/module-hierarchy-builder'
|
|
19
15
|
import { StepParameterType, TagType } from '@prisma/client'
|
|
20
16
|
import { ensureAutomationWorkspaceReady, getAutomationFeaturesDir } from '../src/lib/automation/paths'
|
|
@@ -25,11 +21,7 @@ import {
|
|
|
25
21
|
} from '../src/lib/sync/projected-feature-utils'
|
|
26
22
|
import { extractTestSuiteNameFromFilename } from './lib/filename-utils'
|
|
27
23
|
import { splitTagLine } from './lib/tag-parsing'
|
|
28
|
-
import {
|
|
29
|
-
determineStepTypeAndIcon,
|
|
30
|
-
findMatchingTemplateStep,
|
|
31
|
-
sameResolvedParameters,
|
|
32
|
-
} from './lib/step-matcher'
|
|
24
|
+
import { determineStepTypeAndIcon, findMatchingTemplateStep, sameResolvedParameters } from './lib/step-matcher'
|
|
33
25
|
import { printSyncSummary } from './lib/sync-summary'
|
|
34
26
|
import { runSyncScript } from './lib/sync-script-runner'
|
|
35
27
|
|
|
@@ -41,6 +33,9 @@ interface TestCaseFromFS {
|
|
|
41
33
|
modulePath: string // From folder structure
|
|
42
34
|
filterTags: string[] // Scenario tags excluding @tc_...
|
|
43
35
|
steps: ParsedStep[] // From scenario steps
|
|
36
|
+
hasAppraiseMetadata: boolean
|
|
37
|
+
nodes: Array<{ nodeId: string; order: number; label: string }>
|
|
38
|
+
flowBlocks: Array<{ id: string; name: string; order: number; nodeIds: string[] }>
|
|
44
39
|
filePath: string // Feature file path
|
|
45
40
|
}
|
|
46
41
|
|
|
@@ -109,7 +104,8 @@ async function scanTestCasesFromFilesystem(featuresDir: string): Promise<TestCas
|
|
|
109
104
|
|
|
110
105
|
for (const scenario of parsedFeature.scenarios) {
|
|
111
106
|
// Find identifier tag (@tc_...)
|
|
112
|
-
const
|
|
107
|
+
const flattenedTags = scenario.tags.flatMap(splitTagLine)
|
|
108
|
+
const identifierTag = flattenedTags.find(tag => {
|
|
113
109
|
const tagName = tag.startsWith('@') ? tag.substring(1) : tag
|
|
114
110
|
return tagName.startsWith('tc_')
|
|
115
111
|
})
|
|
@@ -122,20 +118,27 @@ async function scanTestCasesFromFilesystem(featuresDir: string): Promise<TestCas
|
|
|
122
118
|
}
|
|
123
119
|
|
|
124
120
|
// Extract filter tags (all tags except identifier tag)
|
|
125
|
-
const filterTags =
|
|
121
|
+
const filterTags = flattenedTags.filter(tag => tag !== identifierTag)
|
|
126
122
|
|
|
127
123
|
// Parse title and description from scenario name
|
|
128
124
|
// Note: gherkin parser swaps them, so we pass both
|
|
129
|
-
const
|
|
125
|
+
const parsedTitle = parseScenarioTitle(scenario.name, scenario.description)
|
|
126
|
+
const nodesByOrder = new Map((scenario.appraiseMetadata?.nodes ?? []).map(node => [node.order, node]))
|
|
130
127
|
|
|
131
128
|
testCases.push({
|
|
132
129
|
identifierTag: identifierTag.startsWith('@') ? identifierTag : `@${identifierTag}`,
|
|
133
|
-
title,
|
|
134
|
-
description,
|
|
130
|
+
title: scenario.appraiseMetadata?.title ?? parsedTitle.title,
|
|
131
|
+
description: scenario.appraiseMetadata?.description ?? parsedTitle.description,
|
|
135
132
|
testSuiteName,
|
|
136
133
|
modulePath,
|
|
137
134
|
filterTags,
|
|
138
|
-
steps: scenario.steps
|
|
135
|
+
steps: scenario.steps.map(step => ({
|
|
136
|
+
...step,
|
|
137
|
+
appraiseNode: nodesByOrder.get(step.order),
|
|
138
|
+
})),
|
|
139
|
+
hasAppraiseMetadata: scenario.appraiseMetadata != null,
|
|
140
|
+
nodes: scenario.appraiseMetadata?.nodes ?? [],
|
|
141
|
+
flowBlocks: scenario.appraiseMetadata?.flowBlocks ?? [],
|
|
139
142
|
filePath: parsedFeature.filePath,
|
|
140
143
|
})
|
|
141
144
|
}
|
|
@@ -187,10 +190,7 @@ async function findOrCreateTag(tagExpression: string, type: TagType): Promise<st
|
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
192
|
|
|
190
|
-
async function deleteTestCaseWithCascade(
|
|
191
|
-
testCaseId: string,
|
|
192
|
-
identifierTagId?: string,
|
|
193
|
-
): Promise<void> {
|
|
193
|
+
async function deleteTestCaseWithCascade(testCaseId: string, identifierTagId?: string): Promise<void> {
|
|
194
194
|
// Keep deletes in dependency order to satisfy RESTRICT constraints and
|
|
195
195
|
// mirror domain-level delete behavior in a single transactional boundary.
|
|
196
196
|
await prisma.$transaction(async tx => {
|
|
@@ -263,7 +263,9 @@ async function syncTestCaseSteps(
|
|
|
263
263
|
|
|
264
264
|
// Order is the stable identity within a scenario for synchronization.
|
|
265
265
|
const existingStepsMap = new Map(existingSteps.map(step => [step.order, step]))
|
|
266
|
-
const projectedExistingStepsMap = new Map(
|
|
266
|
+
const projectedExistingStepsMap = new Map(
|
|
267
|
+
normalizeProjectedDbTestCaseSteps(existingSteps).map(step => [step.order, step]),
|
|
268
|
+
)
|
|
267
269
|
|
|
268
270
|
// Process each step from filesystem
|
|
269
271
|
for (const step of steps) {
|
|
@@ -280,13 +282,15 @@ async function syncTestCaseSteps(
|
|
|
280
282
|
const existingStep = existingStepsMap.get(step.order)
|
|
281
283
|
const { icon } = determineStepTypeAndIcon(step.keyword)
|
|
282
284
|
const gherkinStep = `${step.keyword} ${step.text}`
|
|
285
|
+
const label = step.appraiseNode?.label ?? step.text
|
|
283
286
|
|
|
284
287
|
if (existingStep) {
|
|
288
|
+
const expectedFlowNodeId = step.appraiseNode?.nodeId ?? existingStep.flowNodeId
|
|
285
289
|
const projectedExistingStep = projectedExistingStepsMap.get(step.order)
|
|
286
290
|
const matchesProjectedState =
|
|
287
291
|
projectedExistingStep != null &&
|
|
288
292
|
projectedExistingStep.gherkinStep === gherkinStep &&
|
|
289
|
-
projectedExistingStep.label ===
|
|
293
|
+
projectedExistingStep.label === label &&
|
|
290
294
|
projectedExistingStep.icon === determineProjectedStepIcon(step.keyword) &&
|
|
291
295
|
projectedExistingStep.templateStepSignature === match.signature &&
|
|
292
296
|
sameResolvedParameters(projectedExistingStep.parameters, match.parameters)
|
|
@@ -297,7 +301,8 @@ async function syncTestCaseSteps(
|
|
|
297
301
|
!matchesProjectedState &&
|
|
298
302
|
(existingStep.gherkinStep !== gherkinStep ||
|
|
299
303
|
existingStep.templateStepId !== match.templateStepId ||
|
|
300
|
-
existingStep.
|
|
304
|
+
existingStep.flowNodeId !== expectedFlowNodeId ||
|
|
305
|
+
existingStep.label !== label ||
|
|
301
306
|
existingStep.icon !== icon)
|
|
302
307
|
|
|
303
308
|
if (needsUpdate) {
|
|
@@ -305,7 +310,8 @@ async function syncTestCaseSteps(
|
|
|
305
310
|
where: { id: existingStep.id },
|
|
306
311
|
data: {
|
|
307
312
|
gherkinStep,
|
|
308
|
-
|
|
313
|
+
flowNodeId: expectedFlowNodeId,
|
|
314
|
+
label,
|
|
309
315
|
templateStepId: match.templateStepId,
|
|
310
316
|
icon,
|
|
311
317
|
},
|
|
@@ -335,7 +341,8 @@ async function syncTestCaseSteps(
|
|
|
335
341
|
testCaseId,
|
|
336
342
|
order: step.order,
|
|
337
343
|
gherkinStep,
|
|
338
|
-
|
|
344
|
+
flowNodeId: step.appraiseNode?.nodeId,
|
|
345
|
+
label,
|
|
339
346
|
icon,
|
|
340
347
|
templateStepId: match.templateStepId,
|
|
341
348
|
},
|
|
@@ -372,6 +379,38 @@ async function syncTestCaseSteps(
|
|
|
372
379
|
}
|
|
373
380
|
}
|
|
374
381
|
|
|
382
|
+
async function syncTestCaseFlowBlocks(testCaseId: string, testCase: TestCaseFromFS): Promise<void> {
|
|
383
|
+
if (!testCase.hasAppraiseMetadata) {
|
|
384
|
+
return
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
const validNodeIds = new Set(testCase.nodes.map(node => node.nodeId))
|
|
388
|
+
|
|
389
|
+
await prisma.testCaseFlowBlock.deleteMany({
|
|
390
|
+
where: { testCaseId },
|
|
391
|
+
})
|
|
392
|
+
|
|
393
|
+
if (testCase.flowBlocks.length === 0) {
|
|
394
|
+
return
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
await prisma.testCase.update({
|
|
398
|
+
where: { id: testCaseId },
|
|
399
|
+
data: {
|
|
400
|
+
flowBlocks: {
|
|
401
|
+
create: testCase.flowBlocks.map(block => ({
|
|
402
|
+
id: block.id,
|
|
403
|
+
name: block.name,
|
|
404
|
+
order: block.order,
|
|
405
|
+
nodes: {
|
|
406
|
+
create: block.nodeIds.filter(nodeId => validNodeIds.has(nodeId)).map(nodeId => ({ flowNodeId: nodeId })),
|
|
407
|
+
},
|
|
408
|
+
})),
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
})
|
|
412
|
+
}
|
|
413
|
+
|
|
375
414
|
type TemplateStepForMatch = Array<{
|
|
376
415
|
id: string
|
|
377
416
|
signature: string
|
|
@@ -509,6 +548,7 @@ async function upsertTestCase(
|
|
|
509
548
|
}
|
|
510
549
|
|
|
511
550
|
await syncTestCaseSteps(existingTestCase.id, testCase.steps, templateSteps, result)
|
|
551
|
+
await syncTestCaseFlowBlocks(existingTestCase.id, testCase)
|
|
512
552
|
return
|
|
513
553
|
}
|
|
514
554
|
|
|
@@ -554,6 +594,7 @@ async function upsertTestCase(
|
|
|
554
594
|
console.log(` ā Created test case '${testCase.title}' (${testCase.identifierTag})`)
|
|
555
595
|
|
|
556
596
|
await syncTestCaseSteps(newTestCase.id, testCase.steps, templateSteps, result)
|
|
597
|
+
await syncTestCaseFlowBlocks(newTestCase.id, testCase)
|
|
557
598
|
}
|
|
558
599
|
|
|
559
600
|
async function deleteOrphanedTestCases(fsTestCaseTags: Set<string>, result: SyncResult): Promise<void> {
|
|
@@ -647,71 +688,71 @@ async function syncTestCasesToDatabase(testCasesFromFS: TestCaseFromFS[], result
|
|
|
647
688
|
* Generates and displays sync summary
|
|
648
689
|
*/
|
|
649
690
|
async function main(): Promise<SyncResult | void> {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
691
|
+
console.log('š Starting test cases sync...')
|
|
692
|
+
console.log('This will scan feature files and sync test cases to database.')
|
|
693
|
+
console.log('Filesystem is the source of truth - test cases in DB but not in FS will be deleted.\n')
|
|
653
694
|
|
|
654
|
-
|
|
655
|
-
|
|
695
|
+
await ensureAutomationWorkspaceReady()
|
|
696
|
+
const featuresDir = getAutomationFeaturesDir()
|
|
656
697
|
|
|
657
|
-
|
|
658
|
-
|
|
698
|
+
// Scan test cases from filesystem
|
|
699
|
+
const testCasesFromFS = await scanTestCasesFromFilesystem(featuresDir)
|
|
659
700
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
701
|
+
if (testCasesFromFS.length === 0) {
|
|
702
|
+
console.log('\nā ļø No test cases found in feature files. Nothing to sync.')
|
|
703
|
+
return
|
|
704
|
+
}
|
|
664
705
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
706
|
+
console.log(`\nš Found ${testCasesFromFS.length} test case(s) from feature files:`)
|
|
707
|
+
for (const tc of testCasesFromFS) {
|
|
708
|
+
console.log(` - ${tc.title} (${tc.identifierTag}) in ${tc.testSuiteName}`)
|
|
709
|
+
}
|
|
669
710
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
711
|
+
// Initialize result
|
|
712
|
+
const result: SyncResult = {
|
|
713
|
+
testCasesScanned: testCasesFromFS.length,
|
|
714
|
+
testCasesExisting: 0,
|
|
715
|
+
testCasesCreated: 0,
|
|
716
|
+
testCasesUpdated: 0,
|
|
717
|
+
testCasesDeleted: 0,
|
|
718
|
+
errors: [],
|
|
719
|
+
warnings: [],
|
|
720
|
+
createdTestCases: [],
|
|
721
|
+
updatedTestCases: [],
|
|
722
|
+
deletedTestCases: [],
|
|
723
|
+
}
|
|
683
724
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
725
|
+
// Sync to database
|
|
726
|
+
await syncTestCasesToDatabase(testCasesFromFS, result)
|
|
727
|
+
|
|
728
|
+
printSyncSummary(
|
|
729
|
+
[
|
|
730
|
+
{ label: 'š Test cases scanned', value: result.testCasesScanned },
|
|
731
|
+
{ label: 'ā
Test cases existing', value: result.testCasesExisting },
|
|
732
|
+
{ label: 'ā Test cases created', value: result.testCasesCreated },
|
|
733
|
+
{ label: 'š Test cases updated', value: result.testCasesUpdated },
|
|
734
|
+
{ label: 'šļø Test cases deleted', value: result.testCasesDeleted },
|
|
735
|
+
{ label: 'ā ļø Warnings', value: result.warnings.length },
|
|
736
|
+
{ label: 'ā Errors', value: result.errors.length },
|
|
737
|
+
],
|
|
738
|
+
[
|
|
739
|
+
{
|
|
740
|
+
title: 'Created test cases',
|
|
741
|
+
items: result.createdTestCases.map(tc => `${tc.title} (${tc.identifierTag})`),
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
title: 'Updated test cases',
|
|
745
|
+
items: result.updatedTestCases.map(tc => `${tc.title} (${tc.identifierTag})`),
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
title: 'Deleted test cases',
|
|
749
|
+
items: result.deletedTestCases.map(tc => `${tc.title} (${tc.identifierTag})`),
|
|
750
|
+
},
|
|
751
|
+
{ title: 'Warnings', items: result.warnings },
|
|
752
|
+
{ title: 'Errors', items: result.errors },
|
|
753
|
+
],
|
|
754
|
+
)
|
|
755
|
+
return result
|
|
715
756
|
}
|
|
716
757
|
|
|
717
758
|
runSyncScript(main)
|
|
@@ -49,14 +49,14 @@ type DbTestSuiteWithModule = Prisma.TestSuiteGetPayload<{ include: { module: tru
|
|
|
49
49
|
*/
|
|
50
50
|
function extractFeatureLevelTags(parsedFeature: ParsedFeature): string[] {
|
|
51
51
|
const tags: string[] = []
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
for (const tagLine of parsedFeature.tags) {
|
|
54
54
|
if (tagLine.startsWith('@')) {
|
|
55
55
|
const splitTags = splitTagLine(tagLine)
|
|
56
56
|
tags.push(...splitTags)
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
return tags
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -65,17 +65,17 @@ function extractFeatureLevelTags(parsedFeature: ParsedFeature): string[] {
|
|
|
65
65
|
*/
|
|
66
66
|
async function scanTestSuitesFromFilesystem(featuresDir: string): Promise<TestSuiteFromFS[]> {
|
|
67
67
|
const testSuites: TestSuiteFromFS[] = []
|
|
68
|
-
|
|
68
|
+
|
|
69
69
|
console.log('š Scanning feature files...')
|
|
70
70
|
const parsedFeatures = await scanFeatureFiles(featuresDir)
|
|
71
71
|
console.log(` Found ${parsedFeatures.length} feature file(s)`)
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
for (const parsedFeature of parsedFeatures) {
|
|
74
74
|
try {
|
|
75
75
|
const testSuiteName = extractTestSuiteNameFromFilename(parsedFeature.filePath)
|
|
76
76
|
const modulePath = extractModulePathFromFilePath(parsedFeature.filePath, featuresDir)
|
|
77
77
|
const tags = extractFeatureLevelTags(parsedFeature)
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
testSuites.push({
|
|
80
80
|
name: testSuiteName,
|
|
81
81
|
description: parsedFeature.featureDescription || null,
|
|
@@ -87,7 +87,7 @@ async function scanTestSuitesFromFilesystem(featuresDir: string): Promise<TestSu
|
|
|
87
87
|
console.error(` ā Error processing feature file '${parsedFeature.filePath}': ${error}`)
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
return testSuites
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -97,13 +97,13 @@ async function scanTestSuitesFromFilesystem(featuresDir: string): Promise<TestSu
|
|
|
97
97
|
*/
|
|
98
98
|
async function findTagIdsByExpressions(tagExpressions: string[]): Promise<string[]> {
|
|
99
99
|
const tagIds: string[] = []
|
|
100
|
-
|
|
100
|
+
|
|
101
101
|
for (const tagExpression of tagExpressions) {
|
|
102
102
|
try {
|
|
103
103
|
const tag = await prisma.tag.findFirst({
|
|
104
104
|
where: { tagExpression },
|
|
105
105
|
})
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
if (tag) {
|
|
108
108
|
tagIds.push(tag.id)
|
|
109
109
|
} else {
|
|
@@ -113,7 +113,7 @@ async function findTagIdsByExpressions(tagExpressions: string[]): Promise<string
|
|
|
113
113
|
console.error(` ā Error finding tag '${tagExpression}': ${error}`)
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
return tagIds
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -128,7 +128,10 @@ async function resolveModuleId(modulePath: string) {
|
|
|
128
128
|
return moduleId
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
async function findExistingTestSuite(
|
|
131
|
+
async function findExistingTestSuite(
|
|
132
|
+
testSuite: TestSuiteFromFS,
|
|
133
|
+
moduleId: string,
|
|
134
|
+
): Promise<ExistingTestSuite | undefined> {
|
|
132
135
|
const existingTestSuites = await prisma.testSuite.findMany({
|
|
133
136
|
where: {
|
|
134
137
|
moduleId,
|
|
@@ -150,7 +153,12 @@ function getSortedTagIds(existingTestSuite: ExistingTestSuite, tagIds: string[])
|
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
function testSuiteNeedsUpdate(
|
|
156
|
+
function testSuiteNeedsUpdate(
|
|
157
|
+
existingTestSuite: ExistingTestSuite,
|
|
158
|
+
testSuite: TestSuiteFromFS,
|
|
159
|
+
moduleId: string,
|
|
160
|
+
tagIds: string[],
|
|
161
|
+
) {
|
|
154
162
|
const { currentTagIds, newTagIds } = getSortedTagIds(existingTestSuite, tagIds)
|
|
155
163
|
|
|
156
164
|
return (
|
|
@@ -346,15 +354,12 @@ async function deleteOrphanedTestSuites(fsTestSuiteKeys: Set<string>, result: Sy
|
|
|
346
354
|
/**
|
|
347
355
|
* Syncs test suites from filesystem to database
|
|
348
356
|
*/
|
|
349
|
-
async function syncTestSuitesToDatabase(
|
|
350
|
-
testSuitesFromFS: TestSuiteFromFS[],
|
|
351
|
-
result: SyncResult,
|
|
352
|
-
): Promise<void> {
|
|
357
|
+
async function syncTestSuitesToDatabase(testSuitesFromFS: TestSuiteFromFS[], result: SyncResult): Promise<void> {
|
|
353
358
|
console.log('\nā
Syncing test suites to database...')
|
|
354
|
-
|
|
359
|
+
|
|
355
360
|
// Track test suites from filesystem (by name + modulePath)
|
|
356
361
|
const fsTestSuiteKeys = new Set<string>()
|
|
357
|
-
|
|
362
|
+
|
|
358
363
|
for (const testSuite of testSuitesFromFS) {
|
|
359
364
|
try {
|
|
360
365
|
await syncFilesystemTestSuite(testSuite, fsTestSuiteKeys, result)
|
|
@@ -372,69 +377,69 @@ async function syncTestSuitesToDatabase(
|
|
|
372
377
|
* Generates and displays sync summary
|
|
373
378
|
*/
|
|
374
379
|
async function main(): Promise<SyncResult | void> {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
380
|
+
console.log('š Starting test suites sync...')
|
|
381
|
+
console.log('This will scan feature files and sync test suites to database.')
|
|
382
|
+
console.log('Filesystem is the source of truth - test suites in DB but not in FS will be deleted.')
|
|
383
|
+
console.log('Note: Test cases are not synced by this script (they will be handled separately).\n')
|
|
384
|
+
|
|
385
|
+
await ensureAutomationWorkspaceReady()
|
|
386
|
+
const featuresDir = getAutomationFeaturesDir()
|
|
387
|
+
|
|
388
|
+
// Scan test suites from filesystem
|
|
389
|
+
const testSuitesFromFS = await scanTestSuitesFromFilesystem(featuresDir)
|
|
390
|
+
|
|
391
|
+
if (testSuitesFromFS.length === 0) {
|
|
392
|
+
console.log('\nā ļø No feature files found. Nothing to sync.')
|
|
393
|
+
return
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
console.log(`\nš Found ${testSuitesFromFS.length} test suite(s) from feature files:`)
|
|
397
|
+
for (const ts of testSuitesFromFS) {
|
|
398
|
+
console.log(` - ${ts.name} (${ts.modulePath})`)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Initialize result
|
|
402
|
+
const result: SyncResult = {
|
|
403
|
+
testSuitesScanned: testSuitesFromFS.length,
|
|
404
|
+
testSuitesExisting: 0,
|
|
405
|
+
testSuitesCreated: 0,
|
|
406
|
+
testSuitesUpdated: 0,
|
|
407
|
+
testSuitesDeleted: 0,
|
|
408
|
+
errors: [],
|
|
409
|
+
createdTestSuites: [],
|
|
410
|
+
updatedTestSuites: [],
|
|
411
|
+
deletedTestSuites: [],
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// Sync to database
|
|
415
|
+
await syncTestSuitesToDatabase(testSuitesFromFS, result)
|
|
416
|
+
|
|
417
|
+
printSyncSummary(
|
|
418
|
+
[
|
|
419
|
+
{ label: 'š Test suites scanned', value: result.testSuitesScanned },
|
|
420
|
+
{ label: 'ā
Test suites existing', value: result.testSuitesExisting },
|
|
421
|
+
{ label: 'ā Test suites created', value: result.testSuitesCreated },
|
|
422
|
+
{ label: 'š Test suites updated', value: result.testSuitesUpdated },
|
|
423
|
+
{ label: 'šļø Test suites deleted', value: result.testSuitesDeleted },
|
|
424
|
+
{ label: 'ā Errors', value: result.errors.length },
|
|
425
|
+
],
|
|
426
|
+
[
|
|
427
|
+
{
|
|
428
|
+
title: 'Created test suites',
|
|
429
|
+
items: result.createdTestSuites.map(ts => `${ts.name} (${ts.modulePath})`),
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
title: 'Updated test suites',
|
|
433
|
+
items: result.updatedTestSuites.map(ts => `${ts.name} (${ts.modulePath})`),
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
title: 'Deleted test suites',
|
|
437
|
+
items: result.deletedTestSuites.map(ts => `${ts.name} (${ts.modulePath})`),
|
|
438
|
+
},
|
|
439
|
+
{ title: 'Errors', items: result.errors },
|
|
440
|
+
],
|
|
441
|
+
)
|
|
442
|
+
return result
|
|
438
443
|
}
|
|
439
444
|
|
|
440
445
|
runSyncScript(main)
|
|
@@ -22,13 +22,7 @@ import {
|
|
|
22
22
|
listEnvironments,
|
|
23
23
|
updateEnvironment,
|
|
24
24
|
} from '@/services/environment/environment-service'
|
|
25
|
-
import {
|
|
26
|
-
createTag,
|
|
27
|
-
deleteTags,
|
|
28
|
-
getTagByIdOrThrow,
|
|
29
|
-
listFilterTags,
|
|
30
|
-
updateTag,
|
|
31
|
-
} from '@/services/tag/tag-service'
|
|
25
|
+
import { createTag, deleteTags, getTagByIdOrThrow, listFilterTags, updateTag } from '@/services/tag/tag-service'
|
|
32
26
|
import {
|
|
33
27
|
checkLocatorGroupNameUnique,
|
|
34
28
|
createLocatorGroup,
|
|
@@ -5,7 +5,9 @@ import { runRequestedSync, type SyncExecutionResult } from '@/lib/sync/sync-exec
|
|
|
5
5
|
import { getSyncPendingCounts, type SyncPendingCounts } from '@/lib/sync/sync-pending-counts'
|
|
6
6
|
import { isSyncRequestId } from '@/lib/sync/sync-registry'
|
|
7
7
|
|
|
8
|
-
export async function runSyncAction(
|
|
8
|
+
export async function runSyncAction(
|
|
9
|
+
requestedScriptId: string,
|
|
10
|
+
): Promise<SyncExecutionResult | InvalidSyncExecutionResult> {
|
|
9
11
|
if (!isSyncRequestId(requestedScriptId)) {
|
|
10
12
|
return {
|
|
11
13
|
requestedScriptId,
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
3
|
import { tagSchema } from '@/constants/form-opts/tag-form-opts'
|
|
4
|
-
import {
|
|
5
|
-
createTag,
|
|
6
|
-
deleteTags,
|
|
7
|
-
getTagByIdOrThrow,
|
|
8
|
-
listFilterTags,
|
|
9
|
-
updateTag,
|
|
10
|
-
} from '@/services/tag/tag-service'
|
|
4
|
+
import { createTag, deleteTags, getTagByIdOrThrow, listFilterTags, updateTag } from '@/services/tag/tag-service'
|
|
11
5
|
import { ServiceError, serviceErrorToActionResponse, unknownErrorToActionResponse } from '@/services/shared/errors'
|
|
12
6
|
import { ActionResponse } from '@/types/form/actionHandler'
|
|
13
7
|
import { revalidatePath } from 'next/cache'
|
|
@@ -40,7 +40,9 @@ export async function deleteTemplateTestCaseAction(id: string[]): Promise<Action
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export async function createTemplateTestCaseAction(
|
|
43
|
+
export async function createTemplateTestCaseAction(
|
|
44
|
+
value: z.infer<typeof templateTestCaseSchema>,
|
|
45
|
+
): Promise<ActionResponse> {
|
|
44
46
|
try {
|
|
45
47
|
templateTestCaseSchema.parse(value)
|
|
46
48
|
const newTemplateTestCase = await createTemplateTestCase(value)
|