qa360 2.3.0 → 2.3.2
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/ask.js +49 -22
- package/{cli/dist → dist}/commands/coverage.js +17 -4
- 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 +12 -5
- 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 +14 -6
- 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 +5 -1
- package/{cli/dist → dist}/commands/run.js +87 -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.d.ts +4 -0
- package/{cli/dist → dist}/core/ai/ollama-provider.js +41 -8
- 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}/index.js +2 -3
- package/{cli/dist → dist}/utils/config.d.ts +1 -1
- package/{cli/dist → dist}/utils/config.js +36 -3
- 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/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/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}/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
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Storage Helpers Module
|
|
3
|
+
*
|
|
4
|
+
* P0: Simplified access to browser storage APIs
|
|
5
|
+
* - LocalStorage helpers with type safety
|
|
6
|
+
* - SessionStorage helpers with type safety
|
|
7
|
+
* - JSON serialization/deserialization
|
|
8
|
+
* - Prefix support for namespacing
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* LocalStorage Helper
|
|
12
|
+
*/
|
|
13
|
+
export class LocalStorage {
|
|
14
|
+
page;
|
|
15
|
+
options;
|
|
16
|
+
constructor(page, options = {}) {
|
|
17
|
+
this.page = page;
|
|
18
|
+
this.options = options;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a value from localStorage
|
|
22
|
+
*/
|
|
23
|
+
async get(key) {
|
|
24
|
+
const fullKey = this.getFullKey(key);
|
|
25
|
+
const result = await this.page.evaluate(({ k }) => {
|
|
26
|
+
const value = localStorage.getItem(k);
|
|
27
|
+
return {
|
|
28
|
+
exists: value !== null,
|
|
29
|
+
rawValue: value,
|
|
30
|
+
};
|
|
31
|
+
}, { k: fullKey });
|
|
32
|
+
if (!result.exists) {
|
|
33
|
+
return { exists: false, value: null, rawValue: null };
|
|
34
|
+
}
|
|
35
|
+
const value = this.options.json !== false
|
|
36
|
+
? this.tryParseJSON(result.rawValue)
|
|
37
|
+
: result.rawValue;
|
|
38
|
+
return {
|
|
39
|
+
exists: true,
|
|
40
|
+
value: value,
|
|
41
|
+
rawValue: result.rawValue,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Set a value in localStorage
|
|
46
|
+
*/
|
|
47
|
+
async set(key, value) {
|
|
48
|
+
const fullKey = this.getFullKey(key);
|
|
49
|
+
const stringValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
50
|
+
await this.page.evaluate(({ k, v }) => {
|
|
51
|
+
localStorage.setItem(k, v);
|
|
52
|
+
}, { k: fullKey, v: stringValue });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Remove a value from localStorage
|
|
56
|
+
*/
|
|
57
|
+
async remove(key) {
|
|
58
|
+
const fullKey = this.getFullKey(key);
|
|
59
|
+
await this.page.evaluate(({ k }) => {
|
|
60
|
+
localStorage.removeItem(k);
|
|
61
|
+
}, { k: fullKey });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a key exists
|
|
65
|
+
*/
|
|
66
|
+
async has(key) {
|
|
67
|
+
const result = await this.get(key);
|
|
68
|
+
return result.exists;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get all keys (with prefix if configured)
|
|
72
|
+
*/
|
|
73
|
+
async keys() {
|
|
74
|
+
const prefix = this.options.prefix || '';
|
|
75
|
+
return await this.page.evaluate(({ p }) => {
|
|
76
|
+
const keys = [];
|
|
77
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
78
|
+
const key = localStorage.key(i);
|
|
79
|
+
if (key && (!p || key.startsWith(p))) {
|
|
80
|
+
keys.push(key);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return keys;
|
|
84
|
+
}, { p: prefix });
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Clear all keys (with prefix if configured)
|
|
88
|
+
*/
|
|
89
|
+
async clear() {
|
|
90
|
+
const prefix = this.options.prefix || '';
|
|
91
|
+
await this.page.evaluate(({ p }) => {
|
|
92
|
+
if (!p) {
|
|
93
|
+
localStorage.clear();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
// Clear only keys with prefix
|
|
97
|
+
const keysToRemove = [];
|
|
98
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
99
|
+
const key = localStorage.key(i);
|
|
100
|
+
if (key && key.startsWith(p)) {
|
|
101
|
+
keysToRemove.push(key);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
keysToRemove.forEach(key => localStorage.removeItem(key));
|
|
105
|
+
}, { p: prefix });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get the number of items (with prefix if configured)
|
|
109
|
+
*/
|
|
110
|
+
async size() {
|
|
111
|
+
const keys = await this.keys();
|
|
112
|
+
return keys.length;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get all items as an object (with prefix stripped if configured)
|
|
116
|
+
*/
|
|
117
|
+
async getAll() {
|
|
118
|
+
const keys = await this.keys();
|
|
119
|
+
const result = {};
|
|
120
|
+
for (const key of keys) {
|
|
121
|
+
const shortKey = this.options.prefix ? key.slice(this.options.prefix.length) : key;
|
|
122
|
+
const item = await this.get(shortKey);
|
|
123
|
+
if (item.exists && item.value !== null) {
|
|
124
|
+
result[shortKey] = item.value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Set multiple items at once
|
|
131
|
+
*/
|
|
132
|
+
async setMany(items) {
|
|
133
|
+
for (const [key, value] of Object.entries(items)) {
|
|
134
|
+
await this.set(key, value);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Remove multiple items at once
|
|
139
|
+
*/
|
|
140
|
+
async removeMany(keys) {
|
|
141
|
+
for (const key of keys) {
|
|
142
|
+
await this.remove(key);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
getFullKey(key) {
|
|
146
|
+
return this.options.prefix ? `${this.options.prefix}${key}` : key;
|
|
147
|
+
}
|
|
148
|
+
tryParseJSON(value) {
|
|
149
|
+
try {
|
|
150
|
+
return JSON.parse(value);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return value;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* SessionStorage Helper
|
|
159
|
+
*/
|
|
160
|
+
export class SessionStorage {
|
|
161
|
+
page;
|
|
162
|
+
options;
|
|
163
|
+
constructor(page, options = {}) {
|
|
164
|
+
this.page = page;
|
|
165
|
+
this.options = options;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Get a value from sessionStorage
|
|
169
|
+
*/
|
|
170
|
+
async get(key) {
|
|
171
|
+
const fullKey = this.getFullKey(key);
|
|
172
|
+
const result = await this.page.evaluate(({ k }) => {
|
|
173
|
+
const value = sessionStorage.getItem(k);
|
|
174
|
+
return {
|
|
175
|
+
exists: value !== null,
|
|
176
|
+
rawValue: value,
|
|
177
|
+
};
|
|
178
|
+
}, { k: fullKey });
|
|
179
|
+
if (!result.exists) {
|
|
180
|
+
return { exists: false, value: null, rawValue: null };
|
|
181
|
+
}
|
|
182
|
+
const value = this.options.json !== false
|
|
183
|
+
? this.tryParseJSON(result.rawValue)
|
|
184
|
+
: result.rawValue;
|
|
185
|
+
return {
|
|
186
|
+
exists: true,
|
|
187
|
+
value: value,
|
|
188
|
+
rawValue: result.rawValue,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Set a value in sessionStorage
|
|
193
|
+
*/
|
|
194
|
+
async set(key, value) {
|
|
195
|
+
const fullKey = this.getFullKey(key);
|
|
196
|
+
const stringValue = typeof value === 'string' ? value : JSON.stringify(value);
|
|
197
|
+
await this.page.evaluate(({ k, v }) => {
|
|
198
|
+
sessionStorage.setItem(k, v);
|
|
199
|
+
}, { k: fullKey, v: stringValue });
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Remove a value from sessionStorage
|
|
203
|
+
*/
|
|
204
|
+
async remove(key) {
|
|
205
|
+
const fullKey = this.getFullKey(key);
|
|
206
|
+
await this.page.evaluate(({ k }) => {
|
|
207
|
+
sessionStorage.removeItem(k);
|
|
208
|
+
}, { k: fullKey });
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Check if a key exists
|
|
212
|
+
*/
|
|
213
|
+
async has(key) {
|
|
214
|
+
const result = await this.get(key);
|
|
215
|
+
return result.exists;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Get all keys (with prefix if configured)
|
|
219
|
+
*/
|
|
220
|
+
async keys() {
|
|
221
|
+
const prefix = this.options.prefix || '';
|
|
222
|
+
return await this.page.evaluate(({ p }) => {
|
|
223
|
+
const keys = [];
|
|
224
|
+
for (let i = 0; i < sessionStorage.length; i++) {
|
|
225
|
+
const key = sessionStorage.key(i);
|
|
226
|
+
if (key && (!p || key.startsWith(p))) {
|
|
227
|
+
keys.push(key);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return keys;
|
|
231
|
+
}, { p: prefix });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Clear all keys (with prefix if configured)
|
|
235
|
+
*/
|
|
236
|
+
async clear() {
|
|
237
|
+
const prefix = this.options.prefix || '';
|
|
238
|
+
await this.page.evaluate(({ p }) => {
|
|
239
|
+
if (!p) {
|
|
240
|
+
sessionStorage.clear();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
// Clear only keys with prefix
|
|
244
|
+
const keysToRemove = [];
|
|
245
|
+
for (let i = 0; i < sessionStorage.length; i++) {
|
|
246
|
+
const key = sessionStorage.key(i);
|
|
247
|
+
if (key && key.startsWith(p)) {
|
|
248
|
+
keysToRemove.push(key);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
keysToRemove.forEach(key => sessionStorage.removeItem(key));
|
|
252
|
+
}, { p: prefix });
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Get the number of items (with prefix if configured)
|
|
256
|
+
*/
|
|
257
|
+
async size() {
|
|
258
|
+
const keys = await this.keys();
|
|
259
|
+
return keys.length;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Get all items as an object (with prefix stripped if configured)
|
|
263
|
+
*/
|
|
264
|
+
async getAll() {
|
|
265
|
+
const keys = await this.keys();
|
|
266
|
+
const result = {};
|
|
267
|
+
for (const key of keys) {
|
|
268
|
+
const shortKey = this.options.prefix ? key.slice(this.options.prefix.length) : key;
|
|
269
|
+
const item = await this.get(shortKey);
|
|
270
|
+
if (item.exists && item.value !== null) {
|
|
271
|
+
result[shortKey] = item.value;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Set multiple items at once
|
|
278
|
+
*/
|
|
279
|
+
async setMany(items) {
|
|
280
|
+
for (const [key, value] of Object.entries(items)) {
|
|
281
|
+
await this.set(key, value);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Remove multiple items at once
|
|
286
|
+
*/
|
|
287
|
+
async removeMany(keys) {
|
|
288
|
+
for (const key of keys) {
|
|
289
|
+
await this.remove(key);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
getFullKey(key) {
|
|
293
|
+
return this.options.prefix ? `${this.options.prefix}${key}` : key;
|
|
294
|
+
}
|
|
295
|
+
tryParseJSON(value) {
|
|
296
|
+
try {
|
|
297
|
+
return JSON.parse(value);
|
|
298
|
+
}
|
|
299
|
+
catch {
|
|
300
|
+
return value;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Convenience function to create LocalStorage helper
|
|
306
|
+
*/
|
|
307
|
+
export function createLocalStorage(page, options) {
|
|
308
|
+
return new LocalStorage(page, options);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Convenience function to create SessionStorage helper
|
|
312
|
+
*/
|
|
313
|
+
export function createSessionStorage(page, options) {
|
|
314
|
+
return new SessionStorage(page, options);
|
|
315
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 State Reset Module
|
|
3
|
+
*
|
|
4
|
+
* P0: Clean slate between tests
|
|
5
|
+
* - Clear localStorage
|
|
6
|
+
* - Clear sessionStorage
|
|
7
|
+
* - Clear cookies
|
|
8
|
+
* - Clear caches
|
|
9
|
+
* - Reset navigation state
|
|
10
|
+
* - Clear all storage
|
|
11
|
+
*/
|
|
12
|
+
import type { Page, BrowserContext } from '@playwright/test';
|
|
13
|
+
/**
|
|
14
|
+
* State reset options
|
|
15
|
+
*/
|
|
16
|
+
export interface StateResetOptions {
|
|
17
|
+
/** Clear localStorage */
|
|
18
|
+
clearLocalStorage?: boolean;
|
|
19
|
+
/** Clear sessionStorage */
|
|
20
|
+
clearSessionStorage?: boolean;
|
|
21
|
+
/** Clear cookies */
|
|
22
|
+
clearCookies?: boolean;
|
|
23
|
+
/** Clear all storage */
|
|
24
|
+
clearAll?: boolean;
|
|
25
|
+
/** Reset navigation to blank page */
|
|
26
|
+
resetNavigation?: boolean;
|
|
27
|
+
/** Clear browser cache */
|
|
28
|
+
clearCache?: boolean;
|
|
29
|
+
/** Wait for network idle before proceeding */
|
|
30
|
+
waitForNetworkIdle?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* State Reset Helper
|
|
34
|
+
*
|
|
35
|
+
* Provides methods to reset browser state between tests
|
|
36
|
+
*/
|
|
37
|
+
export declare class StateReset {
|
|
38
|
+
/**
|
|
39
|
+
* Reset all state for a page
|
|
40
|
+
*
|
|
41
|
+
* @param page - Playwright page to reset
|
|
42
|
+
* @param options - Reset options
|
|
43
|
+
*/
|
|
44
|
+
static resetPage(page: Page, options?: StateResetOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Reset all state for a browser context
|
|
47
|
+
*
|
|
48
|
+
* @param context - Playwright browser context to reset
|
|
49
|
+
* @param options - Reset options
|
|
50
|
+
*/
|
|
51
|
+
static resetContext(context: BrowserContext, options?: StateResetOptions): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Complete reset: clears everything
|
|
54
|
+
*
|
|
55
|
+
* @param context - Browser context
|
|
56
|
+
* @param page - Optional specific page to reset
|
|
57
|
+
*/
|
|
58
|
+
static resetAll(context: BrowserContext, page?: Page): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Reset to a blank state (useful between tests)
|
|
61
|
+
*
|
|
62
|
+
* @param page - Playwright page
|
|
63
|
+
*/
|
|
64
|
+
static resetToBlank(page: Page): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Clean up before a test
|
|
67
|
+
*
|
|
68
|
+
* @param page - Playwright page
|
|
69
|
+
* @param baseUrl - Base URL to navigate to after cleanup
|
|
70
|
+
*/
|
|
71
|
+
static setupTest(page: Page, baseUrl?: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Clean up after a test
|
|
74
|
+
*
|
|
75
|
+
* @param context - Browser context
|
|
76
|
+
* @param page - Playwright page
|
|
77
|
+
*/
|
|
78
|
+
static teardownTest(context: BrowserContext, page: Page): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Clear specific storage keys
|
|
81
|
+
*
|
|
82
|
+
* @param page - Playwright page
|
|
83
|
+
* @param keys - Keys to clear (supports wildcards with *)
|
|
84
|
+
* @param storage - Storage type ('localStorage' or 'sessionStorage')
|
|
85
|
+
*/
|
|
86
|
+
static clearKeys(page: Page, keys: string[], storage?: 'localStorage' | 'sessionStorage'): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Get storage size (useful for debugging)
|
|
89
|
+
*
|
|
90
|
+
* @param page - Playwright page
|
|
91
|
+
* @returns Storage size info
|
|
92
|
+
*/
|
|
93
|
+
static getStorageSize(page: Page): Promise<{
|
|
94
|
+
localStorage: {
|
|
95
|
+
entries: number;
|
|
96
|
+
size: number;
|
|
97
|
+
};
|
|
98
|
+
sessionStorage: {
|
|
99
|
+
entries: number;
|
|
100
|
+
size: number;
|
|
101
|
+
};
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Convenience function to reset page state
|
|
106
|
+
*/
|
|
107
|
+
export declare function resetPageState(page: Page, options?: StateResetOptions): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Convenience function to reset to blank
|
|
110
|
+
*/
|
|
111
|
+
export declare function resetToBlank(page: Page): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Convenience function to setup test
|
|
114
|
+
*/
|
|
115
|
+
export declare function setupTest(page: Page, baseUrl?: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Convenience function to teardown test
|
|
118
|
+
*/
|
|
119
|
+
export declare function teardownTest(context: BrowserContext, page: Page): Promise<void>;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 State Reset Module
|
|
3
|
+
*
|
|
4
|
+
* P0: Clean slate between tests
|
|
5
|
+
* - Clear localStorage
|
|
6
|
+
* - Clear sessionStorage
|
|
7
|
+
* - Clear cookies
|
|
8
|
+
* - Clear caches
|
|
9
|
+
* - Reset navigation state
|
|
10
|
+
* - Clear all storage
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* State Reset Helper
|
|
14
|
+
*
|
|
15
|
+
* Provides methods to reset browser state between tests
|
|
16
|
+
*/
|
|
17
|
+
export class StateReset {
|
|
18
|
+
/**
|
|
19
|
+
* Reset all state for a page
|
|
20
|
+
*
|
|
21
|
+
* @param page - Playwright page to reset
|
|
22
|
+
* @param options - Reset options
|
|
23
|
+
*/
|
|
24
|
+
static async resetPage(page, options = {}) {
|
|
25
|
+
const { clearLocalStorage = true, clearSessionStorage = true, clearAll = false, resetNavigation = false, waitForNetworkIdle = false, } = options;
|
|
26
|
+
// Clear storage
|
|
27
|
+
if (clearAll || clearLocalStorage) {
|
|
28
|
+
await page.evaluate(() => {
|
|
29
|
+
localStorage.clear();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (clearAll || clearSessionStorage) {
|
|
33
|
+
await page.evaluate(() => {
|
|
34
|
+
sessionStorage.clear();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// Reset navigation if requested
|
|
38
|
+
if (resetNavigation) {
|
|
39
|
+
await page.goto('about:blank', { waitUntil: 'domcontentloaded' });
|
|
40
|
+
}
|
|
41
|
+
// Wait for network idle if requested
|
|
42
|
+
if (waitForNetworkIdle) {
|
|
43
|
+
try {
|
|
44
|
+
await page.waitForLoadState('networkidle', { timeout: 5000 }).catch(() => {
|
|
45
|
+
// Ignore timeout - might not be applicable
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Ignore errors
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Reset all state for a browser context
|
|
55
|
+
*
|
|
56
|
+
* @param context - Playwright browser context to reset
|
|
57
|
+
* @param options - Reset options
|
|
58
|
+
*/
|
|
59
|
+
static async resetContext(context, options = {}) {
|
|
60
|
+
const { clearCookies = true, clearCache = false, clearAll = false, } = options;
|
|
61
|
+
// Clear cookies
|
|
62
|
+
if (clearAll || clearCookies) {
|
|
63
|
+
await context.clearCookies();
|
|
64
|
+
}
|
|
65
|
+
// Clear cache (requires permission)
|
|
66
|
+
if (clearAll || clearCache) {
|
|
67
|
+
const pages = context.pages();
|
|
68
|
+
for (const page of pages) {
|
|
69
|
+
try {
|
|
70
|
+
// Clear caches via CDP
|
|
71
|
+
const client = await context.newCDPSession(page);
|
|
72
|
+
await client.send('Network.clearBrowserCache');
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Ignore CDP errors
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Reset all pages in context
|
|
80
|
+
const pages = context.pages();
|
|
81
|
+
for (const page of pages) {
|
|
82
|
+
await this.resetPage(page, options);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Complete reset: clears everything
|
|
87
|
+
*
|
|
88
|
+
* @param context - Browser context
|
|
89
|
+
* @param page - Optional specific page to reset
|
|
90
|
+
*/
|
|
91
|
+
static async resetAll(context, page) {
|
|
92
|
+
const resetOptions = {
|
|
93
|
+
clearAll: true,
|
|
94
|
+
resetNavigation: true,
|
|
95
|
+
clearCache: true,
|
|
96
|
+
};
|
|
97
|
+
// Reset all pages or specific page
|
|
98
|
+
if (page) {
|
|
99
|
+
await this.resetPage(page, resetOptions);
|
|
100
|
+
}
|
|
101
|
+
await this.resetContext(context, resetOptions);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Reset to a blank state (useful between tests)
|
|
105
|
+
*
|
|
106
|
+
* @param page - Playwright page
|
|
107
|
+
*/
|
|
108
|
+
static async resetToBlank(page) {
|
|
109
|
+
// Try to clear storage BEFORE navigating to blank (blank pages don't allow storage access)
|
|
110
|
+
try {
|
|
111
|
+
await page.evaluate(() => {
|
|
112
|
+
if (typeof localStorage !== 'undefined') {
|
|
113
|
+
localStorage.clear();
|
|
114
|
+
}
|
|
115
|
+
if (typeof sessionStorage !== 'undefined') {
|
|
116
|
+
sessionStorage.clear();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
// Ignore errors if storage is not accessible
|
|
122
|
+
}
|
|
123
|
+
await page.goto('about:blank', { waitUntil: 'domcontentloaded' });
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Clean up before a test
|
|
127
|
+
*
|
|
128
|
+
* @param page - Playwright page
|
|
129
|
+
* @param baseUrl - Base URL to navigate to after cleanup
|
|
130
|
+
*/
|
|
131
|
+
static async setupTest(page, baseUrl) {
|
|
132
|
+
// Reset to blank first
|
|
133
|
+
await this.resetToBlank(page);
|
|
134
|
+
// Navigate to base URL if provided
|
|
135
|
+
if (baseUrl) {
|
|
136
|
+
await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Clean up after a test
|
|
141
|
+
*
|
|
142
|
+
* @param context - Browser context
|
|
143
|
+
* @param page - Playwright page
|
|
144
|
+
*/
|
|
145
|
+
static async teardownTest(context, page) {
|
|
146
|
+
await this.resetPage(page, {
|
|
147
|
+
clearLocalStorage: true,
|
|
148
|
+
clearSessionStorage: true,
|
|
149
|
+
resetNavigation: false, // Don't reset nav during teardown
|
|
150
|
+
});
|
|
151
|
+
// Close any additional pages
|
|
152
|
+
const pages = context.pages();
|
|
153
|
+
for (const p of pages) {
|
|
154
|
+
if (p !== page) {
|
|
155
|
+
await p.close().catch(() => { });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Clear specific storage keys
|
|
161
|
+
*
|
|
162
|
+
* @param page - Playwright page
|
|
163
|
+
* @param keys - Keys to clear (supports wildcards with *)
|
|
164
|
+
* @param storage - Storage type ('localStorage' or 'sessionStorage')
|
|
165
|
+
*/
|
|
166
|
+
static async clearKeys(page, keys, storage = 'localStorage') {
|
|
167
|
+
await page.evaluate((args) => {
|
|
168
|
+
const { keysToClear, storageType } = args;
|
|
169
|
+
const store = storageType === 'localStorage' ? localStorage : sessionStorage;
|
|
170
|
+
const allKeys = Object.keys(store);
|
|
171
|
+
for (const key of keysToClear) {
|
|
172
|
+
if (key.includes('*')) {
|
|
173
|
+
// Wildcard match
|
|
174
|
+
const pattern = new RegExp(key.replace(/\*/g, '.*'));
|
|
175
|
+
for (const k of allKeys) {
|
|
176
|
+
if (pattern.test(k)) {
|
|
177
|
+
store.removeItem(k);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
store.removeItem(key);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, { keysToClear: keys, storageType: storage });
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get storage size (useful for debugging)
|
|
189
|
+
*
|
|
190
|
+
* @param page - Playwright page
|
|
191
|
+
* @returns Storage size info
|
|
192
|
+
*/
|
|
193
|
+
static async getStorageSize(page) {
|
|
194
|
+
return await page.evaluate(() => {
|
|
195
|
+
const getSize = (store) => {
|
|
196
|
+
let size = 0;
|
|
197
|
+
const keys = Object.keys(store);
|
|
198
|
+
for (const key of keys) {
|
|
199
|
+
const value = store.getItem(key) || '';
|
|
200
|
+
size += value.length + key.length;
|
|
201
|
+
}
|
|
202
|
+
return { entries: keys.length, size };
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
localStorage: getSize(localStorage),
|
|
206
|
+
sessionStorage: getSize(sessionStorage),
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Convenience function to reset page state
|
|
213
|
+
*/
|
|
214
|
+
export async function resetPageState(page, options) {
|
|
215
|
+
return StateReset.resetPage(page, options);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Convenience function to reset to blank
|
|
219
|
+
*/
|
|
220
|
+
export async function resetToBlank(page) {
|
|
221
|
+
return StateReset.resetToBlank(page);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Convenience function to setup test
|
|
225
|
+
*/
|
|
226
|
+
export async function setupTest(page, baseUrl) {
|
|
227
|
+
return StateReset.setupTest(page, baseUrl);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Convenience function to teardown test
|
|
231
|
+
*/
|
|
232
|
+
export async function teardownTest(context, page) {
|
|
233
|
+
return StateReset.teardownTest(context, page);
|
|
234
|
+
}
|