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,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Tracking Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Global error tracking and monitoring
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - JavaScript error capture
|
|
8
|
+
* - Unhandled rejection tracking
|
|
9
|
+
* - Error aggregation and deduplication
|
|
10
|
+
* - Error context collection
|
|
11
|
+
* - Error reporting
|
|
12
|
+
*
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Error Tracking Handler class
|
|
17
|
+
*/
|
|
18
|
+
export class ErrorTrackingHandler {
|
|
19
|
+
page;
|
|
20
|
+
errors = [];
|
|
21
|
+
resourceErrors = [];
|
|
22
|
+
trackingEnabled = false;
|
|
23
|
+
consoleErrors = [];
|
|
24
|
+
constructor(page) {
|
|
25
|
+
this.page = page;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Setup global error tracking
|
|
29
|
+
*/
|
|
30
|
+
async setupTracking() {
|
|
31
|
+
if (this.trackingEnabled)
|
|
32
|
+
return;
|
|
33
|
+
await this.page.evaluate(() => {
|
|
34
|
+
// Storage for errors
|
|
35
|
+
if (!window.__errorTracker) {
|
|
36
|
+
window.__errorTracker = {
|
|
37
|
+
errors: [],
|
|
38
|
+
resourceErrors: [],
|
|
39
|
+
consoleErrors: [],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const tracker = window.__errorTracker;
|
|
43
|
+
// Track JavaScript errors
|
|
44
|
+
window.addEventListener('error', (event) => {
|
|
45
|
+
const errorInfo = {
|
|
46
|
+
name: 'Error',
|
|
47
|
+
message: event.message,
|
|
48
|
+
stack: event.error?.stack || '',
|
|
49
|
+
filename: event.filename,
|
|
50
|
+
line: event.lineno,
|
|
51
|
+
column: event.colno,
|
|
52
|
+
type: 'error',
|
|
53
|
+
timestamp: Date.now(),
|
|
54
|
+
userAgent: navigator.userAgent,
|
|
55
|
+
pageUrl: window.location.href,
|
|
56
|
+
};
|
|
57
|
+
tracker.errors.push(errorInfo);
|
|
58
|
+
});
|
|
59
|
+
// Track unhandled promise rejections
|
|
60
|
+
window.addEventListener('unhandledrejection', (event) => {
|
|
61
|
+
const error = event.reason;
|
|
62
|
+
const errorInfo = {
|
|
63
|
+
name: error?.name || 'UnhandledRejection',
|
|
64
|
+
message: error?.message || String(error),
|
|
65
|
+
stack: error?.stack || '',
|
|
66
|
+
type: 'unhandledrejection',
|
|
67
|
+
timestamp: Date.now(),
|
|
68
|
+
userAgent: navigator.userAgent,
|
|
69
|
+
pageUrl: window.location.href,
|
|
70
|
+
};
|
|
71
|
+
tracker.errors.push(errorInfo);
|
|
72
|
+
});
|
|
73
|
+
// Track resource loading errors
|
|
74
|
+
window.addEventListener('error', (event) => {
|
|
75
|
+
const target = event.target;
|
|
76
|
+
if (target && (target.tagName === 'SCRIPT' ||
|
|
77
|
+
target.tagName === 'LINK' ||
|
|
78
|
+
target.tagName === 'IMG')) {
|
|
79
|
+
const src = target.src || target.href;
|
|
80
|
+
if (src) {
|
|
81
|
+
tracker.resourceErrors.push({
|
|
82
|
+
url: src,
|
|
83
|
+
type: target.tagName.toLowerCase(),
|
|
84
|
+
status: 0,
|
|
85
|
+
message: 'Failed to load resource',
|
|
86
|
+
timestamp: Date.now(),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, true);
|
|
91
|
+
// Override console.error to capture console errors
|
|
92
|
+
const originalError = console.error;
|
|
93
|
+
console.error = function (...args) {
|
|
94
|
+
tracker.consoleErrors.push(args.map(a => String(a)).join(' '));
|
|
95
|
+
originalError.apply(console, args);
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
// Listen for console events from Playwright
|
|
99
|
+
this.page.on('console', (msg) => {
|
|
100
|
+
if (msg.type() === 'error') {
|
|
101
|
+
this.consoleErrors.push(msg.text());
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
// Listen for page errors
|
|
105
|
+
this.page.on('pageerror', (error) => {
|
|
106
|
+
this.errors.push({
|
|
107
|
+
name: error.name,
|
|
108
|
+
message: error.message,
|
|
109
|
+
stack: error.stack || '',
|
|
110
|
+
type: 'error',
|
|
111
|
+
timestamp: Date.now(),
|
|
112
|
+
userAgent: 'unknown',
|
|
113
|
+
pageUrl: this.page.url(),
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
// Listen for request failures (resource errors)
|
|
117
|
+
this.page.on('requestfailed', (request) => {
|
|
118
|
+
const failure = request.failure();
|
|
119
|
+
if (failure) {
|
|
120
|
+
this.resourceErrors.push({
|
|
121
|
+
url: request.url(),
|
|
122
|
+
type: request.resourceType(),
|
|
123
|
+
status: 0,
|
|
124
|
+
message: failure || 'Request failed',
|
|
125
|
+
timestamp: Date.now(),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
this.trackingEnabled = true;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get all captured errors from the page
|
|
133
|
+
*/
|
|
134
|
+
async getErrors() {
|
|
135
|
+
if (!this.trackingEnabled) {
|
|
136
|
+
await this.setupTracking();
|
|
137
|
+
}
|
|
138
|
+
const pageErrors = await this.page.evaluate(() => {
|
|
139
|
+
return window.__errorTracker?.errors || [];
|
|
140
|
+
});
|
|
141
|
+
// Combine page errors and handler errors
|
|
142
|
+
return [...pageErrors, ...this.errors];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Get all resource errors
|
|
146
|
+
*/
|
|
147
|
+
async getResourceErrors() {
|
|
148
|
+
if (!this.trackingEnabled) {
|
|
149
|
+
await this.setupTracking();
|
|
150
|
+
}
|
|
151
|
+
const pageResourceErrors = await this.page.evaluate(() => {
|
|
152
|
+
return window.__errorTracker?.resourceErrors || [];
|
|
153
|
+
});
|
|
154
|
+
return [...pageResourceErrors, ...this.resourceErrors];
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get console errors
|
|
158
|
+
*/
|
|
159
|
+
async getConsoleErrors() {
|
|
160
|
+
if (!this.trackingEnabled) {
|
|
161
|
+
await this.setupTracking();
|
|
162
|
+
}
|
|
163
|
+
const pageConsoleErrors = await this.page.evaluate(() => {
|
|
164
|
+
return window.__errorTracker?.consoleErrors || [];
|
|
165
|
+
});
|
|
166
|
+
return [...pageConsoleErrors, ...this.consoleErrors];
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Generate error report
|
|
170
|
+
*/
|
|
171
|
+
async generateReport() {
|
|
172
|
+
const errors = await this.getErrors();
|
|
173
|
+
const resourceErrors = await this.getResourceErrors();
|
|
174
|
+
const consoleErrors = await this.getConsoleErrors();
|
|
175
|
+
// Group errors
|
|
176
|
+
const grouped = this.groupErrors(errors);
|
|
177
|
+
// Count by type
|
|
178
|
+
const errorsByType = {};
|
|
179
|
+
for (const error of errors) {
|
|
180
|
+
errorsByType[error.type] = (errorsByType[error.type] || 0) + 1;
|
|
181
|
+
}
|
|
182
|
+
// Find most frequent
|
|
183
|
+
let mostFrequent = null;
|
|
184
|
+
for (const group of grouped) {
|
|
185
|
+
if (!mostFrequent || group.count > mostFrequent.count) {
|
|
186
|
+
mostFrequent = group;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// Count unhandled rejections
|
|
190
|
+
const unhandledRejections = errors.filter(e => e.type === 'unhandledrejection').length;
|
|
191
|
+
return {
|
|
192
|
+
totalErrors: errors.length,
|
|
193
|
+
errorsByType,
|
|
194
|
+
groupedErrors: grouped,
|
|
195
|
+
resourceErrors,
|
|
196
|
+
mostFrequent,
|
|
197
|
+
unhandledRejections,
|
|
198
|
+
consoleErrors: consoleErrors.length,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Group errors by similarity
|
|
203
|
+
*/
|
|
204
|
+
groupErrors(errors) {
|
|
205
|
+
const groups = new Map();
|
|
206
|
+
for (const error of errors) {
|
|
207
|
+
// Create a key based on error name and message (simplified)
|
|
208
|
+
const key = `${error.name}:${error.message.slice(0, 100)}`;
|
|
209
|
+
let group = groups.get(key);
|
|
210
|
+
if (!group) {
|
|
211
|
+
group = {
|
|
212
|
+
key,
|
|
213
|
+
name: error.name,
|
|
214
|
+
message: error.message,
|
|
215
|
+
count: 0,
|
|
216
|
+
firstSeen: error.timestamp,
|
|
217
|
+
lastSeen: error.timestamp,
|
|
218
|
+
stack: error.stack,
|
|
219
|
+
pages: [],
|
|
220
|
+
};
|
|
221
|
+
groups.set(key, group);
|
|
222
|
+
}
|
|
223
|
+
group.count++;
|
|
224
|
+
group.lastSeen = error.timestamp;
|
|
225
|
+
if (!group.pages.includes(error.pageUrl)) {
|
|
226
|
+
group.pages.push(error.pageUrl);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return Array.from(groups.values()).sort((a, b) => b.count - a.count);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Capture error with additional context
|
|
233
|
+
*/
|
|
234
|
+
async captureError(error, context) {
|
|
235
|
+
const pageContext = await this.page.evaluate((ctxKeys) => {
|
|
236
|
+
const result = {};
|
|
237
|
+
for (const key of ctxKeys) {
|
|
238
|
+
result[key] = window[key];
|
|
239
|
+
}
|
|
240
|
+
return result;
|
|
241
|
+
}, Object.keys(context || {}));
|
|
242
|
+
this.errors.push({
|
|
243
|
+
name: error.name,
|
|
244
|
+
message: error.message,
|
|
245
|
+
stack: error.stack || '',
|
|
246
|
+
type: 'error',
|
|
247
|
+
timestamp: Date.now(),
|
|
248
|
+
userAgent: 'unknown',
|
|
249
|
+
pageUrl: this.page.url(),
|
|
250
|
+
context: {
|
|
251
|
+
...context,
|
|
252
|
+
...pageContext,
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Clear all captured errors
|
|
258
|
+
*/
|
|
259
|
+
async clearErrors() {
|
|
260
|
+
this.errors = [];
|
|
261
|
+
this.resourceErrors = [];
|
|
262
|
+
this.consoleErrors = [];
|
|
263
|
+
await this.page.evaluate(() => {
|
|
264
|
+
if (window.__errorTracker) {
|
|
265
|
+
window.__errorTracker.errors = [];
|
|
266
|
+
window.__errorTracker.resourceErrors = [];
|
|
267
|
+
window.__errorTracker.consoleErrors = [];
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get errors by type
|
|
273
|
+
*/
|
|
274
|
+
async getErrorsByType(type) {
|
|
275
|
+
const allErrors = await this.getErrors();
|
|
276
|
+
return allErrors.filter(e => e.type === type);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get errors by page URL
|
|
280
|
+
*/
|
|
281
|
+
async getErrorsByPage(pageUrl) {
|
|
282
|
+
const allErrors = await this.getErrors();
|
|
283
|
+
return allErrors.filter(e => e.pageUrl === pageUrl);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Check if there are any critical errors
|
|
287
|
+
*/
|
|
288
|
+
async hasCriticalErrors() {
|
|
289
|
+
const errors = await this.getErrors();
|
|
290
|
+
const criticalTypes = ['error', 'unhandledrejection'];
|
|
291
|
+
return errors.some(e => criticalTypes.includes(e.type) &&
|
|
292
|
+
!e.message.includes('ResizeObserver') &&
|
|
293
|
+
!e.message.includes('slow') &&
|
|
294
|
+
!e.message.includes('network'));
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Get error statistics
|
|
298
|
+
*/
|
|
299
|
+
async getStatistics() {
|
|
300
|
+
const errors = await this.getErrors();
|
|
301
|
+
const byType = {};
|
|
302
|
+
let critical = 0;
|
|
303
|
+
for (const error of errors) {
|
|
304
|
+
byType[error.type] = (byType[error.type] || 0) + 1;
|
|
305
|
+
if (error.type === 'error' || error.type === 'unhandledrejection') {
|
|
306
|
+
critical++;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
// Calculate unique errors
|
|
310
|
+
const unique = this.groupErrors(errors).length;
|
|
311
|
+
// Calculate errors per minute
|
|
312
|
+
const now = Date.now();
|
|
313
|
+
const oneMinuteAgo = now - 60000;
|
|
314
|
+
const recentErrors = errors.filter(e => e.timestamp > oneMinuteAgo);
|
|
315
|
+
const avgPerMinute = recentErrors.length;
|
|
316
|
+
return {
|
|
317
|
+
total: errors.length,
|
|
318
|
+
byType,
|
|
319
|
+
critical,
|
|
320
|
+
unique,
|
|
321
|
+
avgPerMinute,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Export errors as JSON
|
|
326
|
+
*/
|
|
327
|
+
async exportErrors() {
|
|
328
|
+
const report = await this.generateReport();
|
|
329
|
+
return JSON.stringify(report, null, 2);
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Setup error threshold monitoring
|
|
333
|
+
*/
|
|
334
|
+
async setupThresholdMonitoring(threshold, callback) {
|
|
335
|
+
let intervalId = null;
|
|
336
|
+
const check = async () => {
|
|
337
|
+
const errors = await this.getErrors();
|
|
338
|
+
const recent = errors.filter(e => Date.now() - e.timestamp < 60000);
|
|
339
|
+
if (recent.length >= threshold) {
|
|
340
|
+
await callback(recent);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
intervalId = setInterval(check, 5000);
|
|
344
|
+
return () => {
|
|
345
|
+
if (intervalId) {
|
|
346
|
+
clearInterval(intervalId);
|
|
347
|
+
intervalId = null;
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Check if tracking is enabled
|
|
353
|
+
*/
|
|
354
|
+
isEnabled() {
|
|
355
|
+
return this.trackingEnabled;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Disable error tracking
|
|
359
|
+
*/
|
|
360
|
+
async disableTracking() {
|
|
361
|
+
if (!this.trackingEnabled)
|
|
362
|
+
return;
|
|
363
|
+
await this.page.evaluate(() => {
|
|
364
|
+
// Remove event listeners by reloading the page state
|
|
365
|
+
if (window.__errorTracker) {
|
|
366
|
+
delete window.__errorTracker;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
this.trackingEnabled = false;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Factory function to create Error Tracking Handler
|
|
374
|
+
*/
|
|
375
|
+
export function createErrorTrackingHandler(page) {
|
|
376
|
+
return new ErrorTrackingHandler(page);
|
|
377
|
+
}
|
|
378
|
+
export default ErrorTrackingHandler;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Advanced form interactions
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - Auto-detect form fields
|
|
8
|
+
* - Smart field type detection (input, select, textarea, checkbox, radio)
|
|
9
|
+
* - Fill forms with data
|
|
10
|
+
* - Form validation detection
|
|
11
|
+
* - Submit handling
|
|
12
|
+
*
|
|
13
|
+
* @see https://playwright.dev/docs/input
|
|
14
|
+
*/
|
|
15
|
+
export interface FormField {
|
|
16
|
+
/** Field selector */
|
|
17
|
+
selector: string;
|
|
18
|
+
/** Field type */
|
|
19
|
+
type: 'input' | 'select' | 'textarea' | 'checkbox' | 'radio' | 'file' | 'date' | 'email' | 'tel' | 'number';
|
|
20
|
+
/** Field name/label */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** Current value */
|
|
23
|
+
value?: string;
|
|
24
|
+
/** Required flag */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Disabled flag */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Options (for select/radio) */
|
|
29
|
+
options?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface FormData {
|
|
32
|
+
/** Form selector */
|
|
33
|
+
selector?: string;
|
|
34
|
+
/** Fields in the form */
|
|
35
|
+
fields: FormField[];
|
|
36
|
+
/** Submit button selector */
|
|
37
|
+
submitButton?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface FormConfig {
|
|
40
|
+
/** Form selector (optional, defaults to first form) */
|
|
41
|
+
formSelector?: string;
|
|
42
|
+
/** Auto-detect fields */
|
|
43
|
+
autoDetect?: boolean;
|
|
44
|
+
/** Fill timeout per field */
|
|
45
|
+
timeout?: number;
|
|
46
|
+
/** Clear before fill */
|
|
47
|
+
clearBeforeFill?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface FormFillData {
|
|
50
|
+
/** Field values by name/label */
|
|
51
|
+
[fieldName: string]: string | string[] | boolean | number;
|
|
52
|
+
}
|
|
53
|
+
export interface FormResult {
|
|
54
|
+
success: boolean;
|
|
55
|
+
filled?: number;
|
|
56
|
+
errors?: string[];
|
|
57
|
+
validationErrors?: string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Form Handler class
|
|
61
|
+
*/
|
|
62
|
+
export declare class FormHandler {
|
|
63
|
+
/**
|
|
64
|
+
* Detect form fields on a page
|
|
65
|
+
*/
|
|
66
|
+
detectFormFields(page: any, config?: FormConfig): Promise<FormData>;
|
|
67
|
+
/**
|
|
68
|
+
* Fill a form with data
|
|
69
|
+
*/
|
|
70
|
+
fillForm(page: any, data: FormFillData, config?: FormConfig): Promise<FormResult>;
|
|
71
|
+
/**
|
|
72
|
+
* Fill a single field
|
|
73
|
+
*/
|
|
74
|
+
fillField(page: any, field: FormField, value: string | string[] | boolean | number, config?: FormConfig): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Submit a form
|
|
77
|
+
*/
|
|
78
|
+
submitForm(page: any, config?: FormConfig): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Detect form validation errors
|
|
81
|
+
*/
|
|
82
|
+
detectValidationErrors(page: any, config?: FormConfig): Promise<string[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Fill and submit a form in one action
|
|
85
|
+
*/
|
|
86
|
+
fillAndSubmit(page: any, data: FormFillData, config?: FormConfig): Promise<FormResult>;
|
|
87
|
+
/**
|
|
88
|
+
* Get form data as object (extract current values)
|
|
89
|
+
*/
|
|
90
|
+
getFormData(page: any, config?: FormConfig): Promise<Record<string, string | boolean>>;
|
|
91
|
+
/**
|
|
92
|
+
* Clear all form fields
|
|
93
|
+
*/
|
|
94
|
+
clearForm(page: any, config?: FormConfig): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Factory function to create Form Handler
|
|
98
|
+
*/
|
|
99
|
+
export declare function createFormHandler(): FormHandler;
|
|
100
|
+
export default FormHandler;
|