create-appraisejs 0.3.0 → 0.3.1-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/dist/cli.e2e.test.d.ts +2 -0
- package/dist/cli.e2e.test.d.ts.map +1 -0
- package/dist/cli.e2e.test.js +73 -0
- package/dist/cli.e2e.test.js.map +1 -0
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +65 -0
- package/dist/config.test.js.map +1 -0
- package/dist/copy-template.test.d.ts +2 -0
- package/dist/copy-template.test.d.ts.map +1 -0
- package/dist/copy-template.test.js +71 -0
- package/dist/copy-template.test.js.map +1 -0
- package/dist/download-repo.test.d.ts +2 -0
- package/dist/download-repo.test.d.ts.map +1 -0
- package/dist/download-repo.test.js +14 -0
- package/dist/download-repo.test.js.map +1 -0
- package/dist/install.test.d.ts +2 -0
- package/dist/install.test.d.ts.map +1 -0
- package/dist/install.test.js +119 -0
- package/dist/install.test.js.map +1 -0
- package/dist/prompts.test.d.ts +2 -0
- package/dist/prompts.test.d.ts.map +1 -0
- package/dist/prompts.test.js +58 -0
- package/dist/prompts.test.js.map +1 -0
- package/package.json +3 -6
- package/templates/blank/.env.example +2 -2
- package/templates/blank/components.json +24 -24
- package/templates/blank/cucumber.mjs +16 -16
- package/templates/blank/gitignore +6 -0
- package/templates/blank/next-env.d.ts +6 -6
- package/templates/blank/package-lock.json +2274 -1019
- package/templates/blank/package.json +27 -18
- 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 +68 -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/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/prisma/migrations/20260507000000_add_flow_builder_node_grouping/migration.sql +34 -0
- package/templates/blank/prisma/schema.prisma +36 -0
- package/templates/blank/scripts/lib/jsdoc-parser.test.ts +12 -0
- package/templates/blank/scripts/lib/jsdoc-parser.ts +5 -88
- package/templates/blank/scripts/lib/step-file-parser.ts +111 -178
- package/templates/blank/scripts/lib/template-sync-utils.test.ts +35 -0
- package/templates/blank/scripts/run-fallow-commit.mjs +23 -0
- package/templates/blank/scripts/setup-env.ts +0 -0
- package/templates/blank/scripts/sync-tags.ts +1 -1
- package/templates/blank/scripts/sync-test-suites.ts +233 -162
- package/templates/blank/src/actions/dashboard/dashboard-actions.ts +0 -7
- package/templates/blank/src/actions/locator-picker/locator-picker-actions.test.ts +10 -0
- package/templates/blank/src/actions/locator-picker/locator-picker-actions.ts +5 -0
- package/templates/blank/src/actions/server-action-boundary.test.ts +794 -0
- package/templates/blank/src/actions/test-suite/test-suite-actions.ts +2 -1
- package/templates/blank/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/blank/src/app/(base)/environments/environment-form.tsx +16 -23
- package/templates/blank/src/app/(base)/environments/page.tsx +2 -2
- package/templates/blank/src/app/(base)/layout.tsx +10 -10
- package/templates/blank/src/app/(base)/locator-groups/create/page.tsx +1 -1
- package/templates/blank/src/app/(base)/locator-groups/locator-group-form.tsx +24 -24
- 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 +3 -3
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-helpers.ts +34 -333
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-response.test.ts +85 -0
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-response.ts +125 -0
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-state.ts +227 -0
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-types.ts +68 -0
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace.test.tsx +73 -1
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace.tsx +19 -16
- package/templates/blank/src/app/(base)/locators/create/page.tsx +4 -8
- package/templates/blank/src/app/(base)/locators/create/use-locator-workspace.ts +15 -2
- package/templates/blank/src/app/(base)/locators/locator-file-sync.test.ts +45 -0
- package/templates/blank/src/app/(base)/locators/locator-file-sync.ts +22 -0
- package/templates/blank/src/app/(base)/locators/locator-sync-toast.ts +34 -0
- package/templates/blank/src/app/(base)/locators/modify/[id]/page.tsx +1 -1
- package/templates/blank/src/app/(base)/locators/page.tsx +3 -5
- package/templates/blank/src/app/(base)/locators/picker/page.tsx +6 -0
- package/templates/blank/src/app/(base)/locators/sync-locators-button.tsx +12 -53
- package/templates/blank/src/app/(base)/modules/modify/[id]/page.tsx +11 -5
- package/templates/blank/src/app/(base)/modules/module-form-helpers.ts +12 -0
- package/templates/blank/src/app/(base)/modules/module-form.tsx +14 -19
- package/templates/blank/src/app/(base)/modules/module-helpers.test.ts +48 -0
- package/templates/blank/src/app/(base)/modules/module-helpers.ts +4 -64
- package/templates/blank/src/app/(base)/modules/module-parent-helpers.ts +16 -0
- package/templates/blank/src/app/(base)/modules/module-row-helpers.ts +32 -0
- package/templates/blank/src/app/(base)/modules/module-types.ts +8 -0
- package/templates/blank/src/app/(base)/modules/page.tsx +2 -2
- package/templates/blank/src/app/(base)/reports/[id]/page.tsx +25 -30
- package/templates/blank/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/blank/src/app/(base)/reports/page.tsx +5 -48
- package/templates/blank/src/app/(base)/reports/report-charts.tsx +17 -0
- package/templates/blank/src/app/(base)/reports/report-detail-helpers.ts +27 -54
- package/templates/blank/src/app/(base)/reports/report-metric-card.tsx +3 -3
- package/templates/blank/src/app/(base)/reports/report-table-columns.tsx +14 -46
- package/templates/blank/src/app/(base)/reports/report-table.tsx +5 -55
- package/templates/blank/src/app/(base)/reports/report-view-table-columns.tsx +5 -5
- package/templates/blank/src/app/(base)/reports/report-view-table.tsx +1 -49
- package/templates/blank/src/app/(base)/reports/test-cases/page.tsx +1 -1
- package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +115 -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/page.tsx +2 -2
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +79 -79
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +27 -27
- package/templates/blank/src/app/(base)/reports/view-logs-button.tsx +1 -1
- package/templates/blank/src/app/(base)/settings/page.tsx +2 -2
- package/templates/blank/src/app/(base)/settings/settings-sync-panel-helpers.tsx +2 -2
- package/templates/blank/src/app/(base)/settings/settings-sync-panel.tsx +7 -13
- package/templates/blank/src/app/(base)/settings/use-settings-sync.ts +0 -1
- package/templates/blank/src/app/(base)/tags/create/page.tsx +1 -1
- package/templates/blank/src/app/(base)/tags/modify/[id]/page.tsx +1 -1
- package/templates/blank/src/app/(base)/tags/page.tsx +2 -2
- package/templates/blank/src/app/(base)/tags/tag-form-helpers.ts +9 -0
- package/templates/blank/src/app/(base)/tags/tag-form.test.tsx +43 -1
- package/templates/blank/src/app/(base)/tags/tag-form.tsx +42 -23
- 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/page.tsx +2 -2
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-form.tsx +10 -15
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-table-columns.tsx +1 -5
- package/templates/blank/src/app/(base)/template-steps/modify/[id]/page.tsx +13 -7
- package/templates/blank/src/app/(base)/template-steps/page.tsx +2 -2
- package/templates/blank/src/app/(base)/template-steps/paramChip.tsx +20 -13
- package/templates/blank/src/app/(base)/template-steps/template-step-form-helpers.ts +65 -0
- package/templates/blank/src/app/(base)/template-steps/template-step-form.tsx +21 -26
- package/templates/blank/src/app/(base)/template-steps/template-step-helpers.ts +25 -176
- package/templates/blank/src/app/(base)/template-steps/template-step-option-helpers.ts +13 -0
- package/templates/blank/src/app/(base)/template-steps/template-step-row-guards.ts +69 -0
- package/templates/blank/src/app/(base)/template-steps/template-step-table-columns.tsx +7 -4
- package/templates/blank/src/app/(base)/template-steps/template-step-types.ts +31 -0
- package/templates/blank/src/app/(base)/template-test-cases/create/page.tsx +12 -19
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +78 -0
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +58 -0
- package/templates/blank/src/app/(base)/template-test-cases/modify/[id]/page.tsx +67 -8
- package/templates/blank/src/app/(base)/template-test-cases/page.tsx +2 -2
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +2 -0
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-flow.tsx +19 -4
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-form.test.tsx +6 -0
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-form.tsx +30 -26
- 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.test.tsx +121 -0
- package/templates/blank/src/app/(base)/test-cases/create/page.tsx +27 -5
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-conversion-helpers.ts +27 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-helpers.test.ts +2 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-helpers.ts +14 -171
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +74 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-types.ts +24 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/generate/[id]/page.test.tsx +19 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/generate/[id]/page.tsx +2 -93
- package/templates/blank/src/app/(base)/test-cases/create-from-template/page.test.tsx +157 -0
- package/templates/blank/src/app/(base)/test-cases/create-from-template/page.tsx +113 -10
- package/templates/blank/src/app/(base)/test-cases/editable-test-case-builders.ts +35 -0
- package/templates/blank/src/app/(base)/test-cases/editable-test-case-guards.ts +42 -0
- package/templates/blank/src/app/(base)/test-cases/editable-test-case-helpers.ts +3 -0
- package/templates/blank/src/app/(base)/test-cases/editable-test-case-types.ts +14 -0
- package/templates/blank/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +47 -0
- package/templates/blank/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +57 -0
- package/templates/blank/src/app/(base)/test-cases/modify/[id]/page.tsx +31 -4
- package/templates/blank/src/app/(base)/test-cases/page.tsx +3 -3
- package/templates/blank/src/app/(base)/test-cases/test-case-flow.test.tsx +24 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-flow.tsx +34 -13
- package/templates/blank/src/app/(base)/test-cases/test-case-form-reducer.test.ts +59 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-form-reducer.ts +203 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-form.test.tsx +340 -32
- package/templates/blank/src/app/(base)/test-cases/test-case-form.tsx +1325 -166
- package/templates/blank/src/app/(base)/test-cases/test-case-resource-rows.ts +9 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-route-helpers.test.ts +4 -1
- package/templates/blank/src/app/(base)/test-cases/test-case-route-helpers.ts +3 -147
- package/templates/blank/src/app/(base)/test-cases/test-case-row-helpers.ts +30 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-shared-resource-rows.ts +55 -0
- package/templates/blank/src/app/(base)/test-cases/test-case-table.tsx +3 -3
- package/templates/blank/src/app/(base)/test-cases/test-case-template-resource-rows.ts +21 -0
- package/templates/blank/src/app/(base)/test-runs/create/page.tsx +8 -16
- package/templates/blank/src/app/(base)/test-runs/create-test-run-page-data.test.ts +60 -0
- package/templates/blank/src/app/(base)/test-runs/create-test-run-page-data.ts +38 -0
- package/templates/blank/src/app/(base)/test-runs/page.tsx +2 -2
- package/templates/blank/src/app/(base)/test-runs/test-run-form-data-helpers.ts +71 -0
- package/templates/blank/src/app/(base)/test-runs/test-run-form-display-helpers.ts +44 -0
- package/templates/blank/src/app/(base)/test-runs/test-run-form-helpers.ts +17 -157
- package/templates/blank/src/app/(base)/test-runs/test-run-form-selection-helpers.ts +46 -0
- package/templates/blank/src/app/(base)/test-runs/test-run-form.tsx +19 -24
- package/templates/blank/src/app/(base)/test-runs/test-run-table-columns.tsx +14 -14
- package/templates/blank/src/app/(base)/test-runs/test-run-table.tsx +61 -60
- package/templates/blank/src/app/(base)/test-suites/editable-test-suite-helpers.ts +17 -0
- package/templates/blank/src/app/(base)/test-suites/page.tsx +5 -5
- package/templates/blank/src/app/(base)/test-suites/test-suite-form-display-helpers.ts +54 -0
- package/templates/blank/src/app/(base)/test-suites/test-suite-form.test.tsx +57 -8
- package/templates/blank/src/app/(base)/test-suites/test-suite-form.tsx +38 -21
- package/templates/blank/src/app/(base)/test-suites/test-suite-helpers.ts +25 -215
- package/templates/blank/src/app/(base)/test-suites/test-suite-row-guards.ts +80 -0
- package/templates/blank/src/app/(base)/test-suites/test-suite-table-columns.tsx +1 -1
- package/templates/blank/src/app/(base)/test-suites/test-suite-table-helpers.ts +57 -0
- package/templates/blank/src/app/(base)/test-suites/test-suite-types.ts +30 -0
- package/templates/blank/src/app/(dashboard-components)/app-drawer.tsx +26 -23
- package/templates/blank/src/app/(dashboard-components)/data-card-grid.tsx +1 -1
- package/templates/blank/src/app/(dashboard-components)/data-card.tsx +30 -26
- package/templates/blank/src/app/(dashboard-components)/execution-health-panel.tsx +42 -42
- package/templates/blank/src/app/(dashboard-components)/ongoing-test-runs-card.tsx +8 -8
- package/templates/blank/src/app/(dashboard-components)/quick-actions-drawer.tsx +66 -42
- package/templates/blank/src/app/api/test-runs/[runId]/download/route.ts +160 -103
- package/templates/blank/src/app/globals.css +11 -0
- package/templates/blank/src/app/layout.tsx +17 -17
- package/templates/blank/src/app/page.tsx +10 -5
- 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/base-node.tsx +5 -8
- package/templates/blank/src/components/data-state/empty-state.tsx +1 -1
- package/templates/blank/src/components/data-visualization/info-card.tsx +70 -70
- package/templates/blank/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/blank/src/components/diagram/add-node-prompt-node.tsx +30 -0
- package/templates/blank/src/components/diagram/button-edge.tsx +27 -9
- package/templates/blank/src/components/diagram/dynamic-parameter-field-label.tsx +19 -0
- package/templates/blank/src/components/diagram/dynamic-parameter-field-shell.tsx +30 -0
- package/templates/blank/src/components/diagram/dynamic-parameter-field-types.ts +32 -0
- package/templates/blank/src/components/diagram/dynamic-parameter-fields.tsx +140 -0
- package/templates/blank/src/components/diagram/dynamic-parameter-locator-field.tsx +288 -0
- package/templates/blank/src/components/diagram/dynamic-parameters-helpers.ts +6 -1
- package/templates/blank/src/components/diagram/dynamic-parameters.test.tsx +295 -0
- package/templates/blank/src/components/diagram/dynamic-parameters.tsx +223 -222
- package/templates/blank/src/components/diagram/flow-add-node-prompt-helpers.ts +22 -0
- package/templates/blank/src/components/diagram/flow-block-helpers.ts +86 -0
- package/templates/blank/src/components/diagram/flow-diagram-block-dialog.tsx +56 -0
- package/templates/blank/src/components/diagram/flow-diagram-block-overlays.tsx +65 -0
- package/templates/blank/src/components/diagram/flow-diagram-connection-guards.ts +127 -0
- package/templates/blank/src/components/diagram/flow-diagram-grouping-hints.tsx +38 -0
- package/templates/blank/src/components/diagram/flow-diagram-helpers.test.ts +187 -5
- package/templates/blank/src/components/diagram/flow-diagram-helpers.ts +22 -251
- package/templates/blank/src/components/diagram/flow-diagram-node-search.tsx +108 -0
- package/templates/blank/src/components/diagram/flow-diagram-node-types.tsx +46 -0
- package/templates/blank/src/components/diagram/flow-diagram-toolbar.tsx +88 -0
- package/templates/blank/src/components/diagram/flow-diagram-types.ts +21 -0
- package/templates/blank/src/components/diagram/flow-diagram-view.tsx +179 -0
- package/templates/blank/src/components/diagram/flow-diagram.test.tsx +501 -0
- package/templates/blank/src/components/diagram/flow-diagram.tsx +72 -226
- package/templates/blank/src/components/diagram/flow-node-data-helpers.ts +122 -0
- package/templates/blank/src/components/diagram/flow-node-order-helpers.ts +179 -0
- package/templates/blank/src/components/diagram/flow-node-search-helpers.ts +24 -0
- package/templates/blank/src/components/diagram/node-form-fields-content.tsx +120 -0
- package/templates/blank/src/components/diagram/node-form-fields-props.ts +3 -0
- package/templates/blank/src/components/diagram/node-form-helpers.ts +15 -8
- package/templates/blank/src/components/diagram/node-form-submit.ts +36 -0
- package/templates/blank/src/components/diagram/node-form-template-step-selection.test.ts +42 -0
- package/templates/blank/src/components/diagram/node-form-template-step-selection.ts +40 -0
- package/templates/blank/src/components/diagram/node-form.test.tsx +172 -25
- package/templates/blank/src/components/diagram/node-form.tsx +108 -158
- package/templates/blank/src/components/diagram/options-header-gherkin-step.tsx +72 -0
- package/templates/blank/src/components/diagram/options-header-node.test.tsx +210 -0
- package/templates/blank/src/components/diagram/options-header-node.tsx +226 -32
- package/templates/blank/src/components/diagram/template-step-combobox.test.tsx +144 -0
- package/templates/blank/src/components/diagram/template-step-combobox.tsx +176 -39
- package/templates/blank/src/components/diagram/use-flow-diagram-block-grouping.ts +130 -0
- package/templates/blank/src/components/diagram/use-flow-diagram-search.ts +114 -0
- package/templates/blank/src/components/diagram/use-flow-diagram.ts +384 -0
- package/templates/blank/src/components/form/error-message.tsx +7 -7
- package/templates/blank/src/components/loading-skeleton/data-table/data-table-skeleton.tsx +1 -1
- package/templates/blank/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/blank/src/components/loading-skeleton/form/icon-button-skeleton.tsx +1 -1
- 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/logo.tsx +1 -1
- package/templates/blank/src/components/navigation/command-badge.tsx +1 -1
- package/templates/blank/src/components/navigation/command-chain-input.tsx +5 -10
- package/templates/blank/src/components/navigation/entity-search-command.tsx +47 -24
- package/templates/blank/src/components/navigation/nav-command-search.tsx +5 -5
- package/templates/blank/src/components/navigation/nav-command.tsx +8 -8
- package/templates/blank/src/components/navigation/nav-link.tsx +60 -60
- package/templates/blank/src/components/navigation/nav-menu-card-deck.tsx +73 -70
- package/templates/blank/src/components/reports/test-case-logs-modal.tsx +10 -10
- package/templates/blank/src/components/table/table-actions.test.tsx +53 -0
- package/templates/blank/src/components/table/table-actions.tsx +14 -10
- package/templates/blank/src/components/test-case/test-case-form-helpers.test.ts +1 -0
- package/templates/blank/src/components/test-case/test-case-form-helpers.ts +40 -45
- package/templates/blank/src/components/test-case/test-case-picker.test.tsx +14 -11
- package/templates/blank/src/components/test-case/test-case-picker.tsx +140 -112
- package/templates/blank/src/components/test-case/test-scenario-preview.tsx +69 -16
- package/templates/blank/src/components/test-run/download-logs-button.tsx +13 -26
- package/templates/blank/src/components/test-run/log-viewer-events.ts +7 -0
- package/templates/blank/src/components/test-run/log-viewer-helpers.ts +4 -80
- package/templates/blank/src/components/test-run/log-viewer-parsing.ts +28 -0
- package/templates/blank/src/components/test-run/log-viewer-status.ts +35 -0
- package/templates/blank/src/components/test-run/log-viewer-types.ts +7 -0
- package/templates/blank/src/components/test-run/log-viewer.tsx +9 -9
- package/templates/blank/src/components/test-run/test-run-details-guards.ts +85 -0
- package/templates/blank/src/components/test-run/test-run-details-helpers.test.ts +102 -0
- package/templates/blank/src/components/test-run/test-run-details-helpers.ts +10 -208
- package/templates/blank/src/components/test-run/test-run-details-progress.ts +26 -0
- package/templates/blank/src/components/test-run/test-run-details-status.ts +70 -0
- package/templates/blank/src/components/test-run/test-run-details-types.ts +21 -0
- package/templates/blank/src/components/test-run/test-run-details.test.tsx +1 -6
- package/templates/blank/src/components/test-run/test-run-details.tsx +26 -54
- package/templates/blank/src/components/test-run/test-run-header.test.tsx +13 -18
- package/templates/blank/src/components/test-run/trace-viewer-button-label.tsx +57 -0
- package/templates/blank/src/components/test-run/view-report-button.tsx +60 -64
- package/templates/blank/src/components/test-suite/test-suite-picker-helpers.test.ts +27 -1
- package/templates/blank/src/components/test-suite/test-suite-picker-helpers.ts +80 -1
- package/templates/blank/src/components/test-suite/test-suite-picker-suite-row-header.tsx +87 -0
- package/templates/blank/src/components/test-suite/test-suite-picker-suite-row.tsx +61 -0
- package/templates/blank/src/components/test-suite/test-suite-picker-test-case-list.tsx +95 -0
- package/templates/blank/src/components/test-suite/test-suite-picker.tsx +134 -275
- 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/alert.tsx +12 -18
- package/templates/blank/src/components/ui/badge.tsx +1 -1
- package/templates/blank/src/components/ui/button.tsx +13 -10
- package/templates/blank/src/components/ui/calendar.tsx +3 -3
- package/templates/blank/src/components/ui/card.tsx +16 -34
- package/templates/blank/src/components/ui/chart-utils.ts +43 -0
- package/templates/blank/src/components/ui/chart.tsx +217 -304
- package/templates/blank/src/components/ui/checkbox.tsx +20 -17
- package/templates/blank/src/components/ui/command.tsx +63 -96
- package/templates/blank/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/blank/src/components/ui/data-table-pagination.tsx +7 -7
- package/templates/blank/src/components/ui/data-table-view-options.tsx +20 -15
- package/templates/blank/src/components/ui/data-table.tsx +22 -19
- package/templates/blank/src/components/ui/dialog.tsx +45 -63
- package/templates/blank/src/components/ui/dropdown-menu.tsx +76 -148
- package/templates/blank/src/components/ui/empty.tsx +21 -40
- package/templates/blank/src/components/ui/input.tsx +13 -15
- package/templates/blank/src/components/ui/kbd.tsx +7 -13
- package/templates/blank/src/components/ui/label.tsx +7 -6
- package/templates/blank/src/components/ui/multi-select-with-preview.tsx +20 -7
- package/templates/blank/src/components/ui/multi-select.tsx +7 -5
- package/templates/blank/src/components/ui/picker-browse-shell.tsx +99 -0
- package/templates/blank/src/components/ui/popover.tsx +21 -19
- package/templates/blank/src/components/ui/progress.tsx +14 -15
- package/templates/blank/src/components/ui/radio-group.tsx +14 -25
- package/templates/blank/src/components/ui/scroll-area.tsx +32 -29
- package/templates/blank/src/components/ui/select.tsx +99 -125
- package/templates/blank/src/components/ui/separator.tsx +16 -12
- package/templates/blank/src/components/ui/sheet.tsx +92 -0
- package/templates/blank/src/components/ui/skeleton.tsx +7 -7
- package/templates/blank/src/components/ui/table.tsx +24 -49
- package/templates/blank/src/components/ui/tabs.tsx +36 -41
- package/templates/blank/src/components/ui/textarea.tsx +11 -15
- package/templates/blank/src/components/ui/toast.tsx +56 -62
- package/templates/blank/src/components/ui/toaster.tsx +26 -26
- package/templates/blank/src/components/ui/tooltip.tsx +23 -20
- package/templates/blank/src/components/user-prompt/delete-prompt.tsx +5 -5
- package/templates/blank/src/constants/form-opts/diagram/node-form.ts +11 -28
- package/templates/blank/src/constants/form-opts/environment-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/locator-group-form-opts.ts +1 -7
- package/templates/blank/src/constants/form-opts/module-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/tag-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/template-selection-form-opts.ts +0 -11
- package/templates/blank/src/constants/form-opts/template-step-group-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/template-test-case-form-opts.ts +3 -33
- package/templates/blank/src/constants/form-opts/template-test-step-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/test-case-form-opts.ts +3 -35
- package/templates/blank/src/constants/form-opts/test-case-step-form-opts.ts +27 -0
- package/templates/blank/src/constants/form-opts/test-run-form-opts.ts +1 -1
- package/templates/blank/src/constants/form-opts/test-suite-form-opts.ts +1 -1
- package/templates/blank/src/hooks/use-toast.ts +1 -1
- package/templates/blank/src/lib/automation/automation-path-roots.ts +1 -9
- package/templates/blank/src/lib/bidirectional-sync.ts +116 -107
- package/templates/blank/src/lib/database-sync.ts +142 -190
- package/templates/blank/src/lib/environment-file-utils.ts +3 -115
- package/templates/blank/src/lib/executor/local-executor-adapter.ts +1 -1
- package/templates/blank/src/lib/form/tanstack-form-action.ts +7 -0
- package/templates/blank/src/lib/form/tanstack-form.tsx +18 -0
- package/templates/blank/src/lib/gherkin-parser.test.ts +7 -7
- package/templates/blank/src/lib/gherkin-parser.ts +132 -145
- package/templates/blank/src/lib/gherkin-step-format.ts +80 -0
- package/templates/blank/src/lib/jsdoc/template-step-jsdoc.ts +262 -0
- package/templates/blank/src/lib/locator-group-file-utils.ts +2 -20
- package/templates/blank/src/lib/locator-picker/suggestions.ts +7 -4
- package/templates/blank/src/lib/metrics/metric-calculator.test.ts +156 -0
- package/templates/blank/src/lib/metrics/metric-calculator.ts +251 -273
- package/templates/blank/src/lib/module-hierarchy-builder.ts +1 -10
- package/templates/blank/src/lib/path-helpers/feature-path.ts +10 -0
- package/templates/blank/src/lib/path-helpers/module-path.ts +0 -50
- package/templates/blank/src/lib/process/task-spawner.ts +50 -27
- package/templates/blank/src/lib/sync/projected-feature-utils.ts +2 -42
- package/templates/blank/src/lib/sync/sync-pending-counts.ts +126 -274
- package/templates/blank/src/lib/sync/sync-registry.ts +2 -2
- package/templates/blank/src/lib/tag-filters.ts +11 -0
- package/templates/blank/src/lib/tag-identifiers.ts +18 -0
- package/templates/blank/src/lib/tag-utils.ts +2 -28
- package/templates/blank/src/lib/template-automation-paths.ts +34 -0
- package/templates/blank/src/lib/template-path-exclusions.ts +34 -0
- package/templates/blank/src/lib/template-sync-utils.d.ts +6 -6
- package/templates/blank/src/lib/template-sync-utils.ts +2 -65
- package/templates/blank/src/lib/test-case-utils.ts +6 -6
- package/templates/blank/src/lib/test-run/log-formatter.ts +83 -83
- package/templates/blank/src/lib/test-run/matching.test.ts +77 -0
- package/templates/blank/src/lib/test-run/matching.ts +2 -2
- package/templates/blank/src/lib/test-run/report-parser.test.ts +113 -0
- package/templates/blank/src/lib/test-run/report-parser.ts +352 -352
- package/templates/blank/src/lib/test-suite-identifier-service.ts +1 -1
- 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/transformers/template-test-case-converter.ts +13 -64
- package/templates/blank/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/blank/src/lib/utils/template-step-file-generator.ts +2 -19
- package/templates/blank/src/lib/utils/template-step-file-manager-intelligent.ts +1 -355
- package/templates/blank/src/lib/utils/template-step-function-bounds.test.ts +48 -0
- package/templates/blank/src/lib/utils/template-step-function-bounds.ts +138 -0
- package/templates/blank/src/lib/utils.ts +0 -4
- package/templates/blank/src/services/locator/locator-service.ts +22 -6
- package/templates/blank/src/services/report/report-service.ts +249 -237
- package/templates/blank/src/services/tag/tag-service.test.ts +140 -2
- package/templates/blank/src/services/tag/tag-service.ts +71 -0
- package/templates/blank/src/services/template-test-case/template-test-case-service.ts +34 -2
- package/templates/blank/src/services/test-case/test-case-service.test.ts +1 -0
- package/templates/blank/src/services/test-case/test-case-service.ts +39 -2
- package/templates/blank/src/services/test-run/test-run-service.ts +146 -119
- package/templates/blank/src/test/motion-react-vitest-mocks.ts +18 -0
- package/templates/blank/src/test/setup-motion-react-mocks.ts +4 -0
- package/templates/blank/src/types/diagram/diagram.ts +8 -0
- package/templates/blank/src/types/diagram/template-step.ts +5 -2
- package/templates/blank/src/types/report.ts +84 -0
- package/templates/blank/tsconfig.json +1 -1
- package/templates/default/next-env.d.ts +6 -0
- package/templates/default/packages/locator-picker-companion/dist/cli.d.ts +1 -0
- package/templates/default/packages/locator-picker-companion/dist/cli.js +302 -0
- package/templates/default/packages/locator-picker-companion/dist/index.d.ts +3 -0
- package/templates/default/packages/locator-picker-companion/dist/index.js +3 -0
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.d.ts +1 -0
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.js +615 -0
- package/templates/default/packages/locator-picker-companion/dist/launcher.d.ts +11 -0
- package/templates/default/packages/locator-picker-companion/dist/launcher.js +59 -0
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.d.ts +3 -0
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.js +257 -0
- package/templates/default/packages/locator-picker-companion/dist/session-file.d.ts +22 -0
- package/templates/default/packages/locator-picker-companion/dist/session-file.js +150 -0
- package/templates/default/packages/locator-picker-companion/dist/types.d.ts +31 -0
- package/templates/default/packages/locator-picker-companion/dist/types.js +1 -0
- package/templates/default/prisma/dev.db +0 -0
- package/templates/starter/.env.example +2 -2
- package/templates/starter/automation/steps/actions/click.step.ts +58 -58
- package/templates/starter/automation/steps/actions/hover.step.ts +27 -27
- package/templates/starter/automation/steps/actions/navigation.step.ts +70 -70
- package/templates/starter/automation/steps/actions/random_data.step.ts +142 -142
- package/templates/starter/automation/steps/actions/store.step.ts +1 -80
- package/templates/starter/automation/steps/actions/wait.step.ts +2 -105
- package/templates/starter/automation/steps/validations/active_state_assertion.step.ts +30 -30
- package/templates/starter/automation/steps/validations/navigation_assertion.step.ts +22 -22
- package/templates/starter/automation/steps/validations/text_assertion.step.ts +107 -107
- package/templates/starter/automation/steps/validations/visibility_assertion.step.ts +26 -26
- package/templates/starter/components.json +24 -24
- package/templates/starter/cucumber.mjs +16 -16
- package/templates/starter/gitignore +6 -0
- package/templates/starter/next-env.d.ts +6 -6
- package/templates/starter/package-lock.json +2274 -1019
- package/templates/starter/package.json +27 -18
- 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 +68 -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/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/prisma/migrations/20260507000000_add_flow_builder_node_grouping/migration.sql +34 -0
- package/templates/starter/prisma/schema.prisma +36 -0
- package/templates/starter/scripts/lib/jsdoc-parser.test.ts +12 -0
- package/templates/starter/scripts/lib/jsdoc-parser.ts +5 -88
- package/templates/starter/scripts/lib/step-file-parser.ts +111 -178
- package/templates/starter/scripts/lib/template-sync-utils.test.ts +35 -0
- package/templates/starter/scripts/run-fallow-commit.mjs +23 -0
- package/templates/starter/scripts/setup-env.ts +0 -0
- package/templates/starter/scripts/sync-tags.ts +1 -1
- package/templates/starter/scripts/sync-test-suites.ts +233 -162
- package/templates/starter/src/actions/dashboard/dashboard-actions.ts +0 -7
- package/templates/starter/src/actions/locator-picker/locator-picker-actions.test.ts +10 -0
- package/templates/starter/src/actions/locator-picker/locator-picker-actions.ts +5 -0
- package/templates/starter/src/actions/server-action-boundary.test.ts +794 -0
- package/templates/starter/src/actions/test-suite/test-suite-actions.ts +2 -1
- package/templates/starter/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/starter/src/app/(base)/environments/environment-form.tsx +16 -23
- package/templates/starter/src/app/(base)/environments/page.tsx +2 -2
- package/templates/starter/src/app/(base)/layout.tsx +10 -10
- package/templates/starter/src/app/(base)/locator-groups/create/page.tsx +1 -1
- package/templates/starter/src/app/(base)/locator-groups/locator-group-form.tsx +24 -24
- 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 +3 -3
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-helpers.ts +34 -333
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-response.test.ts +85 -0
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-response.ts +125 -0
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-state.ts +227 -0
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-types.ts +68 -0
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace.test.tsx +73 -1
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace.tsx +19 -16
- package/templates/starter/src/app/(base)/locators/create/page.tsx +4 -8
- package/templates/starter/src/app/(base)/locators/create/use-locator-workspace.ts +15 -2
- package/templates/starter/src/app/(base)/locators/locator-file-sync.test.ts +45 -0
- package/templates/starter/src/app/(base)/locators/locator-file-sync.ts +22 -0
- package/templates/starter/src/app/(base)/locators/locator-sync-toast.ts +34 -0
- package/templates/starter/src/app/(base)/locators/modify/[id]/page.tsx +1 -1
- package/templates/starter/src/app/(base)/locators/page.tsx +3 -5
- package/templates/starter/src/app/(base)/locators/picker/page.tsx +6 -0
- package/templates/starter/src/app/(base)/locators/sync-locators-button.tsx +12 -53
- package/templates/starter/src/app/(base)/modules/modify/[id]/page.tsx +11 -5
- package/templates/starter/src/app/(base)/modules/module-form-helpers.ts +12 -0
- package/templates/starter/src/app/(base)/modules/module-form.tsx +14 -19
- package/templates/starter/src/app/(base)/modules/module-helpers.test.ts +48 -0
- package/templates/starter/src/app/(base)/modules/module-helpers.ts +4 -64
- package/templates/starter/src/app/(base)/modules/module-parent-helpers.ts +16 -0
- package/templates/starter/src/app/(base)/modules/module-row-helpers.ts +32 -0
- package/templates/starter/src/app/(base)/modules/module-types.ts +8 -0
- package/templates/starter/src/app/(base)/modules/page.tsx +2 -2
- package/templates/starter/src/app/(base)/reports/[id]/page.tsx +25 -30
- package/templates/starter/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/starter/src/app/(base)/reports/page.tsx +5 -48
- package/templates/starter/src/app/(base)/reports/report-charts.tsx +17 -0
- package/templates/starter/src/app/(base)/reports/report-detail-helpers.ts +27 -54
- package/templates/starter/src/app/(base)/reports/report-metric-card.tsx +3 -3
- package/templates/starter/src/app/(base)/reports/report-table-columns.tsx +14 -46
- package/templates/starter/src/app/(base)/reports/report-table.tsx +5 -55
- package/templates/starter/src/app/(base)/reports/report-view-table-columns.tsx +5 -5
- package/templates/starter/src/app/(base)/reports/report-view-table.tsx +1 -49
- package/templates/starter/src/app/(base)/reports/test-cases/page.tsx +1 -1
- package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +115 -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/page.tsx +2 -2
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +79 -79
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +27 -27
- package/templates/starter/src/app/(base)/reports/view-logs-button.tsx +1 -1
- package/templates/starter/src/app/(base)/settings/page.tsx +2 -2
- package/templates/starter/src/app/(base)/settings/settings-sync-panel-helpers.tsx +2 -2
- package/templates/starter/src/app/(base)/settings/settings-sync-panel.tsx +7 -13
- package/templates/starter/src/app/(base)/settings/use-settings-sync.ts +0 -1
- package/templates/starter/src/app/(base)/tags/create/page.tsx +1 -1
- package/templates/starter/src/app/(base)/tags/modify/[id]/page.tsx +1 -1
- package/templates/starter/src/app/(base)/tags/page.tsx +2 -2
- package/templates/starter/src/app/(base)/tags/tag-form-helpers.ts +9 -0
- package/templates/starter/src/app/(base)/tags/tag-form.test.tsx +43 -1
- package/templates/starter/src/app/(base)/tags/tag-form.tsx +42 -23
- 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/page.tsx +2 -2
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-form.tsx +10 -15
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-table-columns.tsx +1 -5
- package/templates/starter/src/app/(base)/template-steps/modify/[id]/page.tsx +13 -7
- package/templates/starter/src/app/(base)/template-steps/page.tsx +2 -2
- package/templates/starter/src/app/(base)/template-steps/paramChip.tsx +20 -13
- package/templates/starter/src/app/(base)/template-steps/template-step-form-helpers.ts +65 -0
- package/templates/starter/src/app/(base)/template-steps/template-step-form.tsx +21 -26
- package/templates/starter/src/app/(base)/template-steps/template-step-helpers.ts +25 -176
- package/templates/starter/src/app/(base)/template-steps/template-step-option-helpers.ts +13 -0
- package/templates/starter/src/app/(base)/template-steps/template-step-row-guards.ts +69 -0
- package/templates/starter/src/app/(base)/template-steps/template-step-table-columns.tsx +7 -4
- package/templates/starter/src/app/(base)/template-steps/template-step-types.ts +31 -0
- package/templates/starter/src/app/(base)/template-test-cases/create/page.tsx +12 -19
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +78 -0
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +58 -0
- package/templates/starter/src/app/(base)/template-test-cases/modify/[id]/page.tsx +67 -8
- package/templates/starter/src/app/(base)/template-test-cases/page.tsx +2 -2
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +2 -0
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-flow.tsx +19 -4
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-form.test.tsx +6 -0
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-form.tsx +30 -26
- 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.test.tsx +121 -0
- package/templates/starter/src/app/(base)/test-cases/create/page.tsx +27 -5
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-conversion-helpers.ts +27 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-helpers.test.ts +2 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-helpers.ts +14 -171
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +74 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-types.ts +24 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/generate/[id]/page.test.tsx +19 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/generate/[id]/page.tsx +2 -93
- package/templates/starter/src/app/(base)/test-cases/create-from-template/page.test.tsx +157 -0
- package/templates/starter/src/app/(base)/test-cases/create-from-template/page.tsx +113 -10
- package/templates/starter/src/app/(base)/test-cases/editable-test-case-builders.ts +35 -0
- package/templates/starter/src/app/(base)/test-cases/editable-test-case-guards.ts +42 -0
- package/templates/starter/src/app/(base)/test-cases/editable-test-case-helpers.ts +3 -0
- package/templates/starter/src/app/(base)/test-cases/editable-test-case-types.ts +14 -0
- package/templates/starter/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +47 -0
- package/templates/starter/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +57 -0
- package/templates/starter/src/app/(base)/test-cases/modify/[id]/page.tsx +31 -4
- package/templates/starter/src/app/(base)/test-cases/page.tsx +3 -3
- package/templates/starter/src/app/(base)/test-cases/test-case-flow.test.tsx +24 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-flow.tsx +34 -13
- package/templates/starter/src/app/(base)/test-cases/test-case-form-reducer.test.ts +59 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-form-reducer.ts +203 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-form.test.tsx +340 -32
- package/templates/starter/src/app/(base)/test-cases/test-case-form.tsx +1325 -166
- package/templates/starter/src/app/(base)/test-cases/test-case-resource-rows.ts +9 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-route-helpers.test.ts +4 -1
- package/templates/starter/src/app/(base)/test-cases/test-case-route-helpers.ts +3 -147
- package/templates/starter/src/app/(base)/test-cases/test-case-row-helpers.ts +30 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-shared-resource-rows.ts +55 -0
- package/templates/starter/src/app/(base)/test-cases/test-case-table.tsx +3 -3
- package/templates/starter/src/app/(base)/test-cases/test-case-template-resource-rows.ts +21 -0
- package/templates/starter/src/app/(base)/test-runs/create/page.tsx +8 -16
- package/templates/starter/src/app/(base)/test-runs/create-test-run-page-data.test.ts +60 -0
- package/templates/starter/src/app/(base)/test-runs/create-test-run-page-data.ts +38 -0
- package/templates/starter/src/app/(base)/test-runs/page.tsx +2 -2
- package/templates/starter/src/app/(base)/test-runs/test-run-form-data-helpers.ts +71 -0
- package/templates/starter/src/app/(base)/test-runs/test-run-form-display-helpers.ts +44 -0
- package/templates/starter/src/app/(base)/test-runs/test-run-form-helpers.ts +17 -157
- package/templates/starter/src/app/(base)/test-runs/test-run-form-selection-helpers.ts +46 -0
- package/templates/starter/src/app/(base)/test-runs/test-run-form.tsx +19 -24
- package/templates/starter/src/app/(base)/test-runs/test-run-table-columns.tsx +14 -14
- package/templates/starter/src/app/(base)/test-runs/test-run-table.tsx +61 -60
- package/templates/starter/src/app/(base)/test-suites/editable-test-suite-helpers.ts +17 -0
- package/templates/starter/src/app/(base)/test-suites/page.tsx +5 -5
- package/templates/starter/src/app/(base)/test-suites/test-suite-form-display-helpers.ts +54 -0
- package/templates/starter/src/app/(base)/test-suites/test-suite-form.test.tsx +57 -8
- package/templates/starter/src/app/(base)/test-suites/test-suite-form.tsx +38 -21
- package/templates/starter/src/app/(base)/test-suites/test-suite-helpers.ts +25 -215
- package/templates/starter/src/app/(base)/test-suites/test-suite-row-guards.ts +80 -0
- package/templates/starter/src/app/(base)/test-suites/test-suite-table-columns.tsx +1 -1
- package/templates/starter/src/app/(base)/test-suites/test-suite-table-helpers.ts +57 -0
- package/templates/starter/src/app/(base)/test-suites/test-suite-types.ts +30 -0
- package/templates/starter/src/app/(dashboard-components)/app-drawer.tsx +26 -23
- package/templates/starter/src/app/(dashboard-components)/data-card-grid.tsx +1 -1
- package/templates/starter/src/app/(dashboard-components)/data-card.tsx +30 -26
- package/templates/starter/src/app/(dashboard-components)/execution-health-panel.tsx +42 -42
- package/templates/starter/src/app/(dashboard-components)/ongoing-test-runs-card.tsx +8 -8
- package/templates/starter/src/app/(dashboard-components)/quick-actions-drawer.tsx +66 -42
- package/templates/starter/src/app/api/test-runs/[runId]/download/route.ts +160 -103
- package/templates/starter/src/app/globals.css +11 -0
- package/templates/starter/src/app/layout.tsx +17 -17
- package/templates/starter/src/app/page.tsx +10 -5
- 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/base-node.tsx +5 -8
- package/templates/starter/src/components/data-state/empty-state.tsx +1 -1
- package/templates/starter/src/components/data-visualization/info-card.tsx +70 -70
- package/templates/starter/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/starter/src/components/diagram/add-node-prompt-node.tsx +30 -0
- package/templates/starter/src/components/diagram/button-edge.tsx +27 -9
- package/templates/starter/src/components/diagram/dynamic-parameter-field-label.tsx +19 -0
- package/templates/starter/src/components/diagram/dynamic-parameter-field-shell.tsx +30 -0
- package/templates/starter/src/components/diagram/dynamic-parameter-field-types.ts +32 -0
- package/templates/starter/src/components/diagram/dynamic-parameter-fields.tsx +140 -0
- package/templates/starter/src/components/diagram/dynamic-parameter-locator-field.tsx +288 -0
- package/templates/starter/src/components/diagram/dynamic-parameters-helpers.ts +6 -1
- package/templates/starter/src/components/diagram/dynamic-parameters.test.tsx +295 -0
- package/templates/starter/src/components/diagram/dynamic-parameters.tsx +223 -222
- package/templates/starter/src/components/diagram/flow-add-node-prompt-helpers.ts +22 -0
- package/templates/starter/src/components/diagram/flow-block-helpers.ts +86 -0
- package/templates/starter/src/components/diagram/flow-diagram-block-dialog.tsx +56 -0
- package/templates/starter/src/components/diagram/flow-diagram-block-overlays.tsx +65 -0
- package/templates/starter/src/components/diagram/flow-diagram-connection-guards.ts +127 -0
- package/templates/starter/src/components/diagram/flow-diagram-grouping-hints.tsx +38 -0
- package/templates/starter/src/components/diagram/flow-diagram-helpers.test.ts +187 -5
- package/templates/starter/src/components/diagram/flow-diagram-helpers.ts +22 -251
- package/templates/starter/src/components/diagram/flow-diagram-node-search.tsx +108 -0
- package/templates/starter/src/components/diagram/flow-diagram-node-types.tsx +46 -0
- package/templates/starter/src/components/diagram/flow-diagram-toolbar.tsx +88 -0
- package/templates/starter/src/components/diagram/flow-diagram-types.ts +21 -0
- package/templates/starter/src/components/diagram/flow-diagram-view.tsx +179 -0
- package/templates/starter/src/components/diagram/flow-diagram.test.tsx +501 -0
- package/templates/starter/src/components/diagram/flow-diagram.tsx +72 -226
- package/templates/starter/src/components/diagram/flow-node-data-helpers.ts +122 -0
- package/templates/starter/src/components/diagram/flow-node-order-helpers.ts +179 -0
- package/templates/starter/src/components/diagram/flow-node-search-helpers.ts +24 -0
- package/templates/starter/src/components/diagram/node-form-fields-content.tsx +120 -0
- package/templates/starter/src/components/diagram/node-form-fields-props.ts +3 -0
- package/templates/starter/src/components/diagram/node-form-helpers.ts +15 -8
- package/templates/starter/src/components/diagram/node-form-submit.ts +36 -0
- package/templates/starter/src/components/diagram/node-form-template-step-selection.test.ts +42 -0
- package/templates/starter/src/components/diagram/node-form-template-step-selection.ts +40 -0
- package/templates/starter/src/components/diagram/node-form.test.tsx +172 -25
- package/templates/starter/src/components/diagram/node-form.tsx +108 -158
- package/templates/starter/src/components/diagram/options-header-gherkin-step.tsx +72 -0
- package/templates/starter/src/components/diagram/options-header-node.test.tsx +210 -0
- package/templates/starter/src/components/diagram/options-header-node.tsx +226 -32
- package/templates/starter/src/components/diagram/template-step-combobox.test.tsx +144 -0
- package/templates/starter/src/components/diagram/template-step-combobox.tsx +176 -39
- package/templates/starter/src/components/diagram/use-flow-diagram-block-grouping.ts +130 -0
- package/templates/starter/src/components/diagram/use-flow-diagram-search.ts +114 -0
- package/templates/starter/src/components/diagram/use-flow-diagram.ts +384 -0
- package/templates/starter/src/components/form/error-message.tsx +7 -7
- package/templates/starter/src/components/loading-skeleton/data-table/data-table-skeleton.tsx +1 -1
- package/templates/starter/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/starter/src/components/loading-skeleton/form/icon-button-skeleton.tsx +1 -1
- 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/logo.tsx +1 -1
- package/templates/starter/src/components/navigation/command-badge.tsx +1 -1
- package/templates/starter/src/components/navigation/command-chain-input.tsx +5 -10
- package/templates/starter/src/components/navigation/entity-search-command.tsx +47 -24
- package/templates/starter/src/components/navigation/nav-command-search.tsx +5 -5
- package/templates/starter/src/components/navigation/nav-command.tsx +8 -8
- package/templates/starter/src/components/navigation/nav-link.tsx +60 -60
- package/templates/starter/src/components/navigation/nav-menu-card-deck.tsx +73 -70
- package/templates/starter/src/components/reports/test-case-logs-modal.tsx +10 -10
- package/templates/starter/src/components/table/table-actions.test.tsx +53 -0
- package/templates/starter/src/components/table/table-actions.tsx +14 -10
- package/templates/starter/src/components/test-case/test-case-form-helpers.test.ts +1 -0
- package/templates/starter/src/components/test-case/test-case-form-helpers.ts +40 -45
- package/templates/starter/src/components/test-case/test-case-picker.test.tsx +14 -11
- package/templates/starter/src/components/test-case/test-case-picker.tsx +140 -112
- package/templates/starter/src/components/test-case/test-scenario-preview.tsx +69 -16
- package/templates/starter/src/components/test-run/download-logs-button.tsx +13 -26
- package/templates/starter/src/components/test-run/log-viewer-events.ts +7 -0
- package/templates/starter/src/components/test-run/log-viewer-helpers.ts +4 -80
- package/templates/starter/src/components/test-run/log-viewer-parsing.ts +28 -0
- package/templates/starter/src/components/test-run/log-viewer-status.ts +35 -0
- package/templates/starter/src/components/test-run/log-viewer-types.ts +7 -0
- package/templates/starter/src/components/test-run/log-viewer.tsx +9 -9
- package/templates/starter/src/components/test-run/test-run-details-guards.ts +85 -0
- package/templates/starter/src/components/test-run/test-run-details-helpers.test.ts +102 -0
- package/templates/starter/src/components/test-run/test-run-details-helpers.ts +10 -208
- package/templates/starter/src/components/test-run/test-run-details-progress.ts +26 -0
- package/templates/starter/src/components/test-run/test-run-details-status.ts +70 -0
- package/templates/starter/src/components/test-run/test-run-details-types.ts +21 -0
- package/templates/starter/src/components/test-run/test-run-details.test.tsx +1 -6
- package/templates/starter/src/components/test-run/test-run-details.tsx +26 -54
- package/templates/starter/src/components/test-run/test-run-header.test.tsx +13 -18
- package/templates/starter/src/components/test-run/trace-viewer-button-label.tsx +57 -0
- package/templates/starter/src/components/test-run/view-report-button.tsx +60 -64
- package/templates/starter/src/components/test-suite/test-suite-picker-helpers.test.ts +27 -1
- package/templates/starter/src/components/test-suite/test-suite-picker-helpers.ts +80 -1
- package/templates/starter/src/components/test-suite/test-suite-picker-suite-row-header.tsx +87 -0
- package/templates/starter/src/components/test-suite/test-suite-picker-suite-row.tsx +61 -0
- package/templates/starter/src/components/test-suite/test-suite-picker-test-case-list.tsx +95 -0
- package/templates/starter/src/components/test-suite/test-suite-picker.tsx +134 -275
- 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/alert.tsx +12 -18
- package/templates/starter/src/components/ui/badge.tsx +1 -1
- package/templates/starter/src/components/ui/button.tsx +13 -10
- package/templates/starter/src/components/ui/calendar.tsx +3 -3
- package/templates/starter/src/components/ui/card.tsx +16 -34
- package/templates/starter/src/components/ui/chart-utils.ts +43 -0
- package/templates/starter/src/components/ui/chart.tsx +217 -304
- package/templates/starter/src/components/ui/checkbox.tsx +20 -17
- package/templates/starter/src/components/ui/command.tsx +63 -96
- package/templates/starter/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/starter/src/components/ui/data-table-pagination.tsx +7 -7
- package/templates/starter/src/components/ui/data-table-view-options.tsx +20 -15
- package/templates/starter/src/components/ui/data-table.tsx +22 -19
- package/templates/starter/src/components/ui/dialog.tsx +45 -63
- package/templates/starter/src/components/ui/dropdown-menu.tsx +76 -148
- package/templates/starter/src/components/ui/empty.tsx +21 -40
- package/templates/starter/src/components/ui/input.tsx +13 -15
- package/templates/starter/src/components/ui/kbd.tsx +7 -13
- package/templates/starter/src/components/ui/label.tsx +7 -6
- package/templates/starter/src/components/ui/multi-select-with-preview.tsx +20 -7
- package/templates/starter/src/components/ui/multi-select.tsx +7 -5
- package/templates/starter/src/components/ui/picker-browse-shell.tsx +99 -0
- package/templates/starter/src/components/ui/popover.tsx +21 -19
- package/templates/starter/src/components/ui/progress.tsx +14 -15
- package/templates/starter/src/components/ui/radio-group.tsx +14 -25
- package/templates/starter/src/components/ui/scroll-area.tsx +32 -29
- package/templates/starter/src/components/ui/select.tsx +99 -125
- package/templates/starter/src/components/ui/separator.tsx +16 -12
- package/templates/starter/src/components/ui/sheet.tsx +92 -0
- package/templates/starter/src/components/ui/skeleton.tsx +7 -7
- package/templates/starter/src/components/ui/table.tsx +24 -49
- package/templates/starter/src/components/ui/tabs.tsx +36 -41
- package/templates/starter/src/components/ui/textarea.tsx +11 -15
- package/templates/starter/src/components/ui/toast.tsx +56 -62
- package/templates/starter/src/components/ui/toaster.tsx +26 -26
- package/templates/starter/src/components/ui/tooltip.tsx +23 -20
- package/templates/starter/src/components/user-prompt/delete-prompt.tsx +5 -5
- package/templates/starter/src/constants/form-opts/diagram/node-form.ts +11 -28
- package/templates/starter/src/constants/form-opts/environment-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/locator-group-form-opts.ts +1 -7
- package/templates/starter/src/constants/form-opts/module-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/tag-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/template-selection-form-opts.ts +0 -11
- package/templates/starter/src/constants/form-opts/template-step-group-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/template-test-case-form-opts.ts +3 -33
- package/templates/starter/src/constants/form-opts/template-test-step-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/test-case-form-opts.ts +3 -35
- package/templates/starter/src/constants/form-opts/test-case-step-form-opts.ts +27 -0
- package/templates/starter/src/constants/form-opts/test-run-form-opts.ts +1 -1
- package/templates/starter/src/constants/form-opts/test-suite-form-opts.ts +1 -1
- package/templates/starter/src/hooks/use-toast.ts +1 -1
- package/templates/starter/src/lib/automation/automation-path-roots.ts +1 -9
- package/templates/starter/src/lib/bidirectional-sync.ts +116 -107
- package/templates/starter/src/lib/database-sync.ts +142 -190
- package/templates/starter/src/lib/environment-file-utils.ts +3 -115
- package/templates/starter/src/lib/executor/local-executor-adapter.ts +1 -1
- package/templates/starter/src/lib/form/tanstack-form-action.ts +7 -0
- package/templates/starter/src/lib/form/tanstack-form.tsx +18 -0
- package/templates/starter/src/lib/gherkin-parser.test.ts +7 -7
- package/templates/starter/src/lib/gherkin-parser.ts +132 -145
- package/templates/starter/src/lib/gherkin-step-format.ts +80 -0
- package/templates/starter/src/lib/jsdoc/template-step-jsdoc.ts +262 -0
- package/templates/starter/src/lib/locator-group-file-utils.ts +2 -20
- package/templates/starter/src/lib/locator-picker/suggestions.ts +7 -4
- package/templates/starter/src/lib/metrics/metric-calculator.test.ts +156 -0
- package/templates/starter/src/lib/metrics/metric-calculator.ts +251 -273
- package/templates/starter/src/lib/module-hierarchy-builder.ts +1 -10
- package/templates/starter/src/lib/path-helpers/feature-path.ts +10 -0
- package/templates/starter/src/lib/path-helpers/module-path.ts +0 -50
- package/templates/starter/src/lib/process/task-spawner.ts +50 -27
- package/templates/starter/src/lib/sync/projected-feature-utils.ts +2 -42
- package/templates/starter/src/lib/sync/sync-pending-counts.ts +126 -274
- package/templates/starter/src/lib/sync/sync-registry.ts +2 -2
- package/templates/starter/src/lib/tag-filters.ts +11 -0
- package/templates/starter/src/lib/tag-identifiers.ts +18 -0
- package/templates/starter/src/lib/tag-utils.ts +2 -28
- package/templates/starter/src/lib/template-automation-paths.ts +34 -0
- package/templates/starter/src/lib/template-path-exclusions.ts +34 -0
- package/templates/starter/src/lib/template-sync-utils.d.ts +6 -6
- package/templates/starter/src/lib/template-sync-utils.ts +2 -65
- package/templates/starter/src/lib/test-case-utils.ts +6 -6
- package/templates/starter/src/lib/test-run/log-formatter.ts +83 -83
- package/templates/starter/src/lib/test-run/matching.test.ts +77 -0
- package/templates/starter/src/lib/test-run/matching.ts +2 -2
- package/templates/starter/src/lib/test-run/report-parser.test.ts +113 -0
- package/templates/starter/src/lib/test-run/report-parser.ts +352 -352
- package/templates/starter/src/lib/test-suite-identifier-service.ts +1 -1
- 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/transformers/template-test-case-converter.ts +13 -64
- package/templates/starter/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/starter/src/lib/utils/template-step-file-generator.ts +2 -19
- package/templates/starter/src/lib/utils/template-step-file-manager-intelligent.ts +1 -355
- package/templates/starter/src/lib/utils/template-step-function-bounds.test.ts +48 -0
- package/templates/starter/src/lib/utils/template-step-function-bounds.ts +138 -0
- package/templates/starter/src/lib/utils.ts +0 -4
- package/templates/starter/src/services/locator/locator-service.ts +22 -6
- package/templates/starter/src/services/report/report-service.ts +249 -237
- package/templates/starter/src/services/tag/tag-service.test.ts +140 -2
- package/templates/starter/src/services/tag/tag-service.ts +71 -0
- package/templates/starter/src/services/template-test-case/template-test-case-service.ts +34 -2
- package/templates/starter/src/services/test-case/test-case-service.test.ts +1 -0
- package/templates/starter/src/services/test-case/test-case-service.ts +39 -2
- package/templates/starter/src/services/test-run/test-run-service.ts +146 -119
- package/templates/starter/src/test/motion-react-vitest-mocks.ts +18 -0
- package/templates/starter/src/test/setup-motion-react-mocks.ts +4 -0
- package/templates/starter/src/types/diagram/diagram.ts +8 -0
- package/templates/starter/src/types/diagram/template-step.ts +5 -2
- package/templates/starter/src/types/report.ts +84 -0
- package/templates/starter/tsconfig.json +1 -1
- package/templates/blank/src/app/(base)/test-cases/create-from-template/template-selection-form.test.tsx +0 -87
- package/templates/blank/src/app/(base)/test-cases/create-from-template/template-selection-form.tsx +0 -83
- package/templates/blank/src/components/chart/pie-chart.tsx +0 -73
- package/templates/blank/src/components/data-extraction/locator-inspector.tsx +0 -349
- package/templates/blank/src/components/diagram/edit-header-option.tsx +0 -36
- package/templates/blank/src/components/kokonutui/smooth-tab.tsx +0 -453
- package/templates/blank/src/components/navigation/nav-card.tsx +0 -31
- package/templates/blank/src/components/node-header.tsx +0 -159
- package/templates/blank/src/components/ui/alert-dialog.tsx +0 -106
- package/templates/blank/src/components/ui/avatar.tsx +0 -40
- package/templates/blank/src/components/ui/loading.tsx +0 -12
- package/templates/blank/src/components/ui/navigation-menu.tsx +0 -120
- package/templates/blank/src/lib/template-sync-utils.js +0 -50
- package/templates/blank/src/lib/test-run/test-run-executor.ts +0 -13
- package/templates/blank/src/lib/utils/template-step-file-manager.ts +0 -166
- package/templates/blank/src/services/shared/index.ts +0 -7
- package/templates/blank/src/types/executor/browser.type.ts +0 -1
- package/templates/blank/src/types/locator/locator.type.ts +0 -11
- package/templates/blank/src/types/step/step.type.ts +0 -1
- package/templates/blank/src/types/table/data-table.ts +0 -6
- package/templates/starter/src/app/(base)/test-cases/create-from-template/template-selection-form.test.tsx +0 -87
- package/templates/starter/src/app/(base)/test-cases/create-from-template/template-selection-form.tsx +0 -83
- package/templates/starter/src/components/chart/pie-chart.tsx +0 -73
- package/templates/starter/src/components/data-extraction/locator-inspector.tsx +0 -349
- package/templates/starter/src/components/diagram/edit-header-option.tsx +0 -36
- package/templates/starter/src/components/kokonutui/smooth-tab.tsx +0 -453
- package/templates/starter/src/components/navigation/nav-card.tsx +0 -31
- package/templates/starter/src/components/node-header.tsx +0 -159
- package/templates/starter/src/components/ui/alert-dialog.tsx +0 -106
- package/templates/starter/src/components/ui/avatar.tsx +0 -40
- package/templates/starter/src/components/ui/loading.tsx +0 -12
- package/templates/starter/src/components/ui/navigation-menu.tsx +0 -120
- package/templates/starter/src/lib/template-sync-utils.js +0 -50
- package/templates/starter/src/lib/test-run/test-run-executor.ts +0 -13
- package/templates/starter/src/lib/utils/template-step-file-manager.ts +0 -166
- package/templates/starter/src/services/shared/index.ts +0 -7
- package/templates/starter/src/types/executor/browser.type.ts +0 -1
- package/templates/starter/src/types/locator/locator.type.ts +0 -11
- package/templates/starter/src/types/step/step.type.ts +0 -1
- package/templates/starter/src/types/table/data-table.ts +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises as fs } from 'fs'
|
|
2
|
-
import {
|
|
2
|
+
import { TemplateStepGroupType } from '@prisma/client'
|
|
3
3
|
import { ensureStepsDirectory, getFilePath, formatFileContent } from './template-step-file-generator'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -91,176 +91,6 @@ export function ensureGroupJSDoc(
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/**
|
|
95
|
-
* Generates JSDoc comments for a template step
|
|
96
|
-
*/
|
|
97
|
-
function generateJSDocComment(templateStep: TemplateStep): string {
|
|
98
|
-
const lines = ['/**']
|
|
99
|
-
lines.push(` * @name ${templateStep.name}`)
|
|
100
|
-
if (templateStep.description) {
|
|
101
|
-
lines.push(` * @description ${templateStep.description}`)
|
|
102
|
-
}
|
|
103
|
-
lines.push(` * @icon ${templateStep.icon}`)
|
|
104
|
-
lines.push(' */')
|
|
105
|
-
return lines.join('\n')
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Wraps a function definition with JSDoc comments
|
|
110
|
-
* If the function already has JSDoc comments, replaces them
|
|
111
|
-
*/
|
|
112
|
-
function wrapFunctionWithJSDoc(functionDefinition: string, templateStep: TemplateStep): string {
|
|
113
|
-
const jsdoc = generateJSDocComment(templateStep)
|
|
114
|
-
|
|
115
|
-
// Remove existing JSDoc comments if present
|
|
116
|
-
const cleanedDefinition = functionDefinition.replace(/\/\*\*[\s\S]*?\*\/\s*/g, '').trim()
|
|
117
|
-
|
|
118
|
-
// Prepend JSDoc and return
|
|
119
|
-
return `${jsdoc}\n${cleanedDefinition}`
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Checks if a template step update requires file changes
|
|
124
|
-
* Signature, parameter, and metadata (name, description, icon) changes require file updates
|
|
125
|
-
*/
|
|
126
|
-
function requiresFileUpdate(oldStep: TemplateStep, newStep: TemplateStep): boolean {
|
|
127
|
-
// Check if signature changed
|
|
128
|
-
if (oldStep.signature !== newStep.signature) {
|
|
129
|
-
return true
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Check if function definition changed (this includes parameter changes)
|
|
133
|
-
if (oldStep.functionDefinition !== newStep.functionDefinition) {
|
|
134
|
-
return true
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Check if metadata changed (name, description, icon) - these affect JSDoc comments
|
|
138
|
-
if (oldStep.name !== newStep.name) {
|
|
139
|
-
return true
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (oldStep.description !== newStep.description) {
|
|
143
|
-
return true
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (oldStep.icon !== newStep.icon) {
|
|
147
|
-
return true
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// No file changes needed for other updates
|
|
151
|
-
return false
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Finds the start and end lines of a step definition function in the file
|
|
156
|
-
* Uses flexible signature matching to handle prettier formatting variations
|
|
157
|
-
* Handles JSDoc comments that may precede the function
|
|
158
|
-
*/
|
|
159
|
-
function findStepFunctionBounds(content: string, signature: string): { startLine: number; endLine: number } | null {
|
|
160
|
-
const lines = content.split('\n')
|
|
161
|
-
|
|
162
|
-
// Search for the signature content across multiple lines (handles prettier formatting)
|
|
163
|
-
for (let i = 0; i < lines.length; i++) {
|
|
164
|
-
const line = lines[i]
|
|
165
|
-
const trimmedLine = line.trim()
|
|
166
|
-
|
|
167
|
-
// Skip JSDoc comment lines (but not the function definition itself)
|
|
168
|
-
if (
|
|
169
|
-
trimmedLine.startsWith('/**') ||
|
|
170
|
-
trimmedLine === '*/' ||
|
|
171
|
-
(trimmedLine.startsWith('*') && !trimmedLine.startsWith('When(') && !trimmedLine.startsWith('Then('))
|
|
172
|
-
) {
|
|
173
|
-
continue
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Check if this line starts a step definition
|
|
177
|
-
if (trimmedLine.startsWith('When(') || trimmedLine.startsWith('Then(')) {
|
|
178
|
-
// Look ahead to find the complete signature across multiple lines
|
|
179
|
-
let signatureFound = false
|
|
180
|
-
let currentSignature = ''
|
|
181
|
-
|
|
182
|
-
// Collect signature content from current and following lines until we hit the function start
|
|
183
|
-
for (let j = i; j < lines.length; j++) {
|
|
184
|
-
const currentLine = lines[j]
|
|
185
|
-
currentSignature += currentLine
|
|
186
|
-
|
|
187
|
-
// Check if we've found our signature
|
|
188
|
-
if (currentSignature.includes(signature)) {
|
|
189
|
-
signatureFound = true
|
|
190
|
-
break
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// If we hit the function opening brace, stop looking for signature
|
|
194
|
-
if (currentLine.includes('async function') || currentLine.includes('function(')) {
|
|
195
|
-
break
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (signatureFound) {
|
|
200
|
-
// Found the start, now find the end using bracket and parenthesis counting
|
|
201
|
-
// Also check backwards for JSDoc comments to include them in the bounds
|
|
202
|
-
let functionStartLine = i
|
|
203
|
-
let braceCount = 0
|
|
204
|
-
let parenCount = 0
|
|
205
|
-
let startParenFound = false
|
|
206
|
-
|
|
207
|
-
// Check if there are JSDoc comments before this function
|
|
208
|
-
if (i > 0) {
|
|
209
|
-
let jsdocStart = i - 1
|
|
210
|
-
// Look backwards for JSDoc comment block
|
|
211
|
-
// First, check if the previous line is the end of a JSDoc block
|
|
212
|
-
if (lines[jsdocStart].trim() === '*/') {
|
|
213
|
-
// Found end of JSDoc, continue looking backwards for the start
|
|
214
|
-
jsdocStart--
|
|
215
|
-
while (jsdocStart >= 0) {
|
|
216
|
-
const prevLine = lines[jsdocStart].trim()
|
|
217
|
-
if (prevLine.startsWith('/**')) {
|
|
218
|
-
// Found start of JSDoc block
|
|
219
|
-
functionStartLine = jsdocStart
|
|
220
|
-
break
|
|
221
|
-
} else if (prevLine.startsWith('*') || prevLine === '') {
|
|
222
|
-
jsdocStart--
|
|
223
|
-
} else {
|
|
224
|
-
break
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
for (let j = i; j < lines.length; j++) {
|
|
231
|
-
const currentLine = lines[j]
|
|
232
|
-
|
|
233
|
-
// Count opening and closing parentheses and braces
|
|
234
|
-
for (const char of currentLine) {
|
|
235
|
-
if (char === '(') {
|
|
236
|
-
parenCount++
|
|
237
|
-
startParenFound = true
|
|
238
|
-
} else if (char === ')') {
|
|
239
|
-
parenCount--
|
|
240
|
-
} else if (char === '{') {
|
|
241
|
-
braceCount++
|
|
242
|
-
} else if (char === '}') {
|
|
243
|
-
braceCount--
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// If we found the opening parenthesis and both parentheses and braces are balanced, we're done
|
|
248
|
-
// This ensures we capture the complete When(...) or Then(...) call including the closing )
|
|
249
|
-
if (startParenFound && parenCount === 0 && braceCount === 0) {
|
|
250
|
-
return { startLine: functionStartLine, endLine: j }
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// If we reach here, something went wrong with bracket counting
|
|
255
|
-
console.warn(`Could not find end of function for signature: ${signature}`)
|
|
256
|
-
return null
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return null
|
|
262
|
-
}
|
|
263
|
-
|
|
264
94
|
/**
|
|
265
95
|
* Required import definitions
|
|
266
96
|
*/
|
|
@@ -409,189 +239,6 @@ export function ensureRequiredImports(content: string): string {
|
|
|
409
239
|
return newImportStatements + content
|
|
410
240
|
}
|
|
411
241
|
|
|
412
|
-
/**
|
|
413
|
-
* Intelligently adds a new template step to the file
|
|
414
|
-
* Preserves existing content including imports, types, and other code
|
|
415
|
-
*/
|
|
416
|
-
export async function addTemplateStepToFile(
|
|
417
|
-
groupName: string,
|
|
418
|
-
templateStep: TemplateStep,
|
|
419
|
-
type: TemplateStepGroupType | string,
|
|
420
|
-
): Promise<void> {
|
|
421
|
-
try {
|
|
422
|
-
await ensureStepsDirectory()
|
|
423
|
-
const filePath = getFilePath(groupName, type)
|
|
424
|
-
|
|
425
|
-
let existingContent = ''
|
|
426
|
-
try {
|
|
427
|
-
existingContent = await fs.readFile(filePath, 'utf8')
|
|
428
|
-
} catch {
|
|
429
|
-
// File doesn't exist, start with empty content
|
|
430
|
-
existingContent = ''
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// Ensure required imports are present
|
|
434
|
-
existingContent = ensureRequiredImports(existingContent)
|
|
435
|
-
|
|
436
|
-
// Check if step with this signature already exists
|
|
437
|
-
const bounds = findStepFunctionBounds(existingContent, templateStep.signature)
|
|
438
|
-
|
|
439
|
-
let newContent: string
|
|
440
|
-
|
|
441
|
-
if (bounds) {
|
|
442
|
-
// Replace existing step - replace the entire function with JSDoc comments
|
|
443
|
-
const lines = existingContent.split('\n')
|
|
444
|
-
const beforeStep = lines.slice(0, bounds.startLine).join('\n')
|
|
445
|
-
const afterStep = lines.slice(bounds.endLine + 1).join('\n')
|
|
446
|
-
|
|
447
|
-
// Wrap the function definition with JSDoc comments
|
|
448
|
-
const wrappedStepDefinition = wrapFunctionWithJSDoc(templateStep.functionDefinition || '', templateStep)
|
|
449
|
-
newContent =
|
|
450
|
-
beforeStep +
|
|
451
|
-
(beforeStep.trim() ? '\n\n' : '') +
|
|
452
|
-
wrappedStepDefinition +
|
|
453
|
-
(afterStep.trim() ? '\n' : '') +
|
|
454
|
-
afterStep
|
|
455
|
-
} else {
|
|
456
|
-
// Add new step at the end - wrap with JSDoc comments
|
|
457
|
-
const wrappedStepDefinition = wrapFunctionWithJSDoc(templateStep.functionDefinition || '', templateStep)
|
|
458
|
-
newContent = existingContent + (existingContent ? '\n\n' : '') + wrappedStepDefinition
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
// Format and write the file
|
|
462
|
-
const formattedContent = await formatFileContent(newContent)
|
|
463
|
-
await fs.writeFile(filePath, formattedContent, 'utf8')
|
|
464
|
-
|
|
465
|
-
console.log(`Template step added to file: ${filePath}`)
|
|
466
|
-
} catch (error) {
|
|
467
|
-
console.error(`Failed to add template step to file for group "${groupName}":`, error)
|
|
468
|
-
throw new Error(`File update failed: ${error}`)
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Intelligently removes a template step from the file
|
|
474
|
-
* Only removes the specific step, preserves everything else including imports and types
|
|
475
|
-
*/
|
|
476
|
-
export async function removeTemplateStepFromFile(
|
|
477
|
-
groupName: string,
|
|
478
|
-
templateStep: TemplateStep,
|
|
479
|
-
type: TemplateStepGroupType | string,
|
|
480
|
-
): Promise<void> {
|
|
481
|
-
try {
|
|
482
|
-
await ensureStepsDirectory()
|
|
483
|
-
const filePath = getFilePath(groupName, type)
|
|
484
|
-
|
|
485
|
-
let existingContent = ''
|
|
486
|
-
try {
|
|
487
|
-
existingContent = await fs.readFile(filePath, 'utf8')
|
|
488
|
-
} catch {
|
|
489
|
-
// File doesn't exist, nothing to remove
|
|
490
|
-
return
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
// Ensure required imports are present
|
|
494
|
-
existingContent = ensureRequiredImports(existingContent)
|
|
495
|
-
|
|
496
|
-
// Find the step to remove
|
|
497
|
-
const bounds = findStepFunctionBounds(existingContent, templateStep.signature)
|
|
498
|
-
|
|
499
|
-
if (!bounds) {
|
|
500
|
-
// Step not found, nothing to remove
|
|
501
|
-
return
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
// Remove the entire function block
|
|
505
|
-
const lines = existingContent.split('\n')
|
|
506
|
-
const beforeStep = lines.slice(0, bounds.startLine).join('\n')
|
|
507
|
-
const afterStep = lines.slice(bounds.endLine + 1).join('\n')
|
|
508
|
-
|
|
509
|
-
// Combine content, handling empty sections
|
|
510
|
-
let newContent = ''
|
|
511
|
-
if (beforeStep.trim()) {
|
|
512
|
-
newContent += beforeStep.trim()
|
|
513
|
-
}
|
|
514
|
-
if (afterStep.trim()) {
|
|
515
|
-
if (newContent) newContent += '\n'
|
|
516
|
-
newContent += afterStep.trim()
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
// Format and write the file
|
|
520
|
-
const formattedContent = await formatFileContent(newContent)
|
|
521
|
-
await fs.writeFile(filePath, formattedContent, 'utf8')
|
|
522
|
-
|
|
523
|
-
console.log(`Template step removed from file: ${filePath}`)
|
|
524
|
-
} catch (error) {
|
|
525
|
-
console.error(`Failed to remove template step from file for group "${groupName}":`, error)
|
|
526
|
-
throw new Error(`File update failed: ${error}`)
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* Intelligently updates a template step in the file
|
|
532
|
-
* Only updates the specific step, preserves everything else including imports and types
|
|
533
|
-
*/
|
|
534
|
-
export async function updateTemplateStepInFile(
|
|
535
|
-
groupName: string,
|
|
536
|
-
templateStep: TemplateStep,
|
|
537
|
-
type: TemplateStepGroupType | string,
|
|
538
|
-
oldStep?: TemplateStep,
|
|
539
|
-
): Promise<void> {
|
|
540
|
-
try {
|
|
541
|
-
// If we have the old step data, check if file changes are needed
|
|
542
|
-
if (oldStep && !requiresFileUpdate(oldStep, templateStep)) {
|
|
543
|
-
console.log(`No file changes needed for template step update: ${templateStep.signature}`)
|
|
544
|
-
return
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
await ensureStepsDirectory()
|
|
548
|
-
const filePath = getFilePath(groupName, type)
|
|
549
|
-
|
|
550
|
-
let existingContent = ''
|
|
551
|
-
try {
|
|
552
|
-
existingContent = await fs.readFile(filePath, 'utf8')
|
|
553
|
-
} catch {
|
|
554
|
-
// File doesn't exist, create it with the updated step
|
|
555
|
-
await addTemplateStepToFile(groupName, templateStep, type)
|
|
556
|
-
return
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
// Ensure required imports are present
|
|
560
|
-
existingContent = ensureRequiredImports(existingContent)
|
|
561
|
-
|
|
562
|
-
// Find the step to update
|
|
563
|
-
const bounds = findStepFunctionBounds(existingContent, oldStep!.signature)
|
|
564
|
-
|
|
565
|
-
if (bounds) {
|
|
566
|
-
// Update existing step - replace the entire function with JSDoc comments
|
|
567
|
-
const lines = existingContent.split('\n')
|
|
568
|
-
const beforeStep = lines.slice(0, bounds.startLine).join('\n')
|
|
569
|
-
const afterStep = lines.slice(bounds.endLine + 1).join('\n')
|
|
570
|
-
|
|
571
|
-
// Wrap the function definition with JSDoc comments
|
|
572
|
-
const wrappedStepDefinition = wrapFunctionWithJSDoc(templateStep.functionDefinition || '', templateStep)
|
|
573
|
-
const newContent =
|
|
574
|
-
beforeStep +
|
|
575
|
-
(beforeStep.trim() ? '\n\n' : '') +
|
|
576
|
-
wrappedStepDefinition +
|
|
577
|
-
(afterStep.trim() ? '\n' : '') +
|
|
578
|
-
afterStep
|
|
579
|
-
|
|
580
|
-
// Format and write the file
|
|
581
|
-
const formattedContent = await formatFileContent(newContent)
|
|
582
|
-
await fs.writeFile(filePath, formattedContent, 'utf8')
|
|
583
|
-
|
|
584
|
-
console.log(`Template step updated in file: ${filePath}`)
|
|
585
|
-
} else {
|
|
586
|
-
// Step not found, add it
|
|
587
|
-
await addTemplateStepToFile(groupName, templateStep, type)
|
|
588
|
-
}
|
|
589
|
-
} catch (error) {
|
|
590
|
-
console.error(`Failed to update template step in file for group "${groupName}":`, error)
|
|
591
|
-
throw new Error(`File update failed: ${error}`)
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
242
|
/**
|
|
596
243
|
* Creates a placeholder file for a new template step group
|
|
597
244
|
*/
|
|
@@ -697,4 +344,3 @@ export async function renameTemplateStepGroupFile(
|
|
|
697
344
|
throw new Error(`File rename failed: ${error}`)
|
|
698
345
|
}
|
|
699
346
|
}
|
|
700
|
-
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { findStepFunctionBounds } from './template-step-function-bounds'
|
|
4
|
+
|
|
5
|
+
describe('findStepFunctionBounds', () => {
|
|
6
|
+
it('finds a single-line step definition with its JSDoc block', () => {
|
|
7
|
+
const content = [
|
|
8
|
+
'import { When } from "runtime"',
|
|
9
|
+
'',
|
|
10
|
+
'/**',
|
|
11
|
+
' * @name Login',
|
|
12
|
+
' */',
|
|
13
|
+
'When("I log in", async function () {',
|
|
14
|
+
' await this.page.click("button")',
|
|
15
|
+
'})',
|
|
16
|
+
'',
|
|
17
|
+
'const untouched = true',
|
|
18
|
+
].join('\n')
|
|
19
|
+
|
|
20
|
+
expect(findStepFunctionBounds(content, 'When("I log in"')).toEqual({
|
|
21
|
+
startLine: 2,
|
|
22
|
+
endLine: 7,
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('finds prettier-wrapped step signatures and balanced nested blocks', () => {
|
|
27
|
+
const content = [
|
|
28
|
+
'Then(',
|
|
29
|
+
' "I should see {string}",',
|
|
30
|
+
' async function (label: string) {',
|
|
31
|
+
' if (label) {',
|
|
32
|
+
' await expect(this.page.getByText(label)).toBeVisible()',
|
|
33
|
+
' }',
|
|
34
|
+
' },',
|
|
35
|
+
')',
|
|
36
|
+
].join('\n')
|
|
37
|
+
|
|
38
|
+
expect(findStepFunctionBounds(content, 'Then( "I should see {string}"')).toEqual({
|
|
39
|
+
startLine: 0,
|
|
40
|
+
endLine: 7,
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('returns null when the signature is not present or the call is incomplete', () => {
|
|
45
|
+
expect(findStepFunctionBounds('When("other", async function () {})', 'Then("missing"')).toBeNull()
|
|
46
|
+
expect(findStepFunctionBounds('When("incomplete", async function () {', 'When("incomplete"')).toBeNull()
|
|
47
|
+
})
|
|
48
|
+
})
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export type StepFunctionBounds = {
|
|
2
|
+
startLine: number
|
|
3
|
+
endLine: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
type DelimiterCounts = {
|
|
7
|
+
braceCount: number
|
|
8
|
+
parenCount: number
|
|
9
|
+
startParenFound: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const STEP_DEFINITION_PREFIXES = ['When(', 'Then(']
|
|
13
|
+
|
|
14
|
+
function isStepDefinitionStart(trimmedLine: string) {
|
|
15
|
+
return STEP_DEFINITION_PREFIXES.some(prefix => trimmedLine.startsWith(prefix))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isJSDocLine(trimmedLine: string) {
|
|
19
|
+
return (
|
|
20
|
+
trimmedLine.startsWith('/**') ||
|
|
21
|
+
trimmedLine === '*/' ||
|
|
22
|
+
(trimmedLine.startsWith('*') && !isStepDefinitionStart(trimmedLine))
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function containsFunctionStart(line: string) {
|
|
27
|
+
return line.includes('async function') || line.includes('function(')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function hasMatchingSignature(lines: string[], startLine: number, signature: string) {
|
|
31
|
+
let currentSignature = ''
|
|
32
|
+
|
|
33
|
+
for (let lineIndex = startLine; lineIndex < lines.length; lineIndex++) {
|
|
34
|
+
const currentLine = lines[lineIndex]
|
|
35
|
+
currentSignature += currentLine
|
|
36
|
+
|
|
37
|
+
if (currentSignature.includes(signature)) {
|
|
38
|
+
return true
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (containsFunctionStart(currentLine)) {
|
|
42
|
+
return false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return false
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function findJSDocStartLine(lines: string[], functionLine: number) {
|
|
50
|
+
const lineBeforeFunction = functionLine - 1
|
|
51
|
+
if (lineBeforeFunction < 0 || lines[lineBeforeFunction].trim() !== '*/') {
|
|
52
|
+
return functionLine
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
for (let lineIndex = lineBeforeFunction - 1; lineIndex >= 0; lineIndex--) {
|
|
56
|
+
const previousLine = lines[lineIndex].trim()
|
|
57
|
+
|
|
58
|
+
if (previousLine.startsWith('/**')) {
|
|
59
|
+
return lineIndex
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!previousLine.startsWith('*') && previousLine !== '') {
|
|
63
|
+
return functionLine
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return functionLine
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function countLineDelimiters(line: string, counts: DelimiterCounts) {
|
|
71
|
+
for (const char of line) {
|
|
72
|
+
if (char === '(') {
|
|
73
|
+
counts.parenCount++
|
|
74
|
+
counts.startParenFound = true
|
|
75
|
+
} else if (char === ')') {
|
|
76
|
+
counts.parenCount--
|
|
77
|
+
} else if (char === '{') {
|
|
78
|
+
counts.braceCount++
|
|
79
|
+
} else if (char === '}') {
|
|
80
|
+
counts.braceCount--
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function isBalancedStepCall(counts: DelimiterCounts) {
|
|
86
|
+
return counts.startParenFound && counts.parenCount === 0 && counts.braceCount === 0
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function findStepCallEndLine(lines: string[], functionLine: number) {
|
|
90
|
+
const counts: DelimiterCounts = {
|
|
91
|
+
braceCount: 0,
|
|
92
|
+
parenCount: 0,
|
|
93
|
+
startParenFound: false,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
for (let lineIndex = functionLine; lineIndex < lines.length; lineIndex++) {
|
|
97
|
+
countLineDelimiters(lines[lineIndex], counts)
|
|
98
|
+
|
|
99
|
+
if (isBalancedStepCall(counts)) {
|
|
100
|
+
return lineIndex
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return null
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Finds the start and end lines of a step definition function in the file.
|
|
109
|
+
* Handles prettier-wrapped signatures and a JSDoc block directly above the step.
|
|
110
|
+
*/
|
|
111
|
+
export function findStepFunctionBounds(content: string, signature: string): StepFunctionBounds | null {
|
|
112
|
+
const lines = content.split('\n')
|
|
113
|
+
|
|
114
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
115
|
+
const trimmedLine = lines[lineIndex].trim()
|
|
116
|
+
|
|
117
|
+
if (isJSDocLine(trimmedLine) || !isStepDefinitionStart(trimmedLine)) {
|
|
118
|
+
continue
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!hasMatchingSignature(lines, lineIndex, signature)) {
|
|
122
|
+
continue
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const endLine = findStepCallEndLine(lines, lineIndex)
|
|
126
|
+
if (endLine === null) {
|
|
127
|
+
console.warn(`Could not find end of function for signature: ${signature}`)
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
startLine: findJSDocStartLine(lines, lineIndex),
|
|
133
|
+
endLine,
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return null
|
|
138
|
+
}
|
|
@@ -4,10 +4,6 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
4
4
|
return twMerge(clsx(inputs))
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export function calculateCompletionPercentage(total: number, completed: number) {
|
|
8
|
-
return Math.round((completed / total) * 100)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
7
|
/**
|
|
12
8
|
* Formats a date to show only date and time (without seconds/milliseconds)
|
|
13
9
|
* @param date - Date string or Date object
|
|
@@ -13,8 +13,6 @@ import { promises as fs } from 'fs'
|
|
|
13
13
|
import path from 'path'
|
|
14
14
|
import { glob } from 'glob'
|
|
15
15
|
|
|
16
|
-
export { extractLocatorGroupName, extractModulePathFromLocatorFile } from '@/services/locator/locator-path-utils'
|
|
17
|
-
|
|
18
16
|
export async function listLocators() {
|
|
19
17
|
return prisma.locator.findMany({
|
|
20
18
|
include: {
|
|
@@ -44,8 +42,6 @@ async function updateLocatorGroupFile(locatorGroupId: string | null): Promise<vo
|
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
export { updateLocatorGroupFile }
|
|
48
|
-
|
|
49
45
|
export async function deleteLocators(ids: string[]) {
|
|
50
46
|
const locatorsToDelete = await prisma.locator.findMany({
|
|
51
47
|
where: { id: { in: ids } },
|
|
@@ -342,7 +338,18 @@ const savePickedLocatorSchema = z.object({
|
|
|
342
338
|
})
|
|
343
339
|
|
|
344
340
|
export type SavePickedLocatorOutcome =
|
|
345
|
-
| {
|
|
341
|
+
| {
|
|
342
|
+
kind: 'success'
|
|
343
|
+
locatorId: string
|
|
344
|
+
locatorName: string
|
|
345
|
+
locatorGroupId: string
|
|
346
|
+
locatorGroupName: string
|
|
347
|
+
selector: string
|
|
348
|
+
route: string
|
|
349
|
+
moduleId: string
|
|
350
|
+
message: string
|
|
351
|
+
wasUpdate: boolean
|
|
352
|
+
}
|
|
346
353
|
| { kind: 'error'; status: number; message: string }
|
|
347
354
|
|
|
348
355
|
export async function savePickedLocatorFromRequest(request: SavePickedLocatorRequest): Promise<SavePickedLocatorOutcome> {
|
|
@@ -358,7 +365,8 @@ export async function savePickedLocatorFromRequest(request: SavePickedLocatorReq
|
|
|
358
365
|
|
|
359
366
|
let locatorGroupId = value.existingLocatorGroupId
|
|
360
367
|
let locatorGroupName = ''
|
|
361
|
-
|
|
368
|
+
let route = normalizeRoute(value.route || session?.currentPathname)
|
|
369
|
+
let moduleId = value.moduleId ?? ''
|
|
362
370
|
const locatorName = value.locatorName.trim()
|
|
363
371
|
const selector = value.selector.trim()
|
|
364
372
|
const currentLocator = value.locatorId
|
|
@@ -388,6 +396,8 @@ export async function savePickedLocatorFromRequest(request: SavePickedLocatorReq
|
|
|
388
396
|
}
|
|
389
397
|
|
|
390
398
|
locatorGroupName = locatorGroup.name
|
|
399
|
+
route = locatorGroup.route
|
|
400
|
+
moduleId = locatorGroup.moduleId
|
|
391
401
|
} else {
|
|
392
402
|
if (!value.newLocatorGroupName || value.newLocatorGroupName.trim() === '') {
|
|
393
403
|
return fail(400, 'Locator group name is required when creating a new group.')
|
|
@@ -417,6 +427,7 @@ export async function savePickedLocatorFromRequest(request: SavePickedLocatorReq
|
|
|
417
427
|
|
|
418
428
|
locatorGroupId = newLocatorGroup.id
|
|
419
429
|
locatorGroupName = newLocatorGroup.name
|
|
430
|
+
moduleId = newLocatorGroup.moduleId
|
|
420
431
|
|
|
421
432
|
await automationProjectionService.createEmptyLocatorGroup(newLocatorGroup.id)
|
|
422
433
|
await automationProjectionService.syncLocatorMap(newLocatorGroup.name, route)
|
|
@@ -472,7 +483,12 @@ export async function savePickedLocatorFromRequest(request: SavePickedLocatorReq
|
|
|
472
483
|
return {
|
|
473
484
|
kind: 'success',
|
|
474
485
|
locatorId: locator.id,
|
|
486
|
+
locatorName: locator.name,
|
|
475
487
|
locatorGroupId,
|
|
488
|
+
locatorGroupName,
|
|
489
|
+
selector: locator.value,
|
|
490
|
+
route,
|
|
491
|
+
moduleId,
|
|
476
492
|
message: value.locatorId ? 'Locator updated successfully.' : 'Locator saved successfully.',
|
|
477
493
|
wasUpdate: Boolean(value.locatorId),
|
|
478
494
|
}
|