@sun-asterisk/sungen 3.2.29 → 3.2.31
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/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +2 -1
- 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 +6 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/inspect.js +1 -1
- package/dist/cli/commands/inspect.js.map +1 -1
- package/dist/cli/commands/results-merge.d.ts.map +1 -1
- package/dist/cli/commands/results-merge.js +9 -2
- package/dist/cli/commands/results-merge.js.map +1 -1
- package/dist/cli/commands/results-sanitize.d.ts +24 -0
- package/dist/cli/commands/results-sanitize.d.ts.map +1 -0
- package/dist/cli/commands/results-sanitize.js +126 -0
- package/dist/cli/commands/results-sanitize.js.map +1 -0
- package/dist/cli/commands/script-check.d.ts.map +1 -1
- package/dist/cli/commands/script-check.js +3 -1
- package/dist/cli/commands/script-check.js.map +1 -1
- 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/exporters/api-testcase-formatter.d.ts +3 -6
- package/dist/exporters/api-testcase-formatter.d.ts.map +1 -1
- package/dist/exporters/api-testcase-formatter.js +7 -10
- package/dist/exporters/api-testcase-formatter.js.map +1 -1
- package/dist/exporters/matrix/build.d.ts.map +1 -1
- package/dist/exporters/matrix/build.js +4 -2
- package/dist/exporters/matrix/build.js.map +1 -1
- package/dist/exporters/matrix/render-coverage-sheet.d.ts.map +1 -1
- package/dist/exporters/matrix/render-coverage-sheet.js +3 -1
- package/dist/exporters/matrix/render-coverage-sheet.js.map +1 -1
- package/dist/exporters/matrix/render-csv.d.ts.map +1 -1
- package/dist/exporters/matrix/render-csv.js +3 -1
- package/dist/exporters/matrix/render-csv.js.map +1 -1
- package/dist/exporters/matrix/render-overview-sheet.d.ts.map +1 -1
- package/dist/exporters/matrix/render-overview-sheet.js +5 -9
- package/dist/exporters/matrix/render-overview-sheet.js.map +1 -1
- package/dist/exporters/matrix/result-totals.d.ts +23 -0
- package/dist/exporters/matrix/result-totals.d.ts.map +1 -0
- package/dist/exporters/matrix/result-totals.js +21 -0
- package/dist/exporters/matrix/result-totals.js.map +1 -0
- package/dist/exporters/matrix/testcase-summary-band.d.ts.map +1 -1
- package/dist/exporters/matrix/testcase-summary-band.js +2 -6
- package/dist/exporters/matrix/testcase-summary-band.js.map +1 -1
- package/dist/exporters/qa-env-secret-denylist.js +2 -2
- package/dist/exporters/qa-env-secret-denylist.js.map +1 -1
- package/dist/exporters/report-path-sanitizer.d.ts +38 -0
- package/dist/exporters/report-path-sanitizer.d.ts.map +1 -0
- package/dist/exporters/report-path-sanitizer.js +137 -0
- package/dist/exporters/report-path-sanitizer.js.map +1 -0
- package/dist/exporters/result-variants.d.ts.map +1 -1
- package/dist/exporters/result-variants.js +2 -1
- package/dist/exporters/result-variants.js.map +1 -1
- package/dist/exporters/sensitive-key.d.ts +31 -0
- package/dist/exporters/sensitive-key.d.ts.map +1 -0
- package/dist/exporters/sensitive-key.js +50 -0
- package/dist/exporters/sensitive-key.js.map +1 -0
- package/dist/exporters/test-data-resolver.d.ts +4 -1
- package/dist/exporters/test-data-resolver.d.ts.map +1 -1
- package/dist/exporters/test-data-resolver.js +12 -2
- package/dist/exporters/test-data-resolver.js.map +1 -1
- package/dist/generators/gherkin-parser/index.d.ts +3 -0
- package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
- package/dist/generators/gherkin-parser/index.js +17 -9
- package/dist/generators/gherkin-parser/index.js.map +1 -1
- package/dist/generators/gherkin-parser/parent-scope-clause.d.ts +54 -0
- package/dist/generators/gherkin-parser/parent-scope-clause.d.ts.map +1 -0
- package/dist/generators/gherkin-parser/parent-scope-clause.js +109 -0
- package/dist/generators/gherkin-parser/parent-scope-clause.js.map +1 -0
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts +23 -18
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/appium/appium-adapter.d.ts +4 -19
- package/dist/generators/test-generator/adapters/appium/appium-adapter.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/appium/appium-adapter.js.map +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/after-all.hbs +18 -0
- package/dist/generators/test-generator/adapters/appium/templates/after-each.hbs +18 -0
- package/dist/generators/test-generator/adapters/appium/templates/before-all.hbs +18 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/click-at-position-action.hbs +1 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/click-element-with-text.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/double-click-action.hbs +7 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/frame-enter-action.hbs +3 -6
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/table-paginate-action.hbs +3 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/long-press-action.hbs +4 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/gestures/pinch-zoom-action.hbs +4 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/partials/locator.hbs +9 -1
- package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +54 -23
- package/dist/generators/test-generator/adapters/index.d.ts +1 -1
- package/dist/generators/test-generator/adapters/index.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts +4 -19
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/playwright-adapter.js.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/after-all.hbs +19 -1
- package/dist/generators/test-generator/adapters/playwright/templates/after-each.hbs +18 -0
- package/dist/generators/test-generator/adapters/playwright/templates/before-all.hbs +19 -1
- package/dist/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/check-action.hbs +6 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/click-at-position-action.hbs +23 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +8 -8
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/fill-editor-action.hbs +7 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +3 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +3 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-paginate-action.hbs +5 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/uncheck-action.hbs +3 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/unknown-element-action.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/wait-for-page.hbs +18 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +32 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-element.hbs +5 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/checked-assertion.hbs +5 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +13 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/contain-text-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +2 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-variable-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/have-text-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +2 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-variable-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/not-checked-assertion.hbs +2 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +14 -3
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +13 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +3 -3
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-value-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-variable-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/checked-opts.hbs +8 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +10 -8
- package/dist/generators/test-generator/code-generator.d.ts +37 -0
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +160 -39
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/diagnostics.d.ts +79 -5
- package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
- package/dist/generators/test-generator/diagnostics.js +78 -4
- package/dist/generators/test-generator/diagnostics.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts +24 -5
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +92 -14
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts +18 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts.map +1 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.js +40 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.js.map +1 -0
- package/dist/generators/test-generator/step-mapper.d.ts +63 -9
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +166 -28
- package/dist/generators/test-generator/step-mapper.js.map +1 -1
- package/dist/generators/test-generator/template-engine.d.ts +4 -19
- package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
- package/dist/generators/test-generator/template-engine.js +17 -12
- package/dist/generators/test-generator/template-engine.js.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.d.ts +7 -0
- package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.js +19 -2
- package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/dialog-scope-identity.d.ts +41 -0
- package/dist/generators/test-generator/utils/dialog-scope-identity.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/dialog-scope-identity.js +61 -0
- package/dist/generators/test-generator/utils/dialog-scope-identity.js.map +1 -0
- package/dist/generators/test-generator/utils/escape-js-string.d.ts +17 -0
- package/dist/generators/test-generator/utils/escape-js-string.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/escape-js-string.js +29 -0
- package/dist/generators/test-generator/utils/escape-js-string.js.map +1 -0
- package/dist/generators/test-generator/utils/nearest-match.d.ts +24 -0
- package/dist/generators/test-generator/utils/nearest-match.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/nearest-match.js +56 -0
- package/dist/generators/test-generator/utils/nearest-match.js.map +1 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.d.ts +58 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.js +119 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.js.map +1 -0
- package/dist/generators/test-generator/utils/selector-entry-walk.d.ts +25 -0
- package/dist/generators/test-generator/utils/selector-entry-walk.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/selector-entry-walk.js +54 -0
- package/dist/generators/test-generator/utils/selector-entry-walk.js.map +1 -0
- package/dist/generators/test-generator/utils/selector-nth-validation.d.ts +59 -0
- package/dist/generators/test-generator/utils/selector-nth-validation.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/selector-nth-validation.js +91 -0
- package/dist/generators/test-generator/utils/selector-nth-validation.js.map +1 -0
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +30 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +195 -15
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-type-validation.d.ts +51 -0
- package/dist/generators/test-generator/utils/selector-type-validation.d.ts.map +1 -0
- package/dist/generators/test-generator/utils/selector-type-validation.js +77 -0
- package/dist/generators/test-generator/utils/selector-type-validation.js.map +1 -0
- package/dist/harness/data-driven-lint.d.ts.map +1 -1
- package/dist/harness/data-driven-lint.js +217 -33
- package/dist/harness/data-driven-lint.js.map +1 -1
- package/dist/harness/script-check.d.ts +2 -2
- package/dist/harness/script-check.d.ts.map +1 -1
- package/dist/harness/script-check.js +186 -25
- package/dist/harness/script-check.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts +6 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +16 -0
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/report-sanitize-reporter-install.d.ts +24 -0
- package/dist/orchestrator/report-sanitize-reporter-install.d.ts.map +1 -0
- package/dist/orchestrator/report-sanitize-reporter-install.js +161 -0
- package/dist/orchestrator/report-sanitize-reporter-install.js.map +1 -0
- package/dist/orchestrator/templates/ai-src/commands/run-test.md +9 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +10 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +14 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +108 -8
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +1 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +9 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +4 -4
- package/dist/orchestrator/templates/playwright.config.ts +7 -0
- package/dist/orchestrator/templates/specs-checked-state.d.ts +83 -0
- package/dist/orchestrator/templates/specs-checked-state.d.ts.map +1 -0
- package/dist/orchestrator/templates/specs-checked-state.js +261 -0
- package/dist/orchestrator/templates/specs-checked-state.js.map +1 -0
- package/dist/orchestrator/templates/specs-checked-state.ts +324 -0
- package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.d.ts +36 -0
- package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.d.ts.map +1 -0
- package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.js +155 -0
- package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.js.map +1 -0
- package/dist/orchestrator/templates/specs-report-path-sanitize-reporter.ts +142 -0
- package/dist/orchestrator/templates/specs-url-assert.d.ts +50 -25
- package/dist/orchestrator/templates/specs-url-assert.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.js +65 -24
- package/dist/orchestrator/templates/specs-url-assert.js.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.ts +101 -28
- package/dist/utils/selector-types.d.ts +43 -1
- package/dist/utils/selector-types.d.ts.map +1 -1
- package/dist/utils/selector-types.js +51 -7
- package/dist/utils/selector-types.js.map +1 -1
- package/package.json +3 -3
- package/src/cli/commands/delivery.ts +2 -1
- package/src/cli/commands/generate.ts +5 -2
- package/src/cli/commands/inspect.ts +1 -1
- package/src/cli/commands/results-merge.ts +9 -2
- package/src/cli/commands/results-sanitize.ts +98 -0
- package/src/cli/commands/script-check.ts +3 -1
- package/src/cli/commands/update.ts +3 -0
- package/src/exporters/api-testcase-formatter.ts +5 -7
- package/src/exporters/matrix/build.ts +4 -2
- package/src/exporters/matrix/render-coverage-sheet.ts +3 -1
- package/src/exporters/matrix/render-csv.ts +3 -1
- package/src/exporters/matrix/render-overview-sheet.ts +5 -10
- package/src/exporters/matrix/result-totals.ts +37 -0
- package/src/exporters/matrix/testcase-summary-band.ts +2 -7
- package/src/exporters/qa-env-secret-denylist.ts +1 -1
- package/src/exporters/report-path-sanitizer.ts +144 -0
- package/src/exporters/result-variants.ts +2 -1
- package/src/exporters/sensitive-key.ts +48 -0
- package/src/exporters/test-data-resolver.ts +12 -2
- package/src/generators/gherkin-parser/index.ts +21 -10
- package/src/generators/gherkin-parser/parent-scope-clause.ts +130 -0
- package/src/generators/test-generator/adapters/adapter-interface.ts +25 -3
- package/src/generators/test-generator/adapters/appium/appium-adapter.ts +4 -4
- package/src/generators/test-generator/adapters/appium/templates/after-all.hbs +18 -0
- package/src/generators/test-generator/adapters/appium/templates/after-each.hbs +18 -0
- package/src/generators/test-generator/adapters/appium/templates/before-all.hbs +18 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/click-at-position-action.hbs +1 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/click-element-with-text.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/double-click-action.hbs +7 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/frame-enter-action.hbs +3 -6
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/table-paginate-action.hbs +3 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/gestures/long-press-action.hbs +4 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/gestures/pinch-zoom-action.hbs +4 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/partials/locator.hbs +9 -1
- package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +54 -23
- package/src/generators/test-generator/adapters/index.ts +1 -1
- package/src/generators/test-generator/adapters/playwright/playwright-adapter.ts +4 -4
- package/src/generators/test-generator/adapters/playwright/templates/after-all.hbs +19 -1
- package/src/generators/test-generator/adapters/playwright/templates/after-each.hbs +18 -0
- package/src/generators/test-generator/adapters/playwright/templates/before-all.hbs +19 -1
- package/src/generators/test-generator/adapters/playwright/templates/imports.hbs +3 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/check-action.hbs +6 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/click-at-position-action.hbs +23 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/expand-action.hbs +8 -8
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/fill-editor-action.hbs +7 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row-nth.hbs +3 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +3 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-paginate-action.hbs +5 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/uncheck-action.hbs +3 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/unknown-element-action.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/wait-for-page.hbs +18 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +32 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-element.hbs +5 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/checked-assertion.hbs +5 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/column-cell-assertion.hbs +13 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/contain-text-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +2 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/disabled-with-variable-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/have-text-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +2 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/hidden-with-variable-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/not-checked-assertion.hbs +2 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/selected-assertion.hbs +14 -3
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +13 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +3 -3
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-value-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-variable-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/checked-opts.hbs +8 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +10 -8
- package/src/generators/test-generator/code-generator.ts +176 -45
- package/src/generators/test-generator/diagnostics.ts +79 -5
- package/src/generators/test-generator/patterns/index.ts +97 -16
- package/src/generators/test-generator/patterns/with-parent-scope.ts +41 -0
- package/src/generators/test-generator/step-mapper.ts +170 -26
- package/src/generators/test-generator/template-engine.ts +21 -21
- package/src/generators/test-generator/utils/data-resolver.ts +23 -2
- package/src/generators/test-generator/utils/dialog-scope-identity.ts +71 -0
- package/src/generators/test-generator/utils/escape-js-string.ts +24 -0
- package/src/generators/test-generator/utils/nearest-match.ts +55 -0
- package/src/generators/test-generator/utils/selector-entry-fields.ts +131 -0
- package/src/generators/test-generator/utils/selector-entry-walk.ts +58 -0
- package/src/generators/test-generator/utils/selector-nth-validation.ts +99 -0
- package/src/generators/test-generator/utils/selector-resolver.ts +245 -16
- package/src/generators/test-generator/utils/selector-type-validation.ts +87 -0
- package/src/harness/data-driven-lint.ts +192 -32
- package/src/harness/script-check.ts +186 -21
- package/src/index.ts +7 -0
- package/src/orchestrator/project-initializer.ts +17 -0
- package/src/orchestrator/report-sanitize-reporter-install.ts +109 -0
- package/src/orchestrator/templates/ai-src/commands/run-test.md +9 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-api-coverage-model/SKILL.md +10 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +14 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +108 -8
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +1 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +9 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +4 -4
- package/src/orchestrator/templates/playwright.config.ts +7 -0
- package/src/orchestrator/templates/specs-checked-state.ts +324 -0
- package/src/orchestrator/templates/specs-report-path-sanitize-reporter.ts +142 -0
- package/src/orchestrator/templates/specs-url-assert.ts +101 -28
- package/src/utils/selector-types.ts +54 -5
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The selector-entry field partition, and the SG-W004 check built on it (issue #712).
|
|
3
|
+
*
|
|
4
|
+
* The root cause behind #690, #711 and #712 is one shape: `selectors.yaml` has a DOCUMENTED
|
|
5
|
+
* surface wider than the compiler's IMPLEMENTED surface, and nothing compared the two. A field
|
|
6
|
+
* could be declared on `SelectorEntry`, assigned onto `ResolvedSelector`, and printed in the
|
|
7
|
+
* public reference while no consumer ever read it back — discovered only by grepping.
|
|
8
|
+
*
|
|
9
|
+
* This module states the contract as a partition, the same way #690 answered the equivalent
|
|
10
|
+
* question for `type:` values (STRATEGY_SELECTOR_TYPES vs NON_STRATEGY_SELECTOR_TYPES). Every
|
|
11
|
+
* field an author may write belongs to exactly one set, each entry naming who reads it — so the
|
|
12
|
+
* next unconsumed field is a failing check with a name attached, not an archaeology exercise.
|
|
13
|
+
*
|
|
14
|
+
* The check is deliberately a WARNING, not an error. An unknown key is inert (the compiler simply
|
|
15
|
+
* never reads it), so refusing to compile would break projects over a stray comment-turned-key
|
|
16
|
+
* while teaching nothing extra. `--strict` already turns the whole channel non-zero for CI.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import type { DiagnosticsCollector } from '../diagnostics';
|
|
20
|
+
import { nearestMatch } from './nearest-match';
|
|
21
|
+
import { walkSelectorEntries } from './selector-entry-walk';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fields a consumer actually reads. The comment on each names WHO — that is the part that rots,
|
|
25
|
+
* so it is recorded next to the claim rather than in prose elsewhere. Adding a field here without
|
|
26
|
+
* a named consumer re-opens exactly the hole #712 was filed for.
|
|
27
|
+
*/
|
|
28
|
+
export const CONSUMED_ENTRY_FIELDS: ReadonlySet<string> = new Set([
|
|
29
|
+
'locator', // resolveFromEntry → strategy 'css'/'locator'
|
|
30
|
+
'type', // the strategy switch; also ResolvedSelector.selectorType (#690)
|
|
31
|
+
'value', // every strategy template
|
|
32
|
+
'name', // role templates; `name: null` disables the filter
|
|
33
|
+
'nth', // locator-nth partial
|
|
34
|
+
'exact', // has-text-value partial / anchored-regex assertions
|
|
35
|
+
'inputMethod', // driver-ui fill pattern → fill-editor-action
|
|
36
|
+
'scope', // dialog/landmark scoping in the locator partial
|
|
37
|
+
'match', // collapses into `exact` for getByText
|
|
38
|
+
'anchor', // page assertions — the rendered-content proof (#662)
|
|
39
|
+
'android', // appium adapter → androidSelector (#392)
|
|
40
|
+
'ios', // appium adapter → iosSelector (#392)
|
|
41
|
+
'variant', // widget recipes / native select / upload subtype
|
|
42
|
+
'trigger', // upload step — the visible button over a hidden input
|
|
43
|
+
'frame', // frame-enter/exit steps → page.frameLocator
|
|
44
|
+
'contenteditable', // resolveFromEntry → inputMethod 'pressSequentially' (#712)
|
|
45
|
+
'columns', // table column-index lookup in StepMapper
|
|
46
|
+
'pagination', // driver-ui table-paginate pattern (#712)
|
|
47
|
+
'rows', // table row templates, the row-shape universe (#688, SG-W016)
|
|
48
|
+
'attribute', // "has attribute" assertions → toHaveAttribute
|
|
49
|
+
'pattern', // regex for the attribute value
|
|
50
|
+
'expanded', // expand/collapse state signal
|
|
51
|
+
// Two spellings of ONE signal — how a control that publishes no ARIA marks its ON state, as a
|
|
52
|
+
// class or as a boolean attribute (issue #730). Normalised to `checkedClass`/`checkedAttribute`
|
|
53
|
+
// in selector-resolver, then read by setCheckedState/expectCheckedState via the checked-opts
|
|
54
|
+
// partial.
|
|
55
|
+
'checked', // checked state signal → setCheckedState/expectCheckedState
|
|
56
|
+
'selected', // alias of `checked` for card/tab pickers
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Fields that are metadata by design — written for humans or for a non-codegen consumer, with no
|
|
61
|
+
* template behind them. Empty today: every field the schema accepts is now read by something.
|
|
62
|
+
*
|
|
63
|
+
* It is kept (rather than folded away) as the declared home for the NEXT such field, so that
|
|
64
|
+
* "nothing reads this" is an explicit, reviewable choice recorded here instead of an accident
|
|
65
|
+
* nobody notices for a release — which is precisely how `pagination:` and `contenteditable:`
|
|
66
|
+
* survived as documented no-ops.
|
|
67
|
+
*/
|
|
68
|
+
export const DECLARATIVE_ENTRY_FIELDS: ReadonlySet<string> = new Set([]);
|
|
69
|
+
|
|
70
|
+
/** Everything an author may legitimately write on an entry. */
|
|
71
|
+
export const KNOWN_ENTRY_FIELDS: ReadonlySet<string> = new Set([
|
|
72
|
+
...CONSUMED_ENTRY_FIELDS,
|
|
73
|
+
...DECLARATIVE_ENTRY_FIELDS,
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
/** Keys of a `columns.<name>` definition — a column def is not a SelectorEntry. */
|
|
77
|
+
export const COLUMN_DEF_FIELDS: ReadonlySet<string> = new Set(['index', 'header', 'elements']);
|
|
78
|
+
|
|
79
|
+
export interface UnknownField {
|
|
80
|
+
/** Dotted path to the offending key, e.g. `orders.pagination` or `login.anchor`. */
|
|
81
|
+
path: string;
|
|
82
|
+
field: string;
|
|
83
|
+
/** A near-miss known field, when one is close enough to be worth naming. */
|
|
84
|
+
suggestion?: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Every key in `file` that no consumer will ever read. */
|
|
88
|
+
export function collectUnknownEntryFields(file: Record<string, unknown>): UnknownField[] {
|
|
89
|
+
const out: UnknownField[] = [];
|
|
90
|
+
walkSelectorEntries(file, {
|
|
91
|
+
entry(entry, path) {
|
|
92
|
+
for (const field of Object.keys(entry)) {
|
|
93
|
+
if (KNOWN_ENTRY_FIELDS.has(field)) continue;
|
|
94
|
+
out.push({ path, field, suggestion: nearestMatch(field, KNOWN_ENTRY_FIELDS) });
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
// A column DEFINITION has its own small key set — this is the one check that judges it, and
|
|
98
|
+
// the reason the walk offers the visit at all.
|
|
99
|
+
columnDef(def, path) {
|
|
100
|
+
for (const field of Object.keys(def)) {
|
|
101
|
+
if (COLUMN_DEF_FIELDS.has(field)) continue;
|
|
102
|
+
out.push({ path, field, suggestion: nearestMatch(field, COLUMN_DEF_FIELDS) });
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* SG-W004 — report every entry field nothing reads.
|
|
111
|
+
*
|
|
112
|
+
* Runs once per selector FILE (the resolver's load is cached), not once per step, so a table named
|
|
113
|
+
* by twenty row steps is reported once. Silent when there is no diagnostics channel attached.
|
|
114
|
+
*/
|
|
115
|
+
export function reportUnknownEntryFields(
|
|
116
|
+
file: Record<string, unknown>,
|
|
117
|
+
opts: { feature?: string; diagnostics?: DiagnosticsCollector },
|
|
118
|
+
): void {
|
|
119
|
+
const sink = opts.diagnostics;
|
|
120
|
+
if (!sink) return;
|
|
121
|
+
for (const { path, field, suggestion } of collectUnknownEntryFields(file)) {
|
|
122
|
+
const hint = suggestion
|
|
123
|
+
? ` Did you mean "${suggestion}"?`
|
|
124
|
+
: ' A locator goes in "value:" (with a "type:") or "locator:" (raw CSS).';
|
|
125
|
+
sink.add('SG-W004',
|
|
126
|
+
`selectors.yaml entry "${path}" declares "${field}", which no consumer reads — `
|
|
127
|
+
+ `writing it has no effect on the generated test and never will.${hint} `
|
|
128
|
+
+ `See the selector reference for the fields an entry supports.`,
|
|
129
|
+
{ feature: opts.feature });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One walk over the entries of a `selectors.yaml` file, shared by every per-entry check.
|
|
3
|
+
*
|
|
4
|
+
* SG-W004 (#712), SG-E027 (#711) and SG-W018 (#720) ask three different questions about the same
|
|
5
|
+
* shape — an unknown KEY, an unknown VALUE for `type:`, an out-of-contract VALUE for `nth:` — and
|
|
6
|
+
* each shipped its own copy of the same recursion. Three copies of "where do entries live" is how
|
|
7
|
+
* a check silently stops covering a nesting level: #711's gate has an explicit case for
|
|
8
|
+
* `columns.*.elements.*` precisely because that level was easy to miss. The recursion lives here
|
|
9
|
+
* once, so a new nesting level is added in one place and every check gains it at the same moment.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Sub-entries that are themselves full SelectorEntry values, so they recurse. */
|
|
13
|
+
export const NESTED_ENTRY_FIELDS = ['anchor', 'android', 'ios'] as const;
|
|
14
|
+
|
|
15
|
+
export function isEntryObject(v: unknown): v is Record<string, unknown> {
|
|
16
|
+
return !!v && typeof v === 'object' && !Array.isArray(v);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface WalkVisitors {
|
|
20
|
+
/** Every SelectorEntry in the file, with its dotted path (`save`, `greeting.ios`, …). */
|
|
21
|
+
entry(entry: Record<string, unknown>, path: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Each `columns.<name>` DEFINITION, which is not a SelectorEntry (it holds index/header/
|
|
24
|
+
* elements). Only SG-W004 has business with these; the other checks omit it.
|
|
25
|
+
*/
|
|
26
|
+
columnDef?(def: Record<string, unknown>, path: string): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function walkEntry(entry: Record<string, unknown>, entryPath: string, visit: WalkVisitors): void {
|
|
30
|
+
visit.entry(entry, entryPath);
|
|
31
|
+
|
|
32
|
+
for (const sub of NESTED_ENTRY_FIELDS) {
|
|
33
|
+
const v = entry[sub];
|
|
34
|
+
if (isEntryObject(v)) walkEntry(v, `${entryPath}.${sub}`, visit);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// A column DEFINITION is not a SelectorEntry, but the entries under its `elements:` map are,
|
|
38
|
+
// and each carries its own `type:` / `nth:`.
|
|
39
|
+
const columns = entry.columns;
|
|
40
|
+
if (!isEntryObject(columns)) return;
|
|
41
|
+
for (const [colName, colDef] of Object.entries(columns)) {
|
|
42
|
+
if (!isEntryObject(colDef)) continue;
|
|
43
|
+
const colPath = `${entryPath}.columns.${colName}`;
|
|
44
|
+
visit.columnDef?.(colDef, colPath);
|
|
45
|
+
const elements = colDef.elements;
|
|
46
|
+
if (!isEntryObject(elements)) continue;
|
|
47
|
+
for (const [elName, elEntry] of Object.entries(elements)) {
|
|
48
|
+
if (isEntryObject(elEntry)) walkEntry(elEntry, `${colPath}.elements.${elName}`, visit);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Visit every entry (and, on request, every column definition) in a parsed selector file. */
|
|
54
|
+
export function walkSelectorEntries(file: Record<string, unknown>, visit: WalkVisitors): void {
|
|
55
|
+
for (const [label, entry] of Object.entries(file)) {
|
|
56
|
+
if (isEntryObject(entry)) walkEntry(entry, label, visit);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SG-W018 — an `nth:` value outside the contract (issue #720).
|
|
3
|
+
*
|
|
4
|
+
* `nth:` was the one SelectorEntry field whose VALUE nothing validated. The key is recognised
|
|
5
|
+
* (it is in CONSUMED_ENTRY_FIELDS, so SG-W004 stays quiet) and the entry's `type:` is valid (so
|
|
6
|
+
* SG-E027 stays quiet) — every check we own stopped at the key. What landed in the value went
|
|
7
|
+
* straight to two adapters that disagreed about what a valid `nth` even is:
|
|
8
|
+
*
|
|
9
|
+
* nth: -1 web → the filter vanished (`.getByRole('combobox')`, byte-identical to deleting
|
|
10
|
+
* the line), mobile → `$$('~x')[-1]`, which is `undefined` in JavaScript
|
|
11
|
+
* nth: 'last' web → dropped, mobile → `$$('~x')[last]` — a bare identifier, valid syntax and a
|
|
12
|
+
* ReferenceError at run time, so even the SG-E022 parse self-check passed it
|
|
13
|
+
* nth: 1.5 emitted verbatim into `.nth(1.5)` / `[1.5]`
|
|
14
|
+
*
|
|
15
|
+
* Zero diagnostics in every case. `SelectorEntry.nth` is typed `number?`, but YAML is parsed, not
|
|
16
|
+
* type-checked — the declared type buys nothing at the boundary. Same family as #712 (an
|
|
17
|
+
* unrecognised KEY) and #711 (an unrecognised VALUE for `type:`), one level deeper again.
|
|
18
|
+
*
|
|
19
|
+
* THE CONTRACT: an integer `>= -1`. `0..N` is the zero-based index; `-1` means the last match
|
|
20
|
+
* (Playwright's `.last()` IS `.nth(-1)`, and the appium side now renders `.at(-1)`). Anything
|
|
21
|
+
* else is ignored by the resolver — normalised to `undefined` before it can reach a template —
|
|
22
|
+
* and reported here, so "ignored" is something the author is told rather than something they
|
|
23
|
+
* discover from a strict-mode violation.
|
|
24
|
+
*
|
|
25
|
+
* A WARNING, not an error, on SG-W004's reasoning: the value is inert once dropped, the selector
|
|
26
|
+
* still resolves (it just does not filter by position), and `--strict` already turns the channel
|
|
27
|
+
* non-zero for CI.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import type { DiagnosticsCollector } from '../diagnostics';
|
|
31
|
+
import { walkSelectorEntries } from './selector-entry-walk';
|
|
32
|
+
|
|
33
|
+
/** True for the values `nth:` accepts: an integer index `>= 0`, or `-1` for the last match. */
|
|
34
|
+
export function isValidNth(v: unknown): v is number {
|
|
35
|
+
return typeof v === 'number' && Number.isInteger(v) && v >= -1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The one normalisation every resolve path runs `nth` through: a valid index, or `undefined`.
|
|
40
|
+
*
|
|
41
|
+
* Returning `undefined` rather than the raw value is what makes the SG-W018 message true — and
|
|
42
|
+
* it is the half that keeps broken JavaScript out of the emitted spec even on paths this check
|
|
43
|
+
* does not walk (the legacy selector format), because a template only ever sees a real index.
|
|
44
|
+
*/
|
|
45
|
+
export function normalizeNth(v: unknown): number | undefined {
|
|
46
|
+
return isValidNth(v) ? v : undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface InvalidNth {
|
|
50
|
+
/** Dotted path to the offending entry, e.g. `danh muc` or `greeting.android`. */
|
|
51
|
+
path: string;
|
|
52
|
+
/** The `nth:` value exactly as written, for quoting back at the author. */
|
|
53
|
+
nth: unknown;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Every entry in `file` whose `nth:` is present but outside the contract. */
|
|
57
|
+
export function collectInvalidNth(file: Record<string, unknown>): InvalidNth[] {
|
|
58
|
+
const out: InvalidNth[] = [];
|
|
59
|
+
walkSelectorEntries(file, {
|
|
60
|
+
entry(entry, path) {
|
|
61
|
+
// An ABSENT `nth:` is the common case and means "no positional filter". An explicit
|
|
62
|
+
// `nth: null` is read the same way — the resolver has always treated null as unset, and
|
|
63
|
+
// reporting it would fire on a legitimate "no index here" written out loud.
|
|
64
|
+
if (entry.nth === undefined || entry.nth === null) return;
|
|
65
|
+
if (isValidNth(entry.nth)) return;
|
|
66
|
+
out.push({ path, nth: entry.nth });
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* SG-W018 — report every entry whose `nth:` the compiler cannot use.
|
|
74
|
+
*
|
|
75
|
+
* Runs once per selector FILE (the resolver's load is cached), so an entry named by twenty steps
|
|
76
|
+
* is reported once — the same load point and the same reason as SG-W004 and SG-E027. Silent when
|
|
77
|
+
* no diagnostics channel is attached: `generate` must not depend on diagnostics being wired.
|
|
78
|
+
*/
|
|
79
|
+
export function reportInvalidNth(
|
|
80
|
+
file: Record<string, unknown>,
|
|
81
|
+
opts: { feature?: string; diagnostics?: DiagnosticsCollector },
|
|
82
|
+
): void {
|
|
83
|
+
const sink = opts.diagnostics;
|
|
84
|
+
if (!sink) return;
|
|
85
|
+
for (const { path, nth } of collectInvalidNth(file)) {
|
|
86
|
+
// Quoted for a string so `nth: 'last'` reads back as the string it is; `String()` for a number
|
|
87
|
+
// so -2, 1.5 and .nan survive as written (JSON.stringify renders NaN as `null`, which would
|
|
88
|
+
// quote a value the author never typed).
|
|
89
|
+
const written = typeof nth === 'string' ? `"${nth}"`
|
|
90
|
+
: typeof nth === 'number' ? String(nth)
|
|
91
|
+
: JSON.stringify(nth) ?? String(nth);
|
|
92
|
+
sink.add('SG-W018',
|
|
93
|
+
`selectors.yaml entry "${path}" declares nth: ${written}, which is not a valid index — `
|
|
94
|
+
+ `it is IGNORED, so the selector does not filter by position and a step naming it resolves `
|
|
95
|
+
+ `to every match (strict mode then fails at run time naming the DOM, never this line). `
|
|
96
|
+
+ `Use an integer >= 0 for a zero-based index, or -1 for the last match.`,
|
|
97
|
+
{ feature: opts.feature });
|
|
98
|
+
}
|
|
99
|
+
}
|