create-appraisejs 0.3.1-alpha.0 → 0.3.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -17
- package/dist/cli.e2e.test.d.ts +2 -2
- package/dist/cli.e2e.test.js +74 -72
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -2
- package/dist/config.test.js +64 -64
- package/dist/copy-template.test.d.ts +2 -2
- package/dist/copy-template.test.js +70 -70
- package/dist/download-repo.test.d.ts +2 -2
- package/dist/download-repo.test.js +15 -13
- package/dist/install.test.d.ts +2 -2
- package/dist/install.test.js +115 -114
- package/dist/prepare-template-utils.d.ts.map +1 -1
- package/dist/prepare-template-utils.js.map +1 -1
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -2
- package/dist/prompts.js.map +1 -1
- package/dist/prompts.test.d.ts +2 -2
- package/dist/prompts.test.js +54 -54
- package/dist/sync-templates-utils.d.ts.map +1 -1
- package/dist/sync-templates-utils.js +1 -5
- package/dist/sync-templates-utils.js.map +1 -1
- package/package.json +1 -1
- package/templates/blank/.editorconfig +11 -0
- package/templates/blank/.gitattributes +21 -0
- package/templates/blank/.gitconfig.appraise +14 -0
- package/templates/blank/.prettierrc +13 -0
- package/templates/blank/.vscode/settings.json +2 -0
- package/templates/blank/README.md +12 -12
- package/templates/blank/components.json +24 -24
- package/templates/blank/cucumber.mjs +16 -16
- package/templates/blank/e2e/README.md +56 -0
- package/templates/blank/e2e/apply-migrations.mjs +76 -0
- package/templates/blank/e2e/appraise-smoke.spec.ts +78 -0
- package/templates/blank/e2e/authoring.spec.ts +53 -0
- package/templates/blank/e2e/crud-configuration.spec.ts +138 -0
- package/templates/blank/e2e/crud-tests.spec.ts +76 -0
- package/templates/blank/e2e/helpers/forms.ts +186 -0
- package/templates/blank/e2e/helpers/navigation.ts +27 -0
- package/templates/blank/e2e/helpers/table.ts +45 -0
- package/templates/blank/e2e/helpers/test-data.ts +549 -0
- package/templates/blank/e2e/helpers/ui.ts +41 -0
- package/templates/blank/e2e/navigation.spec.ts +101 -0
- package/templates/blank/e2e/runs-and-reports.spec.ts +82 -0
- package/templates/blank/e2e/settings-sync.spec.ts +39 -0
- package/templates/blank/e2e/start-server.mjs +61 -0
- package/templates/blank/eslint.config.mjs +4 -4
- package/templates/blank/gitignore +0 -3
- package/templates/blank/next-env.d.ts +1 -1
- package/templates/blank/package-lock.json +58 -102
- package/templates/blank/package.json +10 -9
- package/templates/blank/packages/cucumber-runtime/package.json +13 -13
- package/templates/blank/packages/cucumber-runtime/src/cache.util.ts +93 -93
- package/templates/blank/packages/cucumber-runtime/src/cli.ts +77 -68
- package/templates/blank/packages/cucumber-runtime/src/environment.util.ts +21 -21
- package/templates/blank/packages/cucumber-runtime/src/executor.ts +32 -32
- package/templates/blank/packages/cucumber-runtime/src/index.ts +17 -17
- package/templates/blank/packages/cucumber-runtime/src/locator.util.ts +234 -234
- package/templates/blank/packages/cucumber-runtime/src/parameter-types.ts +7 -7
- package/templates/blank/packages/cucumber-runtime/src/random-data.util.ts +35 -35
- package/templates/blank/packages/cucumber-runtime/src/types.ts +13 -13
- package/templates/blank/packages/cucumber-runtime/src/world.ts +44 -44
- package/templates/blank/packages/cucumber-runtime/tsconfig.json +11 -11
- package/templates/blank/packages/locator-picker-companion/dist/cli.js +1 -1
- package/templates/blank/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/blank/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/blank/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
- package/templates/blank/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/blank/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/blank/packages/locator-picker-companion/src/cli.ts +1 -7
- package/templates/blank/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
- package/templates/blank/packages/locator-picker-companion/src/launcher.ts +1 -3
- package/templates/blank/packages/locator-picker-companion/src/session-file.ts +4 -15
- package/templates/blank/packages/locator-picker-companion/src/types.ts +1 -8
- package/templates/blank/playwright.config.ts +46 -0
- package/templates/blank/postcss.config.mjs +8 -8
- package/templates/blank/prisma/dev.db +0 -0
- package/templates/blank/scripts/configure-git-line-endings.mjs +91 -0
- package/templates/blank/scripts/install-template-step.ts +5 -1
- package/templates/blank/scripts/lib/step-matcher.test.ts +3 -3
- package/templates/blank/scripts/lib/step-matcher.ts +5 -1
- package/templates/blank/scripts/lib/template-step-installer.test.ts +4 -2
- package/templates/blank/scripts/lib/template-step-installer.ts +16 -4
- package/templates/blank/scripts/lib/template-step-registry.test.ts +1 -1
- package/templates/blank/scripts/lib/template-step-registry.ts +4 -1
- package/templates/blank/scripts/run-fallow-commit.mjs +4 -6
- package/templates/blank/scripts/sync-all.ts +7 -6
- package/templates/blank/scripts/sync-appraise-base-template.ts +84 -77
- package/templates/blank/scripts/sync-environments.ts +47 -44
- package/templates/blank/scripts/sync-locator-groups.ts +67 -76
- package/templates/blank/scripts/sync-locators.ts +50 -53
- package/templates/blank/scripts/sync-modules.ts +42 -42
- package/templates/blank/scripts/sync-tags.ts +51 -51
- package/templates/blank/scripts/sync-template-step-groups.ts +34 -32
- package/templates/blank/scripts/sync-template-steps.ts +97 -97
- package/templates/blank/scripts/sync-test-cases.ts +65 -74
- package/templates/blank/scripts/sync-test-suites.ts +85 -80
- package/templates/blank/src/actions/server-action-boundary.test.ts +1 -7
- package/templates/blank/src/actions/settings/sync-actions.ts +3 -1
- package/templates/blank/src/actions/tags/tag-actions.ts +1 -7
- package/templates/blank/src/actions/template-test-case/template-test-case-actions.ts +3 -1
- package/templates/blank/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/blank/src/app/(base)/environments/environment-form.tsx +3 -2
- package/templates/blank/src/app/(base)/environments/environment-helpers.ts +4 -1
- package/templates/blank/src/app/(base)/layout.tsx +10 -10
- package/templates/blank/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
- package/templates/blank/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
- package/templates/blank/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
- package/templates/blank/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
- package/templates/blank/src/app/(base)/locator-groups/page.tsx +9 -19
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
- package/templates/blank/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
- package/templates/blank/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
- package/templates/blank/src/app/(base)/locators/locator-file-sync.ts +1 -5
- package/templates/blank/src/app/(base)/locators/locator-helpers.ts +2 -12
- package/templates/blank/src/app/(base)/locators/locator-table-columns.tsx +59 -60
- package/templates/blank/src/app/(base)/modules/module-form.tsx +3 -1
- package/templates/blank/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
- package/templates/blank/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
- package/templates/blank/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
- package/templates/blank/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
- package/templates/blank/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
- package/templates/blank/src/app/(base)/tags/tag-form.test.tsx +2 -10
- package/templates/blank/src/app/(base)/tags/tag-form.tsx +5 -3
- package/templates/blank/src/app/(base)/tags/tag-table-columns.tsx +63 -63
- package/templates/blank/src/app/(base)/tags/tag-table.tsx +29 -29
- package/templates/blank/src/app/(base)/template-step-groups/create/page.tsx +28 -28
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
- package/templates/blank/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
- package/templates/blank/src/app/(base)/template-steps/paramChip.tsx +6 -10
- package/templates/blank/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
- package/templates/blank/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
- package/templates/blank/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
- package/templates/blank/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
- package/templates/blank/src/app/(base)/template-steps/template-step-types.ts +1 -5
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
- package/templates/blank/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
- package/templates/blank/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
- package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
- package/templates/blank/src/app/(base)/test-cases/create/page.tsx +1 -5
- package/templates/blank/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
- package/templates/blank/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
- package/templates/blank/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
- package/templates/blank/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
- package/templates/blank/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
- package/templates/blank/src/app/(base)/test-cases/test-case-form.tsx +63 -78
- package/templates/blank/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
- package/templates/blank/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
- package/templates/blank/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
- package/templates/blank/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
- package/templates/blank/src/app/api/test-runs/[runId]/download/route.ts +1 -4
- package/templates/blank/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
- package/templates/blank/src/assets/icons/empty-tube.tsx +23 -23
- package/templates/blank/src/assets/icons/tube-plus.tsx +29 -29
- package/templates/blank/src/components/data-visualization/info-card.tsx +56 -70
- package/templates/blank/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/blank/src/components/diagram/add-node-prompt-node.tsx +1 -1
- package/templates/blank/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
- package/templates/blank/src/components/diagram/dynamic-parameters.test.tsx +4 -1
- package/templates/blank/src/components/diagram/dynamic-parameters.tsx +0 -1
- package/templates/blank/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
- package/templates/blank/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
- package/templates/blank/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
- package/templates/blank/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
- package/templates/blank/src/components/diagram/flow-diagram-node-search.tsx +65 -65
- package/templates/blank/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
- package/templates/blank/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/blank/src/components/diagram/flow-node-data-helpers.ts +1 -1
- package/templates/blank/src/components/diagram/node-form-fields-content.tsx +9 -2
- package/templates/blank/src/components/diagram/node-form-helpers.test.ts +3 -1
- package/templates/blank/src/components/diagram/node-form-helpers.ts +1 -4
- package/templates/blank/src/components/diagram/node-form-template-step-selection.ts +1 -4
- package/templates/blank/src/components/diagram/node-form.test.tsx +25 -0
- package/templates/blank/src/components/diagram/node-form.tsx +2 -12
- package/templates/blank/src/components/diagram/options-header-node.test.tsx +4 -1
- package/templates/blank/src/components/diagram/options-header-node.tsx +140 -130
- package/templates/blank/src/components/diagram/use-flow-diagram.ts +1 -2
- package/templates/blank/src/components/form/error-message.tsx +7 -7
- package/templates/blank/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/blank/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
- package/templates/blank/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
- package/templates/blank/src/components/navigation/entity-search-command.tsx +3 -9
- package/templates/blank/src/components/navigation/nav-link.tsx +60 -60
- package/templates/blank/src/components/test-case/test-case-form-helpers.test.ts +1 -5
- package/templates/blank/src/components/test-case/test-case-form-helpers.ts +1 -5
- package/templates/blank/src/components/test-case/test-case-picker-helpers.ts +8 -7
- package/templates/blank/src/components/test-case/test-case-picker.tsx +2 -6
- package/templates/blank/src/components/test-run/log-viewer.test.tsx +25 -0
- package/templates/blank/src/components/test-run/log-viewer.tsx +2 -2
- package/templates/blank/src/components/test-run/test-run-details-guards.ts +10 -1
- package/templates/blank/src/components/test-run/test-run-details.test.tsx +9 -19
- package/templates/blank/src/components/test-run/use-log-viewer.ts +2 -8
- package/templates/blank/src/components/test-run/use-test-run-header.ts +1 -4
- package/templates/blank/src/components/test-suite/test-suite-picker.tsx +1 -1
- package/templates/blank/src/components/theme/theme-provider.tsx +7 -1
- package/templates/blank/src/components/typography/page-header-subtitle.tsx +7 -7
- package/templates/blank/src/components/typography/page-header.tsx +7 -7
- package/templates/blank/src/components/ui/chart.tsx +2 -8
- package/templates/blank/src/components/ui/command.tsx +2 -5
- package/templates/blank/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/blank/src/components/ui/data-table.test.tsx +1 -8
- package/templates/blank/src/components/ui/dialog.tsx +1 -4
- package/templates/blank/src/components/ui/select.tsx +2 -2
- package/templates/blank/src/components/ui/separator.tsx +5 -1
- package/templates/blank/src/components/ui/skeleton.tsx +7 -7
- package/templates/blank/src/components/ui/table.tsx +1 -1
- package/templates/blank/src/components/ui/toaster.tsx +26 -26
- package/templates/blank/src/components/ui/tooltip.tsx +1 -1
- package/templates/blank/src/constants/form-opts/locator-group-form-opts.ts +1 -1
- package/templates/blank/src/lib/locator-group-file-utils.ts +5 -1
- package/templates/blank/src/lib/locator-picker/session-manager.ts +1 -2
- package/templates/blank/src/lib/metrics/metric-calculator.test.ts +105 -6
- package/templates/blank/src/lib/metrics/metric-calculator.ts +39 -40
- package/templates/blank/src/lib/sync/sync-executor.ts +1 -4
- package/templates/blank/src/lib/sync/sync-pending-counts.test.ts +201 -7
- package/templates/blank/src/lib/sync/sync-pending-counts.ts +81 -13
- package/templates/blank/src/lib/template-automation-paths.ts +1 -1
- package/templates/blank/src/lib/template-sync-utils.d.ts +14 -7
- package/templates/blank/src/lib/test-case-utils.ts +6 -6
- package/templates/blank/src/lib/test-run/log-formatter.ts +82 -83
- package/templates/blank/src/lib/test-run/report-parser.ts +352 -352
- package/templates/blank/src/lib/transformers/gherkin-converter.ts +42 -42
- package/templates/blank/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
- package/templates/blank/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/blank/src/lib/utils/template-step-file-generator.ts +5 -3
- package/templates/blank/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
- package/templates/blank/src/services/dashboard/dashboard-service.test.ts +28 -1
- package/templates/blank/src/services/dashboard/dashboard-service.ts +2 -0
- package/templates/blank/src/services/locator/locator-service.test.ts +1 -3
- package/templates/blank/src/services/locator/locator-service.ts +3 -1
- package/templates/blank/src/services/locator/locator-sync-utils.test.ts +1 -4
- package/templates/blank/src/services/module/module-service.ts +1 -4
- package/templates/blank/src/services/report/report-service.test.ts +70 -6
- package/templates/blank/src/services/report/report-service.ts +52 -9
- package/templates/blank/src/services/shared/errors.ts +2 -4
- package/templates/blank/src/services/template-step/template-step-service.ts +3 -1
- package/templates/blank/src/services/template-step-group/template-step-group-service.ts +3 -1
- package/templates/blank/src/services/test-case/test-case-service.ts +0 -5
- package/templates/blank/src/services/test-run/test-run-service.test.ts +3 -6
- package/templates/blank/src/services/test-run/test-run-service.ts +12 -7
- package/templates/blank/src/services/test-suite/test-suite-service.test.ts +1 -5
- package/templates/blank/src/services/test-suite/test-suite-service.ts +2 -4
- package/templates/blank/src/types/form/actionHandler.ts +1 -5
- package/templates/blank/tsconfig.json +8 -8
- package/templates/default/packages/locator-picker-companion/dist/cli.d.ts +1 -1
- package/templates/default/packages/locator-picker-companion/dist/cli.js +313 -279
- package/templates/default/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/default/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.d.ts +1 -1
- package/templates/default/packages/locator-picker-companion/dist/injected-picker-script.js +526 -481
- package/templates/default/packages/locator-picker-companion/dist/launcher.d.ts +13 -10
- package/templates/default/packages/locator-picker-companion/dist/launcher.js +47 -48
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/default/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/default/packages/locator-picker-companion/dist/session-file.d.ts +30 -22
- package/templates/default/packages/locator-picker-companion/dist/session-file.js +116 -104
- package/templates/default/packages/locator-picker-companion/dist/types.d.ts +25 -25
- package/templates/default/packages/locator-picker-companion/dist/types.js +1 -1
- package/templates/starter/.editorconfig +11 -0
- package/templates/starter/.gitattributes +21 -0
- package/templates/starter/.gitconfig.appraise +14 -0
- package/templates/starter/.prettierrc +13 -0
- package/templates/starter/.vscode/settings.json +2 -0
- package/templates/starter/README.md +12 -12
- package/templates/starter/automation/steps/actions/click.step.ts +56 -58
- package/templates/starter/automation/steps/actions/hover.step.ts +25 -27
- package/templates/starter/automation/steps/actions/input.step.ts +85 -108
- package/templates/starter/automation/steps/actions/navigation.step.ts +67 -70
- package/templates/starter/automation/steps/actions/random_data.step.ts +149 -143
- package/templates/starter/automation/steps/actions/store.step.ts +69 -1
- package/templates/starter/automation/steps/actions/wait.step.ts +84 -1
- package/templates/starter/automation/steps/validations/active_state_assertion.step.ts +28 -30
- package/templates/starter/automation/steps/validations/navigation_assertion.step.ts +20 -22
- package/templates/starter/automation/steps/validations/text_assertion.step.ts +67 -107
- package/templates/starter/automation/steps/validations/visibility_assertion.step.ts +24 -26
- package/templates/starter/components.json +24 -24
- package/templates/starter/cucumber.mjs +16 -16
- package/templates/starter/e2e/README.md +56 -0
- package/templates/starter/e2e/apply-migrations.mjs +76 -0
- package/templates/starter/e2e/appraise-smoke.spec.ts +78 -0
- package/templates/starter/e2e/authoring.spec.ts +53 -0
- package/templates/starter/e2e/crud-configuration.spec.ts +138 -0
- package/templates/starter/e2e/crud-tests.spec.ts +76 -0
- package/templates/starter/e2e/helpers/forms.ts +186 -0
- package/templates/starter/e2e/helpers/navigation.ts +27 -0
- package/templates/starter/e2e/helpers/table.ts +45 -0
- package/templates/starter/e2e/helpers/test-data.ts +549 -0
- package/templates/starter/e2e/helpers/ui.ts +41 -0
- package/templates/starter/e2e/navigation.spec.ts +101 -0
- package/templates/starter/e2e/runs-and-reports.spec.ts +82 -0
- package/templates/starter/e2e/settings-sync.spec.ts +39 -0
- package/templates/starter/e2e/start-server.mjs +61 -0
- package/templates/starter/eslint.config.mjs +4 -4
- package/templates/starter/gitignore +0 -3
- package/templates/starter/next-env.d.ts +1 -1
- package/templates/starter/package-lock.json +58 -102
- package/templates/starter/package.json +10 -9
- package/templates/starter/packages/cucumber-runtime/package.json +13 -13
- package/templates/starter/packages/cucumber-runtime/src/cache.util.ts +93 -93
- package/templates/starter/packages/cucumber-runtime/src/cli.ts +77 -68
- package/templates/starter/packages/cucumber-runtime/src/environment.util.ts +21 -21
- package/templates/starter/packages/cucumber-runtime/src/executor.ts +32 -32
- package/templates/starter/packages/cucumber-runtime/src/index.ts +17 -17
- package/templates/starter/packages/cucumber-runtime/src/locator.util.ts +234 -234
- package/templates/starter/packages/cucumber-runtime/src/parameter-types.ts +7 -7
- package/templates/starter/packages/cucumber-runtime/src/random-data.util.ts +35 -35
- package/templates/starter/packages/cucumber-runtime/src/types.ts +13 -13
- package/templates/starter/packages/cucumber-runtime/src/world.ts +44 -44
- package/templates/starter/packages/cucumber-runtime/tsconfig.json +11 -11
- package/templates/starter/packages/locator-picker-companion/dist/cli.js +1 -1
- package/templates/starter/packages/locator-picker-companion/dist/index.d.ts +3 -3
- package/templates/starter/packages/locator-picker-companion/dist/index.js +3 -3
- package/templates/starter/packages/locator-picker-companion/dist/injected-picker-script.js +13 -3
- package/templates/starter/packages/locator-picker-companion/dist/selector-generator.d.ts +6 -3
- package/templates/starter/packages/locator-picker-companion/dist/selector-generator.js +233 -229
- package/templates/starter/packages/locator-picker-companion/src/cli.ts +1 -7
- package/templates/starter/packages/locator-picker-companion/src/injected-picker-script.ts +26 -5
- package/templates/starter/packages/locator-picker-companion/src/launcher.ts +1 -3
- package/templates/starter/packages/locator-picker-companion/src/session-file.ts +4 -15
- package/templates/starter/packages/locator-picker-companion/src/types.ts +1 -8
- package/templates/starter/playwright.config.ts +46 -0
- package/templates/starter/postcss.config.mjs +8 -8
- package/templates/starter/prisma/dev.db +0 -0
- package/templates/starter/scripts/configure-git-line-endings.mjs +91 -0
- package/templates/starter/scripts/install-template-step.ts +5 -1
- package/templates/starter/scripts/lib/step-matcher.test.ts +3 -3
- package/templates/starter/scripts/lib/step-matcher.ts +5 -1
- package/templates/starter/scripts/lib/template-step-installer.test.ts +4 -2
- package/templates/starter/scripts/lib/template-step-installer.ts +16 -4
- package/templates/starter/scripts/lib/template-step-registry.test.ts +1 -1
- package/templates/starter/scripts/lib/template-step-registry.ts +4 -1
- package/templates/starter/scripts/run-fallow-commit.mjs +4 -6
- package/templates/starter/scripts/sync-all.ts +7 -6
- package/templates/starter/scripts/sync-appraise-base-template.ts +84 -77
- package/templates/starter/scripts/sync-environments.ts +47 -44
- package/templates/starter/scripts/sync-locator-groups.ts +67 -76
- package/templates/starter/scripts/sync-locators.ts +50 -53
- package/templates/starter/scripts/sync-modules.ts +42 -42
- package/templates/starter/scripts/sync-tags.ts +51 -51
- package/templates/starter/scripts/sync-template-step-groups.ts +34 -32
- package/templates/starter/scripts/sync-template-steps.ts +97 -97
- package/templates/starter/scripts/sync-test-cases.ts +65 -74
- package/templates/starter/scripts/sync-test-suites.ts +85 -80
- package/templates/starter/src/actions/server-action-boundary.test.ts +1 -7
- package/templates/starter/src/actions/settings/sync-actions.ts +3 -1
- package/templates/starter/src/actions/tags/tag-actions.ts +1 -7
- package/templates/starter/src/actions/template-test-case/template-test-case-actions.ts +3 -1
- package/templates/starter/src/app/(base)/environments/create/page.tsx +28 -28
- package/templates/starter/src/app/(base)/environments/environment-form.tsx +3 -2
- package/templates/starter/src/app/(base)/environments/environment-helpers.ts +4 -1
- package/templates/starter/src/app/(base)/layout.tsx +10 -10
- package/templates/starter/src/app/(base)/locator-groups/locator-group-form.tsx +5 -3
- package/templates/starter/src/app/(base)/locator-groups/locator-group-table-columns.tsx +77 -77
- package/templates/starter/src/app/(base)/locator-groups/locator-group-table.tsx +28 -28
- package/templates/starter/src/app/(base)/locator-groups/modify/[id]/page.tsx +46 -46
- package/templates/starter/src/app/(base)/locator-groups/page.tsx +9 -19
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-helpers.test.ts +3 -6
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-response.ts +22 -5
- package/templates/starter/src/app/(base)/locators/create/create-locator-workspace-state.ts +5 -1
- package/templates/starter/src/app/(base)/locators/create/use-locator-workspace.ts +7 -2
- package/templates/starter/src/app/(base)/locators/locator-file-sync.ts +1 -5
- package/templates/starter/src/app/(base)/locators/locator-helpers.ts +2 -12
- package/templates/starter/src/app/(base)/locators/locator-table-columns.tsx +59 -60
- package/templates/starter/src/app/(base)/modules/module-form.tsx +3 -1
- package/templates/starter/src/app/(base)/reports/overview-chart.tsx +49 -49
- package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table-columns.tsx +114 -115
- package/templates/starter/src/app/(base)/reports/test-cases/test-cases-metric-table.tsx +27 -27
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table-columns.tsx +80 -79
- package/templates/starter/src/app/(base)/reports/test-suites/test-suites-metric-table.tsx +29 -27
- package/templates/starter/src/app/(base)/settings/settings-sync-panel-helpers.test.tsx +4 -6
- package/templates/starter/src/app/(base)/settings/settings-sync-panel.tsx +22 -23
- package/templates/starter/src/app/(base)/tags/tag-form.test.tsx +2 -10
- package/templates/starter/src/app/(base)/tags/tag-form.tsx +5 -3
- package/templates/starter/src/app/(base)/tags/tag-table-columns.tsx +63 -63
- package/templates/starter/src/app/(base)/tags/tag-table.tsx +29 -29
- package/templates/starter/src/app/(base)/template-step-groups/create/page.tsx +28 -28
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-form.tsx +3 -1
- package/templates/starter/src/app/(base)/template-step-groups/template-step-group-helpers.ts +4 -1
- package/templates/starter/src/app/(base)/template-steps/paramChip.tsx +6 -10
- package/templates/starter/src/app/(base)/template-steps/template-step-form-helpers.ts +4 -2
- package/templates/starter/src/app/(base)/template-steps/template-step-helpers.test.ts +19 -1
- package/templates/starter/src/app/(base)/template-steps/template-step-helpers.ts +1 -5
- package/templates/starter/src/app/(base)/template-steps/template-step-row-guards.ts +1 -5
- package/templates/starter/src/app/(base)/template-steps/template-step-types.ts +1 -5
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.test.ts +4 -1
- package/templates/starter/src/app/(base)/template-test-cases/create-template-test-case-page-data.ts +1 -2
- package/templates/starter/src/app/(base)/template-test-cases/modify/[id]/page.tsx +1 -0
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-flow.test.tsx +0 -1
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-form.tsx +3 -1
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx +76 -76
- package/templates/starter/src/app/(base)/template-test-cases/template-test-case-table.tsx +32 -32
- package/templates/starter/src/app/(base)/test-cases/create/page.tsx +1 -5
- package/templates/starter/src/app/(base)/test-cases/create-from-template/create-from-template-selection-helpers.ts +1 -4
- package/templates/starter/src/app/(base)/test-cases/create-from-template/page.test.tsx +2 -2
- package/templates/starter/src/app/(base)/test-cases/inline-tag-creation-dialog.tsx +1 -7
- package/templates/starter/src/app/(base)/test-cases/inline-test-suite-creation-dialog.tsx +1 -7
- package/templates/starter/src/app/(base)/test-cases/modify/[id]/page.tsx +1 -5
- package/templates/starter/src/app/(base)/test-cases/test-case-form.tsx +63 -78
- package/templates/starter/src/app/(base)/test-cases/test-case-route-helpers.test.ts +2 -7
- package/templates/starter/src/app/(base)/test-suites/editable-test-suite-helpers.ts +1 -6
- package/templates/starter/src/app/(base)/test-suites/test-suite-form.test.tsx +2 -10
- package/templates/starter/src/app/(dashboard-components)/data-card-grid.tsx +10 -10
- package/templates/starter/src/app/api/test-runs/[runId]/download/route.ts +1 -4
- package/templates/starter/src/app/api/test-runs/[runId]/trace/[testCaseId]/route.test.ts +18 -9
- package/templates/starter/src/assets/icons/empty-tube.tsx +23 -23
- package/templates/starter/src/assets/icons/tube-plus.tsx +29 -29
- package/templates/starter/src/components/data-visualization/info-card.tsx +56 -70
- package/templates/starter/src/components/data-visualization/info-grid.tsx +22 -22
- package/templates/starter/src/components/diagram/add-node-prompt-node.tsx +1 -1
- package/templates/starter/src/components/diagram/dynamic-parameters-helpers.ts +4 -3
- package/templates/starter/src/components/diagram/dynamic-parameters.test.tsx +4 -1
- package/templates/starter/src/components/diagram/dynamic-parameters.tsx +0 -1
- package/templates/starter/src/components/diagram/flow-diagram-block-dialog.test.tsx +26 -0
- package/templates/starter/src/components/diagram/flow-diagram-block-dialog.tsx +3 -1
- package/templates/starter/src/components/diagram/flow-diagram-connection-guards.ts +24 -6
- package/templates/starter/src/components/diagram/flow-diagram-helpers.test.ts +27 -0
- package/templates/starter/src/components/diagram/flow-diagram-node-search.tsx +65 -65
- package/templates/starter/src/components/diagram/flow-diagram-toolbar.tsx +1 -3
- package/templates/starter/src/components/diagram/flow-diagram-view.tsx +1 -7
- package/templates/starter/src/components/diagram/flow-node-data-helpers.ts +1 -1
- package/templates/starter/src/components/diagram/node-form-fields-content.tsx +9 -2
- package/templates/starter/src/components/diagram/node-form-helpers.test.ts +3 -1
- package/templates/starter/src/components/diagram/node-form-helpers.ts +1 -4
- package/templates/starter/src/components/diagram/node-form-template-step-selection.ts +1 -4
- package/templates/starter/src/components/diagram/node-form.test.tsx +25 -0
- package/templates/starter/src/components/diagram/node-form.tsx +2 -12
- package/templates/starter/src/components/diagram/options-header-node.test.tsx +4 -1
- package/templates/starter/src/components/diagram/options-header-node.tsx +140 -130
- package/templates/starter/src/components/diagram/use-flow-diagram.ts +1 -2
- package/templates/starter/src/components/form/error-message.tsx +7 -7
- package/templates/starter/src/components/loading-skeleton/form/button-skeleton.tsx +8 -8
- package/templates/starter/src/components/loading-skeleton/form/text-input-skeleton.tsx +8 -8
- package/templates/starter/src/components/loading-skeleton/visualization/table-skeleton.tsx +14 -14
- package/templates/starter/src/components/navigation/entity-search-command.tsx +3 -9
- package/templates/starter/src/components/navigation/nav-link.tsx +60 -60
- package/templates/starter/src/components/test-case/test-case-form-helpers.test.ts +1 -5
- package/templates/starter/src/components/test-case/test-case-form-helpers.ts +1 -5
- package/templates/starter/src/components/test-case/test-case-picker-helpers.ts +8 -7
- package/templates/starter/src/components/test-case/test-case-picker.tsx +2 -6
- package/templates/starter/src/components/test-run/log-viewer.test.tsx +25 -0
- package/templates/starter/src/components/test-run/log-viewer.tsx +2 -2
- package/templates/starter/src/components/test-run/test-run-details-guards.ts +10 -1
- package/templates/starter/src/components/test-run/test-run-details.test.tsx +9 -19
- package/templates/starter/src/components/test-run/use-log-viewer.ts +2 -8
- package/templates/starter/src/components/test-run/use-test-run-header.ts +1 -4
- package/templates/starter/src/components/test-suite/test-suite-picker.tsx +1 -1
- package/templates/starter/src/components/theme/theme-provider.tsx +7 -1
- package/templates/starter/src/components/typography/page-header-subtitle.tsx +7 -7
- package/templates/starter/src/components/typography/page-header.tsx +7 -7
- package/templates/starter/src/components/ui/chart.tsx +2 -8
- package/templates/starter/src/components/ui/command.tsx +2 -5
- package/templates/starter/src/components/ui/data-table-column-header.tsx +3 -3
- package/templates/starter/src/components/ui/data-table.test.tsx +1 -8
- package/templates/starter/src/components/ui/dialog.tsx +1 -4
- package/templates/starter/src/components/ui/select.tsx +2 -2
- package/templates/starter/src/components/ui/separator.tsx +5 -1
- package/templates/starter/src/components/ui/skeleton.tsx +7 -7
- package/templates/starter/src/components/ui/table.tsx +1 -1
- package/templates/starter/src/components/ui/toaster.tsx +26 -26
- package/templates/starter/src/components/ui/tooltip.tsx +1 -1
- package/templates/starter/src/constants/form-opts/locator-group-form-opts.ts +1 -1
- package/templates/starter/src/lib/locator-group-file-utils.ts +5 -1
- package/templates/starter/src/lib/locator-picker/session-manager.ts +1 -2
- package/templates/starter/src/lib/metrics/metric-calculator.test.ts +105 -6
- package/templates/starter/src/lib/metrics/metric-calculator.ts +39 -40
- package/templates/starter/src/lib/sync/sync-executor.ts +1 -4
- package/templates/starter/src/lib/sync/sync-pending-counts.test.ts +201 -7
- package/templates/starter/src/lib/sync/sync-pending-counts.ts +81 -13
- package/templates/starter/src/lib/template-automation-paths.ts +1 -1
- package/templates/starter/src/lib/template-sync-utils.d.ts +14 -7
- package/templates/starter/src/lib/test-case-utils.ts +6 -6
- package/templates/starter/src/lib/test-run/log-formatter.ts +82 -83
- package/templates/starter/src/lib/test-run/report-parser.ts +352 -352
- package/templates/starter/src/lib/transformers/gherkin-converter.ts +42 -42
- package/templates/starter/src/lib/transformers/key-to-icon-transformer.tsx +95 -95
- package/templates/starter/src/lib/utils/node-param-validation.ts +81 -81
- package/templates/starter/src/lib/utils/template-step-file-generator.ts +5 -3
- package/templates/starter/src/lib/utils/template-step-file-manager-intelligent.ts +11 -1
- package/templates/starter/src/services/dashboard/dashboard-service.test.ts +28 -1
- package/templates/starter/src/services/dashboard/dashboard-service.ts +2 -0
- package/templates/starter/src/services/locator/locator-service.test.ts +1 -3
- package/templates/starter/src/services/locator/locator-service.ts +3 -1
- package/templates/starter/src/services/locator/locator-sync-utils.test.ts +1 -4
- package/templates/starter/src/services/module/module-service.ts +1 -4
- package/templates/starter/src/services/report/report-service.test.ts +70 -6
- package/templates/starter/src/services/report/report-service.ts +52 -9
- package/templates/starter/src/services/shared/errors.ts +2 -4
- package/templates/starter/src/services/template-step/template-step-service.ts +3 -1
- package/templates/starter/src/services/template-step-group/template-step-group-service.ts +3 -1
- package/templates/starter/src/services/test-case/test-case-service.ts +0 -5
- package/templates/starter/src/services/test-run/test-run-service.test.ts +3 -6
- package/templates/starter/src/services/test-run/test-run-service.ts +12 -7
- package/templates/starter/src/services/test-suite/test-suite-service.test.ts +1 -5
- package/templates/starter/src/services/test-suite/test-suite-service.ts +2 -4
- package/templates/starter/src/types/form/actionHandler.ts +1 -5
- package/templates/starter/tsconfig.json +8 -8
package/templates/blank/src/app/(base)/template-test-cases/template-test-case-table-columns.tsx
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { DataTableColumnHeader } from '@/components/ui/data-table-column-header'
|
|
4
|
-
import { TemplateTestCase, TemplateTestCaseStep } from '@prisma/client'
|
|
5
|
-
import { ColumnDef } from '@tanstack/react-table'
|
|
6
|
-
|
|
7
|
-
import { Checkbox } from '@/components/ui/checkbox'
|
|
8
|
-
import TableActions from '@/components/table/table-actions'
|
|
9
|
-
import { deleteTemplateTestCaseAction } from '@/actions/template-test-case/template-test-case-actions'
|
|
10
|
-
import { formatDateTime } from '@/lib/utils'
|
|
11
|
-
|
|
12
|
-
export const templateTestCaseTableCols: ColumnDef<TemplateTestCase & { steps: TemplateTestCaseStep[] }>[] = [
|
|
13
|
-
{
|
|
14
|
-
id: 'select',
|
|
15
|
-
header: ({ table }) => (
|
|
16
|
-
<Checkbox
|
|
17
|
-
checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate')}
|
|
18
|
-
onCheckedChange={value => table.toggleAllPageRowsSelected(!!value)}
|
|
19
|
-
aria-label="Select all"
|
|
20
|
-
className="mr-2"
|
|
21
|
-
/>
|
|
22
|
-
),
|
|
23
|
-
cell: ({ row }) => (
|
|
24
|
-
<Checkbox
|
|
25
|
-
checked={row.getIsSelected()}
|
|
26
|
-
onCheckedChange={value => row.toggleSelected(!!value)}
|
|
27
|
-
aria-label="Select row"
|
|
28
|
-
className="mr-2"
|
|
29
|
-
/>
|
|
30
|
-
),
|
|
31
|
-
enableSorting: false,
|
|
32
|
-
enableHiding: false,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
accessorKey: 'name',
|
|
36
|
-
header: ({ column }) => <DataTableColumnHeader column={column} title="Name" />,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
accessorKey: 'description',
|
|
40
|
-
header: ({ column }) => <DataTableColumnHeader column={column} title="Description" />,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
accessorKey: 'steps',
|
|
44
|
-
header: ({ column }) => <DataTableColumnHeader column={column} title="Steps" />,
|
|
45
|
-
cell: ({ row }) => {
|
|
46
|
-
const templateTestCase = row.original
|
|
47
|
-
return <div>{templateTestCase.steps.length}</div>
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
accessorKey: 'createdAt',
|
|
52
|
-
header: ({ column }) => <DataTableColumnHeader column={column} title="Created At" />,
|
|
53
|
-
cell: ({ row }) => {
|
|
54
|
-
return formatDateTime(row.original.createdAt)
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
accessorKey: 'updatedAt',
|
|
59
|
-
header: ({ column }) => <DataTableColumnHeader column={column} title="Updated At" />,
|
|
60
|
-
cell: ({ row }) => {
|
|
61
|
-
return formatDateTime(row.original.updatedAt)
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: 'actions',
|
|
66
|
-
cell: ({ row }) => {
|
|
67
|
-
const templateTestCase = row.original
|
|
68
|
-
return (
|
|
69
|
-
<TableActions
|
|
70
|
-
modifyLink={`/template-test-cases/modify/${templateTestCase.id}`}
|
|
71
|
-
deleteHandler={() => deleteTemplateTestCaseAction([templateTestCase.id])}
|
|
72
|
-
/>
|
|
73
|
-
)
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
]
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { DataTableColumnHeader } from '@/components/ui/data-table-column-header'
|
|
4
|
+
import { TemplateTestCase, TemplateTestCaseStep } from '@prisma/client'
|
|
5
|
+
import { ColumnDef } from '@tanstack/react-table'
|
|
6
|
+
|
|
7
|
+
import { Checkbox } from '@/components/ui/checkbox'
|
|
8
|
+
import TableActions from '@/components/table/table-actions'
|
|
9
|
+
import { deleteTemplateTestCaseAction } from '@/actions/template-test-case/template-test-case-actions'
|
|
10
|
+
import { formatDateTime } from '@/lib/utils'
|
|
11
|
+
|
|
12
|
+
export const templateTestCaseTableCols: ColumnDef<TemplateTestCase & { steps: TemplateTestCaseStep[] }>[] = [
|
|
13
|
+
{
|
|
14
|
+
id: 'select',
|
|
15
|
+
header: ({ table }) => (
|
|
16
|
+
<Checkbox
|
|
17
|
+
checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate')}
|
|
18
|
+
onCheckedChange={value => table.toggleAllPageRowsSelected(!!value)}
|
|
19
|
+
aria-label="Select all"
|
|
20
|
+
className="mr-2"
|
|
21
|
+
/>
|
|
22
|
+
),
|
|
23
|
+
cell: ({ row }) => (
|
|
24
|
+
<Checkbox
|
|
25
|
+
checked={row.getIsSelected()}
|
|
26
|
+
onCheckedChange={value => row.toggleSelected(!!value)}
|
|
27
|
+
aria-label="Select row"
|
|
28
|
+
className="mr-2"
|
|
29
|
+
/>
|
|
30
|
+
),
|
|
31
|
+
enableSorting: false,
|
|
32
|
+
enableHiding: false,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
accessorKey: 'name',
|
|
36
|
+
header: ({ column }) => <DataTableColumnHeader column={column} title="Name" />,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
accessorKey: 'description',
|
|
40
|
+
header: ({ column }) => <DataTableColumnHeader column={column} title="Description" />,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
accessorKey: 'steps',
|
|
44
|
+
header: ({ column }) => <DataTableColumnHeader column={column} title="Steps" />,
|
|
45
|
+
cell: ({ row }) => {
|
|
46
|
+
const templateTestCase = row.original
|
|
47
|
+
return <div>{templateTestCase.steps.length}</div>
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
accessorKey: 'createdAt',
|
|
52
|
+
header: ({ column }) => <DataTableColumnHeader column={column} title="Created At" />,
|
|
53
|
+
cell: ({ row }) => {
|
|
54
|
+
return formatDateTime(row.original.createdAt)
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
accessorKey: 'updatedAt',
|
|
59
|
+
header: ({ column }) => <DataTableColumnHeader column={column} title="Updated At" />,
|
|
60
|
+
cell: ({ row }) => {
|
|
61
|
+
return formatDateTime(row.original.updatedAt)
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'actions',
|
|
66
|
+
cell: ({ row }) => {
|
|
67
|
+
const templateTestCase = row.original
|
|
68
|
+
return (
|
|
69
|
+
<TableActions
|
|
70
|
+
modifyLink={`/template-test-cases/modify/${templateTestCase.id}`}
|
|
71
|
+
deleteHandler={() => deleteTemplateTestCaseAction([templateTestCase.id])}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
]
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { DataTable } from '@/components/ui/data-table'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { templateTestCaseTableCols } from './template-test-case-table-columns'
|
|
4
|
-
import {
|
|
5
|
-
getAllTemplateTestCasesAction,
|
|
6
|
-
deleteTemplateTestCaseAction,
|
|
7
|
-
} from '@/actions/template-test-case/template-test-case-actions'
|
|
8
|
-
import { TemplateTestCase, TemplateTestCaseStep } from '@prisma/client'
|
|
9
|
-
|
|
10
|
-
type TemplateTestCaseWithSteps = TemplateTestCase & {
|
|
11
|
-
steps: TemplateTestCaseStep[]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const TemplateTestCaseTable = async () => {
|
|
15
|
-
const { data: templateTestCases } = await getAllTemplateTestCasesAction()
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<DataTable
|
|
20
|
-
columns={templateTestCaseTableCols}
|
|
21
|
-
data={templateTestCases as TemplateTestCaseWithSteps[]}
|
|
22
|
-
filterColumn="name"
|
|
23
|
-
filterPlaceholder="Filter by name..."
|
|
24
|
-
createLink="/template-test-cases/create"
|
|
25
|
-
modifyLink="/template-test-cases/modify"
|
|
26
|
-
deleteAction={deleteTemplateTestCaseAction}
|
|
27
|
-
/>
|
|
28
|
-
</>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default TemplateTestCaseTable
|
|
1
|
+
import { DataTable } from '@/components/ui/data-table'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { templateTestCaseTableCols } from './template-test-case-table-columns'
|
|
4
|
+
import {
|
|
5
|
+
getAllTemplateTestCasesAction,
|
|
6
|
+
deleteTemplateTestCaseAction,
|
|
7
|
+
} from '@/actions/template-test-case/template-test-case-actions'
|
|
8
|
+
import { TemplateTestCase, TemplateTestCaseStep } from '@prisma/client'
|
|
9
|
+
|
|
10
|
+
type TemplateTestCaseWithSteps = TemplateTestCase & {
|
|
11
|
+
steps: TemplateTestCaseStep[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const TemplateTestCaseTable = async () => {
|
|
15
|
+
const { data: templateTestCases } = await getAllTemplateTestCasesAction()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<DataTable
|
|
20
|
+
columns={templateTestCaseTableCols}
|
|
21
|
+
data={templateTestCases as TemplateTestCaseWithSteps[]}
|
|
22
|
+
filterColumn="name"
|
|
23
|
+
filterPlaceholder="Filter by name..."
|
|
24
|
+
createLink="/template-test-cases/create"
|
|
25
|
+
modifyLink="/template-test-cases/modify"
|
|
26
|
+
deleteAction={deleteTemplateTestCaseAction}
|
|
27
|
+
/>
|
|
28
|
+
</>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default TemplateTestCaseTable
|
|
@@ -67,11 +67,7 @@ const CreateTestCase = async () => {
|
|
|
67
67
|
environmentsResponse.error
|
|
68
68
|
|
|
69
69
|
if (loadError) {
|
|
70
|
-
return
|
|
71
|
-
<div>
|
|
72
|
-
Error: {loadError}
|
|
73
|
-
</div>
|
|
74
|
-
)
|
|
70
|
+
return <div>Error: {loadError}</div>
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
const templateStepParams = getTemplateStepParamRows(templateStepParamsResponse.data)
|
|
@@ -47,10 +47,7 @@ function isTemplateTestCaseStepRow(value: unknown) {
|
|
|
47
47
|
|
|
48
48
|
function isTemplateTestCaseWithSteps(value: unknown): value is TemplateTestCaseWithSteps {
|
|
49
49
|
return (
|
|
50
|
-
isNamedRow(value) &&
|
|
51
|
-
'steps' in value &&
|
|
52
|
-
Array.isArray(value.steps) &&
|
|
53
|
-
value.steps.every(isTemplateTestCaseStepRow)
|
|
50
|
+
isNamedRow(value) && 'steps' in value && Array.isArray(value.steps) && value.steps.every(isTemplateTestCaseStepRow)
|
|
54
51
|
)
|
|
55
52
|
}
|
|
56
53
|
|
|
@@ -80,6 +80,8 @@ vi.mock('../test-case-form', () => ({
|
|
|
80
80
|
default: testCaseFormSpy,
|
|
81
81
|
}))
|
|
82
82
|
|
|
83
|
+
import CreateTestCaseFromTemplate from './page'
|
|
84
|
+
|
|
83
85
|
describe('Create Test Case From Template page', () => {
|
|
84
86
|
it('passes template options and the selected template defaults into the shared test case form', async () => {
|
|
85
87
|
getAllTemplateTestCasesAction.mockResolvedValue({
|
|
@@ -120,8 +122,6 @@ describe('Create Test Case From Template page', () => {
|
|
|
120
122
|
getAllModulesAction.mockResolvedValue({ data: [{ id: 'module-1', name: 'Auth' }] })
|
|
121
123
|
getAllEnvironmentsAction.mockResolvedValue({ data: [{ id: 'env-1', name: 'Staging' }] })
|
|
122
124
|
|
|
123
|
-
const { default: CreateTestCaseFromTemplate } = await import('./page')
|
|
124
|
-
|
|
125
125
|
render(
|
|
126
126
|
await CreateTestCaseFromTemplate({
|
|
127
127
|
searchParams: Promise.resolve({ templateTestCaseId: 'template-1' }),
|
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import TagForm from '@/app/(base)/tags/tag-form'
|
|
4
4
|
import type { TagFormSubmitAction } from '@/app/(base)/tags/tag-form-helpers'
|
|
5
|
-
import {
|
|
6
|
-
Dialog,
|
|
7
|
-
DialogContent,
|
|
8
|
-
DialogDescription,
|
|
9
|
-
DialogHeader,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
} from '@/components/ui/dialog'
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
|
12
6
|
import type { Tag } from '@prisma/client'
|
|
13
7
|
|
|
14
8
|
type InlineTagCreationDialogProps = {
|
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { TestSuiteForm } from '@/app/(base)/test-suites/test-suite-form'
|
|
4
4
|
import type { TestSuiteFormSubmitAction } from '@/app/(base)/test-suites/test-suite-helpers'
|
|
5
|
-
import {
|
|
6
|
-
Dialog,
|
|
7
|
-
DialogContent,
|
|
8
|
-
DialogDescription,
|
|
9
|
-
DialogHeader,
|
|
10
|
-
DialogTitle,
|
|
11
|
-
} from '@/components/ui/dialog'
|
|
5
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
|
12
6
|
import type { TestCasePickerRow } from '@/types/test-case-picker'
|
|
13
7
|
import type { Module, Tag, TestSuite } from '@prisma/client'
|
|
14
8
|
|
|
@@ -77,11 +77,7 @@ const ModifyTestCase = async ({ params }: { params: Promise<{ id: string }> }) =
|
|
|
77
77
|
environmentsResponse.error
|
|
78
78
|
|
|
79
79
|
if (loadError) {
|
|
80
|
-
return
|
|
81
|
-
<div>
|
|
82
|
-
Error: {loadError}
|
|
83
|
-
</div>
|
|
84
|
-
)
|
|
80
|
+
return <div>Error: {loadError}</div>
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
const testCase = getEditableTestCase(testCaseResponse.data)
|
|
@@ -52,11 +52,7 @@ import { testCaseSchema } from '@/constants/form-opts/test-case-form-opts'
|
|
|
52
52
|
import { toast } from '@/hooks/use-toast'
|
|
53
53
|
import { cn } from '@/lib/utils'
|
|
54
54
|
import type { ActionResponse } from '@/types/form/actionHandler'
|
|
55
|
-
import {
|
|
56
|
-
createTestCaseFormState,
|
|
57
|
-
testCaseFormReducer,
|
|
58
|
-
type TestCaseFormErrors,
|
|
59
|
-
} from './test-case-form-reducer'
|
|
55
|
+
import { createTestCaseFormState, testCaseFormReducer, type TestCaseFormErrors } from './test-case-form-reducer'
|
|
60
56
|
|
|
61
57
|
type TestCaseFormProps = {
|
|
62
58
|
defaultNodesOrder: NodeOrderMap
|
|
@@ -296,53 +292,53 @@ function FlowPanel({
|
|
|
296
292
|
}: FlowPanelProps) {
|
|
297
293
|
return (
|
|
298
294
|
<LazyMotion features={domAnimation} strict>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
295
|
+
<motion.div
|
|
296
|
+
layout
|
|
297
|
+
layoutId="test-case-flow-panel"
|
|
298
|
+
className={cn(
|
|
299
|
+
'flex min-h-0 w-full flex-col overflow-hidden rounded-xl border border-zinc-700 text-card-foreground shadow-sm will-change-transform',
|
|
300
|
+
className,
|
|
301
|
+
)}
|
|
302
|
+
transition={{ layout: { duration: 0.3, ease: 'easeInOut' } }}
|
|
303
|
+
>
|
|
304
|
+
<CardHeader className="shrink-0">
|
|
305
|
+
<div className="flex items-start justify-between gap-3">
|
|
306
|
+
<div className="space-y-1">
|
|
307
|
+
<CardTitle className="text-xl font-bold text-primary">Test Case Flow</CardTitle>
|
|
308
|
+
<CardDescription>Build your test scenario step by step visually</CardDescription>
|
|
309
|
+
</div>
|
|
310
|
+
<Button
|
|
311
|
+
type="button"
|
|
312
|
+
variant="outline"
|
|
313
|
+
size="icon"
|
|
314
|
+
className="size-9 shrink-0"
|
|
315
|
+
onClick={onToggleImmersive}
|
|
316
|
+
aria-label={isFlowImmersive ? 'Exit immersive flow editing' : 'Enter immersive flow editing'}
|
|
317
|
+
>
|
|
318
|
+
{isFlowImmersive ? <Minimize2 className="size-4" /> : <Maximize2 className="size-4" />}
|
|
319
|
+
</Button>
|
|
313
320
|
</div>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
templateSteps={templateSteps}
|
|
333
|
-
onNodeOrderChange={onNodeOrderChange}
|
|
334
|
-
locators={locators}
|
|
335
|
-
locatorGroups={locatorGroups}
|
|
336
|
-
environments={environments}
|
|
337
|
-
modules={moduleList}
|
|
338
|
-
flowBlocks={flowBlocks}
|
|
339
|
-
layoutRefreshKey={isFlowImmersive}
|
|
340
|
-
onFlowBlocksChange={onFlowBlocksChange}
|
|
341
|
-
/>
|
|
321
|
+
</CardHeader>
|
|
322
|
+
<CardContent className="flex min-h-0 flex-1 flex-col">
|
|
323
|
+
<div className="flex min-h-0 flex-1 flex-col gap-2">
|
|
324
|
+
<div className="min-h-0 flex-1">
|
|
325
|
+
<TestCaseFlow
|
|
326
|
+
initialNodesOrder={nodesOrder}
|
|
327
|
+
templateStepParams={templateStepParams}
|
|
328
|
+
templateSteps={templateSteps}
|
|
329
|
+
onNodeOrderChange={onNodeOrderChange}
|
|
330
|
+
locators={locators}
|
|
331
|
+
locatorGroups={locatorGroups}
|
|
332
|
+
environments={environments}
|
|
333
|
+
modules={moduleList}
|
|
334
|
+
flowBlocks={flowBlocks}
|
|
335
|
+
layoutRefreshKey={isFlowImmersive}
|
|
336
|
+
onFlowBlocksChange={onFlowBlocksChange}
|
|
337
|
+
/>
|
|
338
|
+
</div>
|
|
342
339
|
</div>
|
|
343
|
-
</
|
|
344
|
-
</
|
|
345
|
-
</motion.div>
|
|
340
|
+
</CardContent>
|
|
341
|
+
</motion.div>
|
|
346
342
|
</LazyMotion>
|
|
347
343
|
)
|
|
348
344
|
}
|
|
@@ -774,16 +770,16 @@ function FlowStep({
|
|
|
774
770
|
return (
|
|
775
771
|
<div className="flex flex-col gap-4">
|
|
776
772
|
<LazyMotion features={domAnimation} strict>
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
773
|
+
<LayoutGroup id="test-case-flow-panel-layout">
|
|
774
|
+
<div className="w-full min-w-0 overflow-x-hidden">
|
|
775
|
+
{isFlowImmersive ? (
|
|
776
|
+
<div className="fixed inset-0 z-40 bg-background p-3 sm:p-4">{immersiveFlowPanel}</div>
|
|
777
|
+
) : (
|
|
778
|
+
flowPanel
|
|
779
|
+
)}
|
|
780
|
+
<TestCaseFormFieldError message={errors.steps} />
|
|
781
|
+
</div>
|
|
782
|
+
</LayoutGroup>
|
|
787
783
|
</LazyMotion>
|
|
788
784
|
{!isFlowImmersive && (
|
|
789
785
|
<div className="flex flex-col gap-4">
|
|
@@ -857,14 +853,7 @@ type WizardStepContentProps = {
|
|
|
857
853
|
errors: TestCaseFormErrors
|
|
858
854
|
}
|
|
859
855
|
|
|
860
|
-
function WizardStepContent({
|
|
861
|
-
actions,
|
|
862
|
-
details,
|
|
863
|
-
errors,
|
|
864
|
-
flow,
|
|
865
|
-
navigation,
|
|
866
|
-
template,
|
|
867
|
-
}: WizardStepContentProps) {
|
|
856
|
+
function WizardStepContent({ actions, details, errors, flow, navigation, template }: WizardStepContentProps) {
|
|
868
857
|
const { currentStep, detailsStepIndex, hasTemplateSelectionStep } = navigation
|
|
869
858
|
|
|
870
859
|
if (hasTemplateSelectionStep && currentStep === 0) {
|
|
@@ -1142,7 +1131,10 @@ function useBodyScrollLock(isLocked: boolean) {
|
|
|
1142
1131
|
}, [isLocked])
|
|
1143
1132
|
}
|
|
1144
1133
|
|
|
1145
|
-
function useWizardStepClick(
|
|
1134
|
+
function useWizardStepClick(
|
|
1135
|
+
currentStep: number,
|
|
1136
|
+
dispatch: React.Dispatch<import('./test-case-form-reducer').TestCaseFormAction>,
|
|
1137
|
+
) {
|
|
1146
1138
|
return useCallback(
|
|
1147
1139
|
(stepIndex: number) => {
|
|
1148
1140
|
if (stepIndex <= currentStep) {
|
|
@@ -1194,11 +1186,7 @@ const TestCaseForm = ({
|
|
|
1194
1186
|
defaultTestSuiteIds,
|
|
1195
1187
|
defaultTagIds,
|
|
1196
1188
|
defaultTemplateTestCaseId,
|
|
1197
|
-
initialWizardStep: getInitialWizardStep(
|
|
1198
|
-
hasTemplateSelectionStep,
|
|
1199
|
-
defaultTemplateTestCaseId,
|
|
1200
|
-
detailsStepIndex,
|
|
1201
|
-
),
|
|
1189
|
+
initialWizardStep: getInitialWizardStep(hasTemplateSelectionStep, defaultTemplateTestCaseId, detailsStepIndex),
|
|
1202
1190
|
},
|
|
1203
1191
|
createTestCaseFormState,
|
|
1204
1192
|
)
|
|
@@ -1357,10 +1345,7 @@ const TestCaseForm = ({
|
|
|
1357
1345
|
flow: {
|
|
1358
1346
|
isFlowImmersive,
|
|
1359
1347
|
flowPanel: (
|
|
1360
|
-
<FlowPanel
|
|
1361
|
-
{...flowPanelProps}
|
|
1362
|
-
className="relative h-[max(22rem,calc(100dvh-12rem))] bg-zinc-500/10"
|
|
1363
|
-
/>
|
|
1348
|
+
<FlowPanel {...flowPanelProps} className="relative h-[max(22rem,calc(100dvh-12rem))] bg-zinc-500/10" />
|
|
1364
1349
|
),
|
|
1365
1350
|
immersiveFlowPanel: <FlowPanel {...flowPanelProps} className="h-full bg-background" />,
|
|
1366
1351
|
scenarioPreview,
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { StepParameterType, TemplateStepIcon } from '@prisma/client'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
getEditableTestCase,
|
|
7
|
-
} from './editable-test-case-helpers'
|
|
8
|
-
import {
|
|
9
|
-
getTestCaseRows,
|
|
10
|
-
} from './test-case-row-helpers'
|
|
4
|
+
import { buildNodeOrderFromTestCaseSteps, getEditableTestCase } from './editable-test-case-helpers'
|
|
5
|
+
import { getTestCaseRows } from './test-case-row-helpers'
|
|
11
6
|
|
|
12
7
|
describe('test-case route helpers', () => {
|
|
13
8
|
it('narrows test case list rows from action data', () => {
|
|
@@ -4,12 +4,7 @@ import { isTagRow, isTestSuiteTableRow } from './test-suite-row-guards'
|
|
|
4
4
|
import type { EditableTestSuite } from './test-suite-types'
|
|
5
5
|
|
|
6
6
|
function isEditableTestSuite(value: unknown): value is EditableTestSuite {
|
|
7
|
-
return (
|
|
8
|
-
isTestSuiteTableRow(value) &&
|
|
9
|
-
'tags' in value &&
|
|
10
|
-
Array.isArray(value.tags) &&
|
|
11
|
-
value.tags.every(isTagRow)
|
|
12
|
-
)
|
|
7
|
+
return isTestSuiteTableRow(value) && 'tags' in value && Array.isArray(value.tags) && value.tags.every(isTagRow)
|
|
13
8
|
}
|
|
14
9
|
|
|
15
10
|
export function getEditableTestSuite(data: ActionResponseData | undefined) {
|
|
@@ -23,11 +23,7 @@ vi.mock('@/hooks/use-toast', () => ({
|
|
|
23
23
|
|
|
24
24
|
vi.mock('@/components/test-case/test-case-picker', () => ({
|
|
25
25
|
__esModule: true,
|
|
26
|
-
default: ({
|
|
27
|
-
onSave,
|
|
28
|
-
}: {
|
|
29
|
-
onSave: (value: string[]) => void
|
|
30
|
-
}) => (
|
|
26
|
+
default: ({ onSave }: { onSave: (value: string[]) => void }) => (
|
|
31
27
|
<button type="button" onClick={() => onSave(['case-1'])}>
|
|
32
28
|
Select Cases
|
|
33
29
|
</button>
|
|
@@ -36,11 +32,7 @@ vi.mock('@/components/test-case/test-case-picker', () => ({
|
|
|
36
32
|
|
|
37
33
|
vi.mock('@/components/ui/multi-select-with-preview', () => ({
|
|
38
34
|
__esModule: true,
|
|
39
|
-
default: ({
|
|
40
|
-
onSelectChange,
|
|
41
|
-
}: {
|
|
42
|
-
onSelectChange: (value: string[]) => void
|
|
43
|
-
}) => (
|
|
35
|
+
default: ({ onSelectChange }: { onSelectChange: (value: string[]) => void }) => (
|
|
44
36
|
<button type="button" onClick={() => onSelectChange(['tag-1'])}>
|
|
45
37
|
Select Tags
|
|
46
38
|
</button>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from
|
|
1
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
2
2
|
|
|
3
3
|
export const DataCardGrid = ({ children }: { children: React.ReactNode }) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
</CardContent>
|
|
4
|
+
return (
|
|
5
|
+
<Card className="w-fit border-zinc-600/10 bg-zinc-600/10">
|
|
6
|
+
<CardHeader>
|
|
7
|
+
<CardTitle className="text-primary">States</CardTitle>
|
|
8
|
+
<CardDescription>Overview of entity states</CardDescription>
|
|
9
|
+
</CardHeader>
|
|
10
|
+
<CardContent className="grid grid-cols-2 gap-4">{children}</CardContent>
|
|
12
11
|
</Card>
|
|
13
|
-
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -12,10 +12,7 @@ type Archive = ReturnType<typeof archiver>
|
|
|
12
12
|
type ArtifactFile = { absolutePath: string; archivePath: string }
|
|
13
13
|
type DownloadTestRun = NonNullable<Awaited<ReturnType<typeof getDownloadTestRun>>>
|
|
14
14
|
|
|
15
|
-
async function collectRunArtifactFiles(
|
|
16
|
-
dir: string,
|
|
17
|
-
baseDir = dir,
|
|
18
|
-
): Promise<ArtifactFile[]> {
|
|
15
|
+
async function collectRunArtifactFiles(dir: string, baseDir = dir): Promise<ArtifactFile[]> {
|
|
19
16
|
try {
|
|
20
17
|
const entries = await fs.readdir(dir, { withFileTypes: true })
|
|
21
18
|
const files: ArtifactFile[] = []
|
|
@@ -86,9 +86,12 @@ describe('trace route', () => {
|
|
|
86
86
|
testCases: [{ id: 'trtc-1', tracePath: null }],
|
|
87
87
|
})
|
|
88
88
|
|
|
89
|
-
const response = await POST(
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const response = await POST(
|
|
90
|
+
new NextRequest('http://localhost/api/test-runs/run-1/trace/trtc-1', { method: 'POST' }),
|
|
91
|
+
{
|
|
92
|
+
params: Promise.resolve({ runId: 'run-1', testCaseId: 'trtc-1' }),
|
|
93
|
+
},
|
|
94
|
+
)
|
|
92
95
|
|
|
93
96
|
expect(response.status).toBe(400)
|
|
94
97
|
await expect(response.json()).resolves.toEqual({ error: 'No trace path available for this test case' })
|
|
@@ -100,9 +103,12 @@ describe('trace route', () => {
|
|
|
100
103
|
})
|
|
101
104
|
mockAccess.mockRejectedValue(new Error('missing'))
|
|
102
105
|
|
|
103
|
-
const response = await POST(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
const response = await POST(
|
|
107
|
+
new NextRequest('http://localhost/api/test-runs/run-1/trace/trtc-1', { method: 'POST' }),
|
|
108
|
+
{
|
|
109
|
+
params: Promise.resolve({ runId: 'run-1', testCaseId: 'trtc-1' }),
|
|
110
|
+
},
|
|
111
|
+
)
|
|
106
112
|
|
|
107
113
|
expect(response.status).toBe(404)
|
|
108
114
|
await expect(response.json()).resolves.toEqual({ error: 'Trace file not found at path: trace.zip' })
|
|
@@ -115,9 +121,12 @@ describe('trace route', () => {
|
|
|
115
121
|
mockAccess.mockResolvedValue(undefined)
|
|
116
122
|
mockSpawn.mockResolvedValue({ name: 'trace-viewer-trtc-1' })
|
|
117
123
|
|
|
118
|
-
const response = await POST(
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
const response = await POST(
|
|
125
|
+
new NextRequest('http://localhost/api/test-runs/run-1/trace/trtc-1', { method: 'POST' }),
|
|
126
|
+
{
|
|
127
|
+
params: Promise.resolve({ runId: 'run-1', testCaseId: 'trtc-1' }),
|
|
128
|
+
},
|
|
129
|
+
)
|
|
121
130
|
|
|
122
131
|
expect(mockSpawn).toHaveBeenCalledWith('npx', ['playwright', 'show-trace', '/resolved/trace.zip'], {
|
|
123
132
|
streamLogs: true,
|