@sun-asterisk/sungen 3.2.32 → 3.2.34
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/commands/audit.d.ts +5 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +26 -4
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/capability.d.ts.map +1 -1
- package/dist/cli/commands/capability.js +35 -17
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/changed.d.ts.map +1 -1
- package/dist/cli/commands/changed.js +2 -3
- package/dist/cli/commands/changed.js.map +1 -1
- package/dist/cli/commands/dashboard.d.ts.map +1 -1
- package/dist/cli/commands/dashboard.js +2 -28
- package/dist/cli/commands/dashboard.js.map +1 -1
- package/dist/cli/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +79 -53
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +14 -7
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/results-merge.d.ts +9 -0
- package/dist/cli/commands/results-merge.d.ts.map +1 -1
- package/dist/cli/commands/results-merge.js +9 -12
- package/dist/cli/commands/results-merge.js.map +1 -1
- package/dist/cli/commands/results-sanitize.d.ts.map +1 -1
- package/dist/cli/commands/results-sanitize.js +2 -13
- package/dist/cli/commands/results-sanitize.js.map +1 -1
- package/dist/cli/commands/select.d.ts +12 -0
- package/dist/cli/commands/select.d.ts.map +1 -0
- package/dist/cli/commands/select.js +122 -0
- package/dist/cli/commands/select.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +3 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +7 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
- package/dist/dashboard/snapshot-builder.js +6 -10
- package/dist/dashboard/snapshot-builder.js.map +1 -1
- package/dist/dashboard/templates/index.html +1 -1
- package/dist/dashboard/types.d.ts +1 -0
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.js +11 -10
- package/dist/exporters/csv-exporter.js.map +1 -1
- package/dist/exporters/feature-parser.d.ts +21 -0
- package/dist/exporters/feature-parser.d.ts.map +1 -1
- package/dist/exporters/feature-parser.js +32 -1
- package/dist/exporters/feature-parser.js.map +1 -1
- package/dist/exporters/json-exporter.d.ts.map +1 -1
- package/dist/exporters/json-exporter.js +7 -0
- package/dist/exporters/json-exporter.js.map +1 -1
- package/dist/exporters/locale-variants.d.ts +7 -1
- package/dist/exporters/locale-variants.d.ts.map +1 -1
- package/dist/exporters/locale-variants.js +23 -16
- package/dist/exporters/locale-variants.js.map +1 -1
- package/dist/exporters/manual-hybrid-oracle.d.ts +54 -0
- package/dist/exporters/manual-hybrid-oracle.d.ts.map +1 -0
- package/dist/exporters/manual-hybrid-oracle.js +114 -0
- package/dist/exporters/manual-hybrid-oracle.js.map +1 -0
- package/dist/exporters/matrix/build.d.ts.map +1 -1
- package/dist/exporters/matrix/build.js +19 -9
- package/dist/exporters/matrix/build.js.map +1 -1
- package/dist/exporters/matrix/carry-manual-results.d.ts +70 -0
- package/dist/exporters/matrix/carry-manual-results.d.ts.map +1 -0
- package/dist/exporters/matrix/carry-manual-results.js +232 -0
- package/dist/exporters/matrix/carry-manual-results.js.map +1 -0
- package/dist/exporters/matrix/export.d.ts +5 -0
- package/dist/exporters/matrix/export.d.ts.map +1 -1
- package/dist/exporters/matrix/export.js +8 -1
- package/dist/exporters/matrix/export.js.map +1 -1
- package/dist/exporters/matrix/gates.js +6 -0
- package/dist/exporters/matrix/gates.js.map +1 -1
- package/dist/exporters/matrix/render-testcase-sheet.d.ts.map +1 -1
- package/dist/exporters/matrix/render-testcase-sheet.js +10 -4
- package/dist/exporters/matrix/render-testcase-sheet.js.map +1 -1
- package/dist/exporters/matrix/types.d.ts +8 -1
- package/dist/exporters/matrix/types.d.ts.map +1 -1
- package/dist/exporters/matrix/types.js.map +1 -1
- package/dist/exporters/matrix/wording.d.ts +8 -1
- package/dist/exporters/matrix/wording.d.ts.map +1 -1
- package/dist/exporters/matrix/wording.js +37 -2
- package/dist/exporters/matrix/wording.js.map +1 -1
- package/dist/exporters/run-environment.d.ts +32 -0
- package/dist/exporters/run-environment.d.ts.map +1 -0
- package/dist/exporters/run-environment.js +125 -0
- package/dist/exporters/run-environment.js.map +1 -0
- package/dist/exporters/scenario-merger.d.ts +18 -0
- package/dist/exporters/scenario-merger.d.ts.map +1 -1
- package/dist/exporters/scenario-merger.js +47 -3
- package/dist/exporters/scenario-merger.js.map +1 -1
- package/dist/exporters/test-data-resolver.d.ts +0 -4
- package/dist/exporters/test-data-resolver.d.ts.map +1 -1
- package/dist/exporters/test-data-resolver.js +0 -7
- package/dist/exporters/test-data-resolver.js.map +1 -1
- package/dist/exporters/xlsx-exporter.d.ts +2 -0
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.js +7 -2
- package/dist/exporters/xlsx-exporter.js.map +1 -1
- package/dist/generators/gherkin-parser/index.d.ts +11 -4
- package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
- package/dist/generators/gherkin-parser/index.js +49 -19
- package/dist/generators/gherkin-parser/index.js.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts +4 -0
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
- package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +68 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/click-select-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/select-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/pick-option.hbs +13 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +5 -1
- package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +16 -0
- package/dist/generators/test-generator/code-generator.d.ts +2 -1
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +90 -5
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/diagnostics.d.ts +36 -5
- package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
- package/dist/generators/test-generator/diagnostics.js +35 -4
- package/dist/generators/test-generator/diagnostics.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts +12 -2
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +15 -9
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/patterns/types.d.ts +15 -0
- package/dist/generators/test-generator/patterns/types.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts +5 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/with-parent-scope.js +6 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.js.map +1 -1
- package/dist/generators/test-generator/step-mapper.d.ts +46 -0
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +84 -9
- package/dist/generators/test-generator/step-mapper.js.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.d.ts +25 -0
- package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.js +39 -8
- package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-entry-fields.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-entry-fields.js +1 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +37 -4
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +212 -79
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/harness/audit.d.ts +3 -0
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +29 -12
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/capability.d.ts +7 -1
- package/dist/harness/capability.d.ts.map +1 -1
- package/dist/harness/capability.js +15 -12
- package/dist/harness/capability.js.map +1 -1
- package/dist/harness/catalog/universal-viewpoints.yaml +5 -5
- package/dist/harness/config-file.d.ts +17 -0
- package/dist/harness/config-file.d.ts.map +1 -0
- package/dist/harness/config-file.js +100 -0
- package/dist/harness/config-file.js.map +1 -0
- package/dist/harness/data-driven-lint.d.ts.map +1 -1
- package/dist/harness/data-driven-lint.js +69 -27
- package/dist/harness/data-driven-lint.js.map +1 -1
- package/dist/harness/depth-lint.d.ts.map +1 -1
- package/dist/harness/depth-lint.js +2 -1
- package/dist/harness/depth-lint.js.map +1 -1
- package/dist/harness/flow-check.d.ts.map +1 -1
- package/dist/harness/flow-check.js +6 -2
- package/dist/harness/flow-check.js.map +1 -1
- package/dist/harness/keyword-match.d.ts +59 -0
- package/dist/harness/keyword-match.d.ts.map +1 -0
- package/dist/harness/keyword-match.js +86 -0
- package/dist/harness/keyword-match.js.map +1 -0
- package/dist/harness/next-step.d.ts.map +1 -1
- package/dist/harness/next-step.js +1 -0
- package/dist/harness/next-step.js.map +1 -1
- package/dist/harness/parse.d.ts +24 -0
- package/dist/harness/parse.d.ts.map +1 -1
- package/dist/harness/parse.js +117 -13
- package/dist/harness/parse.js.map +1 -1
- package/dist/harness/perf.d.ts +7 -1
- package/dist/harness/perf.d.ts.map +1 -1
- package/dist/harness/perf.js +13 -10
- package/dist/harness/perf.js.map +1 -1
- package/dist/harness/quality-gates.d.ts +9 -2
- package/dist/harness/quality-gates.d.ts.map +1 -1
- package/dist/harness/quality-gates.js +22 -8
- package/dist/harness/quality-gates.js.map +1 -1
- package/dist/harness/query-catalog.js +0 -0
- package/dist/harness/query-catalog.js.map +1 -1
- package/dist/harness/read-text.d.ts +21 -0
- package/dist/harness/read-text.d.ts.map +1 -1
- package/dist/harness/read-text.js +32 -1
- package/dist/harness/read-text.js.map +1 -1
- package/dist/harness/secret-scan.d.ts +27 -1
- package/dist/harness/secret-scan.d.ts.map +1 -1
- package/dist/harness/secret-scan.js +57 -4
- package/dist/harness/secret-scan.js.map +1 -1
- package/dist/harness/select-by-ids.d.ts +31 -0
- package/dist/harness/select-by-ids.d.ts.map +1 -0
- package/dist/harness/select-by-ids.js +106 -0
- package/dist/harness/select-by-ids.js.map +1 -0
- package/dist/harness/sensors.d.ts +20 -1
- package/dist/harness/sensors.d.ts.map +1 -1
- package/dist/harness/sensors.js +102 -27
- package/dist/harness/sensors.js.map +1 -1
- package/dist/harness/spec-branches.d.ts +0 -18
- package/dist/harness/spec-branches.d.ts.map +1 -1
- package/dist/harness/spec-branches.js +24 -3
- package/dist/harness/spec-branches.js.map +1 -1
- package/dist/harness/spec-coverage.d.ts.map +1 -1
- package/dist/harness/spec-coverage.js +14 -4
- package/dist/harness/spec-coverage.js.map +1 -1
- package/dist/harness/ui-inventory.d.ts +40 -0
- package/dist/harness/ui-inventory.d.ts.map +1 -0
- package/dist/harness/ui-inventory.js +191 -0
- package/dist/harness/ui-inventory.js.map +1 -0
- package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
- package/dist/harness/viewpoint-ledger.js +66 -10
- package/dist/harness/viewpoint-ledger.js.map +1 -1
- package/dist/harness/write-atomic.d.ts +2 -0
- package/dist/harness/write-atomic.d.ts.map +1 -0
- package/dist/harness/write-atomic.js +62 -0
- package/dist/harness/write-atomic.js.map +1 -0
- package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -1
- package/dist/orchestrator/ai-skills/writer.js +15 -7
- package/dist/orchestrator/ai-skills/writer.js.map +1 -1
- package/dist/orchestrator/assets-drift.d.ts.map +1 -1
- package/dist/orchestrator/assets-drift.js +11 -6
- package/dist/orchestrator/assets-drift.js.map +1 -1
- package/dist/orchestrator/project-deps-sync.d.ts.map +1 -1
- package/dist/orchestrator/project-deps-sync.js +22 -1
- package/dist/orchestrator/project-deps-sync.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts +8 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +49 -7
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/screen-manager.d.ts.map +1 -1
- package/dist/orchestrator/screen-manager.js +3 -11
- package/dist/orchestrator/screen-manager.js.map +1 -1
- package/dist/orchestrator/security-overrides-catalog.d.ts +39 -0
- package/dist/orchestrator/security-overrides-catalog.d.ts.map +1 -0
- package/dist/orchestrator/security-overrides-catalog.js +63 -0
- package/dist/orchestrator/security-overrides-catalog.js.map +1 -0
- package/dist/orchestrator/security-overrides.d.ts +51 -0
- package/dist/orchestrator/security-overrides.d.ts.map +1 -0
- package/dist/orchestrator/security-overrides.js +165 -0
- package/dist/orchestrator/security-overrides.js.map +1 -0
- package/dist/orchestrator/templates/ai-src/agents/discovery.md +11 -3
- package/dist/orchestrator/templates/ai-src/agents/reviewer.md +8 -0
- package/dist/orchestrator/templates/ai-src/commands/create-test.md +2 -2
- package/dist/orchestrator/templates/ai-src/commands/review.md +2 -2
- package/dist/orchestrator/templates/ai-src/commands/run-test.md +70 -13
- package/dist/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md +2 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +23 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +26 -8
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +58 -14
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +41 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +7 -0
- package/dist/orchestrator/templates/playwright.config.ts +4 -2
- package/dist/orchestrator/templates/specs-locale-fixture.ts +21 -9
- package/dist/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
- package/dist/orchestrator/templates/specs-url-assert.d.ts +17 -1
- package/dist/orchestrator/templates/specs-url-assert.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.js +38 -4
- package/dist/orchestrator/templates/specs-url-assert.js.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.ts +47 -4
- package/dist/orchestrator/templates/wdio.conf.ts +24 -1
- package/dist/orchestrator/trace-mode-install.d.ts +14 -0
- package/dist/orchestrator/trace-mode-install.d.ts.map +1 -0
- package/dist/orchestrator/trace-mode-install.js +132 -0
- package/dist/orchestrator/trace-mode-install.js.map +1 -0
- package/dist/orchestrator/viewpoint-pattern-catalog.d.ts +20 -0
- package/dist/orchestrator/viewpoint-pattern-catalog.d.ts.map +1 -0
- package/dist/orchestrator/viewpoint-pattern-catalog.js +45 -0
- package/dist/orchestrator/viewpoint-pattern-catalog.js.map +1 -0
- package/package.json +3 -3
- package/src/cli/commands/audit.ts +24 -5
- package/src/cli/commands/capability.ts +51 -18
- package/src/cli/commands/changed.ts +2 -4
- package/src/cli/commands/dashboard.ts +1 -26
- package/src/cli/commands/delivery.ts +75 -48
- package/src/cli/commands/generate.ts +15 -7
- package/src/cli/commands/results-merge.ts +9 -9
- package/src/cli/commands/results-sanitize.ts +2 -9
- package/src/cli/commands/select.ts +88 -0
- package/src/cli/commands/update.ts +3 -0
- package/src/cli/index.ts +7 -2
- package/src/dashboard/snapshot-builder.ts +6 -8
- package/src/dashboard/templates/index.html +1 -1
- package/src/dashboard/types.ts +1 -0
- package/src/exporters/csv-exporter.ts +7 -10
- package/src/exporters/feature-parser.ts +32 -2
- package/src/exporters/json-exporter.ts +6 -1
- package/src/exporters/locale-variants.ts +23 -17
- package/src/exporters/manual-hybrid-oracle.ts +112 -0
- package/src/exporters/matrix/build.ts +20 -10
- package/src/exporters/matrix/carry-manual-results.ts +229 -0
- package/src/exporters/matrix/export.ts +14 -4
- package/src/exporters/matrix/gates.ts +6 -0
- package/src/exporters/matrix/render-testcase-sheet.ts +10 -4
- package/src/exporters/matrix/types.ts +8 -1
- package/src/exporters/matrix/wording.ts +36 -2
- package/src/exporters/run-environment.ts +89 -0
- package/src/exporters/scenario-merger.ts +49 -4
- package/src/exporters/test-data-resolver.ts +0 -6
- package/src/exporters/xlsx-exporter.ts +7 -2
- package/src/generators/gherkin-parser/index.ts +50 -18
- package/src/generators/test-generator/adapters/adapter-interface.ts +6 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
- package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +68 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/click-select-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/select-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/pick-option.hbs +13 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +5 -1
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +16 -0
- package/src/generators/test-generator/code-generator.ts +77 -5
- package/src/generators/test-generator/diagnostics.ts +36 -5
- package/src/generators/test-generator/patterns/index.ts +15 -8
- package/src/generators/test-generator/patterns/types.ts +15 -0
- package/src/generators/test-generator/patterns/with-parent-scope.ts +6 -0
- package/src/generators/test-generator/step-mapper.ts +90 -8
- package/src/generators/test-generator/utils/data-resolver.ts +41 -12
- package/src/generators/test-generator/utils/selector-entry-fields.ts +1 -0
- package/src/generators/test-generator/utils/selector-resolver.ts +238 -82
- package/src/harness/audit.ts +37 -16
- package/src/harness/capability.ts +23 -12
- package/src/harness/catalog/universal-viewpoints.yaml +5 -5
- package/src/harness/config-file.ts +66 -0
- package/src/harness/data-driven-lint.ts +82 -24
- package/src/harness/depth-lint.ts +2 -1
- package/src/harness/flow-check.ts +6 -2
- package/src/harness/keyword-match.ts +85 -0
- package/src/harness/next-step.ts +1 -0
- package/src/harness/parse.ts +123 -16
- package/src/harness/perf.ts +15 -7
- package/src/harness/quality-gates.ts +22 -8
- package/src/harness/query-catalog.ts +0 -0
- package/src/harness/read-text.ts +32 -1
- package/src/harness/secret-scan.ts +60 -4
- package/src/harness/select-by-ids.ts +83 -0
- package/src/harness/sensors.ts +109 -28
- package/src/harness/spec-branches.ts +6 -3
- package/src/harness/spec-coverage.ts +14 -4
- package/src/harness/ui-inventory.ts +164 -0
- package/src/harness/viewpoint-ledger.ts +59 -12
- package/src/harness/write-atomic.ts +22 -0
- package/src/orchestrator/ai-skills/writer.ts +18 -3
- package/src/orchestrator/assets-drift.ts +10 -5
- package/src/orchestrator/project-deps-sync.ts +23 -1
- package/src/orchestrator/project-initializer.ts +54 -6
- package/src/orchestrator/screen-manager.ts +3 -11
- package/src/orchestrator/security-overrides-catalog.ts +69 -0
- package/src/orchestrator/security-overrides.ts +149 -0
- package/src/orchestrator/templates/ai-src/agents/discovery.md +11 -3
- package/src/orchestrator/templates/ai-src/agents/reviewer.md +8 -0
- package/src/orchestrator/templates/ai-src/commands/create-test.md +2 -2
- package/src/orchestrator/templates/ai-src/commands/review.md +2 -2
- package/src/orchestrator/templates/ai-src/commands/run-test.md +70 -13
- package/src/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md +2 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +23 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +26 -8
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +58 -14
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +41 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +7 -0
- package/src/orchestrator/templates/playwright.config.ts +4 -2
- package/src/orchestrator/templates/specs-locale-fixture.ts +21 -9
- package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
- package/src/orchestrator/templates/specs-url-assert.ts +47 -4
- package/src/orchestrator/templates/wdio.conf.ts +24 -1
- package/src/orchestrator/trace-mode-install.ts +94 -0
- package/src/orchestrator/viewpoint-pattern-catalog.ts +58 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-interface.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/adapters/adapter-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"adapter-interface.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/adapters/adapter-interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,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g = __resolveAppId();
|
|
5
|
-
|
|
6
|
-
const __appPath =
|
|
5
|
+
// Same reader the reset tiers use — one place decides what "the session has a build file" means.
|
|
6
|
+
const __appPath = __appBuildPath();
|
|
7
7
|
if (!__appPath) {
|
|
8
8
|
throw new Error('reinstall the app: the session must install from a build file — set APP_APK (Android) / IOS_APP (iOS) so the appium:app capability is present.');
|
|
9
9
|
}
|
|
@@ -9,12 +9,18 @@
|
|
|
9
9
|
Flutter screen; UiSelector has no OR, hence the xpath. iOS scatters it across
|
|
10
10
|
label/value, which the predicate already ORs.
|
|
11
11
|
|
|
12
|
+
SCOPE (#747): an `in [Parent] <type>` clause chains this under the parent element. The android
|
|
13
|
+
xpath must go RELATIVE (`.//`) to do so — a child xpath beginning with `//` is ABSOLUTE in
|
|
14
|
+
Appium even when chained, so keeping it would emit code that LOOKS scoped and searches the whole
|
|
15
|
+
screen, which is the same silent widening the scope clause exists to prevent. The iOS predicate
|
|
16
|
+
carries no such trap and chains as written.
|
|
17
|
+
|
|
12
18
|
The expected value must stay a standalone quoted literal so the runtime-data transform
|
|
13
19
|
can swap it for testData.get(...). --}}
|
|
14
20
|
{
|
|
15
21
|
const __expected = String('{{escapeQuotes dataValue}}').trim();
|
|
16
22
|
const __sel = driver.isIOS
|
|
17
23
|
? `-ios predicate string:label == "${__expected}" OR value == "${__expected}"`
|
|
18
|
-
:
|
|
19
|
-
await expect($(__sel)).toBeDisplayed();
|
|
24
|
+
: `{{#if parentLocator}}.{{/if}}//*[@text="${__expected}" or @content-desc="${__expected}"]`;
|
|
25
|
+
await expect({{#if parentLocator}}{{parentLocator}}.$(__sel){{else}}$(__sel){{/if}}).toBeDisplayed();
|
|
20
26
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{{!-- Role variable, visible (mobile best-effort): ARIA role has no native-mobile analog — reuse
|
|
2
2
|
the role→accessibility-id mapping in appium-selector.hbs (`~name`) when a static name
|
|
3
3
|
exists; the resolver already folds dataValue into name when there is none, so this is only
|
|
4
|
-
the fallback for a caller that omits both.
|
|
4
|
+
the fallback for a caller that omits both.
|
|
5
|
+
|
|
6
|
+
SCOPE (#747): an `in [Parent] <type>` clause chains this under the parent element. Both
|
|
7
|
+
branches locate by accessibility id / predicate, neither of which carries the absolute-xpath
|
|
8
|
+
trap the label-value twin has to work around. --}}
|
|
5
9
|
{{#if name}}
|
|
6
|
-
await expect($('~{{escapeQuotes name}}')).toBeDisplayed();
|
|
10
|
+
await expect({{#if parentLocator}}{{parentLocator}}.$('~{{escapeQuotes name}}'){{else}}$('~{{escapeQuotes name}}'){{/if}}).toBeDisplayed();
|
|
7
11
|
{{else}}
|
|
8
12
|
{
|
|
9
13
|
const __expected = String('{{escapeQuotes dataValue}}').trim();
|
|
10
14
|
const __sel = driver.isIOS ? `-ios predicate string:label == "${__expected}" OR value == "${__expected}"` : `android=new UiSelector().text("${__expected}")`;
|
|
11
|
-
await expect($(__sel)).toBeDisplayed();
|
|
15
|
+
await expect({{#if parentLocator}}{{parentLocator}}.$(__sel){{else}}$(__sel){{/if}}).toBeDisplayed();
|
|
12
16
|
}
|
|
13
17
|
{{/if}}
|
|
@@ -502,9 +502,36 @@ describe('{{featureName}}', () => {
|
|
|
502
502
|
// lose the escalation between them — SG-W024 already reports that shape when tiers are involved.)
|
|
503
503
|
let __escalateAfter: string | null = null;
|
|
504
504
|
|
|
505
|
+
// `@known-defect` marks a scenario that is EXPECTED to be red — it asserts a live defect. The
|
|
506
|
+
// scaffolded /sungen:run-test command tells authors exactly that ("expected-red scenarios stay red;
|
|
507
|
+
// never 'fix' them"), so the ladder honours it here: such a failure is the suite working as
|
|
508
|
+
// designed, not evidence of leftover state. Arming escalation off it would make the NEXT scenario
|
|
509
|
+
// pay a harder reset for nothing — on every run, forever, because the defect is known.
|
|
510
|
+
//
|
|
511
|
+
// Read off the TITLE because `@known-defect` is a pass-through tag: appium appends it there as the
|
|
512
|
+
// `[@a @b]` suffix (which is what keeps it greppable via `--grep`), and that is how the field
|
|
513
|
+
// report shows it. Anchored to that trailing group, so a scenario merely NAMED `… known-defect …`
|
|
514
|
+
// cannot exempt itself — the same reason __tierFor refuses to strip a trailing `[Selector]` ref.
|
|
515
|
+
//
|
|
516
|
+
// Matched as a whole TAG TOKEN, never as a substring. `@known-defect-list` is a DIFFERENT tag, and
|
|
517
|
+
// reading it as this one would silently stop the next scenario's real dirty-state failure from
|
|
518
|
+
// getting the escalated reset it needs — with no log line at all, because "never armed" is not the
|
|
519
|
+
// "capped" path and prints nothing. The `:<ref>` parameter form is accepted because that is what
|
|
520
|
+
// the rest of the vocabulary does (`@manual:M10`, `@reset:data`).
|
|
521
|
+
//
|
|
522
|
+
// Caveat, inherited rather than introduced: a @cases scenario builds its title at runtime as
|
|
523
|
+
// `name — <row label>`, so a row LABEL that itself ends in `[@…]` would be read as the tag group.
|
|
524
|
+
// Same trailing-bracket ambiguity __tierFor accepts for a `[Selector]` ref.
|
|
525
|
+
function __isExpectedFail(title: string): boolean {
|
|
526
|
+
const tagGroup = title.match(/ \[@[^\]]*\]$/);
|
|
527
|
+
if (!tagGroup) return false;
|
|
528
|
+
return tagGroup[0].slice(2, -1).split(/\s+/)
|
|
529
|
+
.some((t) => t === '@known-defect' || t.startsWith('@known-defect:'));
|
|
530
|
+
}
|
|
531
|
+
|
|
505
532
|
// Registered BEFORE any user @afterEach block so a throwing user hook cannot skip the bookkeeping.
|
|
506
533
|
afterEach(async function () {
|
|
507
|
-
__escalateAfter = this.currentTest?.state === 'failed' ? (this.currentTest?.title ?? '') : null;
|
|
534
|
+
__escalateAfter = this.currentTest?.state === 'failed' && !__isExpectedFail(this.currentTest?.title ?? '') ? (this.currentTest?.title ?? '') : null;
|
|
508
535
|
});
|
|
509
536
|
|
|
510
537
|
{{#if scenarioResetTiers}}
|
|
@@ -583,9 +610,31 @@ describe('{{featureName}}', () => {
|
|
|
583
610
|
await driver.execute('mobile: clearApp', { appId: pkg });
|
|
584
611
|
}
|
|
585
612
|
|
|
586
|
-
|
|
613
|
+
/** The app's build file, when the session was given one. Absent when the app was attached BY PACKAGE. */
|
|
614
|
+
function __appBuildPath(): string | undefined {
|
|
587
615
|
const caps = (driver.requestedCapabilities || {}) as Record<string, string>;
|
|
588
|
-
|
|
616
|
+
return caps['appium:app'] || caps['app'];
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* The strongest tier THIS SESSION can actually carry out.
|
|
621
|
+
*
|
|
622
|
+
* Reinstalling needs the app's build file, and `data` on iOS IS a reinstall (no `mobile: clearApp`
|
|
623
|
+
* outside UiAutomator2). Attaching the app by package — the common local setup — leaves no build
|
|
624
|
+
* file, so those tiers cannot run at all.
|
|
625
|
+
*
|
|
626
|
+
* This exists so ESCALATION can cap itself. Escalation is a recovery the runner CHOSE; nothing
|
|
627
|
+
* asked for it. Escalating into a tier that throws turns one failed scenario into a dead spec file,
|
|
628
|
+
* because the throw lands in `beforeEach` and mocha then skips every remaining test in the file.
|
|
629
|
+
* A DECLARED tier is never capped — that is an unmet contract and must still throw by name.
|
|
630
|
+
*/
|
|
631
|
+
function __performableTier(): string {
|
|
632
|
+
if (__appBuildPath()) return 'full';
|
|
633
|
+
return driver.isIOS ? 'soft' : 'data';
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
async function __reinstallApp(pkg: string): Promise<void> {
|
|
637
|
+
const appPath = __appBuildPath();
|
|
589
638
|
if (!appPath) {
|
|
590
639
|
throw new Error(
|
|
591
640
|
`reset tier needs the app's build file to reinstall — set APP_APK (Android) / IOS_APP (iOS) so the appium:app capability is present, or drop to @reset:soft.`,
|
|
@@ -637,9 +686,24 @@ describe('{{featureName}}', () => {
|
|
|
637
686
|
// Same title ⟹ this is a retry of the scenario that just failed: keep its declared tier so a real
|
|
638
687
|
// failure fails both attempts (see __escalateAfter above).
|
|
639
688
|
const __escalate = __escalateAfter !== null && __escalateAfter !== (this.currentTest?.title ?? '');
|
|
640
|
-
|
|
689
|
+
// Escalation caps at what this session can perform, with the DECLARED tier as the FLOOR.
|
|
690
|
+
// The cap stops a tier NOBODY ASKED FOR from throwing in this hook and taking the rest of the
|
|
691
|
+
// spec file with it. The floor stops the cap from silently WEAKENING what the feature declared:
|
|
692
|
+
// a declared tier this session cannot perform still reaches __resetApp and still throws by name,
|
|
693
|
+
// because that one IS an unmet contract.
|
|
694
|
+
const __want = __escalate ? __ESCALATE[__base] : __base;
|
|
695
|
+
const __tier = __escalate
|
|
696
|
+
? __TIER_ORDER[Math.max(
|
|
697
|
+
__TIER_ORDER.indexOf(__base),
|
|
698
|
+
Math.min(__TIER_ORDER.indexOf(__want), __TIER_ORDER.indexOf(__performableTier())),
|
|
699
|
+
)]
|
|
700
|
+
: __want;
|
|
641
701
|
if (__tier !== __base) {
|
|
642
702
|
console.log(` \u2191 reset escalated ${__base} \u2192 ${__tier} (previous scenario failed: "${__escalateAfter}")`);
|
|
703
|
+
} else if (__want !== __base) {
|
|
704
|
+
// Said per occurrence, not once per run: this names the scenario that did NOT get the stronger
|
|
705
|
+
// reset it was owed, which is a fact about THIS scenario, not just about the session.
|
|
706
|
+
console.warn(` ! reset could not escalate ${__base} \u2192 ${__want} — this session has no app build file to reinstall from (the app was attached by package). Staying at ${__base}; set APP_APK (Android) / IOS_APP (iOS) to enable the stronger reset.`);
|
|
643
707
|
}
|
|
644
708
|
await __resetApp(__tier);
|
|
645
709
|
{{#if backgroundSteps}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
await {{> locator}}.click();
|
|
2
|
-
|
|
2
|
+
{{> pick-option}}
|
package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/select-action.hbs
CHANGED
|
@@ -9,7 +9,7 @@ if ((await el.evaluate((n) => n.tagName.toLowerCase())) === 'select') {
|
|
|
9
9
|
await el.selectOption('{{selectValue}}');
|
|
10
10
|
} else {
|
|
11
11
|
await el.click();
|
|
12
|
-
|
|
12
|
+
{{> pick-option}}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
{{~else~}}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
{{!-- Caption+value read: the ref names on-screen TEXT ("学科 -"), not an element, so the locator is
|
|
2
|
+
built inline from the caption rather than through the `locator` partial. That is why the scope
|
|
3
|
+
clause needs its own slot here — the partial's `parentLocator` handling never runs (#747).
|
|
4
|
+
Unscoped, `… in [Education Card 6] card` compiled away to nothing: on a screen repeating ten
|
|
5
|
+
学歴・職歴 cards the assertion strict-mode-failed where the caption repeats, and where it
|
|
6
|
+
happened to be unique elsewhere it passed having read a DIFFERENT card than the sentence names. --}}
|
|
7
|
+
await expect({{#if parentLocator}}{{parentLocator}}{{else}}page{{/if}}.getByText(/{{#if label}}{{escapeRegex label}}\s*{{else}}(?:^|\s){{/if}}{{escapeRegex dataValue}}$/)).toBeVisible();
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
{{!-- `getByRole` is built inline from role/name rather than through the `locator` partial, so the
|
|
2
|
+
scope clause needs its own slot here exactly as in label-value-assertion — the label branch's
|
|
3
|
+
twin (#747). `see [Logo] image with {{alt}} in [Product Card 3] card` searched every card on
|
|
4
|
+
the page before this. --}}
|
|
1
5
|
{{#if name}}
|
|
2
6
|
{{#if dataValue}}
|
|
3
|
-
await expect(page.getByRole('{{role}}', { name: '{{escapeQuotes name}}'{{#if exact}}, exact: true{{/if}} }).filter({ hasText: /^{{escapeRegex dataValue}}$/ }){{> locator-nth}}).toBeVisible();
|
|
7
|
+
await expect({{#if parentLocator}}{{parentLocator}}{{else}}page{{/if}}.getByRole('{{role}}', { name: '{{escapeQuotes name}}'{{#if exact}}, exact: true{{/if}} }).filter({ hasText: /^{{escapeRegex dataValue}}$/ }){{> locator-nth}}).toBeVisible();
|
|
4
8
|
{{else}}
|
|
5
|
-
await expect(page.getByRole('{{role}}', { name: '{{escapeQuotes name}}'{{#if exact}}, exact: true{{/if}} }){{> locator-nth}}).toBeVisible();
|
|
9
|
+
await expect({{#if parentLocator}}{{parentLocator}}{{else}}page{{/if}}.getByRole('{{role}}', { name: '{{escapeQuotes name}}'{{#if exact}}, exact: true{{/if}} }){{> locator-nth}}).toBeVisible();
|
|
6
10
|
{{/if}}
|
|
7
11
|
{{else}}
|
|
8
|
-
await expect(page.getByRole('{{role}}'{{#if exact}}, { exact: true }{{/if}}).filter({ hasText: /^{{escapeRegex dataValue}}$/ }){{> locator-nth}}).toBeVisible();
|
|
9
|
-
{{/if}}
|
|
12
|
+
await expect({{#if parentLocator}}{{parentLocator}}{{else}}page{{/if}}.getByRole('{{role}}'{{#if exact}}, { exact: true }{{/if}}).filter({ hasText: /^{{escapeRegex dataValue}}$/ }){{> locator-nth}}).toBeVisible();
|
|
13
|
+
{{/if}}
|
package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/pick-option.hbs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{!-- #847 — pick the value in an OPENED custom listbox (Radix/shadcn, MUI, Headless UI).
|
|
2
|
+
The popup portals to the end of <body>, so a page-wide getByText(…).first() resolved to
|
|
3
|
+
any EARLIER element with the same text (a badge showing the current choice, a result
|
|
4
|
+
card) — and the open popup blocks clicks outside it, so the step timed out every time,
|
|
5
|
+
looking like a race. The ARIA option lives only in the open listbox: wait briefly for it
|
|
6
|
+
(a count() right after opening would race the popup animation), and fall back to the old
|
|
7
|
+
text match only for a widget that exposes no listbox roles. --}}
|
|
8
|
+
{ const __opt = page.getByRole('option', { name: '{{selectValue}}', exact: true }).first();
|
|
9
|
+
if (await __opt.waitFor({ state: 'visible', timeout: 3000 }).then(() => true, () => false)) {
|
|
10
|
+
await __opt.click();
|
|
11
|
+
} else {
|
|
12
|
+
await page.getByText('{{selectValue}}', { exact: true }).first().click();
|
|
13
|
+
} }
|
|
@@ -23,8 +23,12 @@
|
|
|
23
23
|
`https://admin.example.com/jobs` asserted the PATH on any host, and the public site's /jobs
|
|
24
24
|
satisfied it.
|
|
25
25
|
|
|
26
|
+
`ignoreQuery` comes from the page ENTRY's `query: any`, not from the step, because it is a fact
|
|
27
|
+
about the page rather than about one assertion (#748). It relaxes only the bare-page rule; the
|
|
28
|
+
declared-value half below is untouched, so the two compose rather than override each other.
|
|
29
|
+
|
|
26
30
|
The declared-value half is gated on `dataRef`, not on `query`. The step wrote `with {{v}}`
|
|
27
31
|
either way; gating on the resolved VALUE meant an empty test-data entry silently dropped the
|
|
28
32
|
whole check and fell back to the bare-page rule, which is the one case specs/url-assert.ts
|
|
29
33
|
exists to throw on. --}}
|
|
30
|
-
await expectPage(page, { pathname: /^{{pathRegex}}\/?$/{{#if hostRegex}}, hostname: /^{{hostRegex}}$/{{/if}}{{#if dataRef}}, dataRef: '{{escapeQuotes dataRef}}', declared: '{{escapeQuotes query}}'{{/if}} });
|
|
34
|
+
await expectPage(page, { pathname: /^{{pathRegex}}\/?$/{{#if hostRegex}}, hostname: /^{{hostRegex}}$/{{/if}}{{#if ignoreQuery}}, ignoreQuery: true{{/if}}{{#if dataRef}}, dataRef: '{{escapeQuotes dataRef}}', declared: '{{escapeQuotes query}}'{{/if}} });
|
|
@@ -46,6 +46,10 @@ test.describe('{{featureName}}', () => {
|
|
|
46
46
|
test.describe('{{authRole}}', () => {
|
|
47
47
|
test.use({ storageState: 'specs/.auth/{{authRole}}.json' });
|
|
48
48
|
|
|
49
|
+
{{#if afterEach}}
|
|
50
|
+
{{indent afterEach 2}}
|
|
51
|
+
|
|
52
|
+
{{/if}}
|
|
49
53
|
{{#each scenarios}}
|
|
50
54
|
{{indent this 2}}
|
|
51
55
|
|
|
@@ -63,6 +67,18 @@ test.describe('{{featureName}}', () => {
|
|
|
63
67
|
{{#each scenarios}}
|
|
64
68
|
{{indent this 2}}
|
|
65
69
|
|
|
70
|
+
{{/each}}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
{{else if afterEach}}
|
|
74
|
+
{{!-- The un-tagged group next to a `@no-auth` one (#815): an ANONYMOUS describe scopes the hook to
|
|
75
|
+
these tests without adding a title segment, so test titles (and delivery fingerprints) stay put. --}}
|
|
76
|
+
test.describe(() => {
|
|
77
|
+
{{indent afterEach 2}}
|
|
78
|
+
|
|
79
|
+
{{#each scenarios}}
|
|
80
|
+
{{indent this 2}}
|
|
81
|
+
|
|
66
82
|
{{/each}}
|
|
67
83
|
});
|
|
68
84
|
|
|
@@ -139,7 +139,8 @@ export declare class CodeGenerator {
|
|
|
139
139
|
* a name in the committed .env.qa.example. An undeclared ref means the test throws
|
|
140
140
|
* "environment variable not set" the moment the key is used — surface it at compile
|
|
141
141
|
* time instead. Only the `${QA_*}` shape is checked: any other `${...}` text is
|
|
142
|
-
* ordinary literal data by design (never resolved, never warned about).
|
|
142
|
+
* ordinary literal data by design (never resolved, never warned about). A `${QA_*}`
|
|
143
|
+
* that appears only inside a `#` comment is prose, not a reference, and is ignored.
|
|
143
144
|
*/
|
|
144
145
|
private reportedEnvRefs;
|
|
145
146
|
private checkEnvSecretRefs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/test-generator/code-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAA8B,MAAM,mBAAmB,CAAC;AAI9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../../../src/generators/test-generator/code-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAA8B,MAAM,mBAAmB,CAAC;AAI9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAyTrD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,C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AAO,CAAC,UAAU;IAKlB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAS7B;;OAEG;IACH;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,kBAAkB;IAyBpB,gBAAgB,CACpB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,aAAa,EAAE,CAAC;CA+D5B"}
|
|
@@ -15,6 +15,7 @@ const registry_1 = require("../../capabilities/registry");
|
|
|
15
15
|
const discover_1 = require("../../capabilities/discover");
|
|
16
16
|
const capability_1 = require("../../harness/capability");
|
|
17
17
|
const scenario_merger_1 = require("../../exporters/scenario-merger");
|
|
18
|
+
const manual_hybrid_oracle_1 = require("../../exporters/manual-hybrid-oracle");
|
|
18
19
|
const spec_syntax_check_1 = require("./utils/spec-syntax-check");
|
|
19
20
|
/**
|
|
20
21
|
* Filter base scenario steps for @extend: only keep Given→When steps.
|
|
@@ -193,7 +194,7 @@ function getAuthMode(scenarioTags, featureTags) {
|
|
|
193
194
|
* Grouping key for the anonymous bucket. A literal that no `@auth:<role>` can produce, so an
|
|
194
195
|
* imaginative role name can never land in the same group as `@no-auth`.
|
|
195
196
|
*/
|
|
196
|
-
const NO_AUTH_GROUP_KEY = '
|
|
197
|
+
const NO_AUTH_GROUP_KEY = '\0no-auth';
|
|
197
198
|
/**
|
|
198
199
|
* True when the scenario has at least one step in the Then bucket —
|
|
199
200
|
* And/But inherit the preceding primary keyword (Given/When/Then).
|
|
@@ -243,6 +244,69 @@ function warnMultipleAuthTags(tags, context) {
|
|
|
243
244
|
` Ignoring: ${authTags.slice(1).join(', ')}`);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Drop the YAML comment from ONE line: a `#` at line start or preceded by whitespace,
|
|
249
|
+
* and not inside a quoted scalar. Line-level only — see `yamlWithoutComments` for the
|
|
250
|
+
* block-scalar case, which this function cannot see from a single line.
|
|
251
|
+
*/
|
|
252
|
+
function stripYamlComment(line) {
|
|
253
|
+
let quote = null;
|
|
254
|
+
for (let i = 0; i < line.length; i++) {
|
|
255
|
+
const c = line[i];
|
|
256
|
+
if (quote) {
|
|
257
|
+
if (quote === '"' && c === '\\') {
|
|
258
|
+
i++;
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (c === quote)
|
|
262
|
+
quote = null;
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
if (c === '"' || c === "'") {
|
|
266
|
+
quote = c;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (c === '#' && (i === 0 || /\s/.test(line[i - 1])))
|
|
270
|
+
return line.slice(0, i);
|
|
271
|
+
}
|
|
272
|
+
return line;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* The YAML text a `${QA_*}` scan may look at: comments removed, block scalars kept whole.
|
|
276
|
+
*
|
|
277
|
+
* SG-W009's reference scan used to run over the whole raw file, so a `${QA_*}` that only ever
|
|
278
|
+
* appeared in a `#` comment counted as a live reference — including the one sungen's own
|
|
279
|
+
* scaffolded "HOW TO FILL VALUES" block writes into every test-data file. The declared side has
|
|
280
|
+
* always been line-wise; this brings the reference side to the same footing.
|
|
281
|
+
*
|
|
282
|
+
* Inside a `|`/`>` block scalar every character is literal content, `#` included, so those lines
|
|
283
|
+
* pass through untouched. Stripping them would send the check the other way — a real, undeclared
|
|
284
|
+
* `${QA_*}` written after a `#` in a block scalar would go unreported, and the run would only fail
|
|
285
|
+
* later with "environment variable not set". A missed warning is worse than a noisy one.
|
|
286
|
+
*/
|
|
287
|
+
function yamlWithoutComments(text) {
|
|
288
|
+
const out = [];
|
|
289
|
+
let blockIndent = null;
|
|
290
|
+
for (const line of text.split('\n')) {
|
|
291
|
+
if (blockIndent !== null) {
|
|
292
|
+
const indent = line.search(/\S/);
|
|
293
|
+
// blank lines and anything indented deeper than the key stay inside the scalar
|
|
294
|
+
if (indent === -1 || indent > blockIndent) {
|
|
295
|
+
out.push(line);
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
blockIndent = null;
|
|
299
|
+
}
|
|
300
|
+
const block = /^(\s*)[^#\s][^:]*:\s*[|>][+-]?\d*[+-]?\s*$/.exec(line);
|
|
301
|
+
if (block) {
|
|
302
|
+
blockIndent = block[1].length;
|
|
303
|
+
out.push(line);
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
out.push(stripYamlComment(line));
|
|
307
|
+
}
|
|
308
|
+
return out.join('\n');
|
|
309
|
+
}
|
|
246
310
|
class CodeGenerator {
|
|
247
311
|
constructor(options = {}) {
|
|
248
312
|
// Screen/flow name for the CURRENT feature, in catalog-resolution form (`flows/<x>` for flows).
|
|
@@ -265,7 +329,8 @@ class CodeGenerator {
|
|
|
265
329
|
* a name in the committed .env.qa.example. An undeclared ref means the test throws
|
|
266
330
|
* "environment variable not set" the moment the key is used — surface it at compile
|
|
267
331
|
* time instead. Only the `${QA_*}` shape is checked: any other `${...}` text is
|
|
268
|
-
* ordinary literal data by design (never resolved, never warned about).
|
|
332
|
+
* ordinary literal data by design (never resolved, never warned about). A `${QA_*}`
|
|
333
|
+
* that appears only inside a `#` comment is prose, not a reference, and is ignored.
|
|
269
334
|
*/
|
|
270
335
|
this.reportedEnvRefs = new Set();
|
|
271
336
|
this.options = options;
|
|
@@ -689,10 +754,16 @@ class CodeGenerator {
|
|
|
689
754
|
// labeled `Observable:`/`Oracle:`/`Expected:` line (parseManualComments — the
|
|
690
755
|
// SAME parser delivery uses). Field finding (student-site, 87 scenarios): prose
|
|
691
756
|
// paragraphs and rationale-only comments exported EMPTY Steps + Expected cells.
|
|
757
|
+
// • HAS a Then, but every assertion is a bare presence placeholder while the real oracle
|
|
758
|
+
// sits in the comments (#810) — the same banned hybrid wearing a Then: the deliverable
|
|
759
|
+
// reads "See [X] table" and a tester ticking it Passed records a check nobody made.
|
|
692
760
|
const isStructured = scenario.steps.length > 0;
|
|
693
761
|
if (isStructured && !hasThenStep(scenario)) {
|
|
694
762
|
this.diagnostics.add('SG-W008', `@manual scenario "${scenario.name}" has Gherkin steps but no Then — a When without Then is invalid Gherkin. Add the Then step, or remove the steps and write the full procedure (action steps, then "Observable:"/"Oracle:" lines) in its \`# Tester verifies:\` block`, { feature: feature.name, step: scenario.name });
|
|
695
763
|
}
|
|
764
|
+
else if (isStructured && (0, manual_hybrid_oracle_1.isPresencePlaceholderHybrid)(scenario.steps, scenario.comments ?? [])) {
|
|
765
|
+
this.diagnostics.add('SG-W008', `@manual scenario "${scenario.name}" asserts only presence (e.g. "User see [X] table") while its real oracle sits in the \`# Tester verifies:\` comment — the deliverable's Expected would not say what the case checks. Write the oracle as the Then step (e.g. \`table match data:\`), or remove the steps and write the full numbered procedure ("1. <action>" … "N. Observable: <what>")`, { feature: feature.name, step: scenario.name });
|
|
766
|
+
}
|
|
696
767
|
else if (!isStructured) {
|
|
697
768
|
const parsed = (0, scenario_merger_1.parseManualComments)(scenario.comments ?? []);
|
|
698
769
|
if (!parsed.steps.length || !parsed.expected.length) {
|
|
@@ -765,7 +836,7 @@ class CodeGenerator {
|
|
|
765
836
|
}
|
|
766
837
|
authGroupMap.get(key).push(code);
|
|
767
838
|
}
|
|
768
|
-
const authGroups = groupOrder.map(key => ({
|
|
839
|
+
const authGroups = groupOrder.map((key) => ({
|
|
769
840
|
authRole: key === NO_AUTH_GROUP_KEY ? undefined : (key || undefined),
|
|
770
841
|
noAuth: key === NO_AUTH_GROUP_KEY,
|
|
771
842
|
scenarios: authGroupMap.get(key),
|
|
@@ -799,6 +870,20 @@ class CodeGenerator {
|
|
|
799
870
|
`into one feature file per auth role.`);
|
|
800
871
|
}
|
|
801
872
|
const scenarios = renderedScenarios.map(s => s.code);
|
|
873
|
+
// #815 — a feature-level `@afterEach` used to sit in the outermost describe, so it also ran after
|
|
874
|
+
// every `@no-auth` test, on an EMPTY session: a hook that needs the signed-in page (`Given User is
|
|
875
|
+
// on [probe] page` → redirected to /login) failed an anonymous test whose own steps passed. When
|
|
876
|
+
// the feature mixes `@no-auth` with any other group, the hook moves INTO each other group and the
|
|
877
|
+
// no-auth group runs without it. A feature that is anonymous throughout keeps the hook — it was
|
|
878
|
+
// written for those tests.
|
|
879
|
+
// (A no-auth group beside another one means ≥2 groups, so `renderAuthBlocks` is already true.)
|
|
880
|
+
const afterEachInGroups = !!afterEach
|
|
881
|
+
&& authGroups.some(g => g.noAuth) && authGroups.some(g => !g.noAuth);
|
|
882
|
+
if (afterEachInGroups) {
|
|
883
|
+
for (const g of authGroups)
|
|
884
|
+
if (!g.noAuth)
|
|
885
|
+
g.afterEach = afterEach;
|
|
886
|
+
}
|
|
802
887
|
// For single group, extract the auth role to put test.use at describe level. Keyed on
|
|
803
888
|
// `renderAuthBlocks`, not `needsGrouping`: a lone `@no-auth` group now renders its own block, so
|
|
804
889
|
// hoisting anything to the feature describe would double up. Its authRole is undefined anyway.
|
|
@@ -889,7 +974,7 @@ class CodeGenerator {
|
|
|
889
974
|
featureDescription: feature.description,
|
|
890
975
|
background,
|
|
891
976
|
beforeAll,
|
|
892
|
-
afterEach,
|
|
977
|
+
afterEach: afterEachInGroups ? undefined : afterEach,
|
|
893
978
|
afterAll,
|
|
894
979
|
cleanupConfig,
|
|
895
980
|
screenshotOnFailure,
|
|
@@ -1184,7 +1269,7 @@ class CodeGenerator {
|
|
|
1184
1269
|
return;
|
|
1185
1270
|
const referenced = new Set();
|
|
1186
1271
|
for (const f of fs_1.default.readdirSync(testDataDir).filter((x) => x.endsWith('.yaml') || x.endsWith('.yml'))) {
|
|
1187
|
-
const text = fs_1.default.readFileSync(path_1.default.join(testDataDir, f), 'utf-8');
|
|
1272
|
+
const text = yamlWithoutComments(fs_1.default.readFileSync(path_1.default.join(testDataDir, f), 'utf-8'));
|
|
1188
1273
|
for (const m of text.matchAll(/\$\{(QA_[A-Z0-9_]+)\}/g))
|
|
1189
1274
|
referenced.add(m[1]);
|
|
1190
1275
|
}
|