agentic-qe 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.json +44 -6
- package/.claude/skills/accessibility-testing/SKILL.md +777 -0
- package/.claude/skills/chaos-engineering-resilience/SKILL.md +109 -0
- package/.claude/skills/compatibility-testing/SKILL.md +101 -0
- package/.claude/skills/compliance-testing/SKILL.md +162 -0
- package/.claude/skills/contract-testing/SKILL.md +193 -0
- package/.claude/skills/database-testing/SKILL.md +243 -0
- package/.claude/skills/localization-testing/SKILL.md +115 -0
- package/.claude/skills/mobile-testing/SKILL.md +548 -0
- package/.claude/skills/mutation-testing/SKILL.md +129 -0
- package/.claude/skills/regression-testing/SKILL.md +1045 -0
- package/.claude/skills/shift-left-testing/SKILL.md +535 -0
- package/.claude/skills/shift-right-testing/SKILL.md +591 -0
- package/.claude/skills/skill-builder/SKILL.md +1 -1
- package/.claude/skills/test-data-management/SKILL.md +1067 -0
- package/.claude/skills/test-design-techniques/SKILL.md +160 -0
- package/.claude/skills/test-environment-management/SKILL.md +204 -0
- package/.claude/skills/test-reporting-analytics/SKILL.md +143 -0
- package/.claude/skills/visual-testing-advanced/SKILL.md +148 -0
- package/CHANGELOG.md +130 -511
- package/README.md +21 -10
- package/dist/agents/BaseAgent.d.ts.map +1 -1
- package/dist/agents/BaseAgent.js +5 -4
- package/dist/agents/BaseAgent.js.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/CoverageAnalyzerAgent.js +9 -8
- package/dist/agents/CoverageAnalyzerAgent.js.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.d.ts.map +1 -1
- package/dist/agents/FlakyTestHunterAgent.js +3 -2
- package/dist/agents/FlakyTestHunterAgent.js.map +1 -1
- package/dist/agents/FleetCommanderAgent.d.ts.map +1 -1
- package/dist/agents/FleetCommanderAgent.js +2 -1
- package/dist/agents/FleetCommanderAgent.js.map +1 -1
- package/dist/agents/PerformanceTesterAgent.d.ts.map +1 -1
- package/dist/agents/PerformanceTesterAgent.js +7 -6
- package/dist/agents/PerformanceTesterAgent.js.map +1 -1
- package/dist/agents/ProductionIntelligenceAgent.d.ts.map +1 -1
- package/dist/agents/ProductionIntelligenceAgent.js +7 -6
- package/dist/agents/ProductionIntelligenceAgent.js.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/QualityAnalyzerAgent.js +37 -36
- package/dist/agents/QualityAnalyzerAgent.js.map +1 -1
- package/dist/agents/QualityGateAgent.d.ts.map +1 -1
- package/dist/agents/QualityGateAgent.js +2 -1
- package/dist/agents/QualityGateAgent.js.map +1 -1
- package/dist/agents/RegressionRiskAnalyzerAgent.d.ts.map +1 -1
- package/dist/agents/RegressionRiskAnalyzerAgent.js +15 -14
- package/dist/agents/RegressionRiskAnalyzerAgent.js.map +1 -1
- package/dist/agents/SecurityScannerAgent.d.ts.map +1 -1
- package/dist/agents/SecurityScannerAgent.js +2 -1
- package/dist/agents/SecurityScannerAgent.js.map +1 -1
- package/dist/agents/TestDataArchitectAgent.d.ts.map +1 -1
- package/dist/agents/TestDataArchitectAgent.js +12 -11
- package/dist/agents/TestDataArchitectAgent.js.map +1 -1
- package/dist/agents/TestExecutorAgent.d.ts.map +1 -1
- package/dist/agents/TestExecutorAgent.js +17 -16
- package/dist/agents/TestExecutorAgent.js.map +1 -1
- package/dist/agents/TestGeneratorAgent.d.ts.map +1 -1
- package/dist/agents/TestGeneratorAgent.js +10 -9
- package/dist/agents/TestGeneratorAgent.js.map +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/cli/commands/agent/benchmark.d.ts.map +1 -1
- package/dist/cli/commands/agent/benchmark.js +2 -1
- package/dist/cli/commands/agent/benchmark.js.map +1 -1
- package/dist/cli/commands/agent/spawn.d.ts.map +1 -1
- package/dist/cli/commands/agent/spawn.js +2 -1
- package/dist/cli/commands/agent/spawn.js.map +1 -1
- package/dist/cli/commands/analyze.d.ts.map +1 -1
- package/dist/cli/commands/analyze.js +2 -1
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/config/list.d.ts.map +1 -1
- package/dist/cli/commands/config/list.js +2 -1
- package/dist/cli/commands/config/list.js.map +1 -1
- package/dist/cli/commands/config/set.d.ts +7 -0
- package/dist/cli/commands/config/set.d.ts.map +1 -1
- package/dist/cli/commands/config/set.js +35 -4
- package/dist/cli/commands/config/set.js.map +1 -1
- package/dist/cli/commands/fleet/logs.d.ts.map +1 -1
- package/dist/cli/commands/fleet/logs.js +2 -1
- package/dist/cli/commands/fleet/logs.js.map +1 -1
- package/dist/cli/commands/fleet/metrics.d.ts.map +1 -1
- package/dist/cli/commands/fleet/metrics.js +2 -1
- package/dist/cli/commands/fleet/metrics.js.map +1 -1
- package/dist/cli/commands/fleet/monitor.d.ts.map +1 -1
- package/dist/cli/commands/fleet/monitor.js +7 -5
- package/dist/cli/commands/fleet/monitor.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +2 -1
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +2 -1
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/improve/index.d.ts.map +1 -1
- package/dist/cli/commands/improve/index.js +12 -11
- package/dist/cli/commands/improve/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +54 -27
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learn/index.d.ts.map +1 -1
- package/dist/cli/commands/learn/index.js +13 -12
- package/dist/cli/commands/learn/index.js.map +1 -1
- package/dist/cli/commands/monitor/alerts.d.ts.map +1 -1
- package/dist/cli/commands/monitor/alerts.js +2 -1
- package/dist/cli/commands/monitor/alerts.js.map +1 -1
- package/dist/cli/commands/patterns/index.d.ts.map +1 -1
- package/dist/cli/commands/patterns/index.js +20 -19
- package/dist/cli/commands/patterns/index.js.map +1 -1
- package/dist/cli/commands/quality/decision.d.ts.map +1 -1
- package/dist/cli/commands/quality/decision.js +9 -7
- package/dist/cli/commands/quality/decision.js.map +1 -1
- package/dist/cli/commands/quality/gate.d.ts.map +1 -1
- package/dist/cli/commands/quality/gate.js +10 -8
- package/dist/cli/commands/quality/gate.js.map +1 -1
- package/dist/cli/commands/quality/policy.d.ts.map +1 -1
- package/dist/cli/commands/quality/policy.js +10 -8
- package/dist/cli/commands/quality/policy.js.map +1 -1
- package/dist/cli/commands/quality/risk.d.ts.map +1 -1
- package/dist/cli/commands/quality/risk.js +5 -3
- package/dist/cli/commands/quality/risk.js.map +1 -1
- package/dist/cli/commands/quality/validate.d.ts.map +1 -1
- package/dist/cli/commands/quality/validate.js +10 -8
- package/dist/cli/commands/quality/validate.js.map +1 -1
- package/dist/cli/commands/quantization.d.ts +6 -0
- package/dist/cli/commands/quantization.d.ts.map +1 -0
- package/dist/cli/commands/quantization.js +188 -0
- package/dist/cli/commands/quantization.js.map +1 -0
- package/dist/cli/commands/routing/index.d.ts +0 -6
- package/dist/cli/commands/routing/index.d.ts.map +1 -1
- package/dist/cli/commands/routing/index.js +17 -16
- package/dist/cli/commands/routing/index.js.map +1 -1
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +2 -1
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/skills/index.d.ts.map +1 -1
- package/dist/cli/commands/skills/index.js +10 -9
- package/dist/cli/commands/skills/index.js.map +1 -1
- package/dist/cli/commands/test/debug.d.ts.map +1 -1
- package/dist/cli/commands/test/debug.js +2 -1
- package/dist/cli/commands/test/debug.js.map +1 -1
- package/dist/cli/commands/test/mutate.d.ts.map +1 -1
- package/dist/cli/commands/test/mutate.js +2 -1
- package/dist/cli/commands/test/mutate.js.map +1 -1
- package/dist/cli/commands/test/parallel.d.ts.map +1 -1
- package/dist/cli/commands/test/parallel.js +6 -4
- package/dist/cli/commands/test/parallel.js.map +1 -1
- package/dist/cli/commands/test/profile.d.ts.map +1 -1
- package/dist/cli/commands/test/profile.js +3 -2
- package/dist/cli/commands/test/profile.js.map +1 -1
- package/dist/cli/commands/test/queue.d.ts.map +1 -1
- package/dist/cli/commands/test/queue.js +2 -1
- package/dist/cli/commands/test/queue.js.map +1 -1
- package/dist/cli/commands/test/retry.d.ts.map +1 -1
- package/dist/cli/commands/test/retry.js +6 -4
- package/dist/cli/commands/test/retry.js.map +1 -1
- package/dist/cli/commands/test/trace.d.ts.map +1 -1
- package/dist/cli/commands/test/trace.js +2 -1
- package/dist/cli/commands/test/trace.js.map +1 -1
- package/dist/cli/commands/test/watch.d.ts.map +1 -1
- package/dist/cli/commands/test/watch.js +3 -2
- package/dist/cli/commands/test/watch.js.map +1 -1
- package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
- package/dist/cli/commands/workflow/cancel.js +2 -1
- package/dist/cli/commands/workflow/cancel.js.map +1 -1
- package/dist/cli/index-working.js +9 -8
- package/dist/cli/index-working.js.map +1 -1
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/coordination/OODACoordination.d.ts.map +1 -1
- package/dist/core/coordination/OODACoordination.js +2 -1
- package/dist/core/coordination/OODACoordination.js.map +1 -1
- package/dist/core/memory/AgentDBManager.d.ts.map +1 -1
- package/dist/core/memory/AgentDBManager.js +2 -19
- package/dist/core/memory/AgentDBManager.js.map +1 -1
- package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -1
- package/dist/core/memory/RealAgentDBAdapter.js +4 -3
- package/dist/core/memory/RealAgentDBAdapter.js.map +1 -1
- package/dist/core/memory/ReasoningBankAdapter.d.ts.map +1 -1
- package/dist/core/memory/ReasoningBankAdapter.js +2 -5
- package/dist/core/memory/ReasoningBankAdapter.js.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
- package/dist/core/memory/SwarmMemoryManager.js +4 -3
- package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
- package/dist/core/neural/NeuralTrainer.d.ts.map +1 -1
- package/dist/core/neural/NeuralTrainer.js +3 -2
- package/dist/core/neural/NeuralTrainer.js.map +1 -1
- package/dist/core/quantization/QuantizationManager.d.ts +83 -0
- package/dist/core/quantization/QuantizationManager.d.ts.map +1 -0
- package/dist/core/quantization/QuantizationManager.js +264 -0
- package/dist/core/quantization/QuantizationManager.js.map +1 -0
- package/dist/core/quantization/index.d.ts +5 -0
- package/dist/core/quantization/index.d.ts.map +1 -0
- package/dist/core/quantization/index.js +9 -0
- package/dist/core/quantization/index.js.map +1 -0
- package/dist/learning/LearningEngine.d.ts.map +1 -1
- package/dist/learning/LearningEngine.js +4 -1
- package/dist/learning/LearningEngine.js.map +1 -1
- package/dist/mcp/handlers/advanced/mutation-test-execute.d.ts +3 -3
- package/dist/mcp/handlers/advanced/mutation-test-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/advanced/mutation-test-execute.js +5 -4
- package/dist/mcp/handlers/advanced/mutation-test-execute.js.map +1 -1
- package/dist/mcp/handlers/agent-spawn.d.ts.map +1 -1
- package/dist/mcp/handlers/agent-spawn.js +2 -1
- package/dist/mcp/handlers/agent-spawn.js.map +1 -1
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.js +9 -8
- package/dist/mcp/handlers/analysis/coverageAnalyzeSublinear.js.map +1 -1
- package/dist/mcp/handlers/analysis/coverageGapsDetect.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/coverageGapsDetect.js +6 -5
- package/dist/mcp/handlers/analysis/coverageGapsDetect.js.map +1 -1
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.js +5 -4
- package/dist/mcp/handlers/analysis/performance-monitor-realtime-handler.js.map +1 -1
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.js +8 -7
- package/dist/mcp/handlers/analysis/performanceBenchmarkRun.js.map +1 -1
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.js +7 -6
- package/dist/mcp/handlers/analysis/performanceMonitorRealtime.js.map +1 -1
- package/dist/mcp/handlers/analysis/securityScanComprehensive.d.ts.map +1 -1
- package/dist/mcp/handlers/analysis/securityScanComprehensive.js +18 -21
- package/dist/mcp/handlers/analysis/securityScanComprehensive.js.map +1 -1
- package/dist/mcp/handlers/base-handler.d.ts.map +1 -1
- package/dist/mcp/handlers/base-handler.js +2 -9
- package/dist/mcp/handlers/base-handler.js.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-failure.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js +4 -3
- package/dist/mcp/handlers/chaos/chaos-inject-failure.js.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.d.ts.map +1 -1
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js +6 -5
- package/dist/mcp/handlers/chaos/chaos-inject-latency.js.map +1 -1
- package/dist/mcp/handlers/coordination/event-emit.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/event-emit.js +2 -1
- package/dist/mcp/handlers/coordination/event-emit.js.map +1 -1
- package/dist/mcp/handlers/coordination/event-subscribe.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/event-subscribe.js +2 -1
- package/dist/mcp/handlers/coordination/event-subscribe.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-checkpoint.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-create.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-create.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-create.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-execute.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-execute.js.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-resume.d.ts.map +1 -1
- package/dist/mcp/handlers/coordination/workflow-resume.js +2 -1
- package/dist/mcp/handlers/coordination/workflow-resume.js.map +1 -1
- package/dist/mcp/handlers/fleet-init.d.ts.map +1 -1
- package/dist/mcp/handlers/fleet-init.js +2 -1
- package/dist/mcp/handlers/fleet-init.js.map +1 -1
- package/dist/mcp/handlers/fleet-status.d.ts.map +1 -1
- package/dist/mcp/handlers/fleet-status.js +31 -30
- package/dist/mcp/handlers/fleet-status.js.map +1 -1
- package/dist/mcp/handlers/integration/dependency-check.d.ts.map +1 -1
- package/dist/mcp/handlers/integration/dependency-check.js +3 -2
- package/dist/mcp/handlers/integration/dependency-check.js.map +1 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.d.ts.map +1 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.js +2 -1
- package/dist/mcp/handlers/integration/integration-test-orchestrate.js.map +1 -1
- package/dist/mcp/handlers/optimize-tests.d.ts.map +1 -1
- package/dist/mcp/handlers/optimize-tests.js +33 -32
- package/dist/mcp/handlers/optimize-tests.js.map +1 -1
- package/dist/mcp/handlers/predict-defects.d.ts.map +1 -1
- package/dist/mcp/handlers/predict-defects.js +46 -45
- package/dist/mcp/handlers/predict-defects.js.map +1 -1
- package/dist/mcp/handlers/prediction/deployment-readiness-check.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/deployment-readiness-check.js +24 -23
- package/dist/mcp/handlers/prediction/deployment-readiness-check.js.map +1 -1
- package/dist/mcp/handlers/prediction/predict-defects-ai.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/predict-defects-ai.js +10 -9
- package/dist/mcp/handlers/prediction/predict-defects-ai.js.map +1 -1
- package/dist/mcp/handlers/prediction/regression-risk-analyze.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/regression-risk-analyze.js +10 -9
- package/dist/mcp/handlers/prediction/regression-risk-analyze.js.map +1 -1
- package/dist/mcp/handlers/prediction/visual-test-regression.d.ts.map +1 -1
- package/dist/mcp/handlers/prediction/visual-test-regression.js +7 -6
- package/dist/mcp/handlers/prediction/visual-test-regression.js.map +1 -1
- package/dist/mcp/handlers/quality-analyze.d.ts.map +1 -1
- package/dist/mcp/handlers/quality-analyze.js +53 -52
- package/dist/mcp/handlers/quality-analyze.js.map +1 -1
- package/dist/mcp/handlers/task-orchestrate.d.ts.map +1 -1
- package/dist/mcp/handlers/task-orchestrate.js +19 -18
- package/dist/mcp/handlers/task-orchestrate.js.map +1 -1
- package/dist/mcp/handlers/test/test-execute-parallel.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-execute-parallel.js +7 -6
- package/dist/mcp/handlers/test/test-execute-parallel.js.map +1 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.js +2 -1
- package/dist/mcp/handlers/test/test-generate-enhanced.js.map +1 -1
- package/dist/mcp/handlers/test/test-optimize-sublinear.d.ts.map +1 -1
- package/dist/mcp/handlers/test/test-optimize-sublinear.js +3 -2
- package/dist/mcp/handlers/test/test-optimize-sublinear.js.map +1 -1
- package/dist/mcp/handlers/test-execute.d.ts.map +1 -1
- package/dist/mcp/handlers/test-execute.js +11 -10
- package/dist/mcp/handlers/test-execute.js.map +1 -1
- package/dist/mcp/handlers/test-generate.d.ts.map +1 -1
- package/dist/mcp/handlers/test-generate.js +4 -3
- package/dist/mcp/handlers/test-generate.js.map +1 -1
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +2 -1
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.d.ts.map +1 -1
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.js +10 -9
- package/dist/mcp/streaming/CoverageAnalyzeStreamHandler.js.map +1 -1
- package/dist/mcp/streaming/StreamingMCPTool.d.ts.map +1 -1
- package/dist/mcp/streaming/StreamingMCPTool.js +2 -1
- package/dist/mcp/streaming/StreamingMCPTool.js.map +1 -1
- package/dist/mcp/streaming/TestExecuteStreamHandler.d.ts.map +1 -1
- package/dist/mcp/streaming/TestExecuteStreamHandler.js +6 -5
- package/dist/mcp/streaming/TestExecuteStreamHandler.js.map +1 -1
- package/dist/reasoning/TestTemplateCreator.d.ts +10 -2
- package/dist/reasoning/TestTemplateCreator.d.ts.map +1 -1
- package/dist/reasoning/TestTemplateCreator.js +81 -21
- package/dist/reasoning/TestTemplateCreator.js.map +1 -1
- package/dist/types/pattern.types.d.ts +39 -3
- package/dist/types/pattern.types.d.ts.map +1 -1
- package/dist/utils/Config.js +2 -2
- package/dist/utils/Config.js.map +1 -1
- package/dist/utils/ProcessExit.d.ts +23 -0
- package/dist/utils/ProcessExit.d.ts.map +1 -0
- package/dist/utils/ProcessExit.js +40 -0
- package/dist/utils/ProcessExit.js.map +1 -0
- package/dist/utils/SecureRandom.d.ts +171 -0
- package/dist/utils/SecureRandom.d.ts.map +1 -0
- package/dist/utils/SecureRandom.js +229 -0
- package/dist/utils/SecureRandom.js.map +1 -0
- package/dist/utils/SecureUrlValidator.d.ts +167 -0
- package/dist/utils/SecureUrlValidator.d.ts.map +1 -0
- package/dist/utils/SecureUrlValidator.js +306 -0
- package/dist/utils/SecureUrlValidator.js.map +1 -0
- package/dist/utils/SecureValidation.d.ts +131 -0
- package/dist/utils/SecureValidation.d.ts.map +1 -0
- package/dist/utils/SecureValidation.js +265 -0
- package/dist/utils/SecureValidation.js.map +1 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +5 -4
- package/dist/utils/validation.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chaos-engineering-resilience
|
|
3
|
+
description: Chaos engineering principles, controlled failure injection, resilience testing, and system recovery validation. Use when testing distributed systems, building confidence in fault tolerance, or validating disaster recovery.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: specialized-testing
|
|
6
|
+
tags: [chaos-engineering, resilience, fault-injection, disaster-recovery, distributed-systems]
|
|
7
|
+
difficulty: advanced
|
|
8
|
+
estimated_time: 90 minutes
|
|
9
|
+
author: agentic-qe
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Chaos Engineering & Resilience Testing
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
**Systems fail. Build systems that fail gracefully.**
|
|
17
|
+
|
|
18
|
+
Chaos engineering proactively introduces failures to discover weaknesses before they cause outages. Resilience testing validates recovery capabilities.
|
|
19
|
+
|
|
20
|
+
## What is Chaos Engineering?
|
|
21
|
+
|
|
22
|
+
**Chaos Engineering:** Experimenting on distributed systems to build confidence in system ability to withstand turbulent conditions.
|
|
23
|
+
|
|
24
|
+
**Principles:**
|
|
25
|
+
1. Define steady state (normal metrics)
|
|
26
|
+
2. Hypothesize steady state continues
|
|
27
|
+
3. Introduce real-world failures
|
|
28
|
+
4. Try to disprove hypothesis
|
|
29
|
+
5. Fix weaknesses, repeat
|
|
30
|
+
|
|
31
|
+
## Types of Failures to Inject
|
|
32
|
+
|
|
33
|
+
### Network Failures
|
|
34
|
+
- Latency injection
|
|
35
|
+
- Packet loss
|
|
36
|
+
- Network partitions
|
|
37
|
+
- DNS failures
|
|
38
|
+
- Connection timeouts
|
|
39
|
+
|
|
40
|
+
### Infrastructure Failures
|
|
41
|
+
- Instance termination
|
|
42
|
+
- Disk failures
|
|
43
|
+
- CPU exhaustion
|
|
44
|
+
- Memory pressure
|
|
45
|
+
- Cascading failures
|
|
46
|
+
|
|
47
|
+
### Application Failures
|
|
48
|
+
- Exceptions
|
|
49
|
+
- Slow responses
|
|
50
|
+
- Resource leaks
|
|
51
|
+
- Deadlocks
|
|
52
|
+
|
|
53
|
+
## Controlled Experiments
|
|
54
|
+
|
|
55
|
+
**Start small, increase blast radius gradually:**
|
|
56
|
+
```
|
|
57
|
+
1. Development: Test locally
|
|
58
|
+
2. Staging: Test in staging environment
|
|
59
|
+
3. Production Canary: 1% of traffic
|
|
60
|
+
4. Production Gradual: 10% → 50% → 100%
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Netflix Chaos Monkey
|
|
64
|
+
|
|
65
|
+
**Randomly terminates instances:**
|
|
66
|
+
```javascript
|
|
67
|
+
// Chaos Monkey configuration
|
|
68
|
+
{
|
|
69
|
+
"enabled": true,
|
|
70
|
+
"meanTimeBetweenKillsInWorkDays": 2,
|
|
71
|
+
"minTimeBetweenKillsInWorkDays": 1,
|
|
72
|
+
"grouping": "cluster",
|
|
73
|
+
"regions": ["us-east-1"],
|
|
74
|
+
"exceptions": ["production-critical"]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## With qe-chaos-engineer Agent
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// Agent runs controlled chaos experiments
|
|
82
|
+
const experiment = await agent.runChaosExperiment({
|
|
83
|
+
target: 'payment-service',
|
|
84
|
+
failure: 'terminate-random-instance',
|
|
85
|
+
blastRadius: '10%',
|
|
86
|
+
duration: '5m',
|
|
87
|
+
steadyStateHypothesis: {
|
|
88
|
+
metric: 'success-rate',
|
|
89
|
+
threshold: 0.99
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Verifies:
|
|
94
|
+
// - System recovers automatically
|
|
95
|
+
// - Error rate stays below threshold
|
|
96
|
+
// - No data loss
|
|
97
|
+
// - Alerts triggered appropriately
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Remember
|
|
101
|
+
|
|
102
|
+
**Break things on purpose to prevent unplanned outages.**
|
|
103
|
+
|
|
104
|
+
- Find weaknesses before users do
|
|
105
|
+
- Build confidence in system resilience
|
|
106
|
+
- Validate recovery procedures work
|
|
107
|
+
- Create runbooks from experiments
|
|
108
|
+
|
|
109
|
+
**With Agents:** `qe-chaos-engineer` automates chaos experiments with blast radius control, automatic rollback, and comprehensive resilience validation.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compatibility-testing
|
|
3
|
+
description: Cross-browser, cross-platform, and cross-device compatibility testing ensuring consistent experience across environments. Use when validating browser support, testing responsive design, or ensuring platform compatibility.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: specialized-testing
|
|
6
|
+
tags: [compatibility, cross-browser, cross-platform, responsive-design, browser-testing]
|
|
7
|
+
difficulty: intermediate
|
|
8
|
+
estimated_time: 60 minutes
|
|
9
|
+
author: agentic-qe
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Compatibility Testing
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
**Users access your app from 100+ browser/device combinations.**
|
|
17
|
+
|
|
18
|
+
Compatibility testing ensures consistent functionality and UX across browsers, operating systems, devices, and screen sizes.
|
|
19
|
+
|
|
20
|
+
## Browser Matrix
|
|
21
|
+
|
|
22
|
+
**Test on:**
|
|
23
|
+
- Chrome (latest, N-1)
|
|
24
|
+
- Firefox (latest, N-1)
|
|
25
|
+
- Safari (latest, N-1)
|
|
26
|
+
- Edge (latest)
|
|
27
|
+
- Mobile Safari (iOS)
|
|
28
|
+
- Mobile Chrome (Android)
|
|
29
|
+
|
|
30
|
+
**Market share guidance:** Test browsers representing 95%+ of user base.
|
|
31
|
+
|
|
32
|
+
## Responsive Design Testing
|
|
33
|
+
|
|
34
|
+
**Screen sizes:**
|
|
35
|
+
```
|
|
36
|
+
Mobile: 320px - 480px
|
|
37
|
+
Tablet: 481px - 768px
|
|
38
|
+
Desktop: 769px - 1920px+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Test with Playwright:**
|
|
42
|
+
```javascript
|
|
43
|
+
const devices = [
|
|
44
|
+
{ name: 'iPhone 12', width: 390, height: 844 },
|
|
45
|
+
{ name: 'iPad', width: 768, height: 1024 },
|
|
46
|
+
{ name: 'Desktop', width: 1920, height: 1080 }
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
for (const device of devices) {
|
|
50
|
+
test(`layout on ${device.name}`, async ({ page }) => {
|
|
51
|
+
await page.setViewportSize({
|
|
52
|
+
width: device.width,
|
|
53
|
+
height: device.height
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
await page.goto('https://example.com');
|
|
57
|
+
|
|
58
|
+
// Verify responsive layout
|
|
59
|
+
const nav = await page.locator('nav');
|
|
60
|
+
if (device.width < 768) {
|
|
61
|
+
// Mobile: hamburger menu
|
|
62
|
+
expect(await nav.locator('.hamburger')).toBeVisible();
|
|
63
|
+
} else {
|
|
64
|
+
// Desktop: full menu
|
|
65
|
+
expect(await nav.locator('.menu-items')).toBeVisible();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Cloud Testing Services
|
|
72
|
+
|
|
73
|
+
**BrowserStack:**
|
|
74
|
+
```javascript
|
|
75
|
+
const capabilities = {
|
|
76
|
+
'browserName': 'Chrome',
|
|
77
|
+
'browser_version': '118.0',
|
|
78
|
+
'os': 'Windows',
|
|
79
|
+
'os_version': '11',
|
|
80
|
+
'browserstack.user': process.env.BROWSERSTACK_USER,
|
|
81
|
+
'browserstack.key': process.env.BROWSERSTACK_KEY
|
|
82
|
+
};
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Related Skills
|
|
86
|
+
|
|
87
|
+
- [mobile-testing](../mobile-testing/)
|
|
88
|
+
- [accessibility-testing](../accessibility-testing/)
|
|
89
|
+
- [visual-testing-advanced](../visual-testing-advanced/)
|
|
90
|
+
|
|
91
|
+
## Remember
|
|
92
|
+
|
|
93
|
+
**Test where users are, not where you develop.**
|
|
94
|
+
|
|
95
|
+
Developers use latest browsers, users don't. Test on:
|
|
96
|
+
- Older browsers (N-1, N-2)
|
|
97
|
+
- Low-end devices
|
|
98
|
+
- Slow networks
|
|
99
|
+
- Different screen sizes
|
|
100
|
+
|
|
101
|
+
**With Agents:** Agents orchestrate parallel cross-browser testing across cloud platforms, reducing 10 hours of testing to 15 minutes.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: compliance-testing
|
|
3
|
+
description: Regulatory compliance testing for GDPR, CCPA, HIPAA, SOC2, PCI-DSS and industry-specific regulations. Use when ensuring legal compliance, preparing for audits, or handling sensitive data.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: specialized-testing
|
|
6
|
+
tags: [compliance, gdpr, ccpa, hipaa, soc2, pci-dss, regulatory, audit]
|
|
7
|
+
difficulty: advanced
|
|
8
|
+
estimated_time: 90 minutes
|
|
9
|
+
author: agentic-qe
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Compliance Testing
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
**Non-compliance = fines, lawsuits, reputation damage.**
|
|
17
|
+
|
|
18
|
+
Compliance testing validates software meets legal and regulatory requirements. Critical for avoiding penalties and protecting users.
|
|
19
|
+
|
|
20
|
+
## GDPR Compliance Testing
|
|
21
|
+
|
|
22
|
+
**Key Requirements:**
|
|
23
|
+
- Right to access
|
|
24
|
+
- Right to erasure ("right to be forgotten")
|
|
25
|
+
- Data portability
|
|
26
|
+
- Consent management
|
|
27
|
+
- Breach notification
|
|
28
|
+
|
|
29
|
+
**Test data subject rights:**
|
|
30
|
+
```javascript
|
|
31
|
+
test('user can request their data', async () => {
|
|
32
|
+
const userId = 'user123';
|
|
33
|
+
|
|
34
|
+
// User requests data export
|
|
35
|
+
const response = await api.post('/data-export', { userId });
|
|
36
|
+
|
|
37
|
+
// Should receive download link
|
|
38
|
+
expect(response.status).toBe(200);
|
|
39
|
+
expect(response.data.downloadUrl).toBeDefined();
|
|
40
|
+
|
|
41
|
+
// Download contains all user data
|
|
42
|
+
const data = await downloadFile(response.data.downloadUrl);
|
|
43
|
+
expect(data).toHaveProperty('profile');
|
|
44
|
+
expect(data).toHaveProperty('orders');
|
|
45
|
+
expect(data).toHaveProperty('preferences');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('user can delete their account', async () => {
|
|
49
|
+
const userId = 'user123';
|
|
50
|
+
|
|
51
|
+
// User requests deletion
|
|
52
|
+
await api.delete(`/users/${userId}`);
|
|
53
|
+
|
|
54
|
+
// All personal data deleted
|
|
55
|
+
expect(await db.users.findOne({ id: userId })).toBeNull();
|
|
56
|
+
expect(await db.orders.find({ userId })).toHaveLength(0);
|
|
57
|
+
|
|
58
|
+
// Audit log retained (legal requirement)
|
|
59
|
+
const auditLog = await db.auditLogs.find({ userId });
|
|
60
|
+
expect(auditLog).toBeDefined();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('consent is tracked', async () => {
|
|
64
|
+
await api.post('/consent', {
|
|
65
|
+
userId: 'user123',
|
|
66
|
+
type: 'marketing',
|
|
67
|
+
granted: true,
|
|
68
|
+
timestamp: new Date(),
|
|
69
|
+
ipAddress: '192.168.1.1'
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const consent = await db.consents.findOne({
|
|
73
|
+
userId: 'user123',
|
|
74
|
+
type: 'marketing'
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(consent.granted).toBe(true);
|
|
78
|
+
expect(consent.timestamp).toBeDefined();
|
|
79
|
+
expect(consent.ipAddress).toBe('192.168.1.1');
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## HIPAA Compliance (Healthcare)
|
|
84
|
+
|
|
85
|
+
**Test PHI (Protected Health Information) security:**
|
|
86
|
+
```javascript
|
|
87
|
+
test('PHI is encrypted at rest', async () => {
|
|
88
|
+
const patient = await db.patients.create({
|
|
89
|
+
ssn: '123-45-6789',
|
|
90
|
+
medicalHistory: 'Diabetes, Hypertension'
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Verify encrypted in database
|
|
94
|
+
const raw = await db.raw('SELECT * FROM patients WHERE id = ?', patient.id);
|
|
95
|
+
expect(raw.ssn).not.toBe('123-45-6789'); // Should be encrypted
|
|
96
|
+
expect(raw.ssn).toMatch(/^[a-f0-9]{64}$/); // Looks like hash
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('access to PHI is logged', async () => {
|
|
100
|
+
await api.get('/patients/123', {
|
|
101
|
+
headers: { 'User-Id': 'doctor456' }
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const auditLog = await db.auditLogs.findOne({
|
|
105
|
+
resourceType: 'patient',
|
|
106
|
+
resourceId: '123',
|
|
107
|
+
userId: 'doctor456'
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
expect(auditLog.action).toBe('read');
|
|
111
|
+
expect(auditLog.timestamp).toBeDefined();
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## PCI-DSS (Payment Card Industry)
|
|
116
|
+
|
|
117
|
+
**Test credit card handling:**
|
|
118
|
+
```javascript
|
|
119
|
+
test('credit card numbers not stored', async () => {
|
|
120
|
+
await api.post('/payment', {
|
|
121
|
+
cardNumber: '4242424242424242',
|
|
122
|
+
expiry: '12/25',
|
|
123
|
+
cvv: '123'
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// Card number should NOT be in database
|
|
127
|
+
const payment = await db.payments.findOne({ /* ... */ });
|
|
128
|
+
expect(payment.cardNumber).toBeUndefined();
|
|
129
|
+
expect(payment.last4).toBe('4242'); // Only last 4 digits OK
|
|
130
|
+
expect(payment.tokenId).toBeDefined(); // Token from gateway
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('CVV never stored', async () => {
|
|
134
|
+
// CVV should never touch database
|
|
135
|
+
const payments = await db.raw('SELECT * FROM payments');
|
|
136
|
+
const hasCV = payments.some(p =>
|
|
137
|
+
JSON.stringify(p).includes('cvv') ||
|
|
138
|
+
JSON.stringify(p).includes('cvc')
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
expect(hasCVV).toBe(false);
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Related Skills
|
|
146
|
+
|
|
147
|
+
- [security-testing](../security-testing/)
|
|
148
|
+
- [test-data-management](../test-data-management/)
|
|
149
|
+
- [accessibility-testing](../accessibility-testing/)
|
|
150
|
+
|
|
151
|
+
## Remember
|
|
152
|
+
|
|
153
|
+
**Compliance is mandatory, not optional.**
|
|
154
|
+
|
|
155
|
+
Fines:
|
|
156
|
+
- GDPR: Up to €20M or 4% of revenue
|
|
157
|
+
- HIPAA: Up to $1.5M per violation
|
|
158
|
+
- PCI-DSS: Up to $100k per month
|
|
159
|
+
|
|
160
|
+
**Test continuously, audit trail everything.**
|
|
161
|
+
|
|
162
|
+
**With Agents:** Agents validate compliance requirements, detect violations, and generate audit reports automatically.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contract-testing
|
|
3
|
+
description: Consumer-driven contract testing for microservices using Pact, schema validation, API versioning, and backward compatibility testing. Use when testing API contracts, preventing breaking changes, or coordinating distributed teams.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: specialized-testing
|
|
6
|
+
tags: [contract-testing, pact, microservices, api-versioning, consumer-driven, schema-validation]
|
|
7
|
+
difficulty: advanced
|
|
8
|
+
estimated_time: 90 minutes
|
|
9
|
+
author: agentic-qe
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Contract Testing
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
**Microservices fail when API contracts break.**
|
|
17
|
+
|
|
18
|
+
Contract testing validates that providers (APIs) fulfill contracts expected by consumers (clients). Prevents breaking changes that cause production failures in distributed systems.
|
|
19
|
+
|
|
20
|
+
## What is Contract Testing?
|
|
21
|
+
|
|
22
|
+
**Contract:** Agreement between API provider and consumer about request/response structure.
|
|
23
|
+
|
|
24
|
+
**Traditional Testing Problems:**
|
|
25
|
+
```
|
|
26
|
+
Consumer Team: "We need user.id as integer"
|
|
27
|
+
Provider Team: "We changed it to UUID string"
|
|
28
|
+
→ Production failure! No one noticed until deployed.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Contract Testing Solution:**
|
|
32
|
+
```
|
|
33
|
+
1. Consumer defines expected contract
|
|
34
|
+
2. Provider validates against contract
|
|
35
|
+
3. Breaking changes caught before deployment
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Consumer-Driven Contracts (Pact)
|
|
39
|
+
|
|
40
|
+
**Install Pact:**
|
|
41
|
+
```bash
|
|
42
|
+
npm install --save-dev @pact-foundation/pact
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Consumer Test (defines contract):**
|
|
46
|
+
```javascript
|
|
47
|
+
import { PactV3 } from '@pact-foundation/pact';
|
|
48
|
+
|
|
49
|
+
const provider = new PactV3({
|
|
50
|
+
consumer: 'UserWebApp',
|
|
51
|
+
provider: 'UserAPI'
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('get user by id', async () => {
|
|
55
|
+
// Define expected interaction
|
|
56
|
+
await provider
|
|
57
|
+
.given('user 123 exists')
|
|
58
|
+
.uponReceiving('a request for user 123')
|
|
59
|
+
.withRequest({
|
|
60
|
+
method: 'GET',
|
|
61
|
+
path: '/users/123'
|
|
62
|
+
})
|
|
63
|
+
.willRespondWith({
|
|
64
|
+
status: 200,
|
|
65
|
+
headers: { 'Content-Type': 'application/json' },
|
|
66
|
+
body: {
|
|
67
|
+
id: 123,
|
|
68
|
+
email: 'user@example.com',
|
|
69
|
+
name: 'John Doe'
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Execute test
|
|
74
|
+
await provider.executeTest(async (mockServer) => {
|
|
75
|
+
const api = new UserAPI(mockServer.url);
|
|
76
|
+
const user = await api.getUser(123);
|
|
77
|
+
|
|
78
|
+
expect(user.id).toBe(123);
|
|
79
|
+
expect(user.email).toBe('user@example.com');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Generates pact contract file
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Provider Verification:**
|
|
87
|
+
```javascript
|
|
88
|
+
import { Verifier } from '@pact-foundation/pact';
|
|
89
|
+
|
|
90
|
+
test('provider honors all consumer contracts', async () => {
|
|
91
|
+
const verifier = new Verifier({
|
|
92
|
+
provider: 'UserAPI',
|
|
93
|
+
providerBaseUrl: 'http://localhost:3000',
|
|
94
|
+
|
|
95
|
+
// Load contracts from Pact Broker
|
|
96
|
+
pactBrokerUrl: 'https://pact-broker.example.com',
|
|
97
|
+
pactBrokerToken: process.env.PACT_BROKER_TOKEN,
|
|
98
|
+
|
|
99
|
+
// Or load local contracts
|
|
100
|
+
pactUrls: ['./pacts/UserWebApp-UserAPI.json'],
|
|
101
|
+
|
|
102
|
+
// Provider states
|
|
103
|
+
stateHandlers: {
|
|
104
|
+
'user 123 exists': async () => {
|
|
105
|
+
await db.users.create({ id: 123, email: 'user@example.com', name: 'John Doe' });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
await verifier.verifyProvider();
|
|
111
|
+
// Fails if provider doesn't match consumer expectations
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Schema Validation
|
|
116
|
+
|
|
117
|
+
**JSON Schema Contract:**
|
|
118
|
+
```javascript
|
|
119
|
+
const userSchema = {
|
|
120
|
+
type: 'object',
|
|
121
|
+
required: ['id', 'email'],
|
|
122
|
+
properties: {
|
|
123
|
+
id: { type: 'integer' },
|
|
124
|
+
email: { type: 'string', format: 'email' },
|
|
125
|
+
name: { type: 'string' },
|
|
126
|
+
createdAt: { type: 'string', format: 'date-time' }
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
test('API response matches schema', async () => {
|
|
131
|
+
const response = await fetch('/api/users/123');
|
|
132
|
+
const user = await response.json();
|
|
133
|
+
|
|
134
|
+
const validator = new Ajv();
|
|
135
|
+
const valid = validator.validate(userSchema, user);
|
|
136
|
+
|
|
137
|
+
expect(valid).toBe(true);
|
|
138
|
+
expect(validator.errors).toBeNull();
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## API Versioning Testing
|
|
143
|
+
|
|
144
|
+
**Test backward compatibility:**
|
|
145
|
+
```javascript
|
|
146
|
+
test('v2 API is backward compatible with v1', async () => {
|
|
147
|
+
// v1 client
|
|
148
|
+
const v1Response = await fetch('/api/v1/users/123');
|
|
149
|
+
const v1User = await v1Response.json();
|
|
150
|
+
|
|
151
|
+
// v2 client
|
|
152
|
+
const v2Response = await fetch('/api/v2/users/123');
|
|
153
|
+
const v2User = await v2Response.json();
|
|
154
|
+
|
|
155
|
+
// v2 must include all v1 fields
|
|
156
|
+
expect(v2User).toMatchObject(v1User);
|
|
157
|
+
|
|
158
|
+
// v2 can have additional fields
|
|
159
|
+
expect(v2User.newField).toBeDefined();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test('deprecated fields still present', async () => {
|
|
163
|
+
const response = await fetch('/api/v2/users/123');
|
|
164
|
+
const user = await response.json();
|
|
165
|
+
|
|
166
|
+
// Deprecated field still works (with warning header)
|
|
167
|
+
expect(user.oldField).toBeDefined();
|
|
168
|
+
expect(response.headers.get('Deprecation')).toBeTruthy();
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Related Skills
|
|
173
|
+
|
|
174
|
+
- [api-testing-patterns](../api-testing-patterns/) - API testing strategies
|
|
175
|
+
- [regression-testing](../regression-testing/) - Contract regression
|
|
176
|
+
- [agentic-quality-engineering](../agentic-quality-engineering/)
|
|
177
|
+
|
|
178
|
+
## Remember
|
|
179
|
+
|
|
180
|
+
**Breaking API changes break production.**
|
|
181
|
+
|
|
182
|
+
- Microservices depend on each other
|
|
183
|
+
- Changes propagate across services
|
|
184
|
+
- Integration tests miss distributed issues
|
|
185
|
+
- Contract testing catches breaks early
|
|
186
|
+
|
|
187
|
+
**Consumer-driven prevents surprises:**
|
|
188
|
+
- Consumers define expectations
|
|
189
|
+
- Providers validate before deployment
|
|
190
|
+
- Breaking changes caught in CI
|
|
191
|
+
- Safe, independent deployments
|
|
192
|
+
|
|
193
|
+
**With Agents:** `qe-api-contract-validator` automatically validates contracts, detects breaking changes, and ensures backward compatibility across all API versions.
|