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,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Network Simulator
|
|
3
|
+
*
|
|
4
|
+
* P0 Features: Network simulation for testing edge cases
|
|
5
|
+
* - Offline mode: Simulate network disconnection
|
|
6
|
+
* - HTTP errors: Simulate server errors (500, 503, 404, etc.)
|
|
7
|
+
* - Latency: Simulate slow networks
|
|
8
|
+
* - Throttling: Simulate bandwidth limitations
|
|
9
|
+
*
|
|
10
|
+
* Uses Playwright's page.route() for request interception
|
|
11
|
+
*/
|
|
12
|
+
import type { Page } from '@playwright/test';
|
|
13
|
+
/**
|
|
14
|
+
* HTTP error configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface HTTPErrorConfig {
|
|
17
|
+
/**
|
|
18
|
+
* HTTP status code to simulate
|
|
19
|
+
* Common values: 404, 500, 502, 503, 504
|
|
20
|
+
*/
|
|
21
|
+
status: number;
|
|
22
|
+
/**
|
|
23
|
+
* Optional custom status text
|
|
24
|
+
*/
|
|
25
|
+
statusText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional response body
|
|
28
|
+
*/
|
|
29
|
+
body?: string;
|
|
30
|
+
/**
|
|
31
|
+
* URL pattern to apply error to (regex or string)
|
|
32
|
+
* If not specified, applies to all requests
|
|
33
|
+
*/
|
|
34
|
+
urlPattern?: string | RegExp;
|
|
35
|
+
/**
|
|
36
|
+
* HTTP methods to apply error to
|
|
37
|
+
* If not specified, applies to all methods
|
|
38
|
+
*/
|
|
39
|
+
methods?: string[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Network simulation options
|
|
43
|
+
*/
|
|
44
|
+
export interface NetworkSimulationOptions {
|
|
45
|
+
/**
|
|
46
|
+
* Simulate offline mode (no network connection)
|
|
47
|
+
*/
|
|
48
|
+
offline?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Simulate HTTP errors
|
|
51
|
+
*/
|
|
52
|
+
httpErrors?: HTTPErrorConfig[];
|
|
53
|
+
/**
|
|
54
|
+
* Simulate latency (delay in ms)
|
|
55
|
+
*/
|
|
56
|
+
latency?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Simulate throttling (max bytes per second)
|
|
59
|
+
*/
|
|
60
|
+
throttling?: {
|
|
61
|
+
downloadKbps?: number;
|
|
62
|
+
uploadKbps?: number;
|
|
63
|
+
latency?: number;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Network Simulator class
|
|
68
|
+
*/
|
|
69
|
+
export declare class NetworkSimulator {
|
|
70
|
+
private page;
|
|
71
|
+
private activeRoutes;
|
|
72
|
+
private isOffline;
|
|
73
|
+
constructor(page: Page);
|
|
74
|
+
/**
|
|
75
|
+
* Apply network simulation settings
|
|
76
|
+
*/
|
|
77
|
+
simulate(options: NetworkSimulationOptions): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Set offline mode
|
|
80
|
+
* P0: Simulate network disconnection
|
|
81
|
+
*/
|
|
82
|
+
setOffline(offline: boolean): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Add HTTP error simulation
|
|
85
|
+
* P0: Simulate server errors (500, 503, 404, etc.)
|
|
86
|
+
*/
|
|
87
|
+
addHTTPError(config: HTTPErrorConfig): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Set latency for all requests
|
|
90
|
+
*/
|
|
91
|
+
setLatency(delayMs: number): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Set network throttling
|
|
94
|
+
* Uses Chrome DevTools Protocol for accurate throttling
|
|
95
|
+
*/
|
|
96
|
+
setThrottling(config: {
|
|
97
|
+
downloadKbps?: number;
|
|
98
|
+
uploadKbps?: number;
|
|
99
|
+
latency?: number;
|
|
100
|
+
}): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Clear all network simulations
|
|
103
|
+
*/
|
|
104
|
+
clear(): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Get default status text for HTTP status codes
|
|
107
|
+
*/
|
|
108
|
+
private getDefaultStatusText;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Predefined network profiles
|
|
112
|
+
*/
|
|
113
|
+
export declare const NetworkProfiles: {
|
|
114
|
+
/**
|
|
115
|
+
* Offline mode - no network connection
|
|
116
|
+
*/
|
|
117
|
+
offline: () => NetworkSimulationOptions;
|
|
118
|
+
/**
|
|
119
|
+
* Slow 3G network
|
|
120
|
+
*/
|
|
121
|
+
slow3G: () => NetworkSimulationOptions;
|
|
122
|
+
/**
|
|
123
|
+
* Fast 3G network
|
|
124
|
+
*/
|
|
125
|
+
fast3G: () => NetworkSimulationOptions;
|
|
126
|
+
/**
|
|
127
|
+
* Server error simulation (500)
|
|
128
|
+
*/
|
|
129
|
+
serverError: (urlPattern?: string | RegExp) => NetworkSimulationOptions;
|
|
130
|
+
/**
|
|
131
|
+
* Service unavailable simulation (503)
|
|
132
|
+
*/
|
|
133
|
+
serviceUnavailable: (urlPattern?: string | RegExp) => NetworkSimulationOptions;
|
|
134
|
+
/**
|
|
135
|
+
* Not found simulation (404)
|
|
136
|
+
*/
|
|
137
|
+
notFound: (urlPattern?: string | RegExp) => NetworkSimulationOptions;
|
|
138
|
+
/**
|
|
139
|
+
* Multiple server errors for testing resilience
|
|
140
|
+
*/
|
|
141
|
+
flakyServer: (urlPattern?: string | RegExp) => NetworkSimulationOptions;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Convenience function to create a network simulator
|
|
145
|
+
*/
|
|
146
|
+
export declare function createNetworkSimulator(page: Page): NetworkSimulator;
|
|
147
|
+
/**
|
|
148
|
+
* Convenience function to simulate network conditions
|
|
149
|
+
*/
|
|
150
|
+
export declare function simulateNetwork(page: Page, options: NetworkSimulationOptions): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Convenience function to set offline mode
|
|
153
|
+
*/
|
|
154
|
+
export declare function setOffline(page: Page, offline: boolean): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Convenience function to simulate HTTP error
|
|
157
|
+
*/
|
|
158
|
+
export declare function simulateHTTPError(page: Page, config: HTTPErrorConfig): Promise<void>;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Network Simulator
|
|
3
|
+
*
|
|
4
|
+
* P0 Features: Network simulation for testing edge cases
|
|
5
|
+
* - Offline mode: Simulate network disconnection
|
|
6
|
+
* - HTTP errors: Simulate server errors (500, 503, 404, etc.)
|
|
7
|
+
* - Latency: Simulate slow networks
|
|
8
|
+
* - Throttling: Simulate bandwidth limitations
|
|
9
|
+
*
|
|
10
|
+
* Uses Playwright's page.route() for request interception
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Network Simulator class
|
|
14
|
+
*/
|
|
15
|
+
export class NetworkSimulator {
|
|
16
|
+
page;
|
|
17
|
+
activeRoutes = [];
|
|
18
|
+
isOffline = false;
|
|
19
|
+
constructor(page) {
|
|
20
|
+
this.page = page;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Apply network simulation settings
|
|
24
|
+
*/
|
|
25
|
+
async simulate(options) {
|
|
26
|
+
// Remove existing routes first
|
|
27
|
+
await this.clear();
|
|
28
|
+
// Apply offline mode
|
|
29
|
+
if (options.offline) {
|
|
30
|
+
await this.setOffline(true);
|
|
31
|
+
}
|
|
32
|
+
// Apply HTTP errors
|
|
33
|
+
if (options.httpErrors) {
|
|
34
|
+
for (const errorConfig of options.httpErrors) {
|
|
35
|
+
await this.addHTTPError(errorConfig);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Apply latency
|
|
39
|
+
if (options.latency) {
|
|
40
|
+
await this.setLatency(options.latency);
|
|
41
|
+
}
|
|
42
|
+
// Apply throttling
|
|
43
|
+
if (options.throttling) {
|
|
44
|
+
await this.setThrottling(options.throttling);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Set offline mode
|
|
49
|
+
* P0: Simulate network disconnection
|
|
50
|
+
*/
|
|
51
|
+
async setOffline(offline) {
|
|
52
|
+
this.isOffline = offline;
|
|
53
|
+
if (offline) {
|
|
54
|
+
// Abort all requests when offline
|
|
55
|
+
const pattern = /.*/;
|
|
56
|
+
const handler = async (route) => {
|
|
57
|
+
await route.abort('failed');
|
|
58
|
+
};
|
|
59
|
+
await this.page.route(pattern, handler);
|
|
60
|
+
this.activeRoutes.push({ pattern, handler });
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// Remove offline route
|
|
64
|
+
await this.clear();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Add HTTP error simulation
|
|
69
|
+
* P0: Simulate server errors (500, 503, 404, etc.)
|
|
70
|
+
*/
|
|
71
|
+
async addHTTPError(config) {
|
|
72
|
+
const pattern = config.urlPattern || /.*/;
|
|
73
|
+
const status = config.status;
|
|
74
|
+
const statusText = config.statusText || this.getDefaultStatusText(status);
|
|
75
|
+
const body = config.body || `Error ${status}: ${statusText}`;
|
|
76
|
+
const methods = config.methods;
|
|
77
|
+
const handler = async (route) => {
|
|
78
|
+
// Check method filter
|
|
79
|
+
if (methods && !methods.includes(route.request().method())) {
|
|
80
|
+
await route.continue();
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
await route.fulfill({
|
|
84
|
+
status,
|
|
85
|
+
// Note: Playwright doesn't support statusText in route.fulfill()
|
|
86
|
+
// The status is sufficient for most testing purposes
|
|
87
|
+
contentType: 'text/plain',
|
|
88
|
+
body,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
await this.page.route(pattern, handler);
|
|
92
|
+
this.activeRoutes.push({ pattern, handler });
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Set latency for all requests
|
|
96
|
+
*/
|
|
97
|
+
async setLatency(delayMs) {
|
|
98
|
+
const pattern = /.*/;
|
|
99
|
+
const handler = async (route) => {
|
|
100
|
+
// Simulate latency before continuing
|
|
101
|
+
await new Promise(resolve => setTimeout(resolve, delayMs));
|
|
102
|
+
await route.continue();
|
|
103
|
+
};
|
|
104
|
+
await this.page.route(pattern, handler);
|
|
105
|
+
this.activeRoutes.push({ pattern, handler });
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Set network throttling
|
|
109
|
+
* Uses Chrome DevTools Protocol for accurate throttling
|
|
110
|
+
*/
|
|
111
|
+
async setThrottling(config) {
|
|
112
|
+
const client = await this.page.context().newCDPSession(this.page);
|
|
113
|
+
await client.send('Network.emulateNetworkConditions', {
|
|
114
|
+
offline: false,
|
|
115
|
+
downloadThroughput: (config.downloadKbps || 1500) * 1024 / 8, // Convert to bytes/sec
|
|
116
|
+
uploadThroughput: (config.uploadKbps || 750) * 1024 / 8,
|
|
117
|
+
latency: config.latency || 0,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Clear all network simulations
|
|
122
|
+
*/
|
|
123
|
+
async clear() {
|
|
124
|
+
// Remove all routes
|
|
125
|
+
this.activeRoutes = [];
|
|
126
|
+
this.isOffline = false;
|
|
127
|
+
// Unregister all routes by resetting the page
|
|
128
|
+
// Note: Playwright doesn't have a direct way to remove all routes,
|
|
129
|
+
// so we need to use a workaround with a counter
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get default status text for HTTP status codes
|
|
133
|
+
*/
|
|
134
|
+
getDefaultStatusText(status) {
|
|
135
|
+
const statusTexts = {
|
|
136
|
+
400: 'Bad Request',
|
|
137
|
+
401: 'Unauthorized',
|
|
138
|
+
403: 'Forbidden',
|
|
139
|
+
404: 'Not Found',
|
|
140
|
+
500: 'Internal Server Error',
|
|
141
|
+
502: 'Bad Gateway',
|
|
142
|
+
503: 'Service Unavailable',
|
|
143
|
+
504: 'Gateway Timeout',
|
|
144
|
+
};
|
|
145
|
+
return statusTexts[status] || 'Unknown Error';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Predefined network profiles
|
|
150
|
+
*/
|
|
151
|
+
export const NetworkProfiles = {
|
|
152
|
+
/**
|
|
153
|
+
* Offline mode - no network connection
|
|
154
|
+
*/
|
|
155
|
+
offline: () => ({
|
|
156
|
+
offline: true,
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* Slow 3G network
|
|
160
|
+
*/
|
|
161
|
+
slow3G: () => ({
|
|
162
|
+
latency: 200,
|
|
163
|
+
throttling: {
|
|
164
|
+
downloadKbps: 400,
|
|
165
|
+
uploadKbps: 400,
|
|
166
|
+
latency: 200,
|
|
167
|
+
},
|
|
168
|
+
}),
|
|
169
|
+
/**
|
|
170
|
+
* Fast 3G network
|
|
171
|
+
*/
|
|
172
|
+
fast3G: () => ({
|
|
173
|
+
latency: 100,
|
|
174
|
+
throttling: {
|
|
175
|
+
downloadKbps: 1500,
|
|
176
|
+
uploadKbps: 750,
|
|
177
|
+
latency: 100,
|
|
178
|
+
},
|
|
179
|
+
}),
|
|
180
|
+
/**
|
|
181
|
+
* Server error simulation (500)
|
|
182
|
+
*/
|
|
183
|
+
serverError: (urlPattern) => ({
|
|
184
|
+
httpErrors: [
|
|
185
|
+
{
|
|
186
|
+
status: 500,
|
|
187
|
+
statusText: 'Internal Server Error',
|
|
188
|
+
body: '{"error": "Internal Server Error"}',
|
|
189
|
+
urlPattern,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
}),
|
|
193
|
+
/**
|
|
194
|
+
* Service unavailable simulation (503)
|
|
195
|
+
*/
|
|
196
|
+
serviceUnavailable: (urlPattern) => ({
|
|
197
|
+
httpErrors: [
|
|
198
|
+
{
|
|
199
|
+
status: 503,
|
|
200
|
+
statusText: 'Service Unavailable',
|
|
201
|
+
body: '{"error": "Service Unavailable"}',
|
|
202
|
+
urlPattern,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
}),
|
|
206
|
+
/**
|
|
207
|
+
* Not found simulation (404)
|
|
208
|
+
*/
|
|
209
|
+
notFound: (urlPattern) => ({
|
|
210
|
+
httpErrors: [
|
|
211
|
+
{
|
|
212
|
+
status: 404,
|
|
213
|
+
statusText: 'Not Found',
|
|
214
|
+
body: '{"error": "Not Found"}',
|
|
215
|
+
urlPattern,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
}),
|
|
219
|
+
/**
|
|
220
|
+
* Multiple server errors for testing resilience
|
|
221
|
+
*/
|
|
222
|
+
flakyServer: (urlPattern) => ({
|
|
223
|
+
httpErrors: [
|
|
224
|
+
{
|
|
225
|
+
status: 503,
|
|
226
|
+
statusText: 'Service Unavailable',
|
|
227
|
+
body: '{"error": "Service Unavailable"}',
|
|
228
|
+
urlPattern,
|
|
229
|
+
methods: ['GET'],
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
latency: 100,
|
|
233
|
+
}),
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* Convenience function to create a network simulator
|
|
237
|
+
*/
|
|
238
|
+
export function createNetworkSimulator(page) {
|
|
239
|
+
return new NetworkSimulator(page);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Convenience function to simulate network conditions
|
|
243
|
+
*/
|
|
244
|
+
export async function simulateNetwork(page, options) {
|
|
245
|
+
const simulator = new NetworkSimulator(page);
|
|
246
|
+
await simulator.simulate(options);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Convenience function to set offline mode
|
|
250
|
+
*/
|
|
251
|
+
export async function setOffline(page, offline) {
|
|
252
|
+
const simulator = new NetworkSimulator(page);
|
|
253
|
+
await simulator.setOffline(offline);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Convenience function to simulate HTTP error
|
|
257
|
+
*/
|
|
258
|
+
export async function simulateHTTPError(page, config) {
|
|
259
|
+
const simulator = new NetworkSimulator(page);
|
|
260
|
+
await simulator.addHTTPError(config);
|
|
261
|
+
}
|
|
@@ -22,8 +22,8 @@ export class PackValidator {
|
|
|
22
22
|
const __dirname = dirname(__filename);
|
|
23
23
|
// Check multiple paths to handle both development and bundled npm environments
|
|
24
24
|
// From cli/dist/core/pack/validator.js, we need to reach core/schemas/pack.schema.json
|
|
25
|
-
const path1 = join(__dirname, '../../schemas/pack.schema.json');
|
|
26
|
-
const path2 = join(__dirname, '../../../../core/schemas/pack.schema.json');
|
|
25
|
+
const path1 = join(__dirname, '../../schemas/pack.schema.json'); // bundled (cli/dist/core/schemas/)
|
|
26
|
+
const path2 = join(__dirname, '../../../../core/schemas/pack.schema.json'); // npm package (core/schemas/)
|
|
27
27
|
let schemaPath = existsSync(path1) ? path1 : path2;
|
|
28
28
|
// Final fallback: throw error if no schema found
|
|
29
29
|
if (!existsSync(schemaPath)) {
|
|
@@ -41,12 +41,17 @@ export declare class PackMigrator {
|
|
|
41
41
|
* Migrate targets to gate configs
|
|
42
42
|
*/
|
|
43
43
|
private migrateTargetsToGates;
|
|
44
|
+
/**
|
|
45
|
+
* Transform relative page paths to full URLs
|
|
46
|
+
*/
|
|
47
|
+
private transformPagesToFullUrls;
|
|
44
48
|
/**
|
|
45
49
|
* Find a secret in environment variables by trying common names
|
|
46
50
|
*/
|
|
47
51
|
private findSecretInEnv;
|
|
48
52
|
/**
|
|
49
53
|
* Sanitize gate name for v2 format
|
|
54
|
+
* Handles both strings and objects (from YAML parsing edge cases)
|
|
50
55
|
*/
|
|
51
56
|
private sanitizeGateName;
|
|
52
57
|
/**
|
|
@@ -395,14 +395,64 @@ export class PackMigrator {
|
|
|
395
395
|
gate.config.baseUrl = v1Pack.targets.api.baseUrl;
|
|
396
396
|
gate.config.smoke = v1Pack.targets.api.smoke;
|
|
397
397
|
}
|
|
398
|
-
// Web target
|
|
399
|
-
if (v1Pack.targets.web
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
// Web target - migrate to ui, a11y, and accessibility gates
|
|
399
|
+
if (v1Pack.targets.web) {
|
|
400
|
+
const baseUrl = v1Pack.targets.web.baseUrl;
|
|
401
|
+
const pages = this.transformPagesToFullUrls(v1Pack.targets.web.pages || [], baseUrl);
|
|
402
|
+
// ui gate
|
|
403
|
+
if (v2Pack.gates['ui']) {
|
|
404
|
+
const gate = v2Pack.gates['ui'];
|
|
405
|
+
gate.config = gate.config || {};
|
|
406
|
+
gate.config.baseUrl = baseUrl;
|
|
407
|
+
gate.config.pages = pages;
|
|
408
|
+
}
|
|
409
|
+
// a11y gate (v1 name)
|
|
410
|
+
if (v2Pack.gates['a11y']) {
|
|
411
|
+
const gate = v2Pack.gates['a11y'];
|
|
412
|
+
gate.config = gate.config || {};
|
|
413
|
+
gate.config.baseUrl = baseUrl;
|
|
414
|
+
gate.config.pages = pages;
|
|
415
|
+
}
|
|
416
|
+
// accessibility gate (v2 sanitized name from 'a11y')
|
|
417
|
+
if (v2Pack.gates['accessibility']) {
|
|
418
|
+
const gate = v2Pack.gates['accessibility'];
|
|
419
|
+
gate.config = gate.config || {};
|
|
420
|
+
gate.config.baseUrl = baseUrl;
|
|
421
|
+
gate.config.pages = pages;
|
|
422
|
+
}
|
|
404
423
|
}
|
|
405
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Transform relative page paths to full URLs
|
|
427
|
+
*/
|
|
428
|
+
transformPagesToFullUrls(pages, baseUrl) {
|
|
429
|
+
if (!pages || pages.length === 0)
|
|
430
|
+
return [];
|
|
431
|
+
if (!baseUrl)
|
|
432
|
+
return pages;
|
|
433
|
+
const base = baseUrl.replace(/\/$/, '');
|
|
434
|
+
return pages.map((page) => {
|
|
435
|
+
// Handle string pages (e.g., "/", "/products")
|
|
436
|
+
if (typeof page === 'string') {
|
|
437
|
+
if (page.startsWith('http')) {
|
|
438
|
+
return page; // Already a full URL
|
|
439
|
+
}
|
|
440
|
+
return `${base}${page.startsWith('/') ? '' : '/'}${page}`;
|
|
441
|
+
}
|
|
442
|
+
// Handle object pages (e.g., { url: "/", ... })
|
|
443
|
+
if (page && typeof page === 'object' && page.url) {
|
|
444
|
+
const url = page.url;
|
|
445
|
+
if (url.startsWith('http')) {
|
|
446
|
+
return page; // Already a full URL
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
...page,
|
|
450
|
+
url: `${base}${url.startsWith('/') ? '' : '/'}${url}`
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
return page;
|
|
454
|
+
});
|
|
455
|
+
}
|
|
406
456
|
/**
|
|
407
457
|
* Find a secret in environment variables by trying common names
|
|
408
458
|
*/
|
|
@@ -424,8 +474,33 @@ export class PackMigrator {
|
|
|
424
474
|
}
|
|
425
475
|
/**
|
|
426
476
|
* Sanitize gate name for v2 format
|
|
477
|
+
* Handles both strings and objects (from YAML parsing edge cases)
|
|
427
478
|
*/
|
|
428
479
|
sanitizeGateName(gate) {
|
|
480
|
+
// Handle edge case where gate might be an object from YAML parsing
|
|
481
|
+
if (typeof gate !== 'string') {
|
|
482
|
+
// If gate is an object, try to extract a name
|
|
483
|
+
if (gate && typeof gate === 'object') {
|
|
484
|
+
// Try common property names
|
|
485
|
+
const possibleName = gate.name || gate.id || gate.gate;
|
|
486
|
+
if (typeof possibleName === 'string') {
|
|
487
|
+
gate = possibleName;
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
// Fallback: stringify the object keys
|
|
491
|
+
const keys = Object.keys(gate);
|
|
492
|
+
if (keys.length === 1) {
|
|
493
|
+
gate = keys[0];
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
throw new Error(`Invalid gate format: expected string, got object with keys: ${keys.join(', ')}`);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
throw new Error(`Invalid gate format: expected string, got ${typeof gate}`);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
429
504
|
// Map v1 gate names to v2 conventions
|
|
430
505
|
const nameMap = {
|
|
431
506
|
'api_smoke': 'smoke',
|
|
@@ -370,7 +370,8 @@ export class PackValidatorV2 {
|
|
|
370
370
|
// Validate auth profile reference
|
|
371
371
|
if (gate.auth) {
|
|
372
372
|
// Will be validated against profiles in auth section
|
|
373
|
-
|
|
373
|
+
const adapter = typeof gate.adapter === 'string' ? gate.adapter : '';
|
|
374
|
+
if (adapter && !adapter.includes('api') && !adapter.includes('ui')) {
|
|
374
375
|
warnings.push({
|
|
375
376
|
code: 'QP2V019',
|
|
376
377
|
message: `Auth profile specified but adapter may not support auth`,
|
|
@@ -593,7 +594,7 @@ export class PackValidatorV2 {
|
|
|
593
594
|
return { errors, warnings };
|
|
594
595
|
}
|
|
595
596
|
// Check for API gate with api auth but no auth profile
|
|
596
|
-
const apiGates = Object.entries(pack.gates).filter(([_, g]) => g.adapter
|
|
597
|
+
const apiGates = Object.entries(pack.gates).filter(([_, g]) => typeof g.adapter === 'string' && g.adapter.includes('api'));
|
|
597
598
|
if (apiGates.length > 0 && !pack.auth?.api && !pack.auth?.profiles) {
|
|
598
599
|
warnings.push({
|
|
599
600
|
code: 'QP2V034',
|
|
@@ -603,7 +604,7 @@ export class PackValidatorV2 {
|
|
|
603
604
|
});
|
|
604
605
|
}
|
|
605
606
|
// Check for UI gate with ui auth but no auth profile
|
|
606
|
-
const uiGates = Object.entries(pack.gates).filter(([_, g]) => g.adapter
|
|
607
|
+
const uiGates = Object.entries(pack.gates).filter(([_, g]) => typeof g.adapter === 'string' && g.adapter.includes('ui'));
|
|
607
608
|
if (uiGates.length > 0 && !pack.auth?.ui && !pack.auth?.profiles) {
|
|
608
609
|
warnings.push({
|
|
609
610
|
code: 'QP2V035',
|
|
@@ -335,7 +335,7 @@ export class PuppeteerBasePage extends BasePage {
|
|
|
335
335
|
async waitFor(selectorName, options) {
|
|
336
336
|
const selector = this.getSelector(selectorName);
|
|
337
337
|
await this.page.waitForSelector(selector, {
|
|
338
|
-
timeout: options?.timeout ||
|
|
338
|
+
timeout: options?.timeout || 10000,
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
@@ -32,7 +32,7 @@ export class PageObjectLoader {
|
|
|
32
32
|
this.cwd = options.cwd || process.cwd();
|
|
33
33
|
this.baseUrl = options.baseUrl || '';
|
|
34
34
|
this.cacheEnabled = options.cache !== false;
|
|
35
|
-
this.timeout = options.timeout ||
|
|
35
|
+
this.timeout = options.timeout || 10000;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Get page by name
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Reporting Module
|
|
3
|
+
*
|
|
4
|
+
* P0 Features: Generates test reports in various formats (HTML, JSON, JUnit)
|
|
5
|
+
* - HTML: Interactive reports with embedded screenshots/videos
|
|
6
|
+
* - JUnit XML: CI/CD integration (Jenkins, GitLab CI, GitHub Actions, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export { HTMLReporter, generateHTMLReport, type ReportData, type TestReport, type StepReport, type ReportScreenshotArtifact as ScreenshotArtifact, type ReportVideoArtifact as VideoArtifact, type ReportTraceArtifact as TraceArtifact, } from './html-reporter.js';
|
|
9
|
+
export { JUnitReporter, generateJUnitReport, generateJUnitReportToFile, type JUnitTestCase, type JUnitTestSuite, type JUnitOptions, } from './junit-reporter.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Reporting Module
|
|
3
|
+
*
|
|
4
|
+
* P0 Features: Generates test reports in various formats (HTML, JSON, JUnit)
|
|
5
|
+
* - HTML: Interactive reports with embedded screenshots/videos
|
|
6
|
+
* - JUnit XML: CI/CD integration (Jenkins, GitLab CI, GitHub Actions, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export { HTMLReporter, generateHTMLReport, } from './html-reporter.js';
|
|
9
|
+
// P0: JUnit XML Reporter for CI/CD integration
|
|
10
|
+
export { JUnitReporter, generateJUnitReport, generateJUnitReportToFile, } from './junit-reporter.js';
|