@sun-asterisk/sungen 3.2.31 → 3.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/commands/audit.d.ts +1 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +13 -2
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/capability.d.ts.map +1 -1
- package/dist/cli/commands/capability.js +46 -17
- 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 +39 -18
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +14 -7
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +2 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/results-merge.d.ts.map +1 -1
- package/dist/cli/commands/results-merge.js +2 -12
- package/dist/cli/commands/results-merge.js.map +1 -1
- package/dist/cli/commands/results-sanitize.d.ts.map +1 -1
- package/dist/cli/commands/results-sanitize.js +2 -13
- package/dist/cli/commands/results-sanitize.js.map +1 -1
- package/dist/cli/commands/setup-mobile-env.d.ts +15 -0
- package/dist/cli/commands/setup-mobile-env.d.ts.map +1 -0
- package/dist/cli/commands/setup-mobile-env.js +65 -0
- package/dist/cli/commands/setup-mobile-env.js.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
- package/dist/dashboard/snapshot-builder.js +6 -10
- package/dist/dashboard/snapshot-builder.js.map +1 -1
- package/dist/exporters/feature-parser.d.ts +21 -0
- package/dist/exporters/feature-parser.d.ts.map +1 -1
- package/dist/exporters/feature-parser.js +32 -1
- package/dist/exporters/feature-parser.js.map +1 -1
- package/dist/exporters/locale-variants.d.ts +7 -1
- package/dist/exporters/locale-variants.d.ts.map +1 -1
- package/dist/exporters/locale-variants.js +23 -16
- package/dist/exporters/locale-variants.js.map +1 -1
- package/dist/exporters/matrix/build.d.ts.map +1 -1
- package/dist/exporters/matrix/build.js +13 -7
- package/dist/exporters/matrix/build.js.map +1 -1
- package/dist/exporters/matrix/carry-manual-results.d.ts +70 -0
- package/dist/exporters/matrix/carry-manual-results.d.ts.map +1 -0
- package/dist/exporters/matrix/carry-manual-results.js +232 -0
- package/dist/exporters/matrix/carry-manual-results.js.map +1 -0
- package/dist/exporters/matrix/export.d.ts +2 -0
- package/dist/exporters/matrix/export.d.ts.map +1 -1
- package/dist/exporters/matrix/export.js +7 -1
- package/dist/exporters/matrix/export.js.map +1 -1
- package/dist/exporters/matrix/wording.d.ts +7 -0
- package/dist/exporters/matrix/wording.d.ts.map +1 -1
- package/dist/exporters/matrix/wording.js +27 -1
- package/dist/exporters/matrix/wording.js.map +1 -1
- package/dist/exporters/xlsx-exporter.d.ts +2 -0
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.js +7 -2
- package/dist/exporters/xlsx-exporter.js.map +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/all-contain-assertion.hbs +1 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/all-contain-element.hbs +8 -5
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/count-assertion.hbs +5 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/disabled-with-filter-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/hidden-with-filter-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/list-item-count-assertion.hbs +5 -2
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/state-with-filter-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-filtered-assertion.hbs +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
- package/dist/generators/test-generator/adapters/appium/templates/steps/partials/await-elements.hbs +12 -0
- package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +94 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +7 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/row-scoped-column-assertion.hbs +23 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +4 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/default.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.hbs +4 -4
- package/dist/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +17 -2
- package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +14 -0
- package/dist/generators/test-generator/code-generator.d.ts +2 -1
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +122 -15
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/diagnostics.d.ts +70 -4
- package/dist/generators/test-generator/diagnostics.d.ts.map +1 -1
- package/dist/generators/test-generator/diagnostics.js +69 -3
- package/dist/generators/test-generator/diagnostics.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts +13 -3
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +16 -10
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/patterns/types.d.ts +15 -0
- package/dist/generators/test-generator/patterns/types.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts +5 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/with-parent-scope.js +6 -0
- package/dist/generators/test-generator/patterns/with-parent-scope.js.map +1 -1
- package/dist/generators/test-generator/step-mapper.d.ts +81 -0
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +187 -13
- package/dist/generators/test-generator/step-mapper.js.map +1 -1
- package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
- package/dist/generators/test-generator/template-engine.js +18 -0
- package/dist/generators/test-generator/template-engine.js.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.d.ts +25 -0
- package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.js +39 -8
- package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-entry-fields.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-entry-fields.js +1 -0
- package/dist/generators/test-generator/utils/selector-entry-fields.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +84 -4
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +229 -82
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +35 -8
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/capability.d.ts +7 -1
- package/dist/harness/capability.d.ts.map +1 -1
- package/dist/harness/capability.js +15 -12
- package/dist/harness/capability.js.map +1 -1
- package/dist/harness/catalog/universal-viewpoints.yaml +5 -5
- package/dist/harness/config-file.d.ts +17 -0
- package/dist/harness/config-file.d.ts.map +1 -0
- package/dist/harness/config-file.js +100 -0
- package/dist/harness/config-file.js.map +1 -0
- package/dist/harness/depth-lint.d.ts.map +1 -1
- package/dist/harness/depth-lint.js +2 -1
- package/dist/harness/depth-lint.js.map +1 -1
- package/dist/harness/flow-check.d.ts.map +1 -1
- package/dist/harness/flow-check.js +6 -2
- package/dist/harness/flow-check.js.map +1 -1
- package/dist/harness/keyword-match.d.ts +59 -0
- package/dist/harness/keyword-match.d.ts.map +1 -0
- package/dist/harness/keyword-match.js +86 -0
- package/dist/harness/keyword-match.js.map +1 -0
- package/dist/harness/next-step.d.ts.map +1 -1
- package/dist/harness/next-step.js +2 -1
- package/dist/harness/next-step.js.map +1 -1
- package/dist/harness/parse.d.ts.map +1 -1
- package/dist/harness/parse.js +42 -7
- package/dist/harness/parse.js.map +1 -1
- package/dist/harness/perf.d.ts +7 -1
- package/dist/harness/perf.d.ts.map +1 -1
- package/dist/harness/perf.js +13 -10
- package/dist/harness/perf.js.map +1 -1
- package/dist/harness/quality-gates.d.ts +9 -2
- package/dist/harness/quality-gates.d.ts.map +1 -1
- package/dist/harness/quality-gates.js +16 -4
- package/dist/harness/quality-gates.js.map +1 -1
- package/dist/harness/query-catalog.js +0 -0
- package/dist/harness/query-catalog.js.map +1 -1
- package/dist/harness/read-text.d.ts +6 -0
- package/dist/harness/read-text.d.ts.map +1 -1
- package/dist/harness/read-text.js +7 -1
- package/dist/harness/read-text.js.map +1 -1
- package/dist/harness/secret-scan.d.ts +27 -1
- package/dist/harness/secret-scan.d.ts.map +1 -1
- package/dist/harness/secret-scan.js +57 -4
- package/dist/harness/secret-scan.js.map +1 -1
- package/dist/harness/sensors.d.ts +12 -0
- package/dist/harness/sensors.d.ts.map +1 -1
- package/dist/harness/sensors.js +41 -18
- package/dist/harness/sensors.js.map +1 -1
- package/dist/harness/spec-branches.d.ts +7 -20
- package/dist/harness/spec-branches.d.ts.map +1 -1
- package/dist/harness/spec-branches.js +85 -13
- package/dist/harness/spec-branches.js.map +1 -1
- package/dist/harness/spec-coverage.d.ts +16 -0
- package/dist/harness/spec-coverage.d.ts.map +1 -1
- package/dist/harness/spec-coverage.js +131 -12
- package/dist/harness/spec-coverage.js.map +1 -1
- package/dist/harness/viewpoint-ledger.d.ts.map +1 -1
- package/dist/harness/viewpoint-ledger.js +2 -1
- package/dist/harness/viewpoint-ledger.js.map +1 -1
- package/dist/harness/write-atomic.d.ts +2 -0
- package/dist/harness/write-atomic.d.ts.map +1 -0
- package/dist/harness/write-atomic.js +62 -0
- package/dist/harness/write-atomic.js.map +1 -0
- package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -1
- package/dist/orchestrator/ai-skills/writer.js +15 -7
- package/dist/orchestrator/ai-skills/writer.js.map +1 -1
- package/dist/orchestrator/appium-environment-setup.d.ts +24 -0
- package/dist/orchestrator/appium-environment-setup.d.ts.map +1 -0
- package/dist/orchestrator/appium-environment-setup.js +157 -0
- package/dist/orchestrator/appium-environment-setup.js.map +1 -0
- package/dist/orchestrator/assets-drift.d.ts.map +1 -1
- package/dist/orchestrator/assets-drift.js +11 -6
- package/dist/orchestrator/assets-drift.js.map +1 -1
- package/dist/orchestrator/mobile-runtime-scaffolder.d.ts +2 -0
- package/dist/orchestrator/mobile-runtime-scaffolder.d.ts.map +1 -1
- package/dist/orchestrator/mobile-runtime-scaffolder.js.map +1 -1
- package/dist/orchestrator/project-deps-sync.d.ts.map +1 -1
- package/dist/orchestrator/project-deps-sync.js +22 -1
- package/dist/orchestrator/project-deps-sync.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts +9 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +63 -7
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/security-overrides-catalog.d.ts +39 -0
- package/dist/orchestrator/security-overrides-catalog.d.ts.map +1 -0
- package/dist/orchestrator/security-overrides-catalog.js +63 -0
- package/dist/orchestrator/security-overrides-catalog.js.map +1 -0
- package/dist/orchestrator/security-overrides.d.ts +51 -0
- package/dist/orchestrator/security-overrides.d.ts.map +1 -0
- package/dist/orchestrator/security-overrides.js +165 -0
- package/dist/orchestrator/security-overrides.js.map +1 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
- package/dist/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +8 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +64 -2
- package/dist/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +20 -5
- package/dist/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +3 -3
- package/dist/orchestrator/templates/appium-environment/README.md +83 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/install-appium.ps1 +44 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/install-appium.sh +50 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/lib.ps1 +108 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/lib.sh +141 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/verify-appium.ps1 +39 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/verify-appium.sh +43 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/verify-node.ps1 +13 -0
- package/dist/orchestrator/templates/appium-environment/scripts/common/verify-node.sh +16 -0
- package/dist/orchestrator/templates/appium-environment/scripts/macos/install-android.sh +110 -0
- package/dist/orchestrator/templates/appium-environment/scripts/macos/install-ios.sh +32 -0
- package/dist/orchestrator/templates/appium-environment/scripts/macos/verify-android.sh +32 -0
- package/dist/orchestrator/templates/appium-environment/scripts/macos/verify-ios.sh +15 -0
- package/dist/orchestrator/templates/appium-environment/scripts/windows/install-android.ps1 +153 -0
- package/dist/orchestrator/templates/appium-environment/scripts/windows/verify-android.ps1 +26 -0
- package/dist/orchestrator/templates/appium-environment/setup.ps1 +58 -0
- package/dist/orchestrator/templates/appium-environment/setup.sh +88 -0
- package/dist/orchestrator/templates/specs-checked-state.d.ts +1 -1
- package/dist/orchestrator/templates/specs-checked-state.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-checked-state.js +26 -3
- package/dist/orchestrator/templates/specs-checked-state.js.map +1 -1
- package/dist/orchestrator/templates/specs-checked-state.ts +31 -6
- package/dist/orchestrator/templates/specs-locale-fixture.ts +21 -9
- package/dist/orchestrator/templates/specs-mock.d.ts +2 -1
- package/dist/orchestrator/templates/specs-mock.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-mock.js +10 -3
- package/dist/orchestrator/templates/specs-mock.js.map +1 -1
- package/dist/orchestrator/templates/specs-mock.ts +12 -4
- package/dist/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
- package/dist/orchestrator/templates/specs-url-assert.d.ts +17 -1
- package/dist/orchestrator/templates/specs-url-assert.d.ts.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.js +14 -2
- package/dist/orchestrator/templates/specs-url-assert.js.map +1 -1
- package/dist/orchestrator/templates/specs-url-assert.ts +24 -2
- package/dist/orchestrator/templates/wdio.conf.ts +24 -1
- package/package.json +3 -3
- package/src/cli/commands/audit.ts +12 -3
- package/src/cli/commands/capability.ts +63 -19
- package/src/cli/commands/delivery.ts +38 -16
- package/src/cli/commands/generate.ts +15 -7
- package/src/cli/commands/init.ts +3 -0
- package/src/cli/commands/results-merge.ts +2 -8
- package/src/cli/commands/results-sanitize.ts +2 -9
- package/src/cli/commands/setup-mobile-env.ts +64 -0
- package/src/cli/index.ts +2 -0
- package/src/dashboard/snapshot-builder.ts +6 -8
- package/src/exporters/feature-parser.ts +32 -2
- package/src/exporters/locale-variants.ts +23 -17
- package/src/exporters/matrix/build.ts +14 -8
- package/src/exporters/matrix/carry-manual-results.ts +229 -0
- package/src/exporters/matrix/export.ts +10 -4
- package/src/exporters/matrix/wording.ts +26 -1
- package/src/exporters/xlsx-exporter.ts +7 -2
- package/src/generators/test-generator/adapters/adapter-interface.ts +2 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/reinstall-app-action.hbs +2 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/all-contain-assertion.hbs +1 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/all-contain-element.hbs +8 -5
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/count-assertion.hbs +5 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/disabled-with-filter-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/disabled-with-role-variable-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/hidden-with-filter-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/hidden-with-role-variable-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/label-value-assertion.hbs +8 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/list-item-count-assertion.hbs +5 -2
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/state-with-filter-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-filtered-assertion.hbs +1 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/visible-with-role-variable-assertion.hbs +7 -3
- package/src/generators/test-generator/adapters/appium/templates/steps/partials/await-elements.hbs +12 -0
- package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +94 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +7 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/label-value-assertion.hbs +7 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/row-scoped-column-assertion.hbs +23 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/visible-with-role-variable-assertion.hbs +8 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-base.hbs +4 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/locator-strategies/default.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.hbs +4 -4
- package/src/generators/test-generator/adapters/playwright/templates/steps/partials/url-assertion.hbs +17 -2
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +14 -0
- package/src/generators/test-generator/code-generator.ts +119 -19
- package/src/generators/test-generator/diagnostics.ts +70 -4
- package/src/generators/test-generator/patterns/index.ts +16 -9
- package/src/generators/test-generator/patterns/types.ts +15 -0
- package/src/generators/test-generator/patterns/with-parent-scope.ts +6 -0
- package/src/generators/test-generator/step-mapper.ts +196 -13
- package/src/generators/test-generator/template-engine.ts +18 -0
- package/src/generators/test-generator/utils/data-resolver.ts +41 -12
- package/src/generators/test-generator/utils/selector-entry-fields.ts +1 -0
- package/src/generators/test-generator/utils/selector-resolver.ts +256 -85
- package/src/harness/audit.ts +41 -12
- package/src/harness/capability.ts +23 -12
- package/src/harness/catalog/universal-viewpoints.yaml +5 -5
- package/src/harness/config-file.ts +66 -0
- package/src/harness/depth-lint.ts +2 -1
- package/src/harness/flow-check.ts +6 -2
- package/src/harness/keyword-match.ts +85 -0
- package/src/harness/next-step.ts +2 -1
- package/src/harness/parse.ts +42 -7
- package/src/harness/perf.ts +15 -7
- package/src/harness/quality-gates.ts +16 -4
- package/src/harness/query-catalog.ts +0 -0
- package/src/harness/read-text.ts +7 -1
- package/src/harness/secret-scan.ts +60 -4
- package/src/harness/sensors.ts +50 -19
- package/src/harness/spec-branches.ts +72 -14
- package/src/harness/spec-coverage.ts +133 -13
- package/src/harness/viewpoint-ledger.ts +2 -1
- package/src/harness/write-atomic.ts +22 -0
- package/src/orchestrator/ai-skills/writer.ts +18 -3
- package/src/orchestrator/appium-environment-setup.ts +127 -0
- package/src/orchestrator/assets-drift.ts +10 -5
- package/src/orchestrator/mobile-runtime-scaffolder.ts +2 -0
- package/src/orchestrator/project-deps-sync.ts +23 -1
- package/src/orchestrator/project-initializer.ts +69 -7
- package/src/orchestrator/security-overrides-catalog.ts +69 -0
- package/src/orchestrator/security-overrides.ts +149 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md +14 -0
- package/src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md +8 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md +64 -2
- package/src/orchestrator/templates/ai-src/skills/sungen-selector-keys/SKILL.md +13 -1
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-generation/SKILL.md +20 -5
- package/src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md +3 -3
- package/src/orchestrator/templates/appium-environment/README.md +83 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/install-appium.ps1 +44 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/install-appium.sh +50 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/lib.ps1 +108 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/lib.sh +141 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/verify-appium.ps1 +39 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/verify-appium.sh +43 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/verify-node.ps1 +13 -0
- package/src/orchestrator/templates/appium-environment/scripts/common/verify-node.sh +16 -0
- package/src/orchestrator/templates/appium-environment/scripts/macos/install-android.sh +110 -0
- package/src/orchestrator/templates/appium-environment/scripts/macos/install-ios.sh +32 -0
- package/src/orchestrator/templates/appium-environment/scripts/macos/verify-android.sh +32 -0
- package/src/orchestrator/templates/appium-environment/scripts/macos/verify-ios.sh +15 -0
- package/src/orchestrator/templates/appium-environment/scripts/windows/install-android.ps1 +153 -0
- package/src/orchestrator/templates/appium-environment/scripts/windows/verify-android.ps1 +26 -0
- package/src/orchestrator/templates/appium-environment/setup.ps1 +58 -0
- package/src/orchestrator/templates/appium-environment/setup.sh +88 -0
- package/src/orchestrator/templates/specs-checked-state.ts +31 -6
- package/src/orchestrator/templates/specs-locale-fixture.ts +21 -9
- package/src/orchestrator/templates/specs-mock.ts +12 -4
- package/src/orchestrator/templates/specs-pw-shape-reporter.ts +0 -0
- package/src/orchestrator/templates/specs-url-assert.ts +24 -2
- package/src/orchestrator/templates/wdio.conf.ts +24 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<#
|
|
2
|
+
.SYNOPSIS
|
|
3
|
+
setup.ps1 - Windows entry point of the sungen Appium environment bundle.
|
|
4
|
+
.DESCRIPTION
|
|
5
|
+
.\appium-environment\setup.ps1 [-Check] [-SkipAndroid] [-NoProfile]
|
|
6
|
+
|
|
7
|
+
Emitted by `sungen init --mobile` / `sungen capability add mobile`, which also run it once.
|
|
8
|
+
Re-run it any time: every step is check -> install -> verify and a satisfied step is skipped.
|
|
9
|
+
-Check report what is missing, install nothing (side-effect free)
|
|
10
|
+
-SkipAndroid skip JDK / Android SDK / uiautomator2
|
|
11
|
+
-NoProfile do not write ANDROID_HOME / JAVA_HOME / Path to your User environment
|
|
12
|
+
iOS (xcuitest) needs Xcode and therefore a Mac - there is no iOS step on Windows.
|
|
13
|
+
Exit: 0 ready (or only warnings) - 1 something failed - 2 unsupported host
|
|
14
|
+
Run as: powershell -NoProfile -ExecutionPolicy Bypass -File .\appium-environment\setup.ps1
|
|
15
|
+
#>
|
|
16
|
+
[CmdletBinding()]
|
|
17
|
+
param([switch]$Check, [switch]$SkipAndroid, [switch]$NoProfile)
|
|
18
|
+
|
|
19
|
+
$ErrorActionPreference = 'Continue'
|
|
20
|
+
if ($PSVersionTable.PSVersion.Major -lt 5) { Write-Host 'Windows PowerShell 5.1 or newer is required.' -ForegroundColor Red; exit 2 }
|
|
21
|
+
if ($env:OS -ne 'Windows_NT') { Write-Host 'setup.ps1 is for Windows - on macOS run ./appium-environment/setup.sh' -ForegroundColor Red; exit 2 }
|
|
22
|
+
|
|
23
|
+
$script:SungenEnvCheckOnly = [bool]$Check
|
|
24
|
+
$script:SungenEnvSkipAndroid = [bool]$SkipAndroid
|
|
25
|
+
$script:SungenEnvNoProfile = [bool]$NoProfile
|
|
26
|
+
$script:ProjectDir = (Resolve-Path (Join-Path $PSScriptRoot '..')).Path
|
|
27
|
+
. (Join-Path $PSScriptRoot 'scripts\common\lib.ps1')
|
|
28
|
+
|
|
29
|
+
Set-Location $script:ProjectDir
|
|
30
|
+
if ($script:SungenEnvCheckOnly) { Write-Section 'sungen - Appium environment - check only (Windows)' }
|
|
31
|
+
else { Write-Section 'sungen - Appium environment setup (Windows)' }
|
|
32
|
+
Write-Host "project: $($script:ProjectDir)" -ForegroundColor DarkGray
|
|
33
|
+
|
|
34
|
+
# --- 1/4 prerequisites -----------------------------------------------------------------------------
|
|
35
|
+
Write-Section '1/4 Prerequisites'
|
|
36
|
+
. (Join-Path $PSScriptRoot 'scripts\common\verify-node.ps1')
|
|
37
|
+
Invoke-Check -Title 'winget (Windows Package Manager)' -Check {
|
|
38
|
+
if (Get-Command winget -ErrorAction SilentlyContinue) { $v = (& winget --version) 2>$null | Select-Object -First 1; "winget $v" }
|
|
39
|
+
} -Hint 'winget missing - install "App Installer" from the Microsoft Store (Windows 10 1809+ / 11), then re-run'
|
|
40
|
+
|
|
41
|
+
# --- 2/4 Android -----------------------------------------------------------------------------------
|
|
42
|
+
if (-not $script:SungenEnvSkipAndroid) {
|
|
43
|
+
Write-Section '2/4 Android (JDK, SDK, adb, emulator)'
|
|
44
|
+
. (Join-Path $PSScriptRoot 'scripts\windows\install-android.ps1')
|
|
45
|
+
} else {
|
|
46
|
+
Write-Section '2/4 Android'; Write-Skip 'Android toolchain' '-SkipAndroid'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# --- 3/4 Appium ------------------------------------------------------------------------------------
|
|
50
|
+
Write-Section '3/4 Appium (project-local) + platform driver'
|
|
51
|
+
. (Join-Path $PSScriptRoot 'scripts\common\install-appium.ps1')
|
|
52
|
+
|
|
53
|
+
# --- 4/4 health ------------------------------------------------------------------------------------
|
|
54
|
+
Write-Section '4/4 Health check'
|
|
55
|
+
if (-not $script:SungenEnvSkipAndroid) { . (Join-Path $PSScriptRoot 'scripts\windows\verify-android.ps1') }
|
|
56
|
+
. (Join-Path $PSScriptRoot 'scripts\common\verify-appium.ps1')
|
|
57
|
+
|
|
58
|
+
exit (Write-Summary)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# setup.sh — macOS entry point of the sungen Appium environment bundle.
|
|
3
|
+
#
|
|
4
|
+
# ./appium-environment/setup.sh [--check] [--skip-android] [--skip-ios] [--no-profile]
|
|
5
|
+
#
|
|
6
|
+
# Emitted by `sungen init --mobile` / `sungen capability add mobile`, which also run it once.
|
|
7
|
+
# Re-run it any time: every step is check → install → verify and a satisfied step is skipped.
|
|
8
|
+
# --check report what is missing, install nothing (side-effect free)
|
|
9
|
+
# --skip-android skip JDK / Android SDK / uiautomator2
|
|
10
|
+
# --skip-ios skip Xcode CLT / applesimutils / xcuitest
|
|
11
|
+
# --no-profile do not write the ANDROID_HOME / JAVA_HOME / PATH block to your shell profile
|
|
12
|
+
# Exit: 0 ready (or only warnings) · 1 something failed · 2 unsupported OS / bad flag
|
|
13
|
+
set -u
|
|
14
|
+
|
|
15
|
+
BUNDLE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
16
|
+
PROJECT_DIR=$(cd "$BUNDLE_DIR/.." && pwd)
|
|
17
|
+
export PROJECT_DIR
|
|
18
|
+
. "$BUNDLE_DIR/scripts/common/lib.sh"
|
|
19
|
+
|
|
20
|
+
usage() { sed -n '4,13p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'; }
|
|
21
|
+
|
|
22
|
+
for arg in "$@"; do
|
|
23
|
+
case "$arg" in
|
|
24
|
+
--check) SUNGEN_ENV_CHECK_ONLY=1 ;;
|
|
25
|
+
--skip-android) SUNGEN_ENV_SKIP_ANDROID=1 ;;
|
|
26
|
+
--skip-ios) SUNGEN_ENV_SKIP_IOS=1 ;;
|
|
27
|
+
--no-profile) SUNGEN_ENV_NO_PROFILE=1 ;;
|
|
28
|
+
-h|--help) usage; exit 0 ;;
|
|
29
|
+
*) printf 'unknown flag: %s\n\n' "$arg" >&2; usage >&2; exit 2 ;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
case "$(uname -s)" in
|
|
34
|
+
Darwin) ;;
|
|
35
|
+
Linux)
|
|
36
|
+
printf 'ℹ Linux detected — this bundle provisions macOS and Windows.\n'
|
|
37
|
+
printf ' Android on Linux: see README.md → "Manual fallback" (JDK + Android SDK via your package manager,\n'
|
|
38
|
+
printf ' then `sungen capability add mobile` for the project-local Appium + uiautomator2).\n'
|
|
39
|
+
exit 0 ;;
|
|
40
|
+
*) printf '✗ unsupported OS: %s (macOS: setup.sh · Windows: setup.ps1)\n' "$(uname -s)" >&2; exit 2 ;;
|
|
41
|
+
esac
|
|
42
|
+
|
|
43
|
+
cd "$PROJECT_DIR"
|
|
44
|
+
if [ "$SUNGEN_ENV_CHECK_ONLY" = 1 ]; then section "sungen · Appium environment — check only (macOS)"
|
|
45
|
+
else section "sungen · Appium environment setup (macOS)"; fi
|
|
46
|
+
printf '%sproject: %s%s\n' "$C_DIM" "$PROJECT_DIR" "$C_RESET"
|
|
47
|
+
|
|
48
|
+
# ── 1/5 prerequisites ──────────────────────────────────────────────────────────────────────────
|
|
49
|
+
section "1/5 Prerequisites"
|
|
50
|
+
. "$BUNDLE_DIR/scripts/common/verify-node.sh"
|
|
51
|
+
|
|
52
|
+
brew_check() { have brew && printf 'brew at %s' "$(command -v brew)"; }
|
|
53
|
+
brew_install() {
|
|
54
|
+
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" || return 1
|
|
55
|
+
# The installer does not touch the running shell — pick brew up for the rest of this run.
|
|
56
|
+
if [ -x /opt/homebrew/bin/brew ]; then eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
57
|
+
elif [ -x /usr/local/bin/brew ]; then eval "$(/usr/local/bin/brew shellenv)"; fi
|
|
58
|
+
}
|
|
59
|
+
brew_verify() { brew_check || { printf 'Homebrew not found after install — https://brew.sh, then re-run'; return 1; }; }
|
|
60
|
+
run_step "Homebrew" brew_check brew_install brew_verify
|
|
61
|
+
|
|
62
|
+
# ── 2/5 Android ────────────────────────────────────────────────────────────────────────────────
|
|
63
|
+
if [ "$SUNGEN_ENV_SKIP_ANDROID" != 1 ]; then
|
|
64
|
+
section "2/5 Android (JDK, SDK, adb, emulator)"
|
|
65
|
+
. "$BUNDLE_DIR/scripts/macos/install-android.sh"
|
|
66
|
+
else
|
|
67
|
+
section "2/5 Android"; log_skip "Android toolchain" "--skip-android"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# ── 3/5 iOS ────────────────────────────────────────────────────────────────────────────────────
|
|
71
|
+
if [ "$SUNGEN_ENV_SKIP_IOS" != 1 ]; then
|
|
72
|
+
section "3/5 iOS (Xcode, applesimutils)"
|
|
73
|
+
. "$BUNDLE_DIR/scripts/macos/install-ios.sh"
|
|
74
|
+
else
|
|
75
|
+
section "3/5 iOS"; log_skip "iOS toolchain" "--skip-ios"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# ── 4/5 Appium ─────────────────────────────────────────────────────────────────────────────────
|
|
79
|
+
section "4/5 Appium (project-local) + platform drivers"
|
|
80
|
+
. "$BUNDLE_DIR/scripts/common/install-appium.sh"
|
|
81
|
+
|
|
82
|
+
# ── 5/5 health ─────────────────────────────────────────────────────────────────────────────────
|
|
83
|
+
section "5/5 Health check"
|
|
84
|
+
[ "$SUNGEN_ENV_SKIP_ANDROID" != 1 ] && . "$BUNDLE_DIR/scripts/macos/verify-android.sh"
|
|
85
|
+
[ "$SUNGEN_ENV_SKIP_IOS" != 1 ] && . "$BUNDLE_DIR/scripts/macos/verify-ios.sh"
|
|
86
|
+
. "$BUNDLE_DIR/scripts/common/verify-appium.sh"
|
|
87
|
+
|
|
88
|
+
print_summary
|
|
@@ -26,7 +26,7 @@ export interface DeclaredSignal {
|
|
|
26
26
|
attribute?: string;
|
|
27
27
|
}
|
|
28
28
|
/** Where the control publishes its on/off state — decided in the page, from the real element. */
|
|
29
|
-
export type StateSource = 'native' | 'aria-pressed' | 'aria-checked' | 'class' | 'attribute' | 'none';
|
|
29
|
+
export type StateSource = 'native' | 'aria-pressed' | 'aria-checked' | 'aria-selected' | 'aria-current' | 'class' | 'attribute' | 'none';
|
|
30
30
|
export interface ControlProbe {
|
|
31
31
|
source: StateSource;
|
|
32
32
|
/** Current state, already normalised. Meaningless when `source` is 'native' (Playwright reads it). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-checked-state.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-checked-state.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAchD,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAAG,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAEtE,iGAAiG;AACjG,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"specs-checked-state.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-checked-state.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAchD,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAAG,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAEtE,iGAAiG;AACjG,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC;AACzI,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,sGAAsG;IACtG,EAAE,EAAE,OAAO,CAAC;IACZ,mGAAmG;IACnG,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,YAAY,CAoEnF;AAmCD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAC7C,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAAC,IAAI,CAAC,CA6Gf;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EACjD,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
|
|
@@ -73,6 +73,24 @@ function probeControl(node, declared) {
|
|
|
73
73
|
// Role claims checkable but nothing is published — let Playwright raise its own, precise error.
|
|
74
74
|
if (ariaCheckableRole)
|
|
75
75
|
return { source: 'native', on: false, buttonLike };
|
|
76
|
+
// `is selected` on a tab, an option, a chip or a nav item. These publish `aria-selected` or
|
|
77
|
+
// `aria-current`, which nothing above reads: the probe fell straight through to 'none' and the
|
|
78
|
+
// step failed saying the control has no on/off state to set, on a control that publishes one in
|
|
79
|
+
// the standard place. Read here rather than in the templates so a suite already generated in the
|
|
80
|
+
// field picks the fix up without regenerating — the same reasoning the URL predicate is a runtime
|
|
81
|
+
// helper for.
|
|
82
|
+
//
|
|
83
|
+
// `aria-current` is not a boolean: the spec allows 'page', 'step', 'location', 'date', 'time' and
|
|
84
|
+
// 'true', and only the literal 'false' (or the attribute's absence) means off. Read that way
|
|
85
|
+
// round, so `aria-current="page"` on the active nav item reads as ON rather than as a stray
|
|
86
|
+
// non-'true' string.
|
|
87
|
+
if (el.hasAttribute('aria-selected')) {
|
|
88
|
+
return { source: 'aria-selected', on: String(el.getAttribute('aria-selected') ?? '').trim().toLowerCase() === 'true', buttonLike };
|
|
89
|
+
}
|
|
90
|
+
if (el.hasAttribute('aria-current')) {
|
|
91
|
+
const raw = String(el.getAttribute('aria-current') ?? '').trim().toLowerCase();
|
|
92
|
+
return { source: 'aria-current', on: raw !== '' && raw !== 'false', buttonLike };
|
|
93
|
+
}
|
|
76
94
|
return { source: 'none', on: false, buttonLike };
|
|
77
95
|
}
|
|
78
96
|
/** The declaration both helpers forward into the page. Undefined when nothing was declared, so a
|
|
@@ -91,8 +109,13 @@ const left = (deadline) => Math.max(250, deadline - Date.now());
|
|
|
91
109
|
/** Read the live state. A REMOVED attribute means off: `aria-pressed={on || undefined}` is a common
|
|
92
110
|
* React/Vue idiom, so requiring a literal "false" would fail a control that is correctly off. */
|
|
93
111
|
async function readOn(target, attr, deadline) {
|
|
94
|
-
const raw = await target.getAttribute(attr, { timeout: left(deadline) });
|
|
95
|
-
|
|
112
|
+
const raw = String(await target.getAttribute(attr, { timeout: left(deadline) }) ?? '').trim().toLowerCase();
|
|
113
|
+
// `aria-current` is the one non-boolean of the four: the spec allows 'page', 'step', 'location',
|
|
114
|
+
// 'date', 'time' and 'true', so only the literal 'false' (or absence) means off. Read the other
|
|
115
|
+
// way round it would report the active nav item as OFF.
|
|
116
|
+
if (attr === 'aria-current')
|
|
117
|
+
return raw !== '' && raw !== 'false';
|
|
118
|
+
return raw === 'true';
|
|
96
119
|
}
|
|
97
120
|
/**
|
|
98
121
|
* Drive `target` to the requested on/off state, idempotently.
|
|
@@ -184,7 +207,7 @@ async function setCheckedState(target, want, label, options) {
|
|
|
184
207
|
}
|
|
185
208
|
// Not pressable and publishes nothing — there is no reading of this that makes the step meaningful.
|
|
186
209
|
throw new Error(`Cannot ${want ? 'check' : 'uncheck'} [${label}] — it is not a checkbox/radio/switch, is not a `
|
|
187
|
-
+ `button, and publishes no aria-pressed/aria-checked, so it has no on/off state to set. Point the `
|
|
210
|
+
+ `button, and publishes no aria-pressed/aria-checked/aria-selected/aria-current, so it has no on/off state to set. Point the `
|
|
188
211
|
+ `selector at the control itself, or give it a real ARIA toggle role.`);
|
|
189
212
|
}
|
|
190
213
|
const attr = probe.source;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-checked-state.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-checked-state.ts"],"names":[],"mappings":";;AA+DA,
|
|
1
|
+
{"version":3,"file":"specs-checked-state.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-checked-state.ts"],"names":[],"mappings":";;AA+DA,oCAoEC;AA8CD,0CAgHC;AAYD,gDA+CC;AApUD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACjE,qGAAqG;AACrG,qDAAqD;AACrD,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAK,CAAC;AAChG,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAe7B;;;;;;;;;;;;;GAaG;AACH,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AA2F;YAC3F,6EAA6E;YAC7E,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,IAAI,CACV,iBAAiB,KAAK,sEAAsE;sBAC1F,2FAA2F;sBAC3F,oFAAoF,CACvF,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC;QACD,IAAI,MAAM,KAAK,QAAQ;YAAE,OAAO;QAChC,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,gBAAgB,EAAE,CAAC;YAC9C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACb,kBAAkB,KAAK,QAAQ,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,iBAAiB;sBAChF,4FAA4F;sBAC5F,0FAA0F;sBAC1F,mBAAmB,CACtB,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,KAAK,CACb,aAAa,KAAK,WAAW,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,cAAc;kBAC3E,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,UAAU,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,KAAK,CACvE,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
|
|
@@ -38,7 +38,7 @@ const POLL_INTERVAL_MS = 100;
|
|
|
38
38
|
export interface DeclaredSignal { class?: string; attribute?: string }
|
|
39
39
|
|
|
40
40
|
/** Where the control publishes its on/off state — decided in the page, from the real element. */
|
|
41
|
-
export type StateSource = 'native' | 'aria-pressed' | 'aria-checked' | 'class' | 'attribute' | 'none';
|
|
41
|
+
export type StateSource = 'native' | 'aria-pressed' | 'aria-checked' | 'aria-selected' | 'aria-current' | 'class' | 'attribute' | 'none';
|
|
42
42
|
export interface ControlProbe {
|
|
43
43
|
source: StateSource;
|
|
44
44
|
/** Current state, already normalised. Meaningless when `source` is 'native' (Playwright reads it). */
|
|
@@ -110,6 +110,24 @@ export function probeControl(node: unknown, declared?: DeclaredSignal): ControlP
|
|
|
110
110
|
}
|
|
111
111
|
// Role claims checkable but nothing is published — let Playwright raise its own, precise error.
|
|
112
112
|
if (ariaCheckableRole) return { source: 'native', on: false, buttonLike };
|
|
113
|
+
// `is selected` on a tab, an option, a chip or a nav item. These publish `aria-selected` or
|
|
114
|
+
// `aria-current`, which nothing above reads: the probe fell straight through to 'none' and the
|
|
115
|
+
// step failed saying the control has no on/off state to set, on a control that publishes one in
|
|
116
|
+
// the standard place. Read here rather than in the templates so a suite already generated in the
|
|
117
|
+
// field picks the fix up without regenerating — the same reasoning the URL predicate is a runtime
|
|
118
|
+
// helper for.
|
|
119
|
+
//
|
|
120
|
+
// `aria-current` is not a boolean: the spec allows 'page', 'step', 'location', 'date', 'time' and
|
|
121
|
+
// 'true', and only the literal 'false' (or the attribute's absence) means off. Read that way
|
|
122
|
+
// round, so `aria-current="page"` on the active nav item reads as ON rather than as a stray
|
|
123
|
+
// non-'true' string.
|
|
124
|
+
if (el.hasAttribute('aria-selected')) {
|
|
125
|
+
return { source: 'aria-selected', on: String(el.getAttribute('aria-selected') ?? '').trim().toLowerCase() === 'true', buttonLike };
|
|
126
|
+
}
|
|
127
|
+
if (el.hasAttribute('aria-current')) {
|
|
128
|
+
const raw = String(el.getAttribute('aria-current') ?? '').trim().toLowerCase();
|
|
129
|
+
return { source: 'aria-current', on: raw !== '' && raw !== 'false', buttonLike };
|
|
130
|
+
}
|
|
113
131
|
return { source: 'none', on: false, buttonLike };
|
|
114
132
|
}
|
|
115
133
|
|
|
@@ -132,11 +150,18 @@ const sleep = (ms: number): Promise<void> => new Promise((r) => setTimeout(r, ms
|
|
|
132
150
|
*/
|
|
133
151
|
const left = (deadline: number): number => Math.max(250, deadline - Date.now());
|
|
134
152
|
|
|
153
|
+
/** The sources that name an ATTRIBUTE the live state can be re-read from. */
|
|
154
|
+
type AttributeSource = 'aria-pressed' | 'aria-checked' | 'aria-selected' | 'aria-current';
|
|
155
|
+
|
|
135
156
|
/** Read the live state. A REMOVED attribute means off: `aria-pressed={on || undefined}` is a common
|
|
136
157
|
* React/Vue idiom, so requiring a literal "false" would fail a control that is correctly off. */
|
|
137
|
-
async function readOn(target: Locator, attr:
|
|
138
|
-
const raw = await target.getAttribute(attr, { timeout: left(deadline) });
|
|
139
|
-
|
|
158
|
+
async function readOn(target: Locator, attr: AttributeSource, deadline: number): Promise<boolean> {
|
|
159
|
+
const raw = String(await target.getAttribute(attr, { timeout: left(deadline) }) ?? '').trim().toLowerCase();
|
|
160
|
+
// `aria-current` is the one non-boolean of the four: the spec allows 'page', 'step', 'location',
|
|
161
|
+
// 'date', 'time' and 'true', so only the literal 'false' (or absence) means off. Read the other
|
|
162
|
+
// way round it would report the active nav item as OFF.
|
|
163
|
+
if (attr === 'aria-current') return raw !== '' && raw !== 'false';
|
|
164
|
+
return raw === 'true';
|
|
140
165
|
}
|
|
141
166
|
|
|
142
167
|
/**
|
|
@@ -238,12 +263,12 @@ export async function setCheckedState(
|
|
|
238
263
|
// Not pressable and publishes nothing — there is no reading of this that makes the step meaningful.
|
|
239
264
|
throw new Error(
|
|
240
265
|
`Cannot ${want ? 'check' : 'uncheck'} [${label}] — it is not a checkbox/radio/switch, is not a `
|
|
241
|
-
+ `button, and publishes no aria-pressed/aria-checked, so it has no on/off state to set. Point the `
|
|
266
|
+
+ `button, and publishes no aria-pressed/aria-checked/aria-selected/aria-current, so it has no on/off state to set. Point the `
|
|
242
267
|
+ `selector at the control itself, or give it a real ARIA toggle role.`,
|
|
243
268
|
);
|
|
244
269
|
}
|
|
245
270
|
|
|
246
|
-
const attr = probe.source;
|
|
271
|
+
const attr: AttributeSource = probe.source as AttributeSource;
|
|
247
272
|
// Already in the requested state → nothing to do. This is the idempotence `check` promises.
|
|
248
273
|
if (probe.on === want) return;
|
|
249
274
|
await target.click({ timeout });
|
|
@@ -42,18 +42,30 @@ interface LocaleInjection {
|
|
|
42
42
|
|
|
43
43
|
let cached: LocaleInjection | null | undefined;
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Absent config → null, and locale injection is simply off (the documented no-op).
|
|
47
|
+
*
|
|
48
|
+
* A config that EXISTS but does not parse is a different thing and must not read the same way: the
|
|
49
|
+
* header above tells you to hand-edit this file, and a trailing comma would otherwise turn a
|
|
50
|
+
* `SUNGEN_ENV=ja` run into a base-locale run that asserts base-locale strings — green, and wrong.
|
|
51
|
+
* We warn rather than throw, because the injection is genuinely optional and failing every test on
|
|
52
|
+
* it would be a larger change than the fault warrants; the line names the file and the consequence.
|
|
53
|
+
*/
|
|
45
54
|
function loadLocaleConfig(): LocaleInjection | null {
|
|
46
55
|
if (cached !== undefined) return cached;
|
|
56
|
+
const cfgPath = path.join(__dirname, 'locale-config.json');
|
|
57
|
+
if (!fs.existsSync(cfgPath)) {
|
|
58
|
+
cached = null;
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
47
61
|
try {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return parsed;
|
|
56
|
-
} catch {
|
|
62
|
+
cached = JSON.parse(fs.readFileSync(cfgPath, 'utf-8')) as LocaleInjection;
|
|
63
|
+
return cached;
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.error(
|
|
66
|
+
`⚠️ ${cfgPath}: unreadable (${e instanceof Error ? e.message.split('\n')[0] : String(e)}) — ` +
|
|
67
|
+
`locale state is NOT injected, so this SUNGEN_ENV run behaves as the base locale.`,
|
|
68
|
+
);
|
|
57
69
|
cached = null;
|
|
58
70
|
return null;
|
|
59
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-mock.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-mock.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;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AAI,EAAE,IAAI,GAAG,IAAI;IAMhC,yFAAyF;IACnF,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCzD;;2CAEuC;IACvC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQ3C;;6FAEyF;IACnF,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAUjD;;;;;sBAKkB;IAClB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAMpC;;;2FAGuF;IACjF,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAoBvC;AAED,eAAO,MAAM,IAAI,YAAmB,CAAC"}
|
|
@@ -55,10 +55,17 @@ class MockRouter {
|
|
|
55
55
|
st.counts.set(cfg.name, (st.counts.get(cfg.name) ?? 0) + 1);
|
|
56
56
|
if (cfg.delay_ms)
|
|
57
57
|
await new Promise((r) => setTimeout(r, cfg.delay_ms));
|
|
58
|
-
// A delayed
|
|
59
|
-
// not surface as an unhandled rejection from inside a route handler.
|
|
58
|
+
// A delayed response can race a page close / reset at teardown — that race must
|
|
59
|
+
// not surface as an unhandled rejection from inside a route handler. It wraps BOTH
|
|
60
|
+
// outcomes: an abort races teardown exactly like a fulfill does.
|
|
60
61
|
try {
|
|
61
|
-
|
|
62
|
+
// `abort` is the request that never reaches the server; `status` is the one the
|
|
63
|
+
// server answered. The catalog refuses an entry carrying both, so this is a real
|
|
64
|
+
// either/or, not a precedence rule (#676).
|
|
65
|
+
if (cfg.abort)
|
|
66
|
+
await route.abort(cfg.abort);
|
|
67
|
+
else
|
|
68
|
+
await route.fulfill({ status: cfg.status, headers: cfg.headers, body: cfg.body });
|
|
62
69
|
}
|
|
63
70
|
catch { /* page closing */ }
|
|
64
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-mock.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-mock.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"specs-mock.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-mock.ts"],"names":[],"mappings":";;;AAqDA;;oFAEoF;AACpF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAEhD,MAAM,UAAU;IAAhB;QACU,UAAK,GAAG,IAAI,OAAO,EAAmB,CAAC;IA6HjD,CAAC;IA3HS,QAAQ,CAAC,IAAU;QACzB,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,oBAAoB,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;YAC9K,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;;;gDAK4C;IAC5C,cAAc,CAAC,IAAU;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC/B,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;QACtB,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,yFAAyF;IACzF,KAAK,CAAC,OAAO,CAAC,IAAU,EAAE,GAAe;QACvC,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC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CAAC,CAAC;QAChC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,EAAE,CAAC,oBAAoB,GAAG,CAAC,EAAE,CAAC;YAChC,kFAAkF;YAClF,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;gBAC1B,IAAI,CAAC;oBAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;gBAAC,CAAC;gBAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;YACvF,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACxB,OAAO;QACT,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACzD,IAAI,CAAC;gBAAC,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;QACvF,CAAC;QACD,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,oBAAoB,CAAC;QAC3C,EAAE,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC;QAC3C,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QACzB,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC;IACzB,CAAC;CACF;AAEY,QAAA,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -25,7 +25,8 @@ export interface MockConfig {
|
|
|
25
25
|
name: string;
|
|
26
26
|
method: string; // HTTP verb or '*'
|
|
27
27
|
url: string; // page.route glob, or 're:<pattern>' for a regex
|
|
28
|
-
status
|
|
28
|
+
status?: number; // the server ANSWERED — absent exactly when `abort` is set
|
|
29
|
+
abort?: string; // the request NEVER ARRIVED — a route.abort() errorCode
|
|
29
30
|
headers?: Record<string, string>;
|
|
30
31
|
body?: string; // pre-serialized by the compiler (JSON string)
|
|
31
32
|
delay_ms?: number;
|
|
@@ -104,9 +105,16 @@ class MockRouter {
|
|
|
104
105
|
if (cfg.method !== '*' && route.request().method() !== cfg.method) return route.fallback();
|
|
105
106
|
st.counts.set(cfg.name, (st.counts.get(cfg.name) ?? 0) + 1);
|
|
106
107
|
if (cfg.delay_ms) await new Promise((r) => setTimeout(r, cfg.delay_ms));
|
|
107
|
-
// A delayed
|
|
108
|
-
// not surface as an unhandled rejection from inside a route handler.
|
|
109
|
-
|
|
108
|
+
// A delayed response can race a page close / reset at teardown — that race must
|
|
109
|
+
// not surface as an unhandled rejection from inside a route handler. It wraps BOTH
|
|
110
|
+
// outcomes: an abort races teardown exactly like a fulfill does.
|
|
111
|
+
try {
|
|
112
|
+
// `abort` is the request that never reaches the server; `status` is the one the
|
|
113
|
+
// server answered. The catalog refuses an entry carrying both, so this is a real
|
|
114
|
+
// either/or, not a precedence rule (#676).
|
|
115
|
+
if (cfg.abort) await route.abort(cfg.abort);
|
|
116
|
+
else await route.fulfill({ status: cfg.status, headers: cfg.headers, body: cfg.body });
|
|
117
|
+
} catch { /* page closing */ }
|
|
110
118
|
};
|
|
111
119
|
await page.route(pattern, handler);
|
|
112
120
|
st.routes.push({ pattern, handler });
|
|
Binary file
|
|
@@ -42,6 +42,16 @@ export interface UrlExpectation {
|
|
|
42
42
|
declared?: string;
|
|
43
43
|
/** The test-data key behind `declared`, so a failure can name what an author must go fix. */
|
|
44
44
|
dataRef?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The page selector declared `query: any` — the query string is not part of this page's identity,
|
|
47
|
+
* so SILENCE from the step stops meaning "there must be no query" (#748).
|
|
48
|
+
*
|
|
49
|
+
* Emitted only for a page whose entry says so. The default stays strict: a bare page means a bare
|
|
50
|
+
* page, which is the #464 assertion and the reason a filter regression cannot read as green.
|
|
51
|
+
* It is the no-`dataRef` branch alone that this relaxes — a step that declares `with {{v}}` still
|
|
52
|
+
* asserts every param it names, on this page as on any other.
|
|
53
|
+
*/
|
|
54
|
+
ignoreQuery?: boolean;
|
|
45
55
|
}
|
|
46
56
|
/**
|
|
47
57
|
* Join a page's URL with the `with {{v}}` value for a NAVIGATION step
|
|
@@ -73,8 +83,14 @@ export declare function joinPath(base: string, path: string, declared?: string |
|
|
|
73
83
|
* tracking/UTM param the test never cared about cannot turn it red.
|
|
74
84
|
* A declared fragment is asserted too; a declared value carrying no query
|
|
75
85
|
* at all constrains the path only (the compiler warns: SG-W014).
|
|
86
|
+
*
|
|
87
|
+
* `query: any` on the page's selector entry overrides the FIRST rule only (#748): silence then
|
|
88
|
+
* means "the query is not mine to judge" instead of "there must be none". It is the escape hatch
|
|
89
|
+
* for a page whose query is generated at run time — `/admins/detail?id=<the row just clicked>` —
|
|
90
|
+
* which the strict rule makes unassertable and `with {{v}}` cannot express, since that asserts a
|
|
91
|
+
* literal. The second rule is untouched: declare params and they are still all checked.
|
|
76
92
|
*/
|
|
77
|
-
export declare function urlMatches({ pathname, hostname, declared, dataRef }: UrlExpectation): (u: URL) => boolean;
|
|
93
|
+
export declare function urlMatches({ pathname, hostname, declared, dataRef, ignoreQuery }: UrlExpectation): (u: URL) => boolean;
|
|
78
94
|
/** What `settleAndHold` needs of a page — Playwright's `Page` satisfies it; so does a test fake. */
|
|
79
95
|
type SettleablePage = {
|
|
80
96
|
url(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-url-assert.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-url-assert.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IAC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M,CAAA;CAAE;AAgDlE;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,cAAc,EAC3B,IAAI,GAAE,UAAU,GAAG;IAAE,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GACtF,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,cAAc,GAAG;IAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAC3G,WAAW,EAAE,cAAc,EAC3B,IAAI,GAAE,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GACtG,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -93,8 +93,14 @@ function locationMatches(pathname, hostname, u) {
|
|
|
93
93
|
* tracking/UTM param the test never cared about cannot turn it red.
|
|
94
94
|
* A declared fragment is asserted too; a declared value carrying no query
|
|
95
95
|
* at all constrains the path only (the compiler warns: SG-W014).
|
|
96
|
+
*
|
|
97
|
+
* `query: any` on the page's selector entry overrides the FIRST rule only (#748): silence then
|
|
98
|
+
* means "the query is not mine to judge" instead of "there must be none". It is the escape hatch
|
|
99
|
+
* for a page whose query is generated at run time — `/admins/detail?id=<the row just clicked>` —
|
|
100
|
+
* which the strict rule makes unassertable and `with {{v}}` cannot express, since that asserts a
|
|
101
|
+
* literal. The second rule is untouched: declare params and they are still all checked.
|
|
96
102
|
*/
|
|
97
|
-
function urlMatches({ pathname, hostname, declared, dataRef }) {
|
|
103
|
+
function urlMatches({ pathname, hostname, declared, dataRef, ignoreQuery }) {
|
|
98
104
|
return (u) => {
|
|
99
105
|
if (!locationMatches(pathname, hostname, u))
|
|
100
106
|
return false;
|
|
@@ -103,8 +109,14 @@ function urlMatches({ pathname, hostname, declared, dataRef }) {
|
|
|
103
109
|
// undefined, and they mean opposite things: the first is a real assertion (a bare page must be
|
|
104
110
|
// bare), the second is broken test-data. Only the generator knows which, and it says so by
|
|
105
111
|
// emitting `dataRef` exactly when the step carried a `with {{v}}`.
|
|
112
|
+
// `query: any` on the page entry (#748): the query is not part of this page's identity, so
|
|
113
|
+
// silence from the step is not an assertion about it. Without this there is NO way to express
|
|
114
|
+
// "this path, whatever the query" — `with {{v}}` asserts a LITERAL value, and a detail page
|
|
115
|
+
// keyed by `?id=<the row just clicked>` has no literal to declare. Checked before the bare-page
|
|
116
|
+
// rule, never instead of the declared-value rule below: a step that names params still asserts
|
|
117
|
+
// them here exactly as anywhere else.
|
|
106
118
|
if (!dataRef)
|
|
107
|
-
return u.search === '';
|
|
119
|
+
return ignoreQuery ? true : u.search === '';
|
|
108
120
|
// Silence is the whole bug class this assertion exists to kill, so an unusable declared value
|
|
109
121
|
// is an ERROR, not a quiet verdict. Returning false would read as "the app is wrong"; these
|
|
110
122
|
// throws say "your test-data is wrong, and here is the key". An empty value used to parse to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specs-url-assert.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-url-assert.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;;;;;;;;;;;;;;;GAkBG;;
|
|
1
|
+
{"version":3,"file":"specs-url-assert.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-url-assert.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;;;;;;;;;;;;;;;GAkBG;;AA4DH,4BAYC;AAyCD,gCA6CC;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