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,464 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework Wait Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Framework-aware waiting for SPA applications
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - React hydration waiting
|
|
8
|
+
* - React Suspense lazy loading
|
|
9
|
+
* - Vue nextTick / reactive updates
|
|
10
|
+
* - Angular zone.js stability
|
|
11
|
+
* - Svelte tick waiting
|
|
12
|
+
* - SolidJS fine-grained reactivity
|
|
13
|
+
*
|
|
14
|
+
* @see https://playwright.dev/docs/pom
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Framework Wait Handler class
|
|
18
|
+
*/
|
|
19
|
+
export class FrameworkWaitHandler {
|
|
20
|
+
defaultTimeout;
|
|
21
|
+
defaultInterval;
|
|
22
|
+
constructor(config = {}) {
|
|
23
|
+
this.defaultTimeout = config.timeout || 30000;
|
|
24
|
+
this.defaultInterval = config.interval || 100;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Detect which framework is running on the page
|
|
28
|
+
*/
|
|
29
|
+
async detectFramework(page) {
|
|
30
|
+
const result = await page.evaluate(() => {
|
|
31
|
+
const detection = {
|
|
32
|
+
framework: null,
|
|
33
|
+
confidence: 0,
|
|
34
|
+
};
|
|
35
|
+
// React detection
|
|
36
|
+
const reactRoot = document.querySelector('[data-reactroot]');
|
|
37
|
+
const reactRoot2 = document.querySelector('#root');
|
|
38
|
+
const reactRoot3 = document.querySelector('#app');
|
|
39
|
+
const reactAttributes = document.querySelectorAll('[data-react-check-sum]');
|
|
40
|
+
if (typeof window.React !== 'undefined' ||
|
|
41
|
+
typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' ||
|
|
42
|
+
reactRoot || reactAttributes.length > 0) {
|
|
43
|
+
detection.framework = 'react';
|
|
44
|
+
detection.confidence = 0.9;
|
|
45
|
+
// Try to get React version
|
|
46
|
+
const reactEl = document.querySelector('[data-reactroot], #root, #app');
|
|
47
|
+
if (reactEl && reactEl._reactRootContainer) {
|
|
48
|
+
detection.version = '18';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Vue detection
|
|
52
|
+
if (typeof window.Vue !== 'undefined' ||
|
|
53
|
+
typeof window.__VUE__ !== 'undefined') {
|
|
54
|
+
detection.framework = 'vue';
|
|
55
|
+
detection.confidence = 0.95;
|
|
56
|
+
if (window.Vue?.version) {
|
|
57
|
+
detection.version = window.Vue.version;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Angular detection
|
|
61
|
+
if (typeof window.ng !== 'undefined' ||
|
|
62
|
+
document.querySelector('[ng-version]')) {
|
|
63
|
+
detection.framework = 'angular';
|
|
64
|
+
detection.confidence = 0.95;
|
|
65
|
+
const ngApp = document.querySelector('[ng-version]');
|
|
66
|
+
if (ngApp) {
|
|
67
|
+
const version = ngApp.getAttribute('ng-version');
|
|
68
|
+
if (version)
|
|
69
|
+
detection.version = version;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Svelte detection
|
|
73
|
+
if (typeof window.__SVELTE__ !== 'undefined') {
|
|
74
|
+
detection.framework = 'svelte';
|
|
75
|
+
detection.confidence = 0.9;
|
|
76
|
+
}
|
|
77
|
+
// SolidJS detection
|
|
78
|
+
if (typeof window._$HY !== 'undefined' ||
|
|
79
|
+
typeof window.SolidJS !== 'undefined') {
|
|
80
|
+
detection.framework = 'solid';
|
|
81
|
+
detection.confidence = 0.9;
|
|
82
|
+
}
|
|
83
|
+
// Additional detection via global objects
|
|
84
|
+
if (!detection.framework) {
|
|
85
|
+
// Check for common framework-specific class names or attributes
|
|
86
|
+
const hasReactClasses = document.querySelectorAll('.css-1x, .chakra').length > 0;
|
|
87
|
+
const hasVueDirectives = document.querySelectorAll('[data-v-]').length > 0;
|
|
88
|
+
const hasAngularClasses = document.querySelectorAll('.ng-').length > 0;
|
|
89
|
+
if (hasReactClasses) {
|
|
90
|
+
detection.framework = 'react';
|
|
91
|
+
detection.confidence = 0.6;
|
|
92
|
+
}
|
|
93
|
+
else if (hasVueDirectives) {
|
|
94
|
+
detection.framework = 'vue';
|
|
95
|
+
detection.confidence = 0.6;
|
|
96
|
+
}
|
|
97
|
+
else if (hasAngularClasses) {
|
|
98
|
+
detection.framework = 'angular';
|
|
99
|
+
detection.confidence = 0.6;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return detection;
|
|
103
|
+
});
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Wait for React hydration to complete
|
|
108
|
+
*/
|
|
109
|
+
async waitForReactHydration(page, config = {}) {
|
|
110
|
+
const timeout = config.timeout || this.defaultTimeout;
|
|
111
|
+
const startTime = Date.now();
|
|
112
|
+
try {
|
|
113
|
+
await page.waitForFunction(() => {
|
|
114
|
+
// Check if React has finished hydrating
|
|
115
|
+
// Method 1: Check for __REACT_DEVTOOLS_GLOBAL_HOOK__
|
|
116
|
+
const devtools = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
117
|
+
if (devtools && devtools.renderers) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
// Method 2: Check for React roots
|
|
121
|
+
const roots = document.querySelectorAll('[data-reactroot], [data-reactid]');
|
|
122
|
+
if (roots.length > 0) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
// Method 3: Check if React is loaded and DOM is stable
|
|
126
|
+
if (typeof window.React !== 'undefined') {
|
|
127
|
+
// Check for common React app containers
|
|
128
|
+
const root = document.querySelector('#root, #app, [data-root]');
|
|
129
|
+
if (root && root.children.length > 0) {
|
|
130
|
+
// Check if the root has rendered content
|
|
131
|
+
return root.innerHTML.length > 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}, { timeout });
|
|
136
|
+
// Additional wait for Suspense boundaries
|
|
137
|
+
await this.waitForReactSuspense(page, {
|
|
138
|
+
timeout: Math.max(5000, timeout - (Date.now() - startTime))
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
success: true,
|
|
142
|
+
duration: Date.now() - startTime,
|
|
143
|
+
framework: 'react',
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
return {
|
|
148
|
+
success: false,
|
|
149
|
+
duration: Date.now() - startTime,
|
|
150
|
+
framework: 'react',
|
|
151
|
+
error: e instanceof Error ? e.message : 'React hydration timeout',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Wait for React Suspense lazy components to load
|
|
157
|
+
*/
|
|
158
|
+
async waitForReactSuspense(page, config = {}) {
|
|
159
|
+
const timeout = config.timeout || 10000;
|
|
160
|
+
const startTime = Date.now();
|
|
161
|
+
try {
|
|
162
|
+
await page.waitForFunction(() => {
|
|
163
|
+
// Check for Suspense fallbacks (loading states)
|
|
164
|
+
const suspenseFallbacks = document.querySelectorAll('[data-suspense], .suspense-fallback, [data-loading="true"]');
|
|
165
|
+
// Check for common loading patterns in React apps
|
|
166
|
+
const loadingElements = document.querySelectorAll('[data-testid="loading"], .loading, [aria-busy="true"]');
|
|
167
|
+
// If no loading states, consider Suspense resolved
|
|
168
|
+
return suspenseFallbacks.length === 0 && loadingElements.length === 0;
|
|
169
|
+
}, { timeout });
|
|
170
|
+
return {
|
|
171
|
+
success: true,
|
|
172
|
+
duration: Date.now() - startTime,
|
|
173
|
+
framework: 'react',
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
// Timeout is acceptable - loading states might just not exist
|
|
178
|
+
return {
|
|
179
|
+
success: true,
|
|
180
|
+
duration: Date.now() - startTime,
|
|
181
|
+
framework: 'react',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Wait for Vue nextTick and reactive updates to flush
|
|
187
|
+
*/
|
|
188
|
+
async waitForVueStable(page, config = {}) {
|
|
189
|
+
const timeout = config.timeout || this.defaultTimeout;
|
|
190
|
+
const startTime = Date.now();
|
|
191
|
+
try {
|
|
192
|
+
await page.waitForFunction(() => {
|
|
193
|
+
// Check if Vue is loaded
|
|
194
|
+
if (typeof window.Vue === 'undefined' &&
|
|
195
|
+
typeof window.__VUE__ === 'undefined') {
|
|
196
|
+
return true; // Not a Vue app, continue
|
|
197
|
+
}
|
|
198
|
+
// Wait for Vue's nextTick to complete
|
|
199
|
+
// Vue 3: check if __VUE__ is stable
|
|
200
|
+
const vue = window.Vue || window.__VUE__;
|
|
201
|
+
if (vue && vue.version) {
|
|
202
|
+
// Vue 3.x
|
|
203
|
+
if (vue.version.startsWith('3')) {
|
|
204
|
+
// In Vue 3, we check for pending updates
|
|
205
|
+
return document.readyState === 'complete';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// Vue 2.x - check for _watcher
|
|
209
|
+
return true;
|
|
210
|
+
}, { timeout });
|
|
211
|
+
// Additional wait for Vue component updates
|
|
212
|
+
await page.evaluate(() => {
|
|
213
|
+
return new Promise((resolve) => {
|
|
214
|
+
if (typeof window.Vue !== 'undefined' && window.Vue.nextTick) {
|
|
215
|
+
window.Vue.nextTick(resolve);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
resolve(undefined);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
return {
|
|
223
|
+
success: true,
|
|
224
|
+
duration: Date.now() - startTime,
|
|
225
|
+
framework: 'vue',
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
return {
|
|
230
|
+
success: false,
|
|
231
|
+
duration: Date.now() - startTime,
|
|
232
|
+
framework: 'vue',
|
|
233
|
+
error: e instanceof Error ? e.message : 'Vue stability timeout',
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Wait for Angular zone.js to stabilize
|
|
239
|
+
*/
|
|
240
|
+
async waitForAngularStable(page, config = {}) {
|
|
241
|
+
const timeout = config.timeout || this.defaultTimeout;
|
|
242
|
+
const startTime = Date.now();
|
|
243
|
+
try {
|
|
244
|
+
await page.waitForFunction(() => {
|
|
245
|
+
// Check if Angular is loaded
|
|
246
|
+
if (typeof window.ng === 'undefined' &&
|
|
247
|
+
typeof window.getAllAngularRootElements === 'undefined') {
|
|
248
|
+
return true; // Not an Angular app
|
|
249
|
+
}
|
|
250
|
+
// Check if Angular is stable (no pending macro tasks)
|
|
251
|
+
const ng = window.ng;
|
|
252
|
+
if (ng && ng.getTestability) {
|
|
253
|
+
try {
|
|
254
|
+
const testability = ng.getTestability(document.body);
|
|
255
|
+
if (testability && testability.isStable) {
|
|
256
|
+
return testability.isStable();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
// Testability might not be enabled
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// Fallback: Check for ng-version and completed rendering
|
|
264
|
+
const ngApp = document.querySelector('[ng-version]');
|
|
265
|
+
if (ngApp) {
|
|
266
|
+
// Check if Angular has rendered content
|
|
267
|
+
return ngApp.children.length > 0;
|
|
268
|
+
}
|
|
269
|
+
return true;
|
|
270
|
+
}, { timeout });
|
|
271
|
+
return {
|
|
272
|
+
success: true,
|
|
273
|
+
duration: Date.now() - startTime,
|
|
274
|
+
framework: 'angular',
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
catch (e) {
|
|
278
|
+
return {
|
|
279
|
+
success: false,
|
|
280
|
+
duration: Date.now() - startTime,
|
|
281
|
+
framework: 'angular',
|
|
282
|
+
error: e instanceof Error ? e.message : 'Angular stability timeout',
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Wait for Svelte tick to complete
|
|
288
|
+
*/
|
|
289
|
+
async waitForSvelteStable(page, config = {}) {
|
|
290
|
+
const timeout = config.timeout || 15000;
|
|
291
|
+
const startTime = Date.now();
|
|
292
|
+
try {
|
|
293
|
+
await page.waitForFunction(() => {
|
|
294
|
+
// Svelte doesn't have a global stability check like Angular
|
|
295
|
+
// We check for the absence of common loading patterns
|
|
296
|
+
const loadingElements = document.querySelectorAll('[data-svelte-h], [aria-busy="true"], .loading');
|
|
297
|
+
// Check if DOM is stable by comparing snapshots
|
|
298
|
+
return loadingElements.length === 0;
|
|
299
|
+
}, { timeout });
|
|
300
|
+
return {
|
|
301
|
+
success: true,
|
|
302
|
+
duration: Date.now() - startTime,
|
|
303
|
+
framework: 'svelte',
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
return {
|
|
308
|
+
success: false,
|
|
309
|
+
duration: Date.now() - startTime,
|
|
310
|
+
framework: 'svelte',
|
|
311
|
+
error: e instanceof Error ? e.message : 'Svelte stability timeout',
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Wait for SolidJS reactive updates to complete
|
|
317
|
+
*/
|
|
318
|
+
async waitForSolidStable(page, config = {}) {
|
|
319
|
+
const timeout = config.timeout || 10000;
|
|
320
|
+
const startTime = Date.now();
|
|
321
|
+
try {
|
|
322
|
+
await page.waitForFunction(() => {
|
|
323
|
+
// SolidJS uses _$HY for hydration
|
|
324
|
+
const solid = window._$HY;
|
|
325
|
+
if (!solid)
|
|
326
|
+
return true; // Not a SolidJS app
|
|
327
|
+
// Check if Solid has completed hydration
|
|
328
|
+
return true;
|
|
329
|
+
}, { timeout });
|
|
330
|
+
return {
|
|
331
|
+
success: true,
|
|
332
|
+
duration: Date.now() - startTime,
|
|
333
|
+
framework: 'solid',
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
catch (e) {
|
|
337
|
+
return {
|
|
338
|
+
success: false,
|
|
339
|
+
duration: Date.now() - startTime,
|
|
340
|
+
framework: 'solid',
|
|
341
|
+
error: e instanceof Error ? e.message : 'SolidJS stability timeout',
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Auto-detect framework and wait for it to be stable
|
|
347
|
+
*/
|
|
348
|
+
async waitForFramework(page, config = {}) {
|
|
349
|
+
const detection = await this.detectFramework(page);
|
|
350
|
+
switch (detection.framework) {
|
|
351
|
+
case 'react':
|
|
352
|
+
return await this.waitForReactHydration(page, config);
|
|
353
|
+
case 'vue':
|
|
354
|
+
return await this.waitForVueStable(page, config);
|
|
355
|
+
case 'angular':
|
|
356
|
+
return await this.waitForAngularStable(page, config);
|
|
357
|
+
case 'svelte':
|
|
358
|
+
return await this.waitForSvelteStable(page, config);
|
|
359
|
+
case 'solid':
|
|
360
|
+
return await this.waitForSolidStable(page, config);
|
|
361
|
+
default:
|
|
362
|
+
// Unknown framework, just wait for DOM content
|
|
363
|
+
const startTime = Date.now();
|
|
364
|
+
try {
|
|
365
|
+
await page.waitForLoadState('domcontentloaded', {
|
|
366
|
+
timeout: config.timeout || this.defaultTimeout
|
|
367
|
+
});
|
|
368
|
+
return {
|
|
369
|
+
success: true,
|
|
370
|
+
duration: Date.now() - startTime,
|
|
371
|
+
framework: 'unknown',
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
catch (e) {
|
|
375
|
+
return {
|
|
376
|
+
success: true,
|
|
377
|
+
duration: Date.now() - startTime,
|
|
378
|
+
framework: 'unknown',
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Wait for all frameworks to be stable (for micro-frontends)
|
|
385
|
+
*/
|
|
386
|
+
async waitForAllFrameworks(page, config = {}) {
|
|
387
|
+
const timeout = config.timeout || this.defaultTimeout;
|
|
388
|
+
const startTime = Date.now();
|
|
389
|
+
const results = [];
|
|
390
|
+
// Detect and wait for React
|
|
391
|
+
try {
|
|
392
|
+
const reactResult = await this.waitForReactHydration(page, {
|
|
393
|
+
timeout: Math.max(5000, timeout / 4)
|
|
394
|
+
});
|
|
395
|
+
results.push(reactResult);
|
|
396
|
+
}
|
|
397
|
+
catch {
|
|
398
|
+
// React not present, continue
|
|
399
|
+
}
|
|
400
|
+
// Detect and wait for Vue
|
|
401
|
+
try {
|
|
402
|
+
const vueResult = await this.waitForVueStable(page, {
|
|
403
|
+
timeout: Math.max(5000, timeout / 4)
|
|
404
|
+
});
|
|
405
|
+
results.push(vueResult);
|
|
406
|
+
}
|
|
407
|
+
catch {
|
|
408
|
+
// Vue not present, continue
|
|
409
|
+
}
|
|
410
|
+
// Detect and wait for Angular
|
|
411
|
+
try {
|
|
412
|
+
const angularResult = await this.waitForAngularStable(page, {
|
|
413
|
+
timeout: Math.max(5000, timeout / 4)
|
|
414
|
+
});
|
|
415
|
+
results.push(angularResult);
|
|
416
|
+
}
|
|
417
|
+
catch {
|
|
418
|
+
// Angular not present, continue
|
|
419
|
+
}
|
|
420
|
+
// Detect and wait for Svelte
|
|
421
|
+
try {
|
|
422
|
+
const svelteResult = await this.waitForSvelteStable(page, {
|
|
423
|
+
timeout: Math.max(3000, timeout / 4)
|
|
424
|
+
});
|
|
425
|
+
results.push(svelteResult);
|
|
426
|
+
}
|
|
427
|
+
catch {
|
|
428
|
+
// Svelte not present, continue
|
|
429
|
+
}
|
|
430
|
+
const allSuccess = results.every(r => r.success);
|
|
431
|
+
const frameworks = results.filter(r => r.framework !== 'unknown').map(r => r.framework).join(', ');
|
|
432
|
+
return {
|
|
433
|
+
success: allSuccess,
|
|
434
|
+
duration: Date.now() - startTime,
|
|
435
|
+
framework: frameworks || 'unknown',
|
|
436
|
+
error: allSuccess ? undefined : 'Some frameworks did not stabilize',
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Get framework info from the page
|
|
441
|
+
*/
|
|
442
|
+
async getFrameworkInfo(page) {
|
|
443
|
+
const detection = await this.detectFramework(page);
|
|
444
|
+
return {
|
|
445
|
+
framework: detection.framework || null,
|
|
446
|
+
version: detection.version,
|
|
447
|
+
confidence: detection.confidence,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Factory function to create Framework Wait Handler
|
|
453
|
+
*/
|
|
454
|
+
export function createFrameworkWaitHandler(config) {
|
|
455
|
+
return new FrameworkWaitHandler(config);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Auto-detect and wait for framework stability (convenience function)
|
|
459
|
+
*/
|
|
460
|
+
export async function waitForFramework(page, config) {
|
|
461
|
+
const handler = new FrameworkWaitHandler(config);
|
|
462
|
+
return handler.waitForFramework(page, config);
|
|
463
|
+
}
|
|
464
|
+
export default FrameworkWaitHandler;
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
export interface GeoCoordinates {
|
|
15
|
+
/** Latitude (-90 to 90) */
|
|
16
|
+
latitude: number;
|
|
17
|
+
/** Longitude (-180 to 180) */
|
|
18
|
+
longitude: number;
|
|
19
|
+
/** Accuracy in meters (optional) */
|
|
20
|
+
accuracy?: number;
|
|
21
|
+
/** Altitude in meters (optional) */
|
|
22
|
+
altitude?: number;
|
|
23
|
+
/** Altitude accuracy in meters (optional) */
|
|
24
|
+
altitudeAccuracy?: number;
|
|
25
|
+
/** Heading in degrees (0-360, optional) */
|
|
26
|
+
heading?: number;
|
|
27
|
+
/** Speed in m/s (optional) */
|
|
28
|
+
speed?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface GeoLocationConfig {
|
|
31
|
+
/** Default coordinates */
|
|
32
|
+
coordinates?: GeoCoordinates;
|
|
33
|
+
/** Auto-grant permissions */
|
|
34
|
+
grantPermissions?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Common city presets for testing
|
|
38
|
+
*/
|
|
39
|
+
export declare const CITIES: Record<string, GeoCoordinates>;
|
|
40
|
+
/**
|
|
41
|
+
* Geo-Location Handler class
|
|
42
|
+
*/
|
|
43
|
+
export declare class GeoLocationHandler {
|
|
44
|
+
private currentLocation?;
|
|
45
|
+
private grantPermissions;
|
|
46
|
+
constructor(config?: GeoLocationConfig);
|
|
47
|
+
/**
|
|
48
|
+
* Set geolocation for a context/browser
|
|
49
|
+
*/
|
|
50
|
+
setGeolocation(context: any, coordinates: GeoCoordinates): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Set geolocation by city preset
|
|
53
|
+
*/
|
|
54
|
+
setGeolocationByCity(context: any, city: string): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Get current geolocation
|
|
57
|
+
*/
|
|
58
|
+
getCurrentLocation(): GeoCoordinates | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Grant geolocation permission for a context
|
|
61
|
+
*/
|
|
62
|
+
grantGeolocationPermission(context: any): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Setup geolocation for a page (includes permission grant)
|
|
65
|
+
*/
|
|
66
|
+
setup(context: any, coordinates?: GeoCoordinates): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Get geolocation from a page (what the page sees)
|
|
69
|
+
*/
|
|
70
|
+
getPageGeolocation(page: any): Promise<GeCoordinates | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Watch geolocation changes on a page
|
|
73
|
+
*/
|
|
74
|
+
watchGeolocation(page: any, callback: (pos: GeoCoordinates | null) => void): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Set approximate location (reduced precision for privacy testing)
|
|
77
|
+
*/
|
|
78
|
+
setApproximateLocation(context: any, coordinates: GeoCoordinates, precision?: number): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Simulate movement along a path
|
|
81
|
+
*/
|
|
82
|
+
simulateMovement(context: any, from: GeoCoordinates, to: GeoCoordinates, steps?: number, intervalMs?: number): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Animate movement through coordinates
|
|
85
|
+
*/
|
|
86
|
+
animateMovement(context: any, coordinates: GeoCoordinates[], intervalMs?: number): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Validate coordinates
|
|
89
|
+
*/
|
|
90
|
+
private validateCoordinates;
|
|
91
|
+
/**
|
|
92
|
+
* Get distance between two coordinates (in meters)
|
|
93
|
+
*/
|
|
94
|
+
getDistance(from: GeoCoordinates, to: GeoCoordinates): number;
|
|
95
|
+
/**
|
|
96
|
+
* Get list of available cities
|
|
97
|
+
*/
|
|
98
|
+
getAvailableCities(): string[];
|
|
99
|
+
/**
|
|
100
|
+
* Get coordinates for a city
|
|
101
|
+
*/
|
|
102
|
+
getCityCoordinates(city: string): GeoCoordinates | undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Type alias for geolocation coordinates
|
|
106
|
+
*/
|
|
107
|
+
export type GeCoordinates = GeoCoordinates;
|
|
108
|
+
/**
|
|
109
|
+
* Factory function to create Geo-Location Handler
|
|
110
|
+
*/
|
|
111
|
+
export declare function createGeoLocationHandler(config?: GeoLocationConfig): GeoLocationHandler;
|
|
112
|
+
export default GeoLocationHandler;
|