qa360 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -262
- package/{cli/dist → dist}/commands/ai.js +1 -1
- package/{cli/dist → dist}/commands/coverage.js +1 -1
- package/{cli/dist → dist}/commands/crawl.js +2 -2
- package/{cli/dist → dist}/commands/doctor.js +2 -2
- package/{cli/dist → dist}/commands/explain.js +2 -2
- package/{cli/dist → dist}/commands/flakiness.js +1 -1
- package/{cli/dist → dist}/commands/generate.js +1 -1
- package/{cli/dist → dist}/commands/history.js +1 -1
- package/{cli/dist → dist}/commands/monitor.js +3 -3
- package/{cli/dist → dist}/commands/ollama.js +1 -1
- package/{cli/dist → dist}/commands/pack.js +2 -2
- package/{cli/dist → dist}/commands/regression.js +1 -1
- package/{cli/dist → dist}/commands/repair.js +1 -1
- package/{cli/dist → dist}/commands/retry.js +1 -1
- package/{cli/dist → dist}/commands/run.d.ts +1 -1
- package/{cli/dist → dist}/commands/run.js +1 -1
- package/{cli/dist → dist}/commands/secrets.js +1 -1
- package/{cli/dist → dist}/commands/serve.js +1 -1
- package/{cli/dist → dist}/commands/slo.js +1 -1
- package/{cli/dist → dist}/commands/verify.js +1 -1
- package/{cli/dist → dist}/core/adapters/playwright-native-api.d.ts +2 -0
- package/{cli/dist → dist}/core/adapters/playwright-native-api.js +20 -1
- package/{cli/dist → dist}/core/adapters/playwright-ui.d.ts +21 -0
- package/dist/core/adapters/playwright-ui.js +2050 -0
- package/{cli/dist → dist}/core/ai/ollama-provider.js +15 -3
- package/{cli/dist → dist}/core/artifacts/ui-artifacts.js +24 -4
- package/dist/core/auth/backup-codes-provider.d.ts +91 -0
- package/dist/core/auth/backup-codes-provider.js +215 -0
- package/{cli/dist → dist}/core/auth/basic-auth-provider.d.ts +6 -0
- package/{cli/dist → dist}/core/auth/basic-auth-provider.js +24 -6
- package/dist/core/auth/digest-auth-provider.d.ts +116 -0
- package/dist/core/auth/digest-auth-provider.js +244 -0
- package/dist/core/auth/hcaptcha-handler.d.ts +103 -0
- package/dist/core/auth/hcaptcha-handler.js +288 -0
- package/{cli/dist → dist}/core/auth/index.d.ts +81 -4
- package/{cli/dist → dist}/core/auth/index.js +15 -1
- package/dist/core/auth/oauth-handler.d.ts +408 -0
- package/dist/core/auth/oauth-handler.js +636 -0
- package/{cli/dist → dist}/core/auth/oauth2-provider.d.ts +9 -0
- package/dist/core/auth/oauth2-provider.js +227 -0
- package/dist/core/auth/otp-provider.d.ts +93 -0
- package/dist/core/auth/otp-provider.js +288 -0
- package/dist/core/auth/recaptcha-handler.d.ts +119 -0
- package/dist/core/auth/recaptcha-handler.js +301 -0
- package/dist/core/auth/remember-me-handler.d.ts +142 -0
- package/dist/core/auth/remember-me-handler.js +255 -0
- package/dist/core/auth/saml-handler.d.ts +173 -0
- package/dist/core/auth/saml-handler.js +364 -0
- package/dist/core/auth/webauthn-handler.d.ts +182 -0
- package/dist/core/auth/webauthn-handler.js +310 -0
- package/dist/core/crawler/advanced-interactions.d.ts +342 -0
- package/dist/core/crawler/advanced-interactions.js +1069 -0
- package/dist/core/crawler/blob-url-download-handler.d.ts +145 -0
- package/dist/core/crawler/blob-url-download-handler.js +392 -0
- package/dist/core/crawler/consent-handler.d.ts +49 -0
- package/dist/core/crawler/consent-handler.js +258 -0
- package/dist/core/crawler/cookie-manager.d.ts +166 -0
- package/dist/core/crawler/cookie-manager.js +353 -0
- package/dist/core/crawler/coop-coep-handler.d.ts +136 -0
- package/dist/core/crawler/coop-coep-handler.js +338 -0
- package/dist/core/crawler/csp-handler.d.ts +151 -0
- package/dist/core/crawler/csp-handler.js +415 -0
- package/dist/core/crawler/download-handler.d.ts +155 -0
- package/dist/core/crawler/download-handler.js +370 -0
- package/dist/core/crawler/email-testing-handler.d.ts +214 -0
- package/dist/core/crawler/email-testing-handler.js +398 -0
- package/dist/core/crawler/error-tracking-handler.d.ts +177 -0
- package/dist/core/crawler/error-tracking-handler.js +378 -0
- package/dist/core/crawler/form-handler.d.ts +100 -0
- package/dist/core/crawler/form-handler.js +465 -0
- package/dist/core/crawler/framework-wait-handler.d.ts +96 -0
- package/dist/core/crawler/framework-wait-handler.js +464 -0
- package/dist/core/crawler/geolocation-handler.d.ts +112 -0
- package/dist/core/crawler/geolocation-handler.js +276 -0
- package/dist/core/crawler/index.d.ts +78 -0
- package/{cli/dist → dist}/core/crawler/index.js +74 -1
- package/dist/core/crawler/intelligent-selector-generator.d.ts +164 -0
- package/dist/core/crawler/intelligent-selector-generator.js +612 -0
- package/{cli/dist → dist}/core/crawler/journey-generator.js +44 -1
- package/{cli/dist → dist}/core/crawler/page-analyzer.d.ts +16 -1
- package/{cli/dist → dist}/core/crawler/page-analyzer.js +469 -17
- package/dist/core/crawler/permissions-handler.d.ts +112 -0
- package/dist/core/crawler/permissions-handler.js +236 -0
- package/dist/core/crawler/permissions-policy-handler.d.ts +113 -0
- package/dist/core/crawler/permissions-policy-handler.js +402 -0
- package/dist/core/crawler/presets.d.ts +100 -0
- package/dist/core/crawler/presets.js +887 -0
- package/dist/core/crawler/repl-debug-handler.d.ts +105 -0
- package/dist/core/crawler/repl-debug-handler.js +552 -0
- package/dist/core/crawler/reporting-api-handler.d.ts +212 -0
- package/dist/core/crawler/reporting-api-handler.js +344 -0
- package/{cli/dist → dist}/core/crawler/selector-generator.d.ts +9 -0
- package/{cli/dist → dist}/core/crawler/selector-generator.js +99 -23
- package/dist/core/crawler/site-profiler.d.ts +89 -0
- package/dist/core/crawler/site-profiler.js +290 -0
- package/dist/core/crawler/sourcemaps-handler.d.ts +144 -0
- package/dist/core/crawler/sourcemaps-handler.js +420 -0
- package/dist/core/crawler/stacked-modals-handler.d.ts +118 -0
- package/dist/core/crawler/stacked-modals-handler.js +429 -0
- package/dist/core/crawler/trusted-types-handler.d.ts +149 -0
- package/dist/core/crawler/trusted-types-handler.js +413 -0
- package/{cli/dist → dist}/core/crawler/types.d.ts +68 -2
- package/dist/core/crawler/wait-strategies.d.ts +108 -0
- package/dist/core/crawler/wait-strategies.js +399 -0
- package/dist/core/fixtures/factories.d.ts +180 -0
- package/dist/core/fixtures/factories.js +279 -0
- package/dist/core/fixtures/index.d.ts +6 -0
- package/dist/core/fixtures/index.js +6 -0
- package/{cli/dist → dist}/core/generation/crawler-pack-generator.d.ts +13 -3
- package/dist/core/generation/crawler-pack-generator.js +232 -0
- package/{cli/dist → dist}/core/generation/index.d.ts +2 -0
- package/{cli/dist → dist}/core/generation/index.js +2 -0
- package/{cli/dist → dist}/core/index.d.ts +2 -0
- package/{cli/dist → dist}/core/index.js +4 -0
- package/dist/core/network/index.d.ts +7 -0
- package/dist/core/network/index.js +7 -0
- package/dist/core/network/network-manager.d.ts +237 -0
- package/dist/core/network/network-manager.js +343 -0
- package/dist/core/network/network-simulator.d.ts +158 -0
- package/dist/core/network/network-simulator.js +261 -0
- package/{cli/dist → dist}/core/pack/validator.js +2 -2
- package/{cli/dist → dist}/core/pack-v2/migrator.d.ts +5 -0
- package/{cli/dist → dist}/core/pack-v2/migrator.js +81 -6
- package/{cli/dist → dist}/core/pack-v2/validator.js +4 -3
- package/{cli/dist → dist}/core/pom/base-page.js +1 -1
- package/{cli/dist → dist}/core/pom/loader.js +1 -1
- package/dist/core/reporting/index.d.ts +9 -0
- package/dist/core/reporting/index.js +10 -0
- package/dist/core/reporting/junit-reporter.d.ts +114 -0
- package/dist/core/reporting/junit-reporter.js +306 -0
- package/{cli/dist → dist}/core/runner/e2e-helpers.d.ts +1 -1
- package/{cli/dist → dist}/core/runner/e2e-helpers.js +2 -2
- package/{cli/dist → dist}/core/runner/phase3-runner.d.ts +3 -0
- package/{cli/dist → dist}/core/runner/phase3-runner.js +45 -14
- package/dist/core/sharding/test-sharding.d.ts +137 -0
- package/dist/core/sharding/test-sharding.js +233 -0
- package/dist/core/storage/cookie-manager.d.ts +160 -0
- package/dist/core/storage/cookie-manager.js +268 -0
- package/dist/core/storage/index.d.ts +7 -0
- package/dist/core/storage/index.js +7 -0
- package/dist/core/storage/storage-helpers.d.ts +138 -0
- package/dist/core/storage/storage-helpers.js +315 -0
- package/dist/core/test-helpers/index.d.ts +6 -0
- package/dist/core/test-helpers/index.js +6 -0
- package/dist/core/test-helpers/state-reset.d.ts +119 -0
- package/dist/core/test-helpers/state-reset.js +234 -0
- package/{cli/dist → dist}/core/types/pack-v1.d.ts +15 -2
- package/{cli/dist → dist}/core/types/pack-v2.d.ts +1 -1
- package/dist/core/upload/chunked-uploader.d.ts +150 -0
- package/dist/core/upload/chunked-uploader.js +289 -0
- package/dist/core/upload/index.d.ts +11 -0
- package/dist/core/upload/index.js +8 -0
- package/dist/core/upload/mime-validator.d.ts +119 -0
- package/dist/core/upload/mime-validator.js +373 -0
- package/dist/core/upload/presigned-uploader.d.ts +118 -0
- package/dist/core/upload/presigned-uploader.js +274 -0
- package/dist/core/utils/device-emulation.d.ts +194 -0
- package/dist/core/utils/device-emulation.js +380 -0
- package/dist/core/utils/index.d.ts +8 -0
- package/dist/core/utils/index.js +8 -0
- package/dist/core/utils/retry.d.ts +145 -0
- package/dist/core/utils/retry.js +242 -0
- package/dist/core/utils/smart-wait.d.ts +133 -0
- package/dist/core/utils/smart-wait.js +417 -0
- package/dist/core/visual/index.d.ts +7 -0
- package/dist/core/visual/index.js +7 -0
- package/dist/core/visual/pixel-diff.d.ts +87 -0
- package/dist/core/visual/pixel-diff.js +213 -0
- package/dist/core/visual/screenshot-helper.d.ts +130 -0
- package/dist/core/visual/screenshot-helper.js +223 -0
- package/{cli/dist → dist}/utils/config.d.ts +1 -1
- package/examples/README.md +160 -0
- package/examples/accessibility.yml +48 -0
- package/examples/api-basic.yml +27 -0
- package/examples/complete.yml +146 -0
- package/examples/crawler.yml +38 -0
- package/examples/fullstack.yml +78 -0
- package/examples/security.yml +58 -0
- package/examples/ui-advanced.yml +49 -0
- package/examples/ui-basic.yml +24 -0
- package/package.json +33 -67
- package/CHANGELOG.md +0 -330
- package/CONTRIBUTING.md +0 -273
- package/QUICK_START.md +0 -191
- package/cli/CHANGELOG.md +0 -84
- package/cli/LICENSE +0 -24
- package/cli/README.md +0 -222
- package/cli/dist/core/adapters/playwright-ui.js +0 -864
- package/cli/dist/core/auth/oauth2-provider.js +0 -114
- package/cli/dist/core/coverage/analyzer.d.ts +0 -101
- package/cli/dist/core/coverage/analyzer.js +0 -415
- package/cli/dist/core/coverage/collector.d.ts +0 -74
- package/cli/dist/core/coverage/collector.js +0 -459
- package/cli/dist/core/coverage/config.d.ts +0 -37
- package/cli/dist/core/coverage/config.js +0 -156
- package/cli/dist/core/coverage/index.d.ts +0 -11
- package/cli/dist/core/coverage/index.js +0 -15
- package/cli/dist/core/coverage/types.d.ts +0 -267
- package/cli/dist/core/coverage/types.js +0 -6
- package/cli/dist/core/coverage/vault.d.ts +0 -95
- package/cli/dist/core/coverage/vault.js +0 -405
- package/cli/dist/core/crawler/index.d.ts +0 -57
- package/cli/dist/core/fixtures/index.d.ts +0 -8
- package/cli/dist/core/fixtures/index.js +0 -8
- package/cli/dist/core/generation/crawler-pack-generator.js +0 -231
- package/cli/dist/core/reporting/index.d.ts +0 -6
- package/cli/dist/core/reporting/index.js +0 -6
- package/cli/dist/core/visual/index.d.ts +0 -6
- package/cli/dist/core/visual/index.js +0 -6
- package/cli/package.json +0 -76
- package/core/LICENSE +0 -24
- package/core/README.md +0 -105
- package/core/package.json +0 -90
- package/core/schemas/pack.schema.json +0 -236
- /package/{cli/bin → bin}/qa360.js +0 -0
- /package/{cli/dist → dist}/cli-minimal.d.ts +0 -0
- /package/{cli/dist → dist}/cli-minimal.js +0 -0
- /package/{cli/dist → dist}/commands/ai.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ask.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ask.js +0 -0
- /package/{cli/dist → dist}/commands/coverage.d.ts +0 -0
- /package/{cli/dist → dist}/commands/crawl.d.ts +0 -0
- /package/{cli/dist → dist}/commands/doctor.d.ts +0 -0
- /package/{cli/dist → dist}/commands/examples.d.ts +0 -0
- /package/{cli/dist → dist}/commands/examples.js +0 -0
- /package/{cli/dist → dist}/commands/explain.d.ts +0 -0
- /package/{cli/dist → dist}/commands/flakiness.d.ts +0 -0
- /package/{cli/dist → dist}/commands/generate.d.ts +0 -0
- /package/{cli/dist → dist}/commands/history.d.ts +0 -0
- /package/{cli/dist → dist}/commands/init.d.ts +0 -0
- /package/{cli/dist → dist}/commands/init.js +0 -0
- /package/{cli/dist → dist}/commands/monitor.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ollama.d.ts +0 -0
- /package/{cli/dist → dist}/commands/pack.d.ts +0 -0
- /package/{cli/dist → dist}/commands/regression.d.ts +0 -0
- /package/{cli/dist → dist}/commands/repair.d.ts +0 -0
- /package/{cli/dist → dist}/commands/report.d.ts +0 -0
- /package/{cli/dist → dist}/commands/report.js +0 -0
- /package/{cli/dist → dist}/commands/retry.d.ts +0 -0
- /package/{cli/dist → dist}/commands/scan.d.ts +0 -0
- /package/{cli/dist → dist}/commands/scan.js +0 -0
- /package/{cli/dist → dist}/commands/secrets.d.ts +0 -0
- /package/{cli/dist → dist}/commands/serve.d.ts +0 -0
- /package/{cli/dist → dist}/commands/slo.d.ts +0 -0
- /package/{cli/dist → dist}/commands/verify.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.js +0 -0
- /package/{cli/dist → dist}/core/adapters/jest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/jest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/k6-perf.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/k6-perf.js +0 -0
- /package/{cli/dist → dist}/core/adapters/osv-deps.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/osv-deps.js +0 -0
- /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/pytest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/pytest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/semgrep-sast.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/semgrep-sast.js +0 -0
- /package/{cli/dist → dist}/core/adapters/unit-test-types.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/unit-test-types.js +0 -0
- /package/{cli/dist → dist}/core/adapters/vitest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/vitest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/zap-dast.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/zap-dast.js +0 -0
- /package/{cli/dist → dist}/core/ai/anthropic-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/anthropic-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/deepseek-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/deepseek-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/index.js +0 -0
- /package/{cli/dist → dist}/core/ai/llm-client.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/llm-client.js +0 -0
- /package/{cli/dist → dist}/core/ai/mock-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/mock-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/ollama-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/openai-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/openai-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/provider-factory.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/provider-factory.js +0 -0
- /package/{cli/dist → dist}/core/artifacts/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/artifacts/index.js +0 -0
- /package/{cli/dist → dist}/core/artifacts/ui-artifacts.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/engine.js +0 -0
- /package/{cli/dist → dist}/core/assertions/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/index.js +0 -0
- /package/{cli/dist → dist}/core/assertions/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/types.js +0 -0
- /package/{cli/dist → dist}/core/auth/api-key-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/api-key-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/aws-iam-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/aws-iam-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/azure-ad-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/azure-ad-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/gcp-adc-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/gcp-adc-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/jwt-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/jwt-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/manager.js +0 -0
- /package/{cli/dist → dist}/core/auth/totp-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/totp-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/ui-login-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/ui-login-provider.js +0 -0
- /package/{cli/dist → dist}/core/cache/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/cache/index.js +0 -0
- /package/{cli/dist → dist}/core/cache/lru-cache.d.ts +0 -0
- /package/{cli/dist → dist}/core/cache/lru-cache.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/analyzer.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/analyzer.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/collector.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/collector.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/config.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/config.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/index.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/index.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/types.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/types.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/vault.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/vault.js +0 -0
- /package/{cli/dist → dist}/core/crawler/journey-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/crawler/types.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/assets.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/assets.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/index.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/server.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/server.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/types.js +0 -0
- /package/{cli/dist → dist}/core/discoverer/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/discoverer/index.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/loader.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/resolver.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/resolver.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/types.js +0 -0
- /package/{cli/dist → dist}/core/flakiness/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/flakiness/index.js +0 -0
- /package/{cli/dist → dist}/core/generation/code-formatter.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/code-formatter.js +0 -0
- /package/{cli/dist → dist}/core/generation/code-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/code-generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/pack-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/pack-generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/prompt-builder.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/prompt-builder.js +0 -0
- /package/{cli/dist → dist}/core/generation/source-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/source-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/generation/test-optimizer.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/test-optimizer.js +0 -0
- /package/{cli/dist → dist}/core/generation/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/types.js +0 -0
- /package/{cli/dist → dist}/core/hooks/compose.d.ts +0 -0
- /package/{cli/dist → dist}/core/hooks/compose.js +0 -0
- /package/{cli/dist → dist}/core/hooks/runner.d.ts +0 -0
- /package/{cli/dist → dist}/core/hooks/runner.js +0 -0
- /package/{cli/dist → dist}/core/pack/migrator.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack/migrator.js +0 -0
- /package/{cli/dist → dist}/core/pack/validator.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/index.js +0 -0
- /package/{cli/dist → dist}/core/pack-v2/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/loader.js +0 -0
- /package/{cli/dist → dist}/core/pack-v2/validator.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/index.js +0 -0
- /package/{cli/dist → dist}/core/parallel/parallel-runner.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/parallel-runner.js +0 -0
- /package/{cli/dist → dist}/core/pom/base-page.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/index.js +0 -0
- /package/{cli/dist → dist}/core/pom/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/types.js +0 -0
- /package/{cli/dist → dist}/core/proof/bundle.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/bundle.js +0 -0
- /package/{cli/dist → dist}/core/proof/canonicalize.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/canonicalize.js +0 -0
- /package/{cli/dist → dist}/core/proof/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/index.js +0 -0
- /package/{cli/dist → dist}/core/proof/schema.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/schema.js +0 -0
- /package/{cli/dist → dist}/core/proof/signer.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/signer.js +0 -0
- /package/{cli/dist → dist}/core/proof/verifier.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/verifier.js +0 -0
- /package/{cli/dist → dist}/core/regression/detector.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/detector.js +0 -0
- /package/{cli/dist → dist}/core/regression/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/index.js +0 -0
- /package/{cli/dist → dist}/core/regression/trend-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/trend-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/regression/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/types.js +0 -0
- /package/{cli/dist → dist}/core/regression/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/vault.js +0 -0
- /package/{cli/dist → dist}/core/repair/engine/fixer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/engine/fixer.js +0 -0
- /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.js +0 -0
- /package/{cli/dist → dist}/core/repair/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/index.js +0 -0
- /package/{cli/dist → dist}/core/repair/repairer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/repairer.js +0 -0
- /package/{cli/dist → dist}/core/repair/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/types.js +0 -0
- /package/{cli/dist → dist}/core/repair/utils/error-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/utils/error-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/reporting/html-reporter.d.ts +0 -0
- /package/{cli/dist → dist}/core/reporting/html-reporter.js +0 -0
- /package/{cli/dist → dist}/core/retry/flakiness-integration.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/flakiness-integration.js +0 -0
- /package/{cli/dist → dist}/core/retry/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/index.js +0 -0
- /package/{cli/dist → dist}/core/retry/retry-engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/retry-engine.js +0 -0
- /package/{cli/dist → dist}/core/retry/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/types.js +0 -0
- /package/{cli/dist → dist}/core/retry/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/vault.js +0 -0
- /package/{cli/dist → dist}/core/schemas/pack.schema.json +0 -0
- /package/{cli/dist → dist}/core/secrets/crypto.d.ts +0 -0
- /package/{cli/dist → dist}/core/secrets/crypto.js +0 -0
- /package/{cli/dist → dist}/core/secrets/manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/secrets/manager.js +0 -0
- /package/{cli/dist → dist}/core/security/redaction-patterns-extended.d.ts +0 -0
- /package/{cli/dist → dist}/core/security/redaction-patterns-extended.js +0 -0
- /package/{cli/dist → dist}/core/security/redactor.d.ts +0 -0
- /package/{cli/dist → dist}/core/security/redactor.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/assertion-healer.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/assertion-healer.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/engine.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/index.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/selector-healer.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/selector-healer.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/types.js +0 -0
- /package/{cli/dist → dist}/core/serve/diagnostics-collector.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/diagnostics-collector.js +0 -0
- /package/{cli/dist → dist}/core/serve/health-checker.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/health-checker.js +0 -0
- /package/{cli/dist → dist}/core/serve/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/index.js +0 -0
- /package/{cli/dist → dist}/core/serve/metrics-collector.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/metrics-collector.js +0 -0
- /package/{cli/dist → dist}/core/serve/process-manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/process-manager.js +0 -0
- /package/{cli/dist → dist}/core/serve/server.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/server.js +0 -0
- /package/{cli/dist → dist}/core/slo/config.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/config.js +0 -0
- /package/{cli/dist → dist}/core/slo/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/index.js +0 -0
- /package/{cli/dist → dist}/core/slo/sli-calculator.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/sli-calculator.js +0 -0
- /package/{cli/dist → dist}/core/slo/slo-tracker.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/slo-tracker.js +0 -0
- /package/{cli/dist → dist}/core/slo/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/types.js +0 -0
- /package/{cli/dist → dist}/core/slo/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/vault.js +0 -0
- /package/{cli/dist → dist}/core/tui/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/index.js +0 -0
- /package/{cli/dist → dist}/core/tui/monitor.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/monitor.js +0 -0
- /package/{cli/dist → dist}/core/tui/renderer.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/renderer.js +0 -0
- /package/{cli/dist → dist}/core/tui/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/types.js +0 -0
- /package/{cli/dist → dist}/core/types/pack-v1.js +0 -0
- /package/{cli/dist → dist}/core/types/pack-v2.js +0 -0
- /package/{cli/dist → dist}/core/types/trust-score.d.ts +0 -0
- /package/{cli/dist → dist}/core/types/trust-score.js +0 -0
- /package/{cli/dist → dist}/core/vault/cas.d.ts +0 -0
- /package/{cli/dist → dist}/core/vault/cas.js +0 -0
- /package/{cli/dist → dist}/core/vault/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/vault/index.js +0 -0
- /package/{cli/dist → dist}/core/visual/visual-regression.d.ts +0 -0
- /package/{cli/dist → dist}/core/visual/visual-regression.js +0 -0
- /package/{cli/dist → dist}/core/watch/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/watch/index.js +0 -0
- /package/{cli/dist → dist}/core/watch/watch-mode.d.ts +0 -0
- /package/{cli/dist → dist}/core/watch/watch-mode.js +0 -0
- /package/{cli/dist → dist}/generators/index.d.ts +0 -0
- /package/{cli/dist → dist}/generators/index.js +0 -0
- /package/{cli/dist → dist}/generators/json-reporter.d.ts +0 -0
- /package/{cli/dist → dist}/generators/json-reporter.js +0 -0
- /package/{cli/dist → dist}/generators/test-generator.d.ts +0 -0
- /package/{cli/dist → dist}/generators/test-generator.js +0 -0
- /package/{cli/dist → dist}/index.d.ts +0 -0
- /package/{cli/dist → dist}/index.js +0 -0
- /package/{cli/dist → dist}/scanners/dom-scanner.d.ts +0 -0
- /package/{cli/dist → dist}/scanners/dom-scanner.js +0 -0
- /package/{cli/dist → dist}/scanners/index.d.ts +0 -0
- /package/{cli/dist → dist}/scanners/index.js +0 -0
- /package/{cli/dist → dist}/schemas/pack.schema.json +0 -0
- /package/{cli/dist → dist}/types/scan.d.ts +0 -0
- /package/{cli/dist → dist}/types/scan.js +0 -0
- /package/{cli/dist → dist}/utils/config.js +0 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geo-Location Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Mock geolocation for testing
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - Set custom geolocation
|
|
8
|
+
* - Common city presets
|
|
9
|
+
* - Geolocation permission handling
|
|
10
|
+
* - Coordinate precision control
|
|
11
|
+
*
|
|
12
|
+
* @see https://playwright.dev/docs/emulation
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Common city presets for testing
|
|
16
|
+
*/
|
|
17
|
+
export const CITIES = {
|
|
18
|
+
'paris': {
|
|
19
|
+
latitude: 48.8566,
|
|
20
|
+
longitude: 2.3522,
|
|
21
|
+
accuracy: 100,
|
|
22
|
+
},
|
|
23
|
+
'new-york': {
|
|
24
|
+
latitude: 40.7128,
|
|
25
|
+
longitude: -74.0060,
|
|
26
|
+
accuracy: 100,
|
|
27
|
+
},
|
|
28
|
+
'london': {
|
|
29
|
+
latitude: 51.5074,
|
|
30
|
+
longitude: -0.1278,
|
|
31
|
+
accuracy: 100,
|
|
32
|
+
},
|
|
33
|
+
'tokyo': {
|
|
34
|
+
latitude: 35.6762,
|
|
35
|
+
longitude: 139.6503,
|
|
36
|
+
accuracy: 100,
|
|
37
|
+
},
|
|
38
|
+
'sydney': {
|
|
39
|
+
latitude: -33.8688,
|
|
40
|
+
longitude: 151.2093,
|
|
41
|
+
accuracy: 100,
|
|
42
|
+
},
|
|
43
|
+
'berlin': {
|
|
44
|
+
latitude: 52.5200,
|
|
45
|
+
longitude: 13.4050,
|
|
46
|
+
accuracy: 100,
|
|
47
|
+
},
|
|
48
|
+
'san-francisco': {
|
|
49
|
+
latitude: 37.7749,
|
|
50
|
+
longitude: -122.4194,
|
|
51
|
+
accuracy: 100,
|
|
52
|
+
},
|
|
53
|
+
'singapore': {
|
|
54
|
+
latitude: 1.3521,
|
|
55
|
+
longitude: 103.8198,
|
|
56
|
+
accuracy: 100,
|
|
57
|
+
},
|
|
58
|
+
'dubai': {
|
|
59
|
+
latitude: 25.2048,
|
|
60
|
+
longitude: 55.2708,
|
|
61
|
+
accuracy: 100,
|
|
62
|
+
},
|
|
63
|
+
'moscow': {
|
|
64
|
+
latitude: 55.7558,
|
|
65
|
+
longitude: 37.6173,
|
|
66
|
+
accuracy: 100,
|
|
67
|
+
},
|
|
68
|
+
'sao-paulo': {
|
|
69
|
+
latitude: -23.5505,
|
|
70
|
+
longitude: -46.6333,
|
|
71
|
+
accuracy: 100,
|
|
72
|
+
},
|
|
73
|
+
'toronto': {
|
|
74
|
+
latitude: 43.6532,
|
|
75
|
+
longitude: -79.3832,
|
|
76
|
+
accuracy: 100,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Geo-Location Handler class
|
|
81
|
+
*/
|
|
82
|
+
export class GeoLocationHandler {
|
|
83
|
+
currentLocation;
|
|
84
|
+
grantPermissions;
|
|
85
|
+
constructor(config = {}) {
|
|
86
|
+
this.currentLocation = config.coordinates;
|
|
87
|
+
this.grantPermissions = config.grantPermissions !== false;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Set geolocation for a context/browser
|
|
91
|
+
*/
|
|
92
|
+
async setGeolocation(context, coordinates) {
|
|
93
|
+
this.validateCoordinates(coordinates);
|
|
94
|
+
await context.setGeolocation(coordinates);
|
|
95
|
+
this.currentLocation = coordinates;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Set geolocation by city preset
|
|
99
|
+
*/
|
|
100
|
+
async setGeolocationByCity(context, city) {
|
|
101
|
+
const cityName = city.toLowerCase().replace(/\s+/g, '-');
|
|
102
|
+
const coordinates = CITIES[cityName];
|
|
103
|
+
if (!coordinates) {
|
|
104
|
+
throw new Error(`Unknown city: ${city}. Available: ${Object.keys(CITIES).join(', ')}`);
|
|
105
|
+
}
|
|
106
|
+
await this.setGeolocation(context, coordinates);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Get current geolocation
|
|
110
|
+
*/
|
|
111
|
+
getCurrentLocation() {
|
|
112
|
+
return this.currentLocation;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Grant geolocation permission for a context
|
|
116
|
+
*/
|
|
117
|
+
async grantGeolocationPermission(context) {
|
|
118
|
+
await context.grantPermissions(['geolocation']);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Setup geolocation for a page (includes permission grant)
|
|
122
|
+
*/
|
|
123
|
+
async setup(context, coordinates) {
|
|
124
|
+
const coords = coordinates || this.currentLocation;
|
|
125
|
+
if (!coords) {
|
|
126
|
+
throw new Error('No coordinates provided. Use setGeolocation() first or pass coordinates.');
|
|
127
|
+
}
|
|
128
|
+
if (this.grantPermissions) {
|
|
129
|
+
await this.grantGeolocationPermission(context);
|
|
130
|
+
}
|
|
131
|
+
await this.setGeolocation(context, coords);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get geolocation from a page (what the page sees)
|
|
135
|
+
*/
|
|
136
|
+
async getPageGeolocation(page) {
|
|
137
|
+
return await page.evaluate(() => {
|
|
138
|
+
return new Promise((resolve) => {
|
|
139
|
+
if (!navigator.geolocation) {
|
|
140
|
+
resolve(null);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
navigator.geolocation.getCurrentPosition((position) => {
|
|
144
|
+
resolve({
|
|
145
|
+
latitude: position.coords.latitude,
|
|
146
|
+
longitude: position.coords.longitude,
|
|
147
|
+
accuracy: position.coords.accuracy,
|
|
148
|
+
altitude: position.coords.altitude || undefined,
|
|
149
|
+
altitudeAccuracy: position.coords.altitudeAccuracy || undefined,
|
|
150
|
+
heading: position.coords.heading || undefined,
|
|
151
|
+
speed: position.coords.speed || undefined,
|
|
152
|
+
});
|
|
153
|
+
}, () => {
|
|
154
|
+
resolve(null);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Watch geolocation changes on a page
|
|
161
|
+
*/
|
|
162
|
+
async watchGeolocation(page, callback) {
|
|
163
|
+
await page.evaluate((cb) => {
|
|
164
|
+
if (!navigator.geolocation) {
|
|
165
|
+
cb(null);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const watchId = navigator.geolocation.watchPosition((position) => {
|
|
169
|
+
cb({
|
|
170
|
+
latitude: position.coords.latitude,
|
|
171
|
+
longitude: position.coords.longitude,
|
|
172
|
+
accuracy: position.coords.accuracy,
|
|
173
|
+
altitude: position.coords.altitude || undefined,
|
|
174
|
+
altitudeAccuracy: position.coords.altitudeAccuracy || undefined,
|
|
175
|
+
heading: position.coords.heading || undefined,
|
|
176
|
+
speed: position.coords.speed || undefined,
|
|
177
|
+
});
|
|
178
|
+
}, () => {
|
|
179
|
+
cb(null);
|
|
180
|
+
});
|
|
181
|
+
return () => {
|
|
182
|
+
navigator.geolocation.clearWatch(watchId);
|
|
183
|
+
};
|
|
184
|
+
}, callback);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Set approximate location (reduced precision for privacy testing)
|
|
188
|
+
*/
|
|
189
|
+
async setApproximateLocation(context, coordinates, precision = 1000) {
|
|
190
|
+
// Add random jitter within precision radius
|
|
191
|
+
const randomAngle = Math.random() * 2 * Math.PI;
|
|
192
|
+
const randomDistance = Math.random() * precision;
|
|
193
|
+
// Approximate conversion: 1 degree ≈ 111km
|
|
194
|
+
const latOffset = (randomDistance * Math.sin(randomAngle)) / 111000;
|
|
195
|
+
const lonOffset = (randomDistance * Math.cos(randomAngle)) / (111000 * Math.cos(coordinates.latitude * Math.PI / 180));
|
|
196
|
+
await this.setGeolocation(context, {
|
|
197
|
+
...coordinates,
|
|
198
|
+
latitude: coordinates.latitude + latOffset,
|
|
199
|
+
longitude: coordinates.longitude + lonOffset,
|
|
200
|
+
accuracy: precision,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Simulate movement along a path
|
|
205
|
+
*/
|
|
206
|
+
async simulateMovement(context, from, to, steps = 10, intervalMs = 1000) {
|
|
207
|
+
const coordinates = [];
|
|
208
|
+
for (let i = 0; i <= steps; i++) {
|
|
209
|
+
const ratio = i / steps;
|
|
210
|
+
coordinates.push({
|
|
211
|
+
latitude: from.latitude + (to.latitude - from.latitude) * ratio,
|
|
212
|
+
longitude: from.longitude + (to.longitude - from.longitude) * ratio,
|
|
213
|
+
accuracy: Math.max(from.accuracy || 0, to.accuracy || 0),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return this.animateMovement(context, coordinates, intervalMs);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Animate movement through coordinates
|
|
220
|
+
*/
|
|
221
|
+
async animateMovement(context, coordinates, intervalMs = 1000) {
|
|
222
|
+
for (const coord of coordinates) {
|
|
223
|
+
await this.setGeolocation(context, coord);
|
|
224
|
+
await new Promise(resolve => setTimeout(resolve, intervalMs));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Validate coordinates
|
|
229
|
+
*/
|
|
230
|
+
validateCoordinates(coordinates) {
|
|
231
|
+
if (coordinates.latitude < -90 || coordinates.latitude > 90) {
|
|
232
|
+
throw new Error(`Invalid latitude: ${coordinates.latitude}. Must be between -90 and 90.`);
|
|
233
|
+
}
|
|
234
|
+
if (coordinates.longitude < -180 || coordinates.longitude > 180) {
|
|
235
|
+
throw new Error(`Invalid longitude: ${coordinates.longitude}. Must be between -180 and 180.`);
|
|
236
|
+
}
|
|
237
|
+
if (coordinates.accuracy !== undefined && coordinates.accuracy < 0) {
|
|
238
|
+
throw new Error(`Invalid accuracy: ${coordinates.accuracy}. Must be non-negative.`);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get distance between two coordinates (in meters)
|
|
243
|
+
*/
|
|
244
|
+
getDistance(from, to) {
|
|
245
|
+
const R = 6371e3; // Earth radius in meters
|
|
246
|
+
const φ1 = from.latitude * Math.PI / 180;
|
|
247
|
+
const φ2 = to.latitude * Math.PI / 180;
|
|
248
|
+
const Δφ = (to.latitude - from.latitude) * Math.PI / 180;
|
|
249
|
+
const Δλ = (to.longitude - from.longitude) * Math.PI / 180;
|
|
250
|
+
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
251
|
+
Math.cos(φ1) * Math.cos(φ2) *
|
|
252
|
+
Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
|
|
253
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
254
|
+
return R * c;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Get list of available cities
|
|
258
|
+
*/
|
|
259
|
+
getAvailableCities() {
|
|
260
|
+
return Object.keys(CITIES);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Get coordinates for a city
|
|
264
|
+
*/
|
|
265
|
+
getCityCoordinates(city) {
|
|
266
|
+
const cityName = city.toLowerCase().replace(/\s+/g, '-');
|
|
267
|
+
return CITIES[cityName];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Factory function to create Geo-Location Handler
|
|
272
|
+
*/
|
|
273
|
+
export function createGeoLocationHandler(config) {
|
|
274
|
+
return new GeoLocationHandler(config);
|
|
275
|
+
}
|
|
276
|
+
export default GeoLocationHandler;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Web Crawler
|
|
3
|
+
*
|
|
4
|
+
* Automatically discovers and analyzes web applications for E2E test generation
|
|
5
|
+
*/
|
|
6
|
+
import type { CrawlOptions, CrawlResult, PageDefinition, CrawlProgress, CrawlEventHandler } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Web Crawler class
|
|
9
|
+
*/
|
|
10
|
+
export declare class WebCrawler {
|
|
11
|
+
private options;
|
|
12
|
+
private eventHandler?;
|
|
13
|
+
private analyzer;
|
|
14
|
+
private visited;
|
|
15
|
+
private queue;
|
|
16
|
+
private pages;
|
|
17
|
+
private errors;
|
|
18
|
+
private warnings;
|
|
19
|
+
private startTime;
|
|
20
|
+
private readonly defaultOptions;
|
|
21
|
+
constructor(options: CrawlOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Set event handler for progress updates
|
|
24
|
+
*/
|
|
25
|
+
on(event: CrawlEventHandler): void;
|
|
26
|
+
/**
|
|
27
|
+
* Emit event to handler
|
|
28
|
+
*/
|
|
29
|
+
private emit;
|
|
30
|
+
/**
|
|
31
|
+
* Normalize URL for comparison
|
|
32
|
+
*/
|
|
33
|
+
private normalizeUrl;
|
|
34
|
+
/**
|
|
35
|
+
* Check if URL should be excluded
|
|
36
|
+
*/
|
|
37
|
+
private isExcluded;
|
|
38
|
+
/**
|
|
39
|
+
* Start crawling
|
|
40
|
+
*/
|
|
41
|
+
crawl(): Promise<CrawlResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Build site map from crawled pages
|
|
44
|
+
*/
|
|
45
|
+
private buildSiteMap;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Crawl a web application and return results
|
|
49
|
+
*/
|
|
50
|
+
export declare function crawlWebsite(options: CrawlOptions): Promise<CrawlResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Crawl a website with progress callback
|
|
53
|
+
*/
|
|
54
|
+
export declare function crawlWebsiteWithProgress(options: CrawlOptions, onProgress: (progress: CrawlProgress, page?: PageDefinition) => void): Promise<CrawlResult>;
|
|
55
|
+
export * from './types.js';
|
|
56
|
+
export { generateSelector, generateSelectorFromElement, generateIntelligentSelector, generateSelectorWithMetadata, initializeSelectorGenerator, getSiteProfile, getSelectorStrategy, SiteProfiler, analyzeSite, determineSiteProfile, isGeneratedId, isSemanticId, isUtilityClass, SELECTOR_STRATEGIES, } from './selector-generator.js';
|
|
57
|
+
export { generateJourneys } from './journey-generator.js';
|
|
58
|
+
export { AdvancedInteractionsHandler, createAdvancedInteractionsHandler, type ElementLocation, type FileUploadResult, type FileDownloadResult, type AdvancedInteractionsOptions, } from './advanced-interactions.js';
|
|
59
|
+
export { FormHandler, createFormHandler, type FormField, type FormData, type FormConfig, type FormFillData, type FormResult, } from './form-handler.js';
|
|
60
|
+
export { DownloadHandler, createDownloadHandler, type DownloadConfig, type DownloadInfo, type DownloadActionOptions, type DownloadVerification, type DownloadResult, } from './download-handler.js';
|
|
61
|
+
export { GeoLocationHandler, createGeoLocationHandler, type GeoCoordinates, type GeoLocationConfig, CITIES, } from './geolocation-handler.js';
|
|
62
|
+
export { PermissionsHandler, createPermissionsHandler, type PermissionType, type PermissionState, type PermissionConfig, type PermissionChange, PERMISSION_PRESETS, } from './permissions-handler.js';
|
|
63
|
+
export { WaitStrategies, createWaitStrategies, type WaitConfig, type NetworkIdleConfig, type StabilityConfig, type WaitResult, } from './wait-strategies.js';
|
|
64
|
+
export { CookieManager, createCookieManager, type CookieOptions, type CookieValidationResult, type CookieFilterOptions, } from './cookie-manager.js';
|
|
65
|
+
export { CSPHandler, createCSPHandler, type CSPDirective, type CPSPolicy, type CSPValidationResult, type CSPViolation, } from './csp-handler.js';
|
|
66
|
+
export { COOPCOEPHandler, createCOOPCOEPHandler, type COOPValue, type COEPValue, type COOPConfig, type COEPConfig, type CrossOriginIsolationStatus, } from './coop-coep-handler.js';
|
|
67
|
+
export { PermissionsPolicyHandler, createPermissionsPolicyHandler, type PermissionsPolicyFeature, type PermissionsPolicyDirective, type PermissionsPolicyResult, type PermissionsPolicyReport, } from './permissions-policy-handler.js';
|
|
68
|
+
export { TrustedTypesHandler, createTrustedTypesHandler, type TrustedTypesConfig, type TrustedTypePolicy, type XSSSink, type TrustedTypesReport, } from './trusted-types-handler.js';
|
|
69
|
+
export { SourceMapsHandler, createSourceMapsHandler, type SourceMapLocation, type SourceMapInfo, type MappedError, type SourceMapResult, } from './sourcemaps-handler.js';
|
|
70
|
+
export { ErrorTrackingHandler, createErrorTrackingHandler, type ErrorInfo, type ErrorGroup, type ResourceError, type ErrorReport, } from './error-tracking-handler.js';
|
|
71
|
+
export { ReportingAPIHandler, createReportingAPIHandler, type Report, type ReportType, type CSPViolationReport, type PermissionsPolicyViolationReport, type InterventionReport, type DeprecationReport, type ReportingEndpoint, type ReportingAPIConfig, type ReportingSummary, } from './reporting-api-handler.js';
|
|
72
|
+
export { FrameworkWaitHandler, createFrameworkWaitHandler, waitForFramework, type FrameworkWaitConfig, type FrameworkDetectionResult, type FrameworkWaitResult, } from './framework-wait-handler.js';
|
|
73
|
+
export { BlobURLDownloadHandler, createBlobURLDownloadHandler, type BlobDownloadConfig, type BlobDownloadInfo, type BlobDownloadResult, } from './blob-url-download-handler.js';
|
|
74
|
+
export { EmailTestingHandler, createEmailTestingHandler, waitForEmail, type EmailConfig, type EmailMessage, type EmailAttachment, type EmailSearchOptions, } from './email-testing-handler.js';
|
|
75
|
+
export { REPLDebugHandler, createREPLDebugHandler, startREPL, type REPLConfig, type REPLCommand, type REPLContext, } from './repl-debug-handler.js';
|
|
76
|
+
export { StackedModalsHandler, createStackedModalsHandler, type ModalInfo, type ModalHierarchy, type ModalActionOptions, } from './stacked-modals-handler.js';
|
|
77
|
+
export { detectPresetFromUrl, getAllPresets, getPreset, getPresetList, PRESETS, } from './presets.js';
|
|
78
|
+
export type { CrawlerPreset } from './presets.js';
|
|
@@ -67,6 +67,26 @@ export class WebCrawler {
|
|
|
67
67
|
*/
|
|
68
68
|
isExcluded(url) {
|
|
69
69
|
const normalized = this.normalizeUrl(url);
|
|
70
|
+
// Check onlyPatterns (Phase 1: if specified, only include URLs matching these patterns)
|
|
71
|
+
if (this.options.onlyPatterns && this.options.onlyPatterns.length > 0) {
|
|
72
|
+
let matchesOnlyPattern = false;
|
|
73
|
+
for (const pattern of this.options.onlyPatterns) {
|
|
74
|
+
try {
|
|
75
|
+
const regex = new RegExp(pattern);
|
|
76
|
+
if (regex.test(normalized) || regex.test(url)) {
|
|
77
|
+
matchesOnlyPattern = true;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Invalid regex, skip
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// If onlyPatterns is set but URL doesn't match any, exclude it
|
|
86
|
+
if (!matchesOnlyPattern) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
70
90
|
// Check exclude patterns
|
|
71
91
|
for (const pattern of this.options.excludePatterns || []) {
|
|
72
92
|
try {
|
|
@@ -84,11 +104,23 @@ export class WebCrawler {
|
|
|
84
104
|
/\.pdf$/,
|
|
85
105
|
/\.zip$/,
|
|
86
106
|
/\.jpg$/,
|
|
107
|
+
/\.jpeg$/,
|
|
87
108
|
/\.png$/,
|
|
88
109
|
/\.gif$/,
|
|
89
110
|
/\.svg$/,
|
|
111
|
+
/\.css$/, // Stylesheets
|
|
112
|
+
/\.js$/, // JavaScript files
|
|
113
|
+
/\.ico$/, // Favicons
|
|
114
|
+
/\.woff/,
|
|
115
|
+
/\.woff2$/,
|
|
116
|
+
/\.ttf$/,
|
|
117
|
+
/\.eot$/,
|
|
90
118
|
/\/api\//,
|
|
91
119
|
/\/graphql/,
|
|
120
|
+
/\/assets\//, // Asset directories
|
|
121
|
+
/\/static\//, // Static file directories
|
|
122
|
+
/\/_next\//, // Next.js internal
|
|
123
|
+
/\/_nuxt\//, // Nuxt.js internal
|
|
92
124
|
/mailto:/,
|
|
93
125
|
/tel:/,
|
|
94
126
|
'javascript:',
|
|
@@ -277,5 +309,46 @@ export async function crawlWebsiteWithProgress(options, onProgress) {
|
|
|
277
309
|
}
|
|
278
310
|
// Re-export types
|
|
279
311
|
export * from './types.js';
|
|
280
|
-
export
|
|
312
|
+
// Re-export selector generator (legacy + intelligent)
|
|
313
|
+
export { generateSelector, generateSelectorFromElement, generateIntelligentSelector, generateSelectorWithMetadata, initializeSelectorGenerator, getSiteProfile, getSelectorStrategy, SiteProfiler, analyzeSite, determineSiteProfile, isGeneratedId, isSemanticId, isUtilityClass, SELECTOR_STRATEGIES, } from './selector-generator.js';
|
|
281
314
|
export { generateJourneys } from './journey-generator.js';
|
|
315
|
+
// P0 Features: Advanced Interactions (Shadow DOM, Iframes, Files)
|
|
316
|
+
export { AdvancedInteractionsHandler, createAdvancedInteractionsHandler, } from './advanced-interactions.js';
|
|
317
|
+
// P1 Features: Form Handler
|
|
318
|
+
export { FormHandler, createFormHandler, } from './form-handler.js';
|
|
319
|
+
// P1 Features: Download Handler
|
|
320
|
+
export { DownloadHandler, createDownloadHandler, } from './download-handler.js';
|
|
321
|
+
// P1 Features: Geo-Location Handler
|
|
322
|
+
export { GeoLocationHandler, createGeoLocationHandler, CITIES, } from './geolocation-handler.js';
|
|
323
|
+
// P1 Features: Permissions Handler
|
|
324
|
+
export { PermissionsHandler, createPermissionsHandler, PERMISSION_PRESETS, } from './permissions-handler.js';
|
|
325
|
+
// P1 Features: Wait Strategies
|
|
326
|
+
export { WaitStrategies, createWaitStrategies, } from './wait-strategies.js';
|
|
327
|
+
// P1 Features: Cookie Manager
|
|
328
|
+
export { CookieManager, createCookieManager, } from './cookie-manager.js';
|
|
329
|
+
// P1 Features: CSP Handler
|
|
330
|
+
export { CSPHandler, createCSPHandler, } from './csp-handler.js';
|
|
331
|
+
// P1 Features: COOP/COEP Handler
|
|
332
|
+
export { COOPCOEPHandler, createCOOPCOEPHandler, } from './coop-coep-handler.js';
|
|
333
|
+
// P1 Features: Permissions Policy Handler
|
|
334
|
+
export { PermissionsPolicyHandler, createPermissionsPolicyHandler, } from './permissions-policy-handler.js';
|
|
335
|
+
// P1 Features: Trusted Types Handler
|
|
336
|
+
export { TrustedTypesHandler, createTrustedTypesHandler, } from './trusted-types-handler.js';
|
|
337
|
+
// P1 Features: Source Maps Handler
|
|
338
|
+
export { SourceMapsHandler, createSourceMapsHandler, } from './sourcemaps-handler.js';
|
|
339
|
+
// P1 Features: Error Tracking Handler
|
|
340
|
+
export { ErrorTrackingHandler, createErrorTrackingHandler, } from './error-tracking-handler.js';
|
|
341
|
+
// P1 Features: Reporting API Handler
|
|
342
|
+
export { ReportingAPIHandler, createReportingAPIHandler, } from './reporting-api-handler.js';
|
|
343
|
+
// P1 Features: Framework Wait Handler (React/Vue/Angular/Svelte/SolidJS)
|
|
344
|
+
export { FrameworkWaitHandler, createFrameworkWaitHandler, waitForFramework, } from './framework-wait-handler.js';
|
|
345
|
+
// P1 Features: Blob URL Download Handler
|
|
346
|
+
export { BlobURLDownloadHandler, createBlobURLDownloadHandler, } from './blob-url-download-handler.js';
|
|
347
|
+
// P1 Features: Email Testing Handler (Mailhog/Mailtrap/Mailgun/SendGrid)
|
|
348
|
+
export { EmailTestingHandler, createEmailTestingHandler, waitForEmail, } from './email-testing-handler.js';
|
|
349
|
+
// P1 Features: REPL Debug Handler
|
|
350
|
+
export { REPLDebugHandler, createREPLDebugHandler, startREPL, } from './repl-debug-handler.js';
|
|
351
|
+
// P1 Features: Stacked Modals Handler
|
|
352
|
+
export { StackedModalsHandler, createStackedModalsHandler, } from './stacked-modals-handler.js';
|
|
353
|
+
// Crawler Presets
|
|
354
|
+
export { detectPresetFromUrl, getAllPresets, getPreset, getPresetList, PRESETS, } from './presets.js';
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Intelligent Selector Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates optimal CSS selectors by adapting to the detected site profile.
|
|
5
|
+
* Follows Testing Library best practices with configurable strategies.
|
|
6
|
+
*
|
|
7
|
+
* Philosophy: "The more your tests resemble the way your software is used,
|
|
8
|
+
* the more confidence they can give you." - Kent C. Dodds
|
|
9
|
+
*/
|
|
10
|
+
import type { SiteAnalysis, SiteProfile } from './site-profiler.js';
|
|
11
|
+
/**
|
|
12
|
+
* Selector strategy tier definition
|
|
13
|
+
*/
|
|
14
|
+
export interface SelectorTier {
|
|
15
|
+
tier: number;
|
|
16
|
+
name: string;
|
|
17
|
+
fn: string;
|
|
18
|
+
weight: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Selector generation result with metadata
|
|
22
|
+
*/
|
|
23
|
+
export interface SelectorResult {
|
|
24
|
+
selector: string;
|
|
25
|
+
tier: number;
|
|
26
|
+
type: string;
|
|
27
|
+
weight: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Element information for selector generation
|
|
31
|
+
*/
|
|
32
|
+
export interface ElementInfo {
|
|
33
|
+
tagName?: string;
|
|
34
|
+
id?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
attributes?: Record<string, string>;
|
|
37
|
+
textContent?: string;
|
|
38
|
+
role?: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
value?: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Selector strategies by site profile
|
|
45
|
+
*
|
|
46
|
+
* Each profile has a different priority order (tiers) for selector generation.
|
|
47
|
+
* Higher tier = higher priority = checked first.
|
|
48
|
+
*/
|
|
49
|
+
declare const SELECTOR_STRATEGIES: Record<SiteProfile, SelectorTier[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if ID is auto-generated (NOT stable)
|
|
52
|
+
*/
|
|
53
|
+
export declare function isGeneratedId(id: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Check if ID is semantic (describes the PURPOSE)
|
|
56
|
+
*/
|
|
57
|
+
export declare function isSemanticId(id: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Check if class is a utility class (should be filtered out)
|
|
60
|
+
*/
|
|
61
|
+
export declare function isUtilityClass(cls: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Intelligent Selector Generator
|
|
64
|
+
*
|
|
65
|
+
* Adapts selector generation strategy based on detected site profile.
|
|
66
|
+
*/
|
|
67
|
+
export declare class IntelligentSelectorGenerator {
|
|
68
|
+
private siteProfile;
|
|
69
|
+
private siteAnalysis;
|
|
70
|
+
strategy: SelectorTier[] | null;
|
|
71
|
+
/**
|
|
72
|
+
* Initialize the generator with site analysis
|
|
73
|
+
*/
|
|
74
|
+
initialize(analysis: SiteAnalysis): void;
|
|
75
|
+
/**
|
|
76
|
+
* Get the current site profile
|
|
77
|
+
*/
|
|
78
|
+
getProfile(): SiteProfile | null;
|
|
79
|
+
/**
|
|
80
|
+
* Get the current strategy
|
|
81
|
+
*/
|
|
82
|
+
getStrategy(): SelectorTier[] | null;
|
|
83
|
+
/**
|
|
84
|
+
* Determine site profile from analysis
|
|
85
|
+
*/
|
|
86
|
+
private determineProfile;
|
|
87
|
+
/**
|
|
88
|
+
* Log the detected profile to console
|
|
89
|
+
*/
|
|
90
|
+
private logProfile;
|
|
91
|
+
/**
|
|
92
|
+
* Generate optimal selector for an element
|
|
93
|
+
*/
|
|
94
|
+
generateSelector(element: ElementInfo): SelectorResult;
|
|
95
|
+
/**
|
|
96
|
+
* Try to generate a selector for a specific type
|
|
97
|
+
*/
|
|
98
|
+
private trySelector;
|
|
99
|
+
/**
|
|
100
|
+
* TIER 1/7 - Get test ID selector
|
|
101
|
+
*/
|
|
102
|
+
private getTestIdSelector;
|
|
103
|
+
/**
|
|
104
|
+
* TIER 2/6 - Get role + name selector (ARIA)
|
|
105
|
+
*/
|
|
106
|
+
private getRoleNameSelector;
|
|
107
|
+
/**
|
|
108
|
+
* TIER 3 - Get label selector
|
|
109
|
+
*/
|
|
110
|
+
private getLabelSelector;
|
|
111
|
+
/**
|
|
112
|
+
* TIER 4 - Get placeholder selector
|
|
113
|
+
*/
|
|
114
|
+
private getPlaceholderSelector;
|
|
115
|
+
/**
|
|
116
|
+
* TIER 5/1 - Get text selector
|
|
117
|
+
*/
|
|
118
|
+
private getTextSelector;
|
|
119
|
+
/**
|
|
120
|
+
* TIER 6/4 - Get alt text selector (images)
|
|
121
|
+
*/
|
|
122
|
+
private getAltTextSelector;
|
|
123
|
+
/**
|
|
124
|
+
* TIER 7 - Get title selector
|
|
125
|
+
*/
|
|
126
|
+
private getTitleSelector;
|
|
127
|
+
/**
|
|
128
|
+
* TIER 8/1 - Get ID selector (semantic only)
|
|
129
|
+
*/
|
|
130
|
+
private getIdSelector;
|
|
131
|
+
/**
|
|
132
|
+
* TIER 2 - Get name selector (for forms)
|
|
133
|
+
*/
|
|
134
|
+
private getNameSelector;
|
|
135
|
+
/**
|
|
136
|
+
* TIER 4 - Get value selector (submit buttons, etc.)
|
|
137
|
+
*/
|
|
138
|
+
private getValueSelector;
|
|
139
|
+
/**
|
|
140
|
+
* TIER 9/7 - Get CSS selector (MAX 2 semantic classes)
|
|
141
|
+
*/
|
|
142
|
+
private getCssSelector;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Initialize the global generator with site analysis
|
|
146
|
+
*/
|
|
147
|
+
export declare function initializeSelectorGenerator(analysis: SiteAnalysis): void;
|
|
148
|
+
/**
|
|
149
|
+
* Generate optimal selector for an element (uses global instance)
|
|
150
|
+
*/
|
|
151
|
+
export declare function generateSelector(element: ElementInfo): string;
|
|
152
|
+
/**
|
|
153
|
+
* Generate selector with metadata (tier, type, weight)
|
|
154
|
+
*/
|
|
155
|
+
export declare function generateSelectorWithMetadata(element: ElementInfo): SelectorResult;
|
|
156
|
+
/**
|
|
157
|
+
* Get the current site profile
|
|
158
|
+
*/
|
|
159
|
+
export declare function getSiteProfile(): SiteProfile | null;
|
|
160
|
+
/**
|
|
161
|
+
* Get the current strategy
|
|
162
|
+
*/
|
|
163
|
+
export declare function getSelectorStrategy(): SelectorTier[] | null;
|
|
164
|
+
export { SELECTOR_STRATEGIES };
|