@sun-asterisk/sungen 3.2.28 → 3.2.30
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/capabilities/discover.d.ts +29 -0
- package/dist/capabilities/discover.d.ts.map +1 -1
- package/dist/capabilities/discover.js +144 -10
- package/dist/capabilities/discover.js.map +1 -1
- package/dist/capabilities/registry.d.ts +18 -0
- package/dist/capabilities/registry.d.ts.map +1 -1
- package/dist/capabilities/registry.js +25 -0
- package/dist/capabilities/registry.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +9 -0
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/capability.js +1 -1
- package/dist/cli/commands/capability.js.map +1 -1
- 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/dashboard/templates/index.html +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/feature-parser.d.ts +1 -1
- package/dist/exporters/feature-parser.js +1 -1
- package/dist/exporters/matrix/build.d.ts.map +1 -1
- package/dist/exporters/matrix/build.js +18 -3
- package/dist/exporters/matrix/build.js.map +1 -1
- package/dist/exporters/matrix/item-labels.d.ts +35 -0
- package/dist/exporters/matrix/item-labels.d.ts.map +1 -0
- package/dist/exporters/matrix/item-labels.js +90 -0
- package/dist/exporters/matrix/item-labels.js.map +1 -0
- package/dist/exporters/matrix/render-coverage-sheet.d.ts +14 -0
- package/dist/exporters/matrix/render-coverage-sheet.d.ts.map +1 -0
- package/dist/exporters/matrix/render-coverage-sheet.js +162 -0
- package/dist/exporters/matrix/render-coverage-sheet.js.map +1 -0
- 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 +20 -0
- package/dist/exporters/matrix/render-overview-sheet.d.ts.map +1 -0
- package/dist/exporters/matrix/render-overview-sheet.js +32 -0
- package/dist/exporters/matrix/render-overview-sheet.js.map +1 -0
- package/dist/exporters/matrix/render-testcase-sheet.d.ts +30 -0
- package/dist/exporters/matrix/render-testcase-sheet.d.ts.map +1 -0
- package/dist/exporters/matrix/render-testcase-sheet.js +156 -0
- package/dist/exporters/matrix/render-testcase-sheet.js.map +1 -0
- package/dist/exporters/matrix/render-xlsx.d.ts +41 -31
- package/dist/exporters/matrix/render-xlsx.d.ts.map +1 -1
- package/dist/exporters/matrix/render-xlsx.js +72 -425
- package/dist/exporters/matrix/render-xlsx.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 +30 -0
- package/dist/exporters/matrix/testcase-summary-band.d.ts.map +1 -0
- package/dist/exporters/matrix/testcase-summary-band.js +71 -0
- package/dist/exporters/matrix/testcase-summary-band.js.map +1 -0
- package/dist/exporters/matrix/wording.d.ts.map +1 -1
- package/dist/exporters/matrix/wording.js +13 -0
- package/dist/exporters/matrix/wording.js.map +1 -1
- package/dist/exporters/matrix/xlsx-cells.d.ts +38 -0
- package/dist/exporters/matrix/xlsx-cells.d.ts.map +1 -0
- package/dist/exporters/matrix/xlsx-cells.js +52 -0
- package/dist/exporters/matrix/xlsx-cells.js.map +1 -0
- 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/exporters/xlsx-report-builder.d.ts +12 -1
- package/dist/exporters/xlsx-report-builder.d.ts.map +1 -1
- package/dist/exporters/xlsx-report-builder.js +10 -2
- package/dist/exporters/xlsx-report-builder.js.map +1 -1
- package/dist/generators/gherkin-parser/index.d.ts +10 -0
- package/dist/generators/gherkin-parser/index.d.ts.map +1 -1
- package/dist/generators/gherkin-parser/index.js +20 -12
- 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/os-support.d.ts +53 -0
- package/dist/generators/test-generator/adapters/appium/os-support.d.ts.map +1 -0
- package/dist/generators/test-generator/adapters/appium/os-support.js +200 -0
- package/dist/generators/test-generator/adapters/appium/os-support.js.map +1 -0
- 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/alert-fill-action.hbs +9 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
- 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/hover-action.hbs +6 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
- 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/actions/unknown-element-action.hbs +9 -0
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
- 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/go-back-action.hbs +21 -0
- 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/gestures/set-geolocation-action.hbs +16 -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 +62 -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 +7 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +7 -2
- 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 +21 -3
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +20 -2
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -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-base.hbs +8 -8
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
- 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 +165 -40
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/diagnostics.d.ts +116 -6
- package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
- package/dist/generators/test-generator/diagnostics.js +115 -5
- package/dist/generators/test-generator/diagnostics.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts +57 -11
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +163 -21
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/patterns/types.d.ts +8 -0
- package/dist/generators/test-generator/patterns/types.d.ts.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 +103 -10
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +266 -45
- 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 +53 -2
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +273 -27
- 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/audit.d.ts +3 -1
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +51 -28
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/capability-plan.d.ts +4 -0
- package/dist/harness/capability-plan.d.ts.map +1 -1
- package/dist/harness/capability-plan.js +32 -2
- package/dist/harness/capability-plan.js.map +1 -1
- package/dist/harness/catalog/drivers.yaml +1 -1
- package/dist/harness/catalog/universal-viewpoints.yaml +145 -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/parse.d.ts +6 -0
- package/dist/harness/parse.d.ts.map +1 -1
- package/dist/harness/parse.js +1 -1
- package/dist/harness/parse.js.map +1 -1
- package/dist/harness/repair.d.ts.map +1 -1
- package/dist/harness/repair.js +8 -1
- package/dist/harness/repair.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/harness/sensors.d.ts +48 -0
- package/dist/harness/sensors.d.ts.map +1 -1
- package/dist/harness/sensors.js +26 -1
- package/dist/harness/sensors.js.map +1 -1
- package/dist/harness/viewpoint-ledger.d.ts +10 -0
- package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
- package/dist/harness/viewpoint-ledger.js +23 -2
- package/dist/harness/viewpoint-ledger.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/delivery.md +4 -3
- 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-delivery/SKILL.md +14 -5
- package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +62 -3
- package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +126 -11
- package/dist/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +12 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +19 -5
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +62 -5
- package/dist/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
- package/dist/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
- package/dist/orchestrator/templates/playwright.config.ts +7 -0
- package/dist/orchestrator/templates/readme.md +1 -1
- 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-pw-shape-reporter.ts +0 -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/orchestrator/templates/wdio.conf.ts +105 -1
- 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/capabilities/discover.ts +146 -10
- package/src/capabilities/registry.ts +30 -0
- package/src/cli/commands/audit.ts +9 -0
- package/src/cli/commands/capability.ts +1 -1
- 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/dashboard/templates/index.html +1 -1
- package/src/exporters/api-testcase-formatter.ts +5 -7
- package/src/exporters/feature-parser.ts +1 -1
- package/src/exporters/matrix/build.ts +17 -3
- package/src/exporters/matrix/item-labels.ts +78 -0
- package/src/exporters/matrix/render-coverage-sheet.ts +170 -0
- package/src/exporters/matrix/render-csv.ts +3 -1
- package/src/exporters/matrix/render-overview-sheet.ts +51 -0
- package/src/exporters/matrix/render-testcase-sheet.ts +178 -0
- package/src/exporters/matrix/render-xlsx.ts +67 -448
- package/src/exporters/matrix/result-totals.ts +37 -0
- package/src/exporters/matrix/testcase-summary-band.ts +74 -0
- package/src/exporters/matrix/wording.ts +13 -0
- package/src/exporters/matrix/xlsx-cells.ts +56 -0
- 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/exporters/xlsx-report-builder.ts +16 -2
- package/src/generators/gherkin-parser/index.ts +22 -11
- 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/os-support.ts +176 -0
- 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/alert-fill-action.hbs +9 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/capture-variable.hbs +24 -1
- 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/hover-action.hbs +6 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/hover-element-with-text.hbs +4 -3
- 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/actions/unknown-element-action.hbs +9 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/have-value-assertion.hbs +34 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +14 -6
- 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/go-back-action.hbs +21 -0
- 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/gestures/set-geolocation-action.hbs +16 -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 +62 -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 +7 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/table-action-in-row.hbs +7 -2
- 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 +21 -3
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/state-with-filter-assertion.hbs +20 -2
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-empty.hbs +4 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-match-data.hbs +4 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-count.hbs +4 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-exists.hbs +12 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/table-row-not-exists.hbs +14 -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-base.hbs +8 -8
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-nth.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/id.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/testid.hbs +1 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator.hbs +8 -8
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +10 -8
- package/src/generators/test-generator/code-generator.ts +181 -46
- package/src/generators/test-generator/diagnostics.ts +117 -6
- package/src/generators/test-generator/patterns/index.ts +175 -24
- package/src/generators/test-generator/patterns/types.ts +8 -0
- package/src/generators/test-generator/patterns/with-parent-scope.ts +41 -0
- package/src/generators/test-generator/step-mapper.ts +277 -43
- 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 +333 -28
- package/src/generators/test-generator/utils/selector-type-validation.ts +87 -0
- package/src/harness/audit.ts +55 -30
- package/src/harness/capability-plan.ts +33 -1
- package/src/harness/catalog/drivers.yaml +1 -1
- package/src/harness/catalog/universal-viewpoints.yaml +145 -0
- package/src/harness/data-driven-lint.ts +192 -32
- package/src/harness/parse.ts +7 -1
- package/src/harness/repair.ts +8 -1
- package/src/harness/script-check.ts +186 -21
- package/src/harness/sensors.ts +75 -1
- package/src/harness/viewpoint-ledger.ts +26 -5
- 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/delivery.md +4 -3
- 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-delivery/SKILL.md +14 -5
- package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +62 -3
- package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +126 -11
- package/src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md +16 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md +12 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +19 -5
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +88 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +62 -5
- package/src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md +13 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md +59 -10
- package/src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-f-mobile-native.md +419 -0
- package/src/orchestrator/templates/playwright.config.ts +7 -0
- package/src/orchestrator/templates/readme.md +1 -1
- package/src/orchestrator/templates/specs-checked-state.ts +324 -0
- package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -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/orchestrator/templates/wdio.conf.ts +105 -1
- package/src/utils/selector-types.ts +54 -5
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* The selector-entry field partition, and the SG-W004 check built on it (issue #712).
|
|
4
|
+
*
|
|
5
|
+
* The root cause behind #690, #711 and #712 is one shape: `selectors.yaml` has a DOCUMENTED
|
|
6
|
+
* surface wider than the compiler's IMPLEMENTED surface, and nothing compared the two. A field
|
|
7
|
+
* could be declared on `SelectorEntry`, assigned onto `ResolvedSelector`, and printed in the
|
|
8
|
+
* public reference while no consumer ever read it back — discovered only by grepping.
|
|
9
|
+
*
|
|
10
|
+
* This module states the contract as a partition, the same way #690 answered the equivalent
|
|
11
|
+
* question for `type:` values (STRATEGY_SELECTOR_TYPES vs NON_STRATEGY_SELECTOR_TYPES). Every
|
|
12
|
+
* field an author may write belongs to exactly one set, each entry naming who reads it — so the
|
|
13
|
+
* next unconsumed field is a failing check with a name attached, not an archaeology exercise.
|
|
14
|
+
*
|
|
15
|
+
* The check is deliberately a WARNING, not an error. An unknown key is inert (the compiler simply
|
|
16
|
+
* never reads it), so refusing to compile would break projects over a stray comment-turned-key
|
|
17
|
+
* while teaching nothing extra. `--strict` already turns the whole channel non-zero for CI.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.COLUMN_DEF_FIELDS = exports.KNOWN_ENTRY_FIELDS = exports.DECLARATIVE_ENTRY_FIELDS = exports.CONSUMED_ENTRY_FIELDS = void 0;
|
|
21
|
+
exports.collectUnknownEntryFields = collectUnknownEntryFields;
|
|
22
|
+
exports.reportUnknownEntryFields = reportUnknownEntryFields;
|
|
23
|
+
const nearest_match_1 = require("./nearest-match");
|
|
24
|
+
const selector_entry_walk_1 = require("./selector-entry-walk");
|
|
25
|
+
/**
|
|
26
|
+
* Fields a consumer actually reads. The comment on each names WHO — that is the part that rots,
|
|
27
|
+
* so it is recorded next to the claim rather than in prose elsewhere. Adding a field here without
|
|
28
|
+
* a named consumer re-opens exactly the hole #712 was filed for.
|
|
29
|
+
*/
|
|
30
|
+
exports.CONSUMED_ENTRY_FIELDS = new Set([
|
|
31
|
+
'locator', // resolveFromEntry → strategy 'css'/'locator'
|
|
32
|
+
'type', // the strategy switch; also ResolvedSelector.selectorType (#690)
|
|
33
|
+
'value', // every strategy template
|
|
34
|
+
'name', // role templates; `name: null` disables the filter
|
|
35
|
+
'nth', // locator-nth partial
|
|
36
|
+
'exact', // has-text-value partial / anchored-regex assertions
|
|
37
|
+
'inputMethod', // driver-ui fill pattern → fill-editor-action
|
|
38
|
+
'scope', // dialog/landmark scoping in the locator partial
|
|
39
|
+
'match', // collapses into `exact` for getByText
|
|
40
|
+
'anchor', // page assertions — the rendered-content proof (#662)
|
|
41
|
+
'android', // appium adapter → androidSelector (#392)
|
|
42
|
+
'ios', // appium adapter → iosSelector (#392)
|
|
43
|
+
'variant', // widget recipes / native select / upload subtype
|
|
44
|
+
'trigger', // upload step — the visible button over a hidden input
|
|
45
|
+
'frame', // frame-enter/exit steps → page.frameLocator
|
|
46
|
+
'contenteditable', // resolveFromEntry → inputMethod 'pressSequentially' (#712)
|
|
47
|
+
'columns', // table column-index lookup in StepMapper
|
|
48
|
+
'pagination', // driver-ui table-paginate pattern (#712)
|
|
49
|
+
'rows', // table row templates, the row-shape universe (#688, SG-W016)
|
|
50
|
+
'attribute', // "has attribute" assertions → toHaveAttribute
|
|
51
|
+
'pattern', // regex for the attribute value
|
|
52
|
+
'expanded', // expand/collapse state signal
|
|
53
|
+
// Two spellings of ONE signal — how a control that publishes no ARIA marks its ON state, as a
|
|
54
|
+
// class or as a boolean attribute (issue #730). Normalised to `checkedClass`/`checkedAttribute`
|
|
55
|
+
// in selector-resolver, then read by setCheckedState/expectCheckedState via the checked-opts
|
|
56
|
+
// partial.
|
|
57
|
+
'checked', // checked state signal → setCheckedState/expectCheckedState
|
|
58
|
+
'selected', // alias of `checked` for card/tab pickers
|
|
59
|
+
]);
|
|
60
|
+
/**
|
|
61
|
+
* Fields that are metadata by design — written for humans or for a non-codegen consumer, with no
|
|
62
|
+
* template behind them. Empty today: every field the schema accepts is now read by something.
|
|
63
|
+
*
|
|
64
|
+
* It is kept (rather than folded away) as the declared home for the NEXT such field, so that
|
|
65
|
+
* "nothing reads this" is an explicit, reviewable choice recorded here instead of an accident
|
|
66
|
+
* nobody notices for a release — which is precisely how `pagination:` and `contenteditable:`
|
|
67
|
+
* survived as documented no-ops.
|
|
68
|
+
*/
|
|
69
|
+
exports.DECLARATIVE_ENTRY_FIELDS = new Set([]);
|
|
70
|
+
/** Everything an author may legitimately write on an entry. */
|
|
71
|
+
exports.KNOWN_ENTRY_FIELDS = new Set([
|
|
72
|
+
...exports.CONSUMED_ENTRY_FIELDS,
|
|
73
|
+
...exports.DECLARATIVE_ENTRY_FIELDS,
|
|
74
|
+
]);
|
|
75
|
+
/** Keys of a `columns.<name>` definition — a column def is not a SelectorEntry. */
|
|
76
|
+
exports.COLUMN_DEF_FIELDS = new Set(['index', 'header', 'elements']);
|
|
77
|
+
/** Every key in `file` that no consumer will ever read. */
|
|
78
|
+
function collectUnknownEntryFields(file) {
|
|
79
|
+
const out = [];
|
|
80
|
+
(0, selector_entry_walk_1.walkSelectorEntries)(file, {
|
|
81
|
+
entry(entry, path) {
|
|
82
|
+
for (const field of Object.keys(entry)) {
|
|
83
|
+
if (exports.KNOWN_ENTRY_FIELDS.has(field))
|
|
84
|
+
continue;
|
|
85
|
+
out.push({ path, field, suggestion: (0, nearest_match_1.nearestMatch)(field, exports.KNOWN_ENTRY_FIELDS) });
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
// A column DEFINITION has its own small key set — this is the one check that judges it, and
|
|
89
|
+
// the reason the walk offers the visit at all.
|
|
90
|
+
columnDef(def, path) {
|
|
91
|
+
for (const field of Object.keys(def)) {
|
|
92
|
+
if (exports.COLUMN_DEF_FIELDS.has(field))
|
|
93
|
+
continue;
|
|
94
|
+
out.push({ path, field, suggestion: (0, nearest_match_1.nearestMatch)(field, exports.COLUMN_DEF_FIELDS) });
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* SG-W004 — report every entry field nothing reads.
|
|
102
|
+
*
|
|
103
|
+
* Runs once per selector FILE (the resolver's load is cached), not once per step, so a table named
|
|
104
|
+
* by twenty row steps is reported once. Silent when there is no diagnostics channel attached.
|
|
105
|
+
*/
|
|
106
|
+
function reportUnknownEntryFields(file, opts) {
|
|
107
|
+
const sink = opts.diagnostics;
|
|
108
|
+
if (!sink)
|
|
109
|
+
return;
|
|
110
|
+
for (const { path, field, suggestion } of collectUnknownEntryFields(file)) {
|
|
111
|
+
const hint = suggestion
|
|
112
|
+
? ` Did you mean "${suggestion}"?`
|
|
113
|
+
: ' A locator goes in "value:" (with a "type:") or "locator:" (raw CSS).';
|
|
114
|
+
sink.add('SG-W004', `selectors.yaml entry "${path}" declares "${field}", which no consumer reads — `
|
|
115
|
+
+ `writing it has no effect on the generated test and never will.${hint} `
|
|
116
|
+
+ `See the selector reference for the fields an entry supports.`, { feature: opts.feature });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=selector-entry-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-entry-fields.js","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-entry-fields.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/** Sub-entries that are themselves full SelectorEntry values, so they recurse. */
|
|
12
|
+
export declare const NESTED_ENTRY_FIELDS: readonly ["anchor", "android", "ios"];
|
|
13
|
+
export declare function isEntryObject(v: unknown): v is Record<string, unknown>;
|
|
14
|
+
export interface WalkVisitors {
|
|
15
|
+
/** Every SelectorEntry in the file, with its dotted path (`save`, `greeting.ios`, …). */
|
|
16
|
+
entry(entry: Record<string, unknown>, path: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Each `columns.<name>` DEFINITION, which is not a SelectorEntry (it holds index/header/
|
|
19
|
+
* elements). Only SG-W004 has business with these; the other checks omit it.
|
|
20
|
+
*/
|
|
21
|
+
columnDef?(def: Record<string, unknown>, path: string): void;
|
|
22
|
+
}
|
|
23
|
+
/** Visit every entry (and, on request, every column definition) in a parsed selector file. */
|
|
24
|
+
export declare function walkSelectorEntries(file: Record<string, unknown>, visit: WalkVisitors): void;
|
|
25
|
+
//# sourceMappingURL=selector-entry-walk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-entry-walk.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-entry-walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kFAAkF;AAClF,eAAO,MAAM,mBAAmB,uCAAwC,CAAC;AAEzE,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEtE;AAED,MAAM,WAAW,YAAY;IAC3B,yFAAyF;IACzF,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1D;;;OAGG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9D;AA0BD,8FAA8F;AAC9F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAI5F"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* One walk over the entries of a `selectors.yaml` file, shared by every per-entry check.
|
|
4
|
+
*
|
|
5
|
+
* SG-W004 (#712), SG-E027 (#711) and SG-W018 (#720) ask three different questions about the same
|
|
6
|
+
* shape — an unknown KEY, an unknown VALUE for `type:`, an out-of-contract VALUE for `nth:` — and
|
|
7
|
+
* each shipped its own copy of the same recursion. Three copies of "where do entries live" is how
|
|
8
|
+
* a check silently stops covering a nesting level: #711's gate has an explicit case for
|
|
9
|
+
* `columns.*.elements.*` precisely because that level was easy to miss. The recursion lives here
|
|
10
|
+
* once, so a new nesting level is added in one place and every check gains it at the same moment.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.NESTED_ENTRY_FIELDS = void 0;
|
|
14
|
+
exports.isEntryObject = isEntryObject;
|
|
15
|
+
exports.walkSelectorEntries = walkSelectorEntries;
|
|
16
|
+
/** Sub-entries that are themselves full SelectorEntry values, so they recurse. */
|
|
17
|
+
exports.NESTED_ENTRY_FIELDS = ['anchor', 'android', 'ios'];
|
|
18
|
+
function isEntryObject(v) {
|
|
19
|
+
return !!v && typeof v === 'object' && !Array.isArray(v);
|
|
20
|
+
}
|
|
21
|
+
function walkEntry(entry, entryPath, visit) {
|
|
22
|
+
visit.entry(entry, entryPath);
|
|
23
|
+
for (const sub of exports.NESTED_ENTRY_FIELDS) {
|
|
24
|
+
const v = entry[sub];
|
|
25
|
+
if (isEntryObject(v))
|
|
26
|
+
walkEntry(v, `${entryPath}.${sub}`, visit);
|
|
27
|
+
}
|
|
28
|
+
// A column DEFINITION is not a SelectorEntry, but the entries under its `elements:` map are,
|
|
29
|
+
// and each carries its own `type:` / `nth:`.
|
|
30
|
+
const columns = entry.columns;
|
|
31
|
+
if (!isEntryObject(columns))
|
|
32
|
+
return;
|
|
33
|
+
for (const [colName, colDef] of Object.entries(columns)) {
|
|
34
|
+
if (!isEntryObject(colDef))
|
|
35
|
+
continue;
|
|
36
|
+
const colPath = `${entryPath}.columns.${colName}`;
|
|
37
|
+
visit.columnDef?.(colDef, colPath);
|
|
38
|
+
const elements = colDef.elements;
|
|
39
|
+
if (!isEntryObject(elements))
|
|
40
|
+
continue;
|
|
41
|
+
for (const [elName, elEntry] of Object.entries(elements)) {
|
|
42
|
+
if (isEntryObject(elEntry))
|
|
43
|
+
walkEntry(elEntry, `${colPath}.elements.${elName}`, visit);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Visit every entry (and, on request, every column definition) in a parsed selector file. */
|
|
48
|
+
function walkSelectorEntries(file, visit) {
|
|
49
|
+
for (const [label, entry] of Object.entries(file)) {
|
|
50
|
+
if (isEntryObject(entry))
|
|
51
|
+
walkEntry(entry, label, visit);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=selector-entry-walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-entry-walk.js","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-entry-walk.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAKH,sCAEC;AAqCD,kDAIC;AA9CD,kFAAkF;AACrE,QAAA,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AAEzE,SAAgB,aAAa,CAAC,CAAU;IACtC,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAYD,SAAS,SAAS,CAAC,KAA8B,EAAE,SAAiB,EAAE,KAAmB;IACvF,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAE9B,KAAK,MAAM,GAAG,IAAI,2BAAmB,EAAE,CAAC;QACtC,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACrB,IAAI,aAAa,CAAC,CAAC,CAAC;YAAE,SAAS,CAAC,CAAC,EAAE,GAAG,SAAS,IAAI,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,6FAA6F;IAC7F,6CAA6C;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAAE,OAAO;IACpC,KAAK,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;YAAE,SAAS;QACrC,MAAM,OAAO,GAAG,GAAG,SAAS,YAAY,OAAO,EAAE,CAAC;QAClD,KAAK,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;YAAE,SAAS;QACvC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzD,IAAI,aAAa,CAAC,OAAO,CAAC;gBAAE,SAAS,CAAC,OAAO,EAAE,GAAG,OAAO,aAAa,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;AACH,CAAC;AAED,8FAA8F;AAC9F,SAAgB,mBAAmB,CAAC,IAA6B,EAAE,KAAmB;IACpF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
import type { DiagnosticsCollector } from '../diagnostics';
|
|
30
|
+
/** True for the values `nth:` accepts: an integer index `>= 0`, or `-1` for the last match. */
|
|
31
|
+
export declare function isValidNth(v: unknown): v is number;
|
|
32
|
+
/**
|
|
33
|
+
* The one normalisation every resolve path runs `nth` through: a valid index, or `undefined`.
|
|
34
|
+
*
|
|
35
|
+
* Returning `undefined` rather than the raw value is what makes the SG-W018 message true — and
|
|
36
|
+
* it is the half that keeps broken JavaScript out of the emitted spec even on paths this check
|
|
37
|
+
* does not walk (the legacy selector format), because a template only ever sees a real index.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeNth(v: unknown): number | undefined;
|
|
40
|
+
export interface InvalidNth {
|
|
41
|
+
/** Dotted path to the offending entry, e.g. `danh muc` or `greeting.android`. */
|
|
42
|
+
path: string;
|
|
43
|
+
/** The `nth:` value exactly as written, for quoting back at the author. */
|
|
44
|
+
nth: unknown;
|
|
45
|
+
}
|
|
46
|
+
/** Every entry in `file` whose `nth:` is present but outside the contract. */
|
|
47
|
+
export declare function collectInvalidNth(file: Record<string, unknown>): InvalidNth[];
|
|
48
|
+
/**
|
|
49
|
+
* SG-W018 — report every entry whose `nth:` the compiler cannot use.
|
|
50
|
+
*
|
|
51
|
+
* Runs once per selector FILE (the resolver's load is cached), so an entry named by twenty steps
|
|
52
|
+
* is reported once — the same load point and the same reason as SG-W004 and SG-E027. Silent when
|
|
53
|
+
* no diagnostics channel is attached: `generate` must not depend on diagnostics being wired.
|
|
54
|
+
*/
|
|
55
|
+
export declare function reportInvalidNth(file: Record<string, unknown>, opts: {
|
|
56
|
+
feature?: string;
|
|
57
|
+
diagnostics?: DiagnosticsCollector;
|
|
58
|
+
}): void;
|
|
59
|
+
//# sourceMappingURL=selector-nth-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-nth-validation.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-nth-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D,+FAA+F;AAC/F,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE3D;AAED,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,GAAG,EAAE,OAAO,CAAC;CACd;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,EAAE,CAa7E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,oBAAoB,CAAA;CAAE,GAC7D,IAAI,CAiBN"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SG-W018 — an `nth:` value outside the contract (issue #720).
|
|
4
|
+
*
|
|
5
|
+
* `nth:` was the one SelectorEntry field whose VALUE nothing validated. The key is recognised
|
|
6
|
+
* (it is in CONSUMED_ENTRY_FIELDS, so SG-W004 stays quiet) and the entry's `type:` is valid (so
|
|
7
|
+
* SG-E027 stays quiet) — every check we own stopped at the key. What landed in the value went
|
|
8
|
+
* straight to two adapters that disagreed about what a valid `nth` even is:
|
|
9
|
+
*
|
|
10
|
+
* nth: -1 web → the filter vanished (`.getByRole('combobox')`, byte-identical to deleting
|
|
11
|
+
* the line), mobile → `$$('~x')[-1]`, which is `undefined` in JavaScript
|
|
12
|
+
* nth: 'last' web → dropped, mobile → `$$('~x')[last]` — a bare identifier, valid syntax and a
|
|
13
|
+
* ReferenceError at run time, so even the SG-E022 parse self-check passed it
|
|
14
|
+
* nth: 1.5 emitted verbatim into `.nth(1.5)` / `[1.5]`
|
|
15
|
+
*
|
|
16
|
+
* Zero diagnostics in every case. `SelectorEntry.nth` is typed `number?`, but YAML is parsed, not
|
|
17
|
+
* type-checked — the declared type buys nothing at the boundary. Same family as #712 (an
|
|
18
|
+
* unrecognised KEY) and #711 (an unrecognised VALUE for `type:`), one level deeper again.
|
|
19
|
+
*
|
|
20
|
+
* THE CONTRACT: an integer `>= -1`. `0..N` is the zero-based index; `-1` means the last match
|
|
21
|
+
* (Playwright's `.last()` IS `.nth(-1)`, and the appium side now renders `.at(-1)`). Anything
|
|
22
|
+
* else is ignored by the resolver — normalised to `undefined` before it can reach a template —
|
|
23
|
+
* and reported here, so "ignored" is something the author is told rather than something they
|
|
24
|
+
* discover from a strict-mode violation.
|
|
25
|
+
*
|
|
26
|
+
* A WARNING, not an error, on SG-W004's reasoning: the value is inert once dropped, the selector
|
|
27
|
+
* still resolves (it just does not filter by position), and `--strict` already turns the channel
|
|
28
|
+
* non-zero for CI.
|
|
29
|
+
*/
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.isValidNth = isValidNth;
|
|
32
|
+
exports.normalizeNth = normalizeNth;
|
|
33
|
+
exports.collectInvalidNth = collectInvalidNth;
|
|
34
|
+
exports.reportInvalidNth = reportInvalidNth;
|
|
35
|
+
const selector_entry_walk_1 = require("./selector-entry-walk");
|
|
36
|
+
/** True for the values `nth:` accepts: an integer index `>= 0`, or `-1` for the last match. */
|
|
37
|
+
function isValidNth(v) {
|
|
38
|
+
return typeof v === 'number' && Number.isInteger(v) && v >= -1;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The one normalisation every resolve path runs `nth` through: a valid index, or `undefined`.
|
|
42
|
+
*
|
|
43
|
+
* Returning `undefined` rather than the raw value is what makes the SG-W018 message true — and
|
|
44
|
+
* it is the half that keeps broken JavaScript out of the emitted spec even on paths this check
|
|
45
|
+
* does not walk (the legacy selector format), because a template only ever sees a real index.
|
|
46
|
+
*/
|
|
47
|
+
function normalizeNth(v) {
|
|
48
|
+
return isValidNth(v) ? v : undefined;
|
|
49
|
+
}
|
|
50
|
+
/** Every entry in `file` whose `nth:` is present but outside the contract. */
|
|
51
|
+
function collectInvalidNth(file) {
|
|
52
|
+
const out = [];
|
|
53
|
+
(0, selector_entry_walk_1.walkSelectorEntries)(file, {
|
|
54
|
+
entry(entry, path) {
|
|
55
|
+
// An ABSENT `nth:` is the common case and means "no positional filter". An explicit
|
|
56
|
+
// `nth: null` is read the same way — the resolver has always treated null as unset, and
|
|
57
|
+
// reporting it would fire on a legitimate "no index here" written out loud.
|
|
58
|
+
if (entry.nth === undefined || entry.nth === null)
|
|
59
|
+
return;
|
|
60
|
+
if (isValidNth(entry.nth))
|
|
61
|
+
return;
|
|
62
|
+
out.push({ path, nth: entry.nth });
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* SG-W018 — report every entry whose `nth:` the compiler cannot use.
|
|
69
|
+
*
|
|
70
|
+
* Runs once per selector FILE (the resolver's load is cached), so an entry named by twenty steps
|
|
71
|
+
* is reported once — the same load point and the same reason as SG-W004 and SG-E027. Silent when
|
|
72
|
+
* no diagnostics channel is attached: `generate` must not depend on diagnostics being wired.
|
|
73
|
+
*/
|
|
74
|
+
function reportInvalidNth(file, opts) {
|
|
75
|
+
const sink = opts.diagnostics;
|
|
76
|
+
if (!sink)
|
|
77
|
+
return;
|
|
78
|
+
for (const { path, nth } of collectInvalidNth(file)) {
|
|
79
|
+
// Quoted for a string so `nth: 'last'` reads back as the string it is; `String()` for a number
|
|
80
|
+
// so -2, 1.5 and .nan survive as written (JSON.stringify renders NaN as `null`, which would
|
|
81
|
+
// quote a value the author never typed).
|
|
82
|
+
const written = typeof nth === 'string' ? `"${nth}"`
|
|
83
|
+
: typeof nth === 'number' ? String(nth)
|
|
84
|
+
: JSON.stringify(nth) ?? String(nth);
|
|
85
|
+
sink.add('SG-W018', `selectors.yaml entry "${path}" declares nth: ${written}, which is not a valid index — `
|
|
86
|
+
+ `it is IGNORED, so the selector does not filter by position and a step naming it resolves `
|
|
87
|
+
+ `to every match (strict mode then fails at run time naming the DOM, never this line). `
|
|
88
|
+
+ `Use an integer >= 0 for a zero-based index, or -1 for the last match.`, { feature: opts.feature });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=selector-nth-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-nth-validation.js","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-nth-validation.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;AAMH,gCAEC;AASD,oCAEC;AAUD,8CAaC;AASD,4CAoBC;AApED,+DAA4D;AAE5D,+FAA+F;AAC/F,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,CAAU;IACrC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvC,CAAC;AASD,8EAA8E;AAC9E,SAAgB,iBAAiB,CAAC,IAA6B;IAC7D,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,IAAA,yCAAmB,EAAC,IAAI,EAAE;QACxB,KAAK,CAAC,KAAK,EAAE,IAAI;YACf,oFAAoF;YACpF,wFAAwF;YACxF,4EAA4E;YAC5E,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,IAAI;gBAAE,OAAO;YAC1D,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;gBAAE,OAAO;YAClC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC;QACrC,CAAC;KACF,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC9B,IAA6B,EAC7B,IAA8D;IAE9D,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IAC9B,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,KAAK,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,+FAA+F;QAC/F,4FAA4F;QAC5F,yCAAyC;QACzC,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG;YAClD,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;gBACvC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,SAAS,EAChB,yBAAyB,IAAI,mBAAmB,OAAO,iCAAiC;cACtF,2FAA2F;cAC3F,uFAAuF;cACvF,uEAAuE,EACzE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -48,6 +48,7 @@ export interface ResolvedSelector {
|
|
|
48
48
|
elements?: Record<string, any>;
|
|
49
49
|
}>;
|
|
50
50
|
pagination?: Record<string, string>;
|
|
51
|
+
rows?: string;
|
|
51
52
|
attribute?: string;
|
|
52
53
|
pattern?: string;
|
|
53
54
|
expanded?: {
|
|
@@ -55,6 +56,8 @@ export interface ResolvedSelector {
|
|
|
55
56
|
attribute?: string;
|
|
56
57
|
state?: 'none';
|
|
57
58
|
};
|
|
59
|
+
checkedClass?: string;
|
|
60
|
+
checkedAttribute?: string;
|
|
58
61
|
anchor?: ResolvedSelector;
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
@@ -71,8 +74,29 @@ export declare class SelectorResolver {
|
|
|
71
74
|
private diagnostics?;
|
|
72
75
|
private contentNamedRoles;
|
|
73
76
|
private warnedContentNamed;
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
/** The adapter's target platform — gates the list-member auto-infer (#665). Defaults to web. */
|
|
78
|
+
private platform;
|
|
79
|
+
constructor(selectorsDir?: string, screenName?: string, platform?: 'web' | 'mobile');
|
|
80
|
+
/**
|
|
81
|
+
* A role that resolved with NO accessible name, on the mobile adapter — a dead selector (#665).
|
|
82
|
+
*
|
|
83
|
+
* `appium-selector.hbs` renders a role as `~{{name || value}}`, so with no name it emits the role
|
|
84
|
+
* TOKEN itself: `~listitem`, `~status`. A native a11y tree has no role concept and contains no
|
|
85
|
+
* such string, so the locator can never match — yet it compiled clean and only failed at run time
|
|
86
|
+
* with `element with selector "~listitem" wasn't found`.
|
|
87
|
+
*
|
|
88
|
+
* The invariant is "role with no name", NOT "role in LIST_MEMBER_ROLES". Both are reachable and
|
|
89
|
+
* both are dead:
|
|
90
|
+
* · auto-infer — only the three LIST_MEMBER_ROLES are nameless (the other 22 default the label)
|
|
91
|
+
* · an entry — a list-member role withholds the name by design, and `name: null` is the
|
|
92
|
+
* documented opt-out for a content-named role, so `type: role` reaches it too
|
|
93
|
+
* One predicate covers every door; the CALLERS choose the remedy, because it differs: with no
|
|
94
|
+
* entry the fix is "add one", with an entry the fix is "change its type".
|
|
95
|
+
*
|
|
96
|
+
* Web is unaffected — there the role IS the locator (see LIST_MEMBER_ROLES).
|
|
97
|
+
*/
|
|
98
|
+
private isUnusableMobileRole;
|
|
99
|
+
/** Attach the compile-diagnostics collector (SG-W003, SG-W016, SG-W030) */
|
|
76
100
|
setDiagnostics(collector: DiagnosticsCollector): void;
|
|
77
101
|
/** Override the name-from-content role list from the app profile (qa/app.yaml feedback.toast) */
|
|
78
102
|
setContentNamedRoles(roles: string[]): void;
|
|
@@ -158,9 +182,36 @@ export declare class SelectorResolver {
|
|
|
158
182
|
* "No variables" → "No variables" (unchanged)
|
|
159
183
|
*/
|
|
160
184
|
private static resolveTemplateVars;
|
|
185
|
+
/** Encode `{{var}}` references inside a table's `columns: { <col>: { header } }` map. */
|
|
186
|
+
private static resolveColumnHeaders;
|
|
187
|
+
/**
|
|
188
|
+
* Normalise `checked:` / `selected:` into the one signal consumers read (issue #730). The two
|
|
189
|
+
* spellings are an authoring convenience for the same thing — `checked:` on a toggle, `selected:`
|
|
190
|
+
* on a card/tab picker — so they collapse here rather than at every call site. Each spelling can
|
|
191
|
+
* publish the state as a class token or as a boolean attribute; one entry declares one of them.
|
|
192
|
+
*
|
|
193
|
+
* Validated at CODEGEN because every failure mode here is silent at run time: the class token
|
|
194
|
+
* lands inside `[class~="..."]`, where a quote breaks the selector and whitespace can never match
|
|
195
|
+
* (the `~=` operator matches ONE whitespace-separated token, so 'a b' matches nothing at all and
|
|
196
|
+
* the step would just time out claiming the control never changed state); an attribute name has
|
|
197
|
+
* the same exposure inside `[name="true"]`. Refused rather than warned-and-dropped, unlike
|
|
198
|
+
* `expanded:`: dropping this signal leaves the step with nothing to read, so it would fail again
|
|
199
|
+
* with the original "no on/off state" error and hide the real cause.
|
|
200
|
+
*/
|
|
201
|
+
private resolveCheckedSignal;
|
|
161
202
|
/**
|
|
162
203
|
* Resolve from new structured entry format
|
|
163
204
|
*/
|
|
205
|
+
/**
|
|
206
|
+
* An `expanded:` signal's `class` / `attribute` value is pasted into the generated spec — into a
|
|
207
|
+
* string literal, a regex, a `classList.contains()` argument. selectors.yaml is often generated
|
|
208
|
+
* from the page under test, so a value carrying a quote, a `${`, whitespace or any other character
|
|
209
|
+
* a class or attribute name cannot legitimately contain is refused (diagnostic + the field is
|
|
210
|
+
* dropped) rather than compiled into code. Dropping it leaves a working step — codegen falls back
|
|
211
|
+
* to driving/asserting `aria-expanded` — which is why this warns where the checked/selected signal,
|
|
212
|
+
* whose fallback is the failure it exists to fix, refuses outright.
|
|
213
|
+
*/
|
|
214
|
+
private validatedStateSignal;
|
|
164
215
|
private resolveFromEntry;
|
|
165
216
|
/**
|
|
166
217
|
* Resolve selector by priority chain (legacy)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector-resolver.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-resolver.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"selector-resolver.d.ts","sourceRoot":"","sources":["../../../../src/generators/test-generator/utils/selector-resolver.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAmFtD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,aAA0C,CAAC;AAkBzE,MAAM,WAAW,gBAAgB;IAI/B,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GACrF,kBAAkB,GAAG,OAAO,GAAG,qBAAqB,GAAG,eAAe,CAAC;IAC3E,KAAK,EAAE,MAAM,CAAC;IAMd,YAAY,CAAC,EAAE,YAAY,CAAC;IAI5B,eAAe,CAAC,EAAE;QAAE,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3F,WAAW,CAAC,EAAE;QAAE,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAIlE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,aAAa,CAAwD;IAC7E,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAkB;IAClC,kFAAkF;IAClF,OAAO,CAAC,WAAW,CAAC,CAAuB;IAC3C,OAAO,CAAC,iBAAiB,CAAyC;IAClE,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,gGAAgG;IAChG,OAAO,CAAC,QAAQ,CAA2B;gBAE/B,YAAY,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,KAAK,GAAG,QAAgB;IAM1F;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,oBAAoB;IAI5B,2EAA2E;IAC3E,cAAc,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI;IAIrD,iGAAiG;IACjG,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAI3C,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAInC;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAI1C;;OAEG;IACH,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAI5C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIzC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAQ5B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAMvD;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,gBAAgB;IAsDhH;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAwCnC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAwDnC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAyG9B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoC3B;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAMlC,yFAAyF;IACzF,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAYnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IA+D5B;;OAEG;IACH;;;;;;;;OAQG;IACH,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,gBAAgB;IAkQxB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAuEzB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA8D3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA6B5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA4BxB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAcjC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAqD9B;;OAEG;IACH,OAAO,CAAC,YAAY;IAIpB;;OAEG;IACH,UAAU,IAAI,IAAI;CAGnB"}
|