snow-flow 3.0.9 → 3.0.13
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-flow.bat +0 -0
- package/claude-flow.ps1 +0 -0
- package/dist/mcp/intelligent-reporting-mcp.d.ts +7 -0
- package/dist/mcp/intelligent-reporting-mcp.js +379 -0
- package/dist/mcp/servicenow-automation-mcp.js +0 -0
- package/dist/mcp/servicenow-deployment-mcp.js +0 -0
- package/dist/mcp/servicenow-integration-mcp.js +0 -0
- package/dist/mcp/servicenow-mcp-server.js +0 -0
- package/dist/mcp/servicenow-operations-mcp.js +0 -0
- package/dist/mcp/servicenow-platform-development-mcp.js +0 -0
- package/dist/mcp/servicenow-progressive-indexer.js +0 -0
- package/dist/mcp/servicenow-reporting-analytics-mcp.js +280 -29
- package/dist/mcp/servicenow-security-compliance-mcp.js +0 -0
- package/dist/mcp/servicenow-update-set-mcp.js +0 -0
- package/dist/mcp/start-all-mcp-servers.js +0 -0
- package/dist/mcp/start-servicenow-mcp.js +0 -0
- package/dist/services/widget-deployment-service.d.ts +2 -1
- package/dist/services/widget-deployment-service.js +17 -16
- package/dist/utils/anti-mock-data-validator.d.ts +66 -0
- package/dist/utils/anti-mock-data-validator.js +316 -0
- package/dist/utils/servicenow-eventual-consistency.d.ts +120 -0
- package/dist/utils/servicenow-eventual-consistency.js +220 -0
- package/memory/agents/README.md +1 -1
- package/memory/claude-flow-data.json +1 -1
- package/memory/sessions/README.md +1 -1
- package/package.json +4 -3
- package/.mcp.json +0 -22
- package/claude-flow.config.json +0 -20
- package/dist/agents/app-creator.agent.d.ts +0 -55
- package/dist/agents/app-creator.agent.js +0 -1292
- package/dist/agents/base/base-snow-agent.d.ts +0 -75
- package/dist/agents/base/base-snow-agent.js +0 -169
- package/dist/agents/base-snow-agent.d.ts +0 -63
- package/dist/agents/base-snow-agent.js +0 -296
- package/dist/agents/coordinator.d.ts +0 -200
- package/dist/agents/coordinator.js +0 -777
- package/dist/agents/flow-builder-agent.d.ts +0 -18
- package/dist/agents/flow-builder-agent.js +0 -197
- package/dist/agents/queen-403-handler.d.ts +0 -47
- package/dist/agents/queen-403-handler.js +0 -175
- package/dist/agents/queen-agent-example.d.ts +0 -23
- package/dist/agents/queen-agent-example.js +0 -240
- package/dist/agents/queen-agent.test.d.ts +0 -6
- package/dist/agents/script-generator.agent.d.ts +0 -32
- package/dist/agents/script-generator.agent.js +0 -772
- package/dist/agents/script-writer-agent.d.ts +0 -22
- package/dist/agents/script-writer-agent.js +0 -695
- package/dist/agents/security-agent.d.ts +0 -23
- package/dist/agents/security-agent.js +0 -619
- package/dist/agents/specialists/automation-specialist.agent.d.ts +0 -44
- package/dist/agents/specialists/automation-specialist.agent.js +0 -204
- package/dist/agents/specialists/data-specialist.agent.d.ts +0 -165
- package/dist/agents/specialists/data-specialist.agent.js +0 -484
- package/dist/agents/specialists/integration-specialist.agent.d.ts +0 -227
- package/dist/agents/specialists/integration-specialist.agent.js +0 -725
- package/dist/agents/specialists/reporting-specialist.agent.d.ts +0 -54
- package/dist/agents/specialists/reporting-specialist.agent.js +0 -193
- package/dist/agents/specialists/security-specialist.agent.d.ts +0 -85
- package/dist/agents/specialists/security-specialist.agent.js +0 -309
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.d.ts +0 -111
- package/dist/agents/teams/adaptive/adaptive-coordinator.agent.js +0 -383
- package/dist/agents/teams/base-team.d.ts +0 -72
- package/dist/agents/teams/base-team.js +0 -253
- package/dist/agents/teams/team-types.d.ts +0 -265
- package/dist/agents/teams/team-types.js +0 -3
- package/dist/agents/teams/widget/widget-architect.agent.d.ts +0 -61
- package/dist/agents/teams/widget/widget-architect.agent.js +0 -436
- package/dist/agents/teams/widget/widget-backend.agent.d.ts +0 -74
- package/dist/agents/teams/widget/widget-backend.agent.js +0 -1531
- package/dist/agents/teams/widget/widget-frontend.agent.d.ts +0 -67
- package/dist/agents/teams/widget/widget-frontend.agent.js +0 -1014
- package/dist/agents/teams/widget/widget-platform.agent.d.ts +0 -90
- package/dist/agents/teams/widget/widget-platform.agent.js +0 -1190
- package/dist/agents/teams/widget/widget-uiux.agent.d.ts +0 -107
- package/dist/agents/teams/widget/widget-uiux.agent.js +0 -1033
- package/dist/agents/test-agent.d.ts +0 -26
- package/dist/agents/test-agent.js +0 -734
- package/dist/agents/test-agents.d.ts +0 -7
- package/dist/agents/test-agents.js +0 -64
- package/dist/agents/ui-builder.agent.d.ts +0 -50
- package/dist/agents/ui-builder.agent.js +0 -1539
- package/dist/agents/widget-builder.agent.d.ts +0 -32
- package/dist/agents/widget-builder.agent.js +0 -439
- package/dist/agents/widget-creator-agent.d.ts +0 -18
- package/dist/agents/widget-creator-agent.js +0 -498
- package/dist/agents/workflow-designer.agent.d.ts +0 -31
- package/dist/agents/workflow-designer.agent.js +0 -583
- package/dist/api/error-handling.d.ts +0 -325
- package/dist/api/error-handling.js +0 -1488
- package/dist/api/flow-designer-api.d.ts +0 -167
- package/dist/api/flow-designer-api.js +0 -554
- package/dist/api/natural-language-mapper.d.ts +0 -124
- package/dist/api/natural-language-mapper.js +0 -501
- package/dist/api/performance-optimizer.d.ts +0 -240
- package/dist/api/performance-optimizer.js +0 -706
- package/dist/api/transaction-manager.d.ts +0 -189
- package/dist/api/transaction-manager.js +0 -576
- package/dist/assembly/team-assembler.d.ts +0 -140
- package/dist/assembly/team-assembler.js +0 -502
- package/dist/benchmark-performance.d.ts +0 -41
- package/dist/benchmark-performance.js +0 -230
- package/dist/cli/snow-flow-cli-integration.d.ts +0 -30
- package/dist/cli/snow-flow-cli-integration.js +0 -396
- package/dist/coordination/coordination-engine.d.ts +0 -41
- package/dist/coordination/coordination-engine.js +0 -324
- package/dist/coordination/coordination.test.d.ts +0 -6
- package/dist/coordination/example.d.ts +0 -31
- package/dist/coordination/example.js +0 -394
- package/dist/coordination/execution-patterns.d.ts +0 -43
- package/dist/coordination/execution-patterns.js +0 -507
- package/dist/coordination/factory.d.ts +0 -94
- package/dist/coordination/factory.js +0 -433
- package/dist/coordination/index.d.ts +0 -71
- package/dist/coordination/index.js +0 -135
- package/dist/coordination/progress-monitor.d.ts +0 -71
- package/dist/coordination/progress-monitor.js +0 -505
- package/dist/coordination/quality-gates.d.ts +0 -124
- package/dist/coordination/quality-gates.js +0 -577
- package/dist/coordination/shared-memory.d.ts +0 -39
- package/dist/coordination/shared-memory.js +0 -289
- package/dist/coordination/task-dependencies.d.ts +0 -50
- package/dist/coordination/task-dependencies.js +0 -407
- package/dist/coordination/team-coordinator.d.ts +0 -59
- package/dist/coordination/team-coordinator.js +0 -550
- package/dist/coordination/types.d.ts +0 -152
- package/dist/coordination/types.js +0 -3
- package/dist/mcp/mcp-wrapper.d.ts +0 -8
- package/dist/mcp/mcp-wrapper.js +0 -77
- package/dist/mcp/servicenow-flow-composer-enhanced.js +0 -396
- package/dist/mcp/servicenow-flow-composer-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-flow-composer-mcp.js +0 -3103
- package/dist/mcp/servicenow-graph-memory-mcp.d.ts +0 -7
- package/dist/mcp/servicenow-intelligent-mcp.d.ts +0 -143
- package/dist/mcp/servicenow-intelligent-mcp.js +0 -4156
- package/dist/mcp/servicenow-xml-flow-mcp.d.ts +0 -53
- package/dist/mcp/servicenow-xml-flow-mcp.js +0 -1704
- package/dist/mcp/singleton-check.js +0 -31
- package/dist/mcp/test-simple-mcp.d.ts +0 -6
- package/dist/mcp/test-simple-mcp.js +0 -63
- package/dist/memory/hierarchical-memory-system.d.ts +0 -90
- package/dist/memory/hierarchical-memory-system.js +0 -400
- package/dist/memory/index.d.ts +0 -9
- package/dist/memory/index.js +0 -20
- package/dist/memory/mcp-integration-example.d.ts +0 -6
- package/dist/memory/mcp-integration-example.js +0 -281
- package/dist/memory/memory-client.d.ts +0 -199
- package/dist/memory/memory-client.js +0 -364
- package/dist/memory/memory-manager.d.ts +0 -29
- package/dist/memory/memory-manager.js +0 -280
- package/dist/memory/memory-operations.d.ts +0 -179
- package/dist/memory/memory-operations.js +0 -691
- package/dist/memory/memory-system.d.ts +0 -153
- package/dist/memory/memory-system.js +0 -651
- package/dist/memory/memory-test.d.ts +0 -6
- package/dist/memory/memory-test.js +0 -161
- package/dist/memory/snow-flow-memory-patterns.d.ts +0 -213
- package/dist/memory/snow-flow-memory-patterns.js +0 -200
- package/dist/memory/snow-memory.d.ts +0 -54
- package/dist/memory/snow-memory.js +0 -301
- package/dist/memory/swarm-memory.d.ts +0 -135
- package/dist/memory/swarm-memory.js +0 -378
- package/dist/optimization/flow-performance-optimizer.js +0 -723
- package/dist/orchestration/discovery/service-discovery.d.ts +0 -81
- package/dist/orchestration/discovery/service-discovery.js +0 -808
- package/dist/orchestration/distributed-orchestrator.d.ts +0 -131
- package/dist/orchestration/distributed-orchestrator.js +0 -712
- package/dist/orchestration/distribution/task-distribution-engine.d.ts +0 -53
- package/dist/orchestration/distribution/task-distribution-engine.js +0 -586
- package/dist/orchestration/flow-update-orchestrator.js +0 -648
- package/dist/orchestration/interfaces/distributed-orchestration.interface.d.ts +0 -606
- package/dist/orchestration/interfaces/distributed-orchestration.interface.js +0 -65
- package/dist/orchestration/protocols/mcpx-protocol.d.ts +0 -71
- package/dist/orchestration/protocols/mcpx-protocol.js +0 -668
- package/dist/orchestration/state/distributed-state-manager.d.ts +0 -89
- package/dist/orchestration/state/distributed-state-manager.js +0 -716
- package/dist/orchestrator/flow-composer.d.ts +0 -105
- package/dist/orchestrator/flow-composer.js +0 -404
- package/dist/orchestrator/flow-pattern-templates.d.ts +0 -260
- package/dist/orchestrator/flow-pattern-templates.js +0 -908
- package/dist/orchestrator/flow-subflow-decision-engine.d.ts +0 -202
- package/dist/orchestrator/flow-subflow-decision-engine.js +0 -769
- package/dist/orchestrator/flow-validation-engine.d.ts +0 -169
- package/dist/orchestrator/flow-validation-engine.js +0 -913
- package/dist/orchestrator/snow-orchestrator.d.ts +0 -49
- package/dist/orchestrator/snow-orchestrator.js +0 -235
- package/dist/orchestrator/subflow-creation-handler.d.ts +0 -230
- package/dist/orchestrator/subflow-creation-handler.js +0 -791
- package/dist/patterns/adaptive-patterns.d.ts +0 -140
- package/dist/patterns/adaptive-patterns.js +0 -549
- package/dist/queen/advanced-integration-test.d.ts +0 -48
- package/dist/queen/advanced-integration-test.js +0 -473
- package/dist/queen/integration-example.d.ts +0 -82
- package/dist/queen/integration-example.js +0 -219
- package/dist/queen/integration-test.d.ts +0 -72
- package/dist/queen/integration-test.js +0 -563
- package/dist/queen/mock-mcp-client.d.ts +0 -71
- package/dist/queen/mock-mcp-client.js +0 -317
- package/dist/queen/run-integration-tests.d.ts +0 -9
- package/dist/queen/run-integration-tests.js +0 -27
- package/dist/sparc/coordinators/adaptive-coordinator.d.ts +0 -54
- package/dist/sparc/coordinators/adaptive-coordinator.js +0 -367
- package/dist/sparc/coordinators/team-coordinator.d.ts +0 -66
- package/dist/sparc/coordinators/team-coordinator.js +0 -402
- package/dist/sparc/modes/team-modes.d.ts +0 -33
- package/dist/sparc/modes/team-modes.js +0 -399
- package/dist/sparc/teams/application-team.d.ts +0 -73
- package/dist/sparc/teams/application-team.js +0 -463
- package/dist/sparc/teams/flow-team.d.ts +0 -67
- package/dist/sparc/teams/flow-team.js +0 -373
- package/dist/sparc/teams/widget-team.d.ts +0 -61
- package/dist/sparc/teams/widget-team.js +0 -280
- package/dist/specialists/app-specialists.d.ts +0 -93
- package/dist/specialists/app-specialists.js +0 -1639
- package/dist/specialists/base-specialist.d.ts +0 -19
- package/dist/specialists/base-specialist.js +0 -54
- package/dist/specialists/flow-specialists.d.ts +0 -113
- package/dist/specialists/flow-specialists.js +0 -1787
- package/dist/specialists/individual-specialists.d.ts +0 -67
- package/dist/specialists/individual-specialists.js +0 -632
- package/dist/specialists/widget-specialists.d.ts +0 -70
- package/dist/specialists/widget-specialists.js +0 -1264
- package/dist/src/utils/agent-detector.js +0 -655
- package/dist/teams/adaptive-team.d.ts +0 -81
- package/dist/teams/adaptive-team.js +0 -1153
- package/dist/teams/application-team.d.ts +0 -30
- package/dist/teams/application-team.js +0 -547
- package/dist/teams/base-team.d.ts +0 -55
- package/dist/teams/base-team.js +0 -243
- package/dist/teams/flow-team.d.ts +0 -28
- package/dist/teams/flow-team.js +0 -525
- package/dist/teams/widget-team.d.ts +0 -26
- package/dist/teams/widget-team.js +0 -459
- package/dist/templates/flow-template-system.js +0 -625
- package/dist/test-fetch-incidents.d.ts +0 -2
- package/dist/test-fetch-incidents.js +0 -84
- package/dist/test-incident-access.d.ts +0 -2
- package/dist/test-incident-access.js +0 -72
- package/dist/test-iphone-flow.js +0 -189
- package/dist/test-limit-problem.d.ts +0 -2
- package/dist/test-limit-problem.js +0 -60
- package/dist/test-ml-batch-fix.d.ts +0 -2
- package/dist/test-ml-batch-fix.js +0 -104
- package/dist/test-ml-batch.d.ts +0 -2
- package/dist/test-ml-batch.js +0 -87
- package/dist/test-ml-query.d.ts +0 -2
- package/dist/test-ml-query.js +0 -100
- package/dist/test-ml-training-fix.d.ts +0 -12
- package/dist/test-ml-training-fix.js +0 -113
- package/dist/test-ml-training.d.ts +0 -2
- package/dist/test-ml-training.js +0 -32
- package/dist/test-operations-query.d.ts +0 -2
- package/dist/test-operations-query.js +0 -84
- package/dist/test-performance-query.d.ts +0 -2
- package/dist/test-performance-query.js +0 -52
- package/dist/test-singleton-protection.d.ts +0 -8
- package/dist/test-singleton-protection.js +0 -110
- package/dist/test-smart-limits.d.ts +0 -13
- package/dist/test-smart-limits.js +0 -100
- package/dist/test-snow-query-incidents.d.ts +0 -2
- package/dist/test-snow-query-incidents.js +0 -66
- package/dist/test-universal-query.d.ts +0 -2
- package/dist/test-universal-query.js +0 -106
- package/dist/testing/flow-testing-automation.js +0 -641
- package/dist/utils/complete-flow-xml-generator.js +0 -1285
- package/dist/utils/file-storage-fallback.d.ts +0 -62
- package/dist/utils/file-storage-fallback.js +0 -289
- package/dist/utils/flow-api-discovery.d.ts +0 -151
- package/dist/utils/flow-api-discovery.js +0 -439
- package/dist/utils/flow-examples.js +0 -720
- package/dist/utils/flow-structure-builder.js +0 -677
- package/dist/utils/flow-xml-generator.d.ts +0 -41
- package/dist/utils/flow-xml-generator.js +0 -258
- package/dist/utils/improved-flow-xml-generator.js +0 -820
- package/dist/utils/mcp-process-manager.backup.d.ts +0 -58
- package/dist/utils/mcp-process-manager.backup.js +0 -220
- package/dist/utils/mcp-singleton-enforcer.d.ts +0 -36
- package/dist/utils/mcp-singleton-enforcer.js +0 -201
- package/dist/utils/mcp-timeout-fix.d.ts +0 -53
- package/dist/utils/mcp-timeout-fix.js +0 -221
- package/dist/utils/migrate-claude-flow.d.ts +0 -22
- package/dist/utils/migrate-claude-flow.js +0 -120
- package/dist/utils/scope-utils.d.ts +0 -72
- package/dist/utils/scope-utils.js +0 -386
- package/dist/utils/snow-oauth-old.d.ts +0 -65
- package/dist/utils/snow-oauth-old.js +0 -345
- package/dist/utils/xml-first-flow-generator.js +0 -513
- package/memory/servicenow_artifacts/000d9224c895221055906c7518aa2d3d.json +0 -30
- package/memory/servicenow_artifacts/0196b66173303010e46b4a2214f6a7a2.json +0 -36
- package/memory/servicenow_artifacts/125e5d1d837e2a102a7ea130ceaad397.json +0 -30
- package/memory/servicenow_artifacts/7637c1f2b7112210a5e5911cde11a972.json +0 -30
- package/memory/servicenow_artifacts/default_documentation_tables_1754056582292.json +0 -55
- package/memory/servicenow_artifacts/default_documentation_tables_1754057477189.json +0 -55
- package/memory/update-set-sessions/01f82af583faea102a7ea130ceaad3d4.json +0 -9
- package/memory/update-set-sessions/27718fb983faea102a7ea130ceaad34b.json +0 -9
- package/memory/update-set-sessions/412e9bf6833e22502a7ea130ceaad30a.json +0 -8
- package/memory/update-set-sessions/66fc5a79837aea102a7ea130ceaad3ab.json +0 -9
- package/memory/update-set-sessions/71a30ff5837eea102a7ea130ceaad37f.json +0 -9
- package/memory/update-set-sessions/74fba27983faea102a7ea130ceaad3bd.json +0 -9
- package/memory/update-set-sessions/a0b147b5837eea102a7ea130ceaad344.json +0 -58
- package/memory/update-set-sessions/b13f5eb983baea102a7ea130ceaad33e.json +0 -9
- package/reports/swarm-auto-centralized-1752649029776.json +0 -13
- package/src/memory/README.md +0 -240
|
@@ -1,641 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* 🚀 Advanced Flow Testing Automation System
|
|
4
|
-
*
|
|
5
|
-
* Revolutionary testing framework that automatically generates comprehensive
|
|
6
|
-
* test scenarios, validates flow logic, and ensures production-ready quality
|
|
7
|
-
* for all ServiceNow flows before deployment.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.FlowTestingAutomation = void 0;
|
|
11
|
-
const logger_js_1 = require("../utils/logger.js");
|
|
12
|
-
class FlowTestingAutomation {
|
|
13
|
-
constructor(client, memory) {
|
|
14
|
-
this.testSuites = new Map();
|
|
15
|
-
this.executionHistory = new Map();
|
|
16
|
-
this.logger = new logger_js_1.Logger('FlowTestingAutomation');
|
|
17
|
-
this.client = client;
|
|
18
|
-
this.memory = memory;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Generate comprehensive test suite for a flow
|
|
22
|
-
*/
|
|
23
|
-
async generateTestSuite(flowDefinition, options = {}) {
|
|
24
|
-
this.logger.info('🧪 Generating comprehensive test suite', {
|
|
25
|
-
flowName: flowDefinition.name,
|
|
26
|
-
coverageLevel: options.coverageLevel || 'comprehensive'
|
|
27
|
-
});
|
|
28
|
-
const flowId = `test_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
29
|
-
try {
|
|
30
|
-
// Generate test scenarios based on flow structure
|
|
31
|
-
const scenarios = await this.generateTestScenarios(flowDefinition, options);
|
|
32
|
-
// Generate coverage targets
|
|
33
|
-
const coverageTargets = this.generateCoverageTargets(flowDefinition, options.coverageLevel || 'comprehensive');
|
|
34
|
-
// Generate validation rules
|
|
35
|
-
const validationRules = this.generateValidationRules(flowDefinition);
|
|
36
|
-
// Generate performance thresholds
|
|
37
|
-
const performanceThresholds = this.generatePerformanceThresholds(flowDefinition);
|
|
38
|
-
const testSuite = {
|
|
39
|
-
flowId,
|
|
40
|
-
flowName: flowDefinition.name,
|
|
41
|
-
testScenarios: scenarios,
|
|
42
|
-
coverageTargets,
|
|
43
|
-
validationRules,
|
|
44
|
-
performanceThresholds,
|
|
45
|
-
metadata: {
|
|
46
|
-
createdAt: new Date().toISOString(),
|
|
47
|
-
version: '1.0.0',
|
|
48
|
-
testFramework: 'FlowTestingAutomation',
|
|
49
|
-
totalTests: scenarios.length,
|
|
50
|
-
estimatedDuration: this.estimateTestDuration(scenarios)
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
// Store test suite
|
|
54
|
-
this.testSuites.set(flowId, testSuite);
|
|
55
|
-
await this.memory.store(`test_suite_${flowId}`, testSuite, 86400000); // 24 hours
|
|
56
|
-
this.logger.info('✅ Test suite generated successfully', {
|
|
57
|
-
flowId,
|
|
58
|
-
totalScenarios: scenarios.length,
|
|
59
|
-
coverageTargets: coverageTargets.length,
|
|
60
|
-
estimatedDuration: testSuite.metadata.estimatedDuration
|
|
61
|
-
});
|
|
62
|
-
return testSuite;
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
this.logger.error('❌ Failed to generate test suite', error);
|
|
66
|
-
throw error;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Execute test suite with comprehensive reporting
|
|
71
|
-
*/
|
|
72
|
-
async executeTestSuite(testSuiteId, options = {}) {
|
|
73
|
-
this.logger.info('🚀 Executing test suite', { testSuiteId, options });
|
|
74
|
-
const testSuite = this.testSuites.get(testSuiteId);
|
|
75
|
-
if (!testSuite) {
|
|
76
|
-
throw new Error(`Test suite not found: ${testSuiteId}`);
|
|
77
|
-
}
|
|
78
|
-
const executionId = `exec_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`;
|
|
79
|
-
const startTime = Date.now();
|
|
80
|
-
try {
|
|
81
|
-
// Execute test scenarios
|
|
82
|
-
const results = options.parallel
|
|
83
|
-
? await this.executeTestsInParallel(testSuite, options)
|
|
84
|
-
: await this.executeTestsSequentially(testSuite, options);
|
|
85
|
-
// Generate summary
|
|
86
|
-
const summary = this.generateTestSummary(results);
|
|
87
|
-
// Calculate coverage
|
|
88
|
-
const coverage = this.calculateCoverage(testSuite, results);
|
|
89
|
-
// Generate performance report
|
|
90
|
-
const performance = this.generatePerformanceReport(results);
|
|
91
|
-
// Identify issues
|
|
92
|
-
const issues = this.identifyTestIssues(results, testSuite);
|
|
93
|
-
// Generate recommendations
|
|
94
|
-
const recommendations = await this.generateRecommendations(results, testSuite, issues);
|
|
95
|
-
const executionResult = {
|
|
96
|
-
testSuiteId,
|
|
97
|
-
executionId,
|
|
98
|
-
results,
|
|
99
|
-
summary,
|
|
100
|
-
coverage,
|
|
101
|
-
performance,
|
|
102
|
-
issues,
|
|
103
|
-
recommendations,
|
|
104
|
-
executionTime: Date.now() - startTime,
|
|
105
|
-
timestamp: new Date().toISOString()
|
|
106
|
-
};
|
|
107
|
-
// Store execution history
|
|
108
|
-
const history = this.executionHistory.get(testSuiteId) || [];
|
|
109
|
-
history.push(executionResult);
|
|
110
|
-
this.executionHistory.set(testSuiteId, history);
|
|
111
|
-
// Store in memory
|
|
112
|
-
await this.memory.store(`test_execution_${executionId}`, executionResult, 604800000); // 7 days
|
|
113
|
-
this.logger.info('✅ Test suite execution completed', {
|
|
114
|
-
executionId,
|
|
115
|
-
totalTests: summary.totalTests,
|
|
116
|
-
passed: summary.passed,
|
|
117
|
-
failed: summary.failed,
|
|
118
|
-
successRate: summary.successRate,
|
|
119
|
-
executionTime: executionResult.executionTime
|
|
120
|
-
});
|
|
121
|
-
return executionResult;
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
this.logger.error('❌ Test suite execution failed', error);
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Generate automated test scenarios based on flow structure
|
|
130
|
-
*/
|
|
131
|
-
async generateTestScenarios(flowDefinition, options) {
|
|
132
|
-
const scenarios = [];
|
|
133
|
-
// Happy Path Test
|
|
134
|
-
scenarios.push(await this.createHappyPathScenario(flowDefinition));
|
|
135
|
-
// Error Handling Tests
|
|
136
|
-
scenarios.push(...await this.createErrorHandlingScenarios(flowDefinition));
|
|
137
|
-
// Edge Case Tests
|
|
138
|
-
scenarios.push(...await this.createEdgeCaseScenarios(flowDefinition));
|
|
139
|
-
// Condition Branch Tests
|
|
140
|
-
scenarios.push(...await this.createConditionBranchScenarios(flowDefinition));
|
|
141
|
-
// Data Validation Tests
|
|
142
|
-
scenarios.push(...await this.createDataValidationScenarios(flowDefinition));
|
|
143
|
-
// Performance Tests
|
|
144
|
-
if (options.includePerformanceTests !== false) {
|
|
145
|
-
scenarios.push(...await this.createPerformanceScenarios(flowDefinition));
|
|
146
|
-
}
|
|
147
|
-
// Security Tests
|
|
148
|
-
if (options.includeSecurityTests) {
|
|
149
|
-
scenarios.push(...await this.createSecurityScenarios(flowDefinition));
|
|
150
|
-
}
|
|
151
|
-
// Regression Tests
|
|
152
|
-
if (options.includeRegressionTests) {
|
|
153
|
-
scenarios.push(...await this.createRegressionScenarios(flowDefinition));
|
|
154
|
-
}
|
|
155
|
-
// Custom Scenarios
|
|
156
|
-
if (options.customScenarios) {
|
|
157
|
-
scenarios.push(...options.customScenarios);
|
|
158
|
-
}
|
|
159
|
-
return scenarios;
|
|
160
|
-
}
|
|
161
|
-
async createHappyPathScenario(flowDefinition) {
|
|
162
|
-
return {
|
|
163
|
-
id: 'happy_path_001',
|
|
164
|
-
name: 'Happy Path - Complete Flow Execution',
|
|
165
|
-
description: 'Tests the complete flow execution with valid inputs and expected path',
|
|
166
|
-
type: 'e2e',
|
|
167
|
-
priority: 'critical',
|
|
168
|
-
inputs: {
|
|
169
|
-
triggerData: this.generateValidTriggerData(flowDefinition),
|
|
170
|
-
contextVariables: {},
|
|
171
|
-
userProfile: {
|
|
172
|
-
sys_id: 'test_user_001',
|
|
173
|
-
roles: ['itil', 'flow_operator'],
|
|
174
|
-
groups: ['IT Support'],
|
|
175
|
-
permissions: ['flow_execute', 'record_read', 'record_write']
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
expectedOutputs: this.generateExpectedHappyPathOutputs(flowDefinition),
|
|
179
|
-
preconditions: [
|
|
180
|
-
'Flow is active and published',
|
|
181
|
-
'Required tables and fields exist',
|
|
182
|
-
'User has appropriate permissions'
|
|
183
|
-
],
|
|
184
|
-
postconditions: [
|
|
185
|
-
'Flow executes without errors',
|
|
186
|
-
'All activities complete successfully',
|
|
187
|
-
'Expected records are created/updated'
|
|
188
|
-
],
|
|
189
|
-
timeout: 60000,
|
|
190
|
-
retryCount: 0,
|
|
191
|
-
tags: ['critical', 'happy_path', 'e2e']
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
async createErrorHandlingScenarios(flowDefinition) {
|
|
195
|
-
const scenarios = [];
|
|
196
|
-
// Invalid input data
|
|
197
|
-
scenarios.push({
|
|
198
|
-
id: 'error_001',
|
|
199
|
-
name: 'Invalid Input Data Handling',
|
|
200
|
-
description: 'Tests flow behavior with invalid or malformed input data',
|
|
201
|
-
type: 'unit',
|
|
202
|
-
priority: 'high',
|
|
203
|
-
inputs: {
|
|
204
|
-
triggerData: this.generateInvalidTriggerData(flowDefinition),
|
|
205
|
-
contextVariables: {}
|
|
206
|
-
},
|
|
207
|
-
expectedOutputs: [{
|
|
208
|
-
type: 'flow_completion',
|
|
209
|
-
expected: { status: 'error', error_handled: true }
|
|
210
|
-
}],
|
|
211
|
-
preconditions: ['Flow has error handling logic'],
|
|
212
|
-
postconditions: ['Error is caught and handled gracefully'],
|
|
213
|
-
timeout: 30000,
|
|
214
|
-
retryCount: 1,
|
|
215
|
-
tags: ['error_handling', 'validation']
|
|
216
|
-
});
|
|
217
|
-
// Missing required data
|
|
218
|
-
scenarios.push({
|
|
219
|
-
id: 'error_002',
|
|
220
|
-
name: 'Missing Required Data',
|
|
221
|
-
description: 'Tests flow behavior when required data is missing',
|
|
222
|
-
type: 'unit',
|
|
223
|
-
priority: 'high',
|
|
224
|
-
inputs: {
|
|
225
|
-
triggerData: {},
|
|
226
|
-
contextVariables: {}
|
|
227
|
-
},
|
|
228
|
-
expectedOutputs: [{
|
|
229
|
-
type: 'flow_completion',
|
|
230
|
-
expected: { status: 'error', error_type: 'missing_data' }
|
|
231
|
-
}],
|
|
232
|
-
preconditions: ['Flow validates required inputs'],
|
|
233
|
-
postconditions: ['Appropriate error message is generated'],
|
|
234
|
-
timeout: 15000,
|
|
235
|
-
retryCount: 1,
|
|
236
|
-
tags: ['error_handling', 'required_data']
|
|
237
|
-
});
|
|
238
|
-
return scenarios;
|
|
239
|
-
}
|
|
240
|
-
async createEdgeCaseScenarios(flowDefinition) {
|
|
241
|
-
const scenarios = [];
|
|
242
|
-
// Large data volumes
|
|
243
|
-
scenarios.push({
|
|
244
|
-
id: 'edge_001',
|
|
245
|
-
name: 'Large Data Volume Processing',
|
|
246
|
-
description: 'Tests flow performance with large data volumes',
|
|
247
|
-
type: 'performance',
|
|
248
|
-
priority: 'medium',
|
|
249
|
-
inputs: {
|
|
250
|
-
triggerData: this.generateLargeDataSet(flowDefinition),
|
|
251
|
-
contextVariables: {}
|
|
252
|
-
},
|
|
253
|
-
expectedOutputs: [{
|
|
254
|
-
type: 'flow_completion',
|
|
255
|
-
expected: { status: 'completed', records_processed: '>1000' }
|
|
256
|
-
}],
|
|
257
|
-
preconditions: ['Flow can handle large datasets'],
|
|
258
|
-
postconditions: ['Performance remains within acceptable limits'],
|
|
259
|
-
timeout: 300000, // 5 minutes
|
|
260
|
-
retryCount: 0,
|
|
261
|
-
tags: ['performance', 'edge_case', 'large_data']
|
|
262
|
-
});
|
|
263
|
-
return scenarios;
|
|
264
|
-
}
|
|
265
|
-
async createConditionBranchScenarios(flowDefinition) {
|
|
266
|
-
const scenarios = [];
|
|
267
|
-
// Find all conditional activities
|
|
268
|
-
const conditionalActivities = flowDefinition.activities.filter(activity => activity.condition || activity.type === 'condition');
|
|
269
|
-
for (const activity of conditionalActivities) {
|
|
270
|
-
// True branch
|
|
271
|
-
scenarios.push({
|
|
272
|
-
id: `condition_true_${activity.name.replace(/\s+/g, '_')}`,
|
|
273
|
-
name: `Condition True - ${activity.name}`,
|
|
274
|
-
description: `Tests the true branch of condition: ${activity.name}`,
|
|
275
|
-
type: 'unit',
|
|
276
|
-
priority: 'high',
|
|
277
|
-
inputs: {
|
|
278
|
-
triggerData: this.generateDataForCondition(activity, true),
|
|
279
|
-
contextVariables: {}
|
|
280
|
-
},
|
|
281
|
-
expectedOutputs: [{
|
|
282
|
-
type: 'activity_execution',
|
|
283
|
-
activityId: activity.name,
|
|
284
|
-
expected: { condition_result: true, branch_taken: 'true' }
|
|
285
|
-
}],
|
|
286
|
-
preconditions: [`Condition "${activity.condition}" evaluates to true`],
|
|
287
|
-
postconditions: ['True branch logic executes'],
|
|
288
|
-
timeout: 30000,
|
|
289
|
-
retryCount: 1,
|
|
290
|
-
tags: ['condition', 'branch_testing', 'true_branch']
|
|
291
|
-
});
|
|
292
|
-
// False branch
|
|
293
|
-
scenarios.push({
|
|
294
|
-
id: `condition_false_${activity.name.replace(/\s+/g, '_')}`,
|
|
295
|
-
name: `Condition False - ${activity.name}`,
|
|
296
|
-
description: `Tests the false branch of condition: ${activity.name}`,
|
|
297
|
-
type: 'unit',
|
|
298
|
-
priority: 'high',
|
|
299
|
-
inputs: {
|
|
300
|
-
triggerData: this.generateDataForCondition(activity, false),
|
|
301
|
-
contextVariables: {}
|
|
302
|
-
},
|
|
303
|
-
expectedOutputs: [{
|
|
304
|
-
type: 'activity_execution',
|
|
305
|
-
activityId: activity.name,
|
|
306
|
-
expected: { condition_result: false, branch_taken: 'false' }
|
|
307
|
-
}],
|
|
308
|
-
preconditions: [`Condition "${activity.condition}" evaluates to false`],
|
|
309
|
-
postconditions: ['False branch logic executes'],
|
|
310
|
-
timeout: 30000,
|
|
311
|
-
retryCount: 1,
|
|
312
|
-
tags: ['condition', 'branch_testing', 'false_branch']
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
return scenarios;
|
|
316
|
-
}
|
|
317
|
-
async createDataValidationScenarios(flowDefinition) {
|
|
318
|
-
const scenarios = [];
|
|
319
|
-
// SQL injection attempts
|
|
320
|
-
scenarios.push({
|
|
321
|
-
id: 'security_001',
|
|
322
|
-
name: 'SQL Injection Protection',
|
|
323
|
-
description: 'Tests flow resistance to SQL injection attempts',
|
|
324
|
-
type: 'security',
|
|
325
|
-
priority: 'critical',
|
|
326
|
-
inputs: {
|
|
327
|
-
triggerData: {
|
|
328
|
-
malicious_input: "'; DROP TABLE incident; --",
|
|
329
|
-
normal_field: 'regular_value'
|
|
330
|
-
},
|
|
331
|
-
contextVariables: {}
|
|
332
|
-
},
|
|
333
|
-
expectedOutputs: [{
|
|
334
|
-
type: 'flow_completion',
|
|
335
|
-
expected: { status: 'completed', security_validated: true }
|
|
336
|
-
}],
|
|
337
|
-
preconditions: ['Flow properly validates and sanitizes inputs'],
|
|
338
|
-
postconditions: ['No SQL injection occurs, data integrity maintained'],
|
|
339
|
-
timeout: 30000,
|
|
340
|
-
retryCount: 0,
|
|
341
|
-
tags: ['security', 'sql_injection', 'validation']
|
|
342
|
-
});
|
|
343
|
-
return scenarios;
|
|
344
|
-
}
|
|
345
|
-
async createPerformanceScenarios(flowDefinition) {
|
|
346
|
-
return [{
|
|
347
|
-
id: 'perf_001',
|
|
348
|
-
name: 'Performance Baseline Test',
|
|
349
|
-
description: 'Establishes performance baseline for flow execution',
|
|
350
|
-
type: 'performance',
|
|
351
|
-
priority: 'medium',
|
|
352
|
-
inputs: {
|
|
353
|
-
triggerData: this.generateValidTriggerData(flowDefinition),
|
|
354
|
-
contextVariables: {}
|
|
355
|
-
},
|
|
356
|
-
expectedOutputs: [{
|
|
357
|
-
type: 'flow_completion',
|
|
358
|
-
expected: { status: 'completed', execution_time: '<30000' }
|
|
359
|
-
}],
|
|
360
|
-
preconditions: ['System under normal load'],
|
|
361
|
-
postconditions: ['Performance metrics within thresholds'],
|
|
362
|
-
timeout: 60000,
|
|
363
|
-
retryCount: 2,
|
|
364
|
-
tags: ['performance', 'baseline', 'timing']
|
|
365
|
-
}];
|
|
366
|
-
}
|
|
367
|
-
async createSecurityScenarios(flowDefinition) {
|
|
368
|
-
return [{
|
|
369
|
-
id: 'sec_001',
|
|
370
|
-
name: 'Permission Validation',
|
|
371
|
-
description: 'Tests that flow respects user permissions',
|
|
372
|
-
type: 'security',
|
|
373
|
-
priority: 'high',
|
|
374
|
-
inputs: {
|
|
375
|
-
triggerData: this.generateValidTriggerData(flowDefinition),
|
|
376
|
-
contextVariables: {},
|
|
377
|
-
userProfile: {
|
|
378
|
-
sys_id: 'limited_user_001',
|
|
379
|
-
roles: ['basic_user'],
|
|
380
|
-
groups: [],
|
|
381
|
-
permissions: []
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
expectedOutputs: [{
|
|
385
|
-
type: 'flow_completion',
|
|
386
|
-
expected: { status: 'error', error_type: 'insufficient_permissions' }
|
|
387
|
-
}],
|
|
388
|
-
preconditions: ['User has limited permissions'],
|
|
389
|
-
postconditions: ['Flow properly enforces permission checks'],
|
|
390
|
-
timeout: 30000,
|
|
391
|
-
retryCount: 0,
|
|
392
|
-
tags: ['security', 'permissions', 'access_control']
|
|
393
|
-
}];
|
|
394
|
-
}
|
|
395
|
-
async createRegressionScenarios(flowDefinition) {
|
|
396
|
-
// Load previous test results for regression comparison
|
|
397
|
-
return [{
|
|
398
|
-
id: 'reg_001',
|
|
399
|
-
name: 'Regression - Previous Success Scenarios',
|
|
400
|
-
description: 'Re-runs previously successful test cases to detect regressions',
|
|
401
|
-
type: 'regression',
|
|
402
|
-
priority: 'medium',
|
|
403
|
-
inputs: {
|
|
404
|
-
triggerData: this.generateValidTriggerData(flowDefinition),
|
|
405
|
-
contextVariables: {}
|
|
406
|
-
},
|
|
407
|
-
expectedOutputs: [{
|
|
408
|
-
type: 'flow_completion',
|
|
409
|
-
expected: { status: 'completed', matches_baseline: true }
|
|
410
|
-
}],
|
|
411
|
-
preconditions: ['Previous test baseline exists'],
|
|
412
|
-
postconditions: ['Results match previous successful execution'],
|
|
413
|
-
timeout: 60000,
|
|
414
|
-
retryCount: 1,
|
|
415
|
-
tags: ['regression', 'baseline_comparison']
|
|
416
|
-
}];
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Helper methods for test data generation
|
|
420
|
-
*/
|
|
421
|
-
generateValidTriggerData(flowDefinition) {
|
|
422
|
-
const data = {};
|
|
423
|
-
// Generate based on flow trigger type and table
|
|
424
|
-
if (flowDefinition.table) {
|
|
425
|
-
data.table = flowDefinition.table;
|
|
426
|
-
data.sys_id = 'test_record_' + Math.random().toString(36).substr(2, 9);
|
|
427
|
-
}
|
|
428
|
-
// Add common ServiceNow fields
|
|
429
|
-
data.state = '1';
|
|
430
|
-
data.active = 'true';
|
|
431
|
-
data.priority = '3';
|
|
432
|
-
data.sys_created_by = 'test_user';
|
|
433
|
-
data.sys_created_on = new Date().toISOString();
|
|
434
|
-
return data;
|
|
435
|
-
}
|
|
436
|
-
generateInvalidTriggerData(flowDefinition) {
|
|
437
|
-
return {
|
|
438
|
-
malformed_json: '{"invalid": json}',
|
|
439
|
-
null_values: null,
|
|
440
|
-
empty_string: '',
|
|
441
|
-
invalid_sys_id: 'not_a_valid_sys_id',
|
|
442
|
-
negative_number: -999
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
generateLargeDataSet(flowDefinition) {
|
|
446
|
-
const data = this.generateValidTriggerData(flowDefinition);
|
|
447
|
-
// Add large array/object data
|
|
448
|
-
data.large_array = Array.from({ length: 1000 }, (_, i) => ({
|
|
449
|
-
id: i,
|
|
450
|
-
data: `test_data_${i}`,
|
|
451
|
-
timestamp: new Date().toISOString()
|
|
452
|
-
}));
|
|
453
|
-
data.large_string = 'x'.repeat(10000);
|
|
454
|
-
return data;
|
|
455
|
-
}
|
|
456
|
-
generateDataForCondition(activity, conditionResult) {
|
|
457
|
-
const data = {
|
|
458
|
-
sys_id: 'test_record_001',
|
|
459
|
-
state: conditionResult ? '1' : '6',
|
|
460
|
-
priority: conditionResult ? '1' : '5',
|
|
461
|
-
active: conditionResult ? 'true' : 'false'
|
|
462
|
-
};
|
|
463
|
-
// Analyze condition and generate appropriate data
|
|
464
|
-
if (activity.condition) {
|
|
465
|
-
const condition = activity.condition.toLowerCase();
|
|
466
|
-
if (condition.includes('priority')) {
|
|
467
|
-
data.priority = conditionResult ? '1' : '5';
|
|
468
|
-
}
|
|
469
|
-
if (condition.includes('state')) {
|
|
470
|
-
data.state = conditionResult ? '1' : '7';
|
|
471
|
-
}
|
|
472
|
-
if (condition.includes('active')) {
|
|
473
|
-
data.active = conditionResult ? 'true' : 'false';
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
return data;
|
|
477
|
-
}
|
|
478
|
-
generateExpectedHappyPathOutputs(flowDefinition) {
|
|
479
|
-
const outputs = [];
|
|
480
|
-
// Flow completion
|
|
481
|
-
outputs.push({
|
|
482
|
-
type: 'flow_completion',
|
|
483
|
-
expected: {
|
|
484
|
-
status: 'completed',
|
|
485
|
-
error_count: 0,
|
|
486
|
-
activities_executed: flowDefinition.activities.length
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
// Each activity execution
|
|
490
|
-
flowDefinition.activities.forEach(activity => {
|
|
491
|
-
outputs.push({
|
|
492
|
-
type: 'activity_execution',
|
|
493
|
-
activityId: activity.name,
|
|
494
|
-
expected: {
|
|
495
|
-
status: 'completed',
|
|
496
|
-
has_outputs: activity.outputs ? Object.keys(activity.outputs).length > 0 : false
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
|
-
});
|
|
500
|
-
return outputs;
|
|
501
|
-
}
|
|
502
|
-
// Additional implementation methods would continue here...
|
|
503
|
-
// For brevity, I'm including the key framework structure
|
|
504
|
-
generateCoverageTargets(flowDefinition, level) {
|
|
505
|
-
const targets = [];
|
|
506
|
-
// Activity coverage
|
|
507
|
-
targets.push({
|
|
508
|
-
type: 'activity',
|
|
509
|
-
target: 'all_activities',
|
|
510
|
-
requiredCoverage: level === 'exhaustive' ? 100 : level === 'comprehensive' ? 95 : 80,
|
|
511
|
-
critical: true
|
|
512
|
-
});
|
|
513
|
-
// Condition coverage
|
|
514
|
-
targets.push({
|
|
515
|
-
type: 'condition',
|
|
516
|
-
target: 'all_conditions',
|
|
517
|
-
requiredCoverage: level === 'exhaustive' ? 100 : level === 'comprehensive' ? 90 : 75,
|
|
518
|
-
critical: true
|
|
519
|
-
});
|
|
520
|
-
return targets;
|
|
521
|
-
}
|
|
522
|
-
generateValidationRules(flowDefinition) {
|
|
523
|
-
return [
|
|
524
|
-
{
|
|
525
|
-
id: 'syntax_validation',
|
|
526
|
-
name: 'Flow Syntax Validation',
|
|
527
|
-
type: 'syntax',
|
|
528
|
-
rule: 'All activities must have valid syntax and references',
|
|
529
|
-
severity: 'error',
|
|
530
|
-
autoFix: false
|
|
531
|
-
},
|
|
532
|
-
{
|
|
533
|
-
id: 'security_validation',
|
|
534
|
-
name: 'Security Best Practices',
|
|
535
|
-
type: 'security',
|
|
536
|
-
rule: 'Flow must not expose sensitive data or bypass security',
|
|
537
|
-
severity: 'error',
|
|
538
|
-
autoFix: false
|
|
539
|
-
}
|
|
540
|
-
];
|
|
541
|
-
}
|
|
542
|
-
generatePerformanceThresholds(flowDefinition) {
|
|
543
|
-
return [
|
|
544
|
-
{
|
|
545
|
-
metric: 'execution_time',
|
|
546
|
-
threshold: 30000, // 30 seconds
|
|
547
|
-
unit: 'ms',
|
|
548
|
-
critical: true
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
metric: 'memory_usage',
|
|
552
|
-
threshold: 100, // 100 MB
|
|
553
|
-
unit: 'MB',
|
|
554
|
-
critical: false
|
|
555
|
-
}
|
|
556
|
-
];
|
|
557
|
-
}
|
|
558
|
-
estimateTestDuration(scenarios) {
|
|
559
|
-
return scenarios.reduce((total, scenario) => total + scenario.timeout, 0);
|
|
560
|
-
}
|
|
561
|
-
// Execution methods would be implemented here...
|
|
562
|
-
async executeTestsInParallel(testSuite, options) {
|
|
563
|
-
// Implementation for parallel test execution
|
|
564
|
-
return [];
|
|
565
|
-
}
|
|
566
|
-
async executeTestsSequentially(testSuite, options) {
|
|
567
|
-
// Implementation for sequential test execution
|
|
568
|
-
return [];
|
|
569
|
-
}
|
|
570
|
-
generateTestSummary(results) {
|
|
571
|
-
const totalTests = results.length;
|
|
572
|
-
const passed = results.filter(r => r.status === 'passed').length;
|
|
573
|
-
const failed = results.filter(r => r.status === 'failed').length;
|
|
574
|
-
const skipped = results.filter(r => r.status === 'skipped').length;
|
|
575
|
-
const errors = results.filter(r => r.status === 'error').length;
|
|
576
|
-
return {
|
|
577
|
-
totalTests,
|
|
578
|
-
passed,
|
|
579
|
-
failed,
|
|
580
|
-
skipped,
|
|
581
|
-
errors,
|
|
582
|
-
successRate: totalTests > 0 ? (passed / totalTests) * 100 : 0,
|
|
583
|
-
criticalFailures: results.filter(r => r.status === 'failed' &&
|
|
584
|
-
(r.name.includes('critical') || r.name.includes('security'))).length,
|
|
585
|
-
regressionDetected: results.some(r => r.name.includes('regression') && r.status === 'failed')
|
|
586
|
-
};
|
|
587
|
-
}
|
|
588
|
-
calculateCoverage(testSuite, results) {
|
|
589
|
-
// Implementation for coverage calculation
|
|
590
|
-
return {
|
|
591
|
-
overall: 85,
|
|
592
|
-
activities: 90,
|
|
593
|
-
conditions: 80,
|
|
594
|
-
paths: 75,
|
|
595
|
-
dataFlow: 85,
|
|
596
|
-
criticalPaths: 95,
|
|
597
|
-
uncoveredAreas: []
|
|
598
|
-
};
|
|
599
|
-
}
|
|
600
|
-
generatePerformanceReport(results) {
|
|
601
|
-
const executionTimes = results.map(r => r.executionTime);
|
|
602
|
-
return {
|
|
603
|
-
averageExecutionTime: executionTimes.reduce((a, b) => a + b, 0) / executionTimes.length,
|
|
604
|
-
maxExecutionTime: Math.max(...executionTimes),
|
|
605
|
-
memoryUsage: 0, // Would be measured during execution
|
|
606
|
-
apiCallCount: 0,
|
|
607
|
-
databaseQueries: 0,
|
|
608
|
-
thresholdViolations: [],
|
|
609
|
-
optimizationSuggestions: []
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
identifyTestIssues(results, testSuite) {
|
|
613
|
-
const issues = [];
|
|
614
|
-
// Critical test failures
|
|
615
|
-
results.filter(r => r.status === 'failed').forEach(result => {
|
|
616
|
-
issues.push({
|
|
617
|
-
severity: 'high',
|
|
618
|
-
category: 'functional',
|
|
619
|
-
description: `Test failed: ${result.name}`,
|
|
620
|
-
location: result.scenarioId,
|
|
621
|
-
impact: 'Flow may not work as expected in production',
|
|
622
|
-
recommendation: 'Fix the underlying issue causing test failure',
|
|
623
|
-
autoFixable: false
|
|
624
|
-
});
|
|
625
|
-
});
|
|
626
|
-
return issues;
|
|
627
|
-
}
|
|
628
|
-
async generateRecommendations(results, testSuite, issues) {
|
|
629
|
-
const recommendations = [];
|
|
630
|
-
if (issues.length > 0) {
|
|
631
|
-
recommendations.push('Address all identified test issues before deploying to production');
|
|
632
|
-
}
|
|
633
|
-
const failureRate = results.filter(r => r.status === 'failed').length / results.length;
|
|
634
|
-
if (failureRate > 0.1) {
|
|
635
|
-
recommendations.push('High test failure rate detected - review flow logic and test scenarios');
|
|
636
|
-
}
|
|
637
|
-
return recommendations;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
exports.FlowTestingAutomation = FlowTestingAutomation;
|
|
641
|
-
exports.default = FlowTestingAutomation;
|