@yasserkhanorg/e2e-agents 0.3.2 → 0.3.3

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.
Files changed (74) hide show
  1. package/README.md +22 -18
  2. package/dist/agent/config.d.ts +1 -0
  3. package/dist/agent/config.d.ts.map +1 -1
  4. package/dist/agent/config.js +10 -0
  5. package/dist/agent/pipeline.d.ts +6 -1
  6. package/dist/agent/pipeline.d.ts.map +1 -1
  7. package/dist/agent/pipeline.js +627 -27
  8. package/dist/agent/report.d.ts +5 -0
  9. package/dist/agent/report.d.ts.map +1 -1
  10. package/dist/agent/report.js +3 -0
  11. package/dist/agent/runner.d.ts.map +1 -1
  12. package/dist/agent/runner.js +25 -6
  13. package/dist/agent/tests.d.ts.map +1 -1
  14. package/dist/agent/tests.js +12 -2
  15. package/dist/cli.js +73 -5
  16. package/dist/esm/agent/config.js +10 -0
  17. package/dist/esm/agent/pipeline.js +627 -27
  18. package/dist/esm/agent/report.js +3 -0
  19. package/dist/esm/agent/runner.js +25 -6
  20. package/dist/esm/agent/tests.js +12 -2
  21. package/dist/esm/cli.js +73 -5
  22. package/package.json +1 -1
  23. package/dist/agent/cache_utils.d.ts +0 -38
  24. package/dist/agent/cache_utils.d.ts.map +0 -1
  25. package/dist/agent/cache_utils.js +0 -67
  26. package/dist/agent/impact-analyzer.d.ts +0 -114
  27. package/dist/agent/impact-analyzer.d.ts.map +0 -1
  28. package/dist/agent/impact-analyzer.js +0 -557
  29. package/dist/agent/index.d.ts +0 -21
  30. package/dist/agent/index.d.ts.map +0 -1
  31. package/dist/agent/index.js +0 -38
  32. package/dist/agent/model-router.d.ts +0 -57
  33. package/dist/agent/model-router.d.ts.map +0 -1
  34. package/dist/agent/model-router.js +0 -154
  35. package/dist/agent/report-generator.d.ts +0 -24
  36. package/dist/agent/report-generator.d.ts.map +0 -1
  37. package/dist/agent/report-generator.js +0 -250
  38. package/dist/agent/spec-bridge.d.ts +0 -101
  39. package/dist/agent/spec-bridge.d.ts.map +0 -1
  40. package/dist/agent/spec-bridge.js +0 -273
  41. package/dist/agent/spec-builder.d.ts +0 -102
  42. package/dist/agent/spec-builder.d.ts.map +0 -1
  43. package/dist/agent/spec-builder.js +0 -273
  44. package/dist/agent/telemetry.d.ts +0 -84
  45. package/dist/agent/telemetry.d.ts.map +0 -1
  46. package/dist/agent/telemetry.js +0 -220
  47. package/dist/agent/validators/selector-validator.d.ts +0 -74
  48. package/dist/agent/validators/selector-validator.d.ts.map +0 -1
  49. package/dist/agent/validators/selector-validator.js +0 -165
  50. package/dist/e2e-test-gen/index.d.ts +0 -51
  51. package/dist/e2e-test-gen/index.d.ts.map +0 -1
  52. package/dist/e2e-test-gen/index.js +0 -57
  53. package/dist/e2e-test-gen/spec_parser.d.ts +0 -142
  54. package/dist/e2e-test-gen/spec_parser.d.ts.map +0 -1
  55. package/dist/e2e-test-gen/spec_parser.js +0 -786
  56. package/dist/e2e-test-gen/types.d.ts +0 -185
  57. package/dist/e2e-test-gen/types.d.ts.map +0 -1
  58. package/dist/e2e-test-gen/types.js +0 -4
  59. package/dist/esm/agent/cache_utils.js +0 -63
  60. package/dist/esm/agent/impact-analyzer.js +0 -548
  61. package/dist/esm/agent/index.js +0 -22
  62. package/dist/esm/agent/model-router.js +0 -150
  63. package/dist/esm/agent/report-generator.js +0 -247
  64. package/dist/esm/agent/spec-bridge.js +0 -267
  65. package/dist/esm/agent/spec-builder.js +0 -267
  66. package/dist/esm/agent/telemetry.js +0 -216
  67. package/dist/esm/agent/validators/selector-validator.js +0 -160
  68. package/dist/esm/e2e-test-gen/index.js +0 -50
  69. package/dist/esm/e2e-test-gen/spec_parser.js +0 -782
  70. package/dist/esm/e2e-test-gen/types.js +0 -3
  71. package/dist/esm/plan-and-test-constants.js +0 -126
  72. package/dist/plan-and-test-constants.d.ts +0 -110
  73. package/dist/plan-and-test-constants.d.ts.map +0 -1
  74. package/dist/plan-and-test-constants.js +0 -132
@@ -1,3 +0,0 @@
1
- // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
- // See LICENSE.txt for license information.
3
- export {};
@@ -1,126 +0,0 @@
1
- // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
- // See LICENSE.txt for license information.
3
- /**
4
- * Centralized constants for plan-and-test command
5
- * Eliminates magic strings and hardcoded values
6
- * Makes configuration easy to modify and maintain
7
- */
8
- export const PLANNING_CONFIG = {
9
- // Number of test scenarios per priority level
10
- SCENARIO_COUNTS: {
11
- P0: 3,
12
- P1: 2,
13
- P2: 1,
14
- },
15
- // Default parameter values
16
- DEFAULTS: {
17
- MAX_TESTS: 10,
18
- COVERAGE_THRESHOLD: 50,
19
- PRIORITY_FILTER: ['P0', 'P1'],
20
- },
21
- // Limit constraints
22
- LIMITS: {
23
- MIN_MAX_TESTS: 1,
24
- MAX_MAX_TESTS: 100,
25
- MIN_COVERAGE_THRESHOLD: 0,
26
- MAX_COVERAGE_THRESHOLD: 100,
27
- },
28
- };
29
- /**
30
- * Display messages for plan-and-test command
31
- */
32
- export const PLAN_AND_TEST_MESSAGES = {
33
- HEADER: {
34
- MAIN: '🚀 Planning and Generating Tests',
35
- STEP_1_ANALYSIS: '📊 Step 1: Analyzing Code Changes...',
36
- STEP_2_PLANNING: '💡 Step 2: Planning Test Generation...',
37
- STEP_3_GENERATION: '⚡ Step 3: Generating Tests...',
38
- STEP_4_SUMMARY: '📈 Generation Summary',
39
- FOUND_FLOW_GROUPS: (count) => `📦 Found ${count} flow groups (end-to-end journeys):`,
40
- },
41
- ANALYSIS: {
42
- FOUND_FLOWS: (count) => `✓ Found ${count} affected flows`,
43
- MORE_FLOWS: (count) => ` ... and ${count} more`,
44
- FOUND_FLOW_GROUPS: (count) => `📦 Found ${count} flow groups (end-to-end journeys)`,
45
- },
46
- PLANNING: {
47
- PLAN_CREATED: (count) => `✓ Plan created: ${count} flows to test`,
48
- SKIPPING_COUNT: (count) => `⊘ Skipping ${count} flows:`,
49
- },
50
- SKIP_REASONS: {
51
- MAX_LIMIT_REACHED: (limit) => `Max tests limit reached (${limit})`,
52
- ALREADY_COVERED: (count) => `Already covered (${count} existing tests)`,
53
- },
54
- COVERAGE_REASONS: {
55
- NO_COVERAGE: (priority) => `${priority} - no coverage`,
56
- PARTIAL_COVERAGE: (priority, gaps) => `${priority} - partial coverage (${gaps} gaps)`,
57
- },
58
- EXECUTION: {
59
- TEST_COUNT: (index, total) => `[${index}/${total}]`,
60
- GENERATION_FAILED: (error) => ` ⚠️ Generation failed: ${error}`,
61
- DRY_RUN_MODE: '📋 DRY RUN: Not executing. Run without --dry-run to generate tests.',
62
- },
63
- SUMMARY: {
64
- SEPARATOR: '═'.repeat(50),
65
- TOTAL_GENERATED: (count) => `Total Tests Generated: ${count}`,
66
- SUCCESSFUL: (successful, total) => `Successful: ${successful}/${total}`,
67
- TOTAL_SCENARIOS: (count) => `Total Scenarios: ${count}`,
68
- COMPLETION: '✅ Execution complete!',
69
- },
70
- NEXT_STEPS: [
71
- ' • Run tests: npx playwright test --grep @smoke',
72
- ' • Re-run impact: npx e2e-ai-agents impact --path <app-root> --tests-root <tests-root>',
73
- ' • Check coverage: npm run test:impact',
74
- ],
75
- ERRORS: {
76
- INVALID_PRIORITY: (priorities) => `Invalid priority levels: ${priorities.join(', ')}`,
77
- INVALID_MAX_TESTS: (min, max) => `maxTests must be between ${min} and ${max}`,
78
- INVALID_COVERAGE_THRESHOLD: (min, max) => `coverageThreshold must be between ${min} and ${max}`,
79
- NO_CHANGES_DETECTED: '✓ No significant changes detected',
80
- },
81
- };
82
- /**
83
- * Priority levels in the system
84
- */
85
- export const PRIORITY_LEVELS = {
86
- CRITICAL: 'P0',
87
- HIGH: 'P1',
88
- MEDIUM: 'P2',
89
- };
90
- /**
91
- * Test strategy types for flow groups
92
- */
93
- export const TEST_STRATEGIES = {
94
- SEQUENTIAL: 'sequential',
95
- PARALLEL: 'parallel',
96
- MIXED: 'mixed',
97
- };
98
- /**
99
- * Flow group types
100
- */
101
- export const FLOW_GROUP_TYPES = {
102
- MESSAGING_LIFECYCLE: 'messaging-lifecycle',
103
- CHANNEL_MANAGEMENT: 'channel-management',
104
- MESSAGING_INTERACTIONS: 'messaging-interactions',
105
- };
106
- /**
107
- * Utility function to get scenario count for a priority
108
- * Provides type-safe access to scenario counts
109
- */
110
- export function getScenarioCount(priority) {
111
- const normalizedPriority = priority.toUpperCase();
112
- return (PLANNING_CONFIG.SCENARIO_COUNTS[normalizedPriority] || PLANNING_CONFIG.SCENARIO_COUNTS.P1);
113
- }
114
- /**
115
- * Utility function to validate priority level
116
- */
117
- export function isValidPriority(priority) {
118
- const validPriorities = Object.values(PRIORITY_LEVELS);
119
- return validPriorities.includes(priority.toUpperCase());
120
- }
121
- /**
122
- * Utility function to get all valid priority levels
123
- */
124
- export function getValidPriorities() {
125
- return Object.values(PRIORITY_LEVELS);
126
- }
@@ -1,110 +0,0 @@
1
- /**
2
- * Centralized constants for plan-and-test command
3
- * Eliminates magic strings and hardcoded values
4
- * Makes configuration easy to modify and maintain
5
- */
6
- export declare const PLANNING_CONFIG: {
7
- readonly SCENARIO_COUNTS: {
8
- readonly P0: 3;
9
- readonly P1: 2;
10
- readonly P2: 1;
11
- };
12
- readonly DEFAULTS: {
13
- readonly MAX_TESTS: 10;
14
- readonly COVERAGE_THRESHOLD: 50;
15
- readonly PRIORITY_FILTER: readonly ["P0", "P1"];
16
- };
17
- readonly LIMITS: {
18
- readonly MIN_MAX_TESTS: 1;
19
- readonly MAX_MAX_TESTS: 100;
20
- readonly MIN_COVERAGE_THRESHOLD: 0;
21
- readonly MAX_COVERAGE_THRESHOLD: 100;
22
- };
23
- };
24
- /**
25
- * Display messages for plan-and-test command
26
- */
27
- export declare const PLAN_AND_TEST_MESSAGES: {
28
- readonly HEADER: {
29
- readonly MAIN: "🚀 Planning and Generating Tests";
30
- readonly STEP_1_ANALYSIS: "📊 Step 1: Analyzing Code Changes...";
31
- readonly STEP_2_PLANNING: "💡 Step 2: Planning Test Generation...";
32
- readonly STEP_3_GENERATION: "⚡ Step 3: Generating Tests...";
33
- readonly STEP_4_SUMMARY: "📈 Generation Summary";
34
- readonly FOUND_FLOW_GROUPS: (count: number) => string;
35
- };
36
- readonly ANALYSIS: {
37
- readonly FOUND_FLOWS: (count: number) => string;
38
- readonly MORE_FLOWS: (count: number) => string;
39
- readonly FOUND_FLOW_GROUPS: (count: number) => string;
40
- };
41
- readonly PLANNING: {
42
- readonly PLAN_CREATED: (count: number) => string;
43
- readonly SKIPPING_COUNT: (count: number) => string;
44
- };
45
- readonly SKIP_REASONS: {
46
- readonly MAX_LIMIT_REACHED: (limit: number) => string;
47
- readonly ALREADY_COVERED: (count: number) => string;
48
- };
49
- readonly COVERAGE_REASONS: {
50
- readonly NO_COVERAGE: (priority: string) => string;
51
- readonly PARTIAL_COVERAGE: (priority: string, gaps: number) => string;
52
- };
53
- readonly EXECUTION: {
54
- readonly TEST_COUNT: (index: number, total: number) => string;
55
- readonly GENERATION_FAILED: (error: string) => string;
56
- readonly DRY_RUN_MODE: "📋 DRY RUN: Not executing. Run without --dry-run to generate tests.";
57
- };
58
- readonly SUMMARY: {
59
- readonly SEPARATOR: string;
60
- readonly TOTAL_GENERATED: (count: number) => string;
61
- readonly SUCCESSFUL: (successful: number, total: number) => string;
62
- readonly TOTAL_SCENARIOS: (count: number) => string;
63
- readonly COMPLETION: "✅ Execution complete!";
64
- };
65
- readonly NEXT_STEPS: readonly [" • Run tests: npx playwright test --grep @smoke", " • Re-run impact: npx e2e-ai-agents impact --path <app-root> --tests-root <tests-root>", " • Check coverage: npm run test:impact"];
66
- readonly ERRORS: {
67
- readonly INVALID_PRIORITY: (priorities: string[]) => string;
68
- readonly INVALID_MAX_TESTS: (min: number, max: number) => string;
69
- readonly INVALID_COVERAGE_THRESHOLD: (min: number, max: number) => string;
70
- readonly NO_CHANGES_DETECTED: "✓ No significant changes detected";
71
- };
72
- };
73
- /**
74
- * Priority levels in the system
75
- */
76
- export declare const PRIORITY_LEVELS: {
77
- readonly CRITICAL: "P0";
78
- readonly HIGH: "P1";
79
- readonly MEDIUM: "P2";
80
- };
81
- /**
82
- * Test strategy types for flow groups
83
- */
84
- export declare const TEST_STRATEGIES: {
85
- readonly SEQUENTIAL: "sequential";
86
- readonly PARALLEL: "parallel";
87
- readonly MIXED: "mixed";
88
- };
89
- /**
90
- * Flow group types
91
- */
92
- export declare const FLOW_GROUP_TYPES: {
93
- readonly MESSAGING_LIFECYCLE: "messaging-lifecycle";
94
- readonly CHANNEL_MANAGEMENT: "channel-management";
95
- readonly MESSAGING_INTERACTIONS: "messaging-interactions";
96
- };
97
- /**
98
- * Utility function to get scenario count for a priority
99
- * Provides type-safe access to scenario counts
100
- */
101
- export declare function getScenarioCount(priority: string): number;
102
- /**
103
- * Utility function to validate priority level
104
- */
105
- export declare function isValidPriority(priority: string): boolean;
106
- /**
107
- * Utility function to get all valid priority levels
108
- */
109
- export declare function getValidPriorities(): string[];
110
- //# sourceMappingURL=plan-and-test-constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plan-and-test-constants.d.ts","sourceRoot":"","sources":["../src/plan-and-test-constants.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;CAsBlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;4CAOA,MAAM;;;sCAIZ,MAAM;qCACP,MAAM;4CACC,MAAM;;;uCAIX,MAAM;yCACJ,MAAM;;;4CAIH,MAAM;0CACR,MAAM;;;yCAIP,MAAM;8CACD,MAAM,QAAQ,MAAM;;;qCAI7B,MAAM,SAAS,MAAM;4CACd,MAAM;;;;;0CAMR,MAAM;0CACN,MAAM,SAAS,MAAM;0CACrB,MAAM;;;;;gDAWA,MAAM,EAAE;0CACd,MAAM,OAAO,MAAM;mDACV,MAAM,OAAO,MAAM;;;CAGnD,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
3
- // See LICENSE.txt for license information.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.FLOW_GROUP_TYPES = exports.TEST_STRATEGIES = exports.PRIORITY_LEVELS = exports.PLAN_AND_TEST_MESSAGES = exports.PLANNING_CONFIG = void 0;
6
- exports.getScenarioCount = getScenarioCount;
7
- exports.isValidPriority = isValidPriority;
8
- exports.getValidPriorities = getValidPriorities;
9
- /**
10
- * Centralized constants for plan-and-test command
11
- * Eliminates magic strings and hardcoded values
12
- * Makes configuration easy to modify and maintain
13
- */
14
- exports.PLANNING_CONFIG = {
15
- // Number of test scenarios per priority level
16
- SCENARIO_COUNTS: {
17
- P0: 3,
18
- P1: 2,
19
- P2: 1,
20
- },
21
- // Default parameter values
22
- DEFAULTS: {
23
- MAX_TESTS: 10,
24
- COVERAGE_THRESHOLD: 50,
25
- PRIORITY_FILTER: ['P0', 'P1'],
26
- },
27
- // Limit constraints
28
- LIMITS: {
29
- MIN_MAX_TESTS: 1,
30
- MAX_MAX_TESTS: 100,
31
- MIN_COVERAGE_THRESHOLD: 0,
32
- MAX_COVERAGE_THRESHOLD: 100,
33
- },
34
- };
35
- /**
36
- * Display messages for plan-and-test command
37
- */
38
- exports.PLAN_AND_TEST_MESSAGES = {
39
- HEADER: {
40
- MAIN: '🚀 Planning and Generating Tests',
41
- STEP_1_ANALYSIS: '📊 Step 1: Analyzing Code Changes...',
42
- STEP_2_PLANNING: '💡 Step 2: Planning Test Generation...',
43
- STEP_3_GENERATION: '⚡ Step 3: Generating Tests...',
44
- STEP_4_SUMMARY: '📈 Generation Summary',
45
- FOUND_FLOW_GROUPS: (count) => `📦 Found ${count} flow groups (end-to-end journeys):`,
46
- },
47
- ANALYSIS: {
48
- FOUND_FLOWS: (count) => `✓ Found ${count} affected flows`,
49
- MORE_FLOWS: (count) => ` ... and ${count} more`,
50
- FOUND_FLOW_GROUPS: (count) => `📦 Found ${count} flow groups (end-to-end journeys)`,
51
- },
52
- PLANNING: {
53
- PLAN_CREATED: (count) => `✓ Plan created: ${count} flows to test`,
54
- SKIPPING_COUNT: (count) => `⊘ Skipping ${count} flows:`,
55
- },
56
- SKIP_REASONS: {
57
- MAX_LIMIT_REACHED: (limit) => `Max tests limit reached (${limit})`,
58
- ALREADY_COVERED: (count) => `Already covered (${count} existing tests)`,
59
- },
60
- COVERAGE_REASONS: {
61
- NO_COVERAGE: (priority) => `${priority} - no coverage`,
62
- PARTIAL_COVERAGE: (priority, gaps) => `${priority} - partial coverage (${gaps} gaps)`,
63
- },
64
- EXECUTION: {
65
- TEST_COUNT: (index, total) => `[${index}/${total}]`,
66
- GENERATION_FAILED: (error) => ` ⚠️ Generation failed: ${error}`,
67
- DRY_RUN_MODE: '📋 DRY RUN: Not executing. Run without --dry-run to generate tests.',
68
- },
69
- SUMMARY: {
70
- SEPARATOR: '═'.repeat(50),
71
- TOTAL_GENERATED: (count) => `Total Tests Generated: ${count}`,
72
- SUCCESSFUL: (successful, total) => `Successful: ${successful}/${total}`,
73
- TOTAL_SCENARIOS: (count) => `Total Scenarios: ${count}`,
74
- COMPLETION: '✅ Execution complete!',
75
- },
76
- NEXT_STEPS: [
77
- ' • Run tests: npx playwright test --grep @smoke',
78
- ' • Re-run impact: npx e2e-ai-agents impact --path <app-root> --tests-root <tests-root>',
79
- ' • Check coverage: npm run test:impact',
80
- ],
81
- ERRORS: {
82
- INVALID_PRIORITY: (priorities) => `Invalid priority levels: ${priorities.join(', ')}`,
83
- INVALID_MAX_TESTS: (min, max) => `maxTests must be between ${min} and ${max}`,
84
- INVALID_COVERAGE_THRESHOLD: (min, max) => `coverageThreshold must be between ${min} and ${max}`,
85
- NO_CHANGES_DETECTED: '✓ No significant changes detected',
86
- },
87
- };
88
- /**
89
- * Priority levels in the system
90
- */
91
- exports.PRIORITY_LEVELS = {
92
- CRITICAL: 'P0',
93
- HIGH: 'P1',
94
- MEDIUM: 'P2',
95
- };
96
- /**
97
- * Test strategy types for flow groups
98
- */
99
- exports.TEST_STRATEGIES = {
100
- SEQUENTIAL: 'sequential',
101
- PARALLEL: 'parallel',
102
- MIXED: 'mixed',
103
- };
104
- /**
105
- * Flow group types
106
- */
107
- exports.FLOW_GROUP_TYPES = {
108
- MESSAGING_LIFECYCLE: 'messaging-lifecycle',
109
- CHANNEL_MANAGEMENT: 'channel-management',
110
- MESSAGING_INTERACTIONS: 'messaging-interactions',
111
- };
112
- /**
113
- * Utility function to get scenario count for a priority
114
- * Provides type-safe access to scenario counts
115
- */
116
- function getScenarioCount(priority) {
117
- const normalizedPriority = priority.toUpperCase();
118
- return (exports.PLANNING_CONFIG.SCENARIO_COUNTS[normalizedPriority] || exports.PLANNING_CONFIG.SCENARIO_COUNTS.P1);
119
- }
120
- /**
121
- * Utility function to validate priority level
122
- */
123
- function isValidPriority(priority) {
124
- const validPriorities = Object.values(exports.PRIORITY_LEVELS);
125
- return validPriorities.includes(priority.toUpperCase());
126
- }
127
- /**
128
- * Utility function to get all valid priority levels
129
- */
130
- function getValidPriorities() {
131
- return Object.values(exports.PRIORITY_LEVELS);
132
- }