test-genie-mcp 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -0
- package/dist/analyzers/astAnalyzer.d.ts +108 -0
- package/dist/analyzers/astAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/astAnalyzer.js +800 -0
- package/dist/analyzers/astAnalyzer.js.map +1 -0
- package/dist/analyzers/performanceAnalyzer.d.ts +90 -0
- package/dist/analyzers/performanceAnalyzer.d.ts.map +1 -0
- package/dist/analyzers/performanceAnalyzer.js +647 -0
- package/dist/analyzers/performanceAnalyzer.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +683 -0
- package/dist/index.js.map +1 -0
- package/dist/platforms/android/index.d.ts +90 -0
- package/dist/platforms/android/index.d.ts.map +1 -0
- package/dist/platforms/android/index.js +519 -0
- package/dist/platforms/android/index.js.map +1 -0
- package/dist/platforms/flutter/index.d.ts +105 -0
- package/dist/platforms/flutter/index.d.ts.map +1 -0
- package/dist/platforms/flutter/index.js +533 -0
- package/dist/platforms/flutter/index.js.map +1 -0
- package/dist/platforms/ios/index.d.ts +79 -0
- package/dist/platforms/ios/index.d.ts.map +1 -0
- package/dist/platforms/ios/index.js +393 -0
- package/dist/platforms/ios/index.js.map +1 -0
- package/dist/platforms/react-native/index.d.ts +160 -0
- package/dist/platforms/react-native/index.d.ts.map +1 -0
- package/dist/platforms/react-native/index.js +602 -0
- package/dist/platforms/react-native/index.js.map +1 -0
- package/dist/platforms/web/index.d.ts +177 -0
- package/dist/platforms/web/index.d.ts.map +1 -0
- package/dist/platforms/web/index.js +637 -0
- package/dist/platforms/web/index.js.map +1 -0
- package/dist/storage/index.d.ts +35 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +351 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/tools/analysis/analyzeAppStructure.d.ts +9 -0
- package/dist/tools/analysis/analyzeAppStructure.d.ts.map +1 -0
- package/dist/tools/analysis/analyzeAppStructure.js +289 -0
- package/dist/tools/analysis/analyzeAppStructure.js.map +1 -0
- package/dist/tools/analysis/createTestPlan.d.ts +21 -0
- package/dist/tools/analysis/createTestPlan.d.ts.map +1 -0
- package/dist/tools/analysis/createTestPlan.js +214 -0
- package/dist/tools/analysis/createTestPlan.js.map +1 -0
- package/dist/tools/analysis/generateScenarios.d.ts +21 -0
- package/dist/tools/analysis/generateScenarios.d.ts.map +1 -0
- package/dist/tools/analysis/generateScenarios.js +567 -0
- package/dist/tools/analysis/generateScenarios.js.map +1 -0
- package/dist/tools/automation/cicdIntegration.d.ts +41 -0
- package/dist/tools/automation/cicdIntegration.d.ts.map +1 -0
- package/dist/tools/automation/cicdIntegration.js +825 -0
- package/dist/tools/automation/cicdIntegration.js.map +1 -0
- package/dist/tools/automation/generateReport.d.ts +16 -0
- package/dist/tools/automation/generateReport.d.ts.map +1 -0
- package/dist/tools/automation/generateReport.js +406 -0
- package/dist/tools/automation/generateReport.js.map +1 -0
- package/dist/tools/automation/runFullAutomation.d.ts +25 -0
- package/dist/tools/automation/runFullAutomation.d.ts.map +1 -0
- package/dist/tools/automation/runFullAutomation.js +296 -0
- package/dist/tools/automation/runFullAutomation.js.map +1 -0
- package/dist/tools/detection/detectLogicErrors.d.ts +18 -0
- package/dist/tools/detection/detectLogicErrors.d.ts.map +1 -0
- package/dist/tools/detection/detectLogicErrors.js +470 -0
- package/dist/tools/detection/detectLogicErrors.js.map +1 -0
- package/dist/tools/detection/detectMemoryLeaks.d.ts +23 -0
- package/dist/tools/detection/detectMemoryLeaks.d.ts.map +1 -0
- package/dist/tools/detection/detectMemoryLeaks.js +453 -0
- package/dist/tools/detection/detectMemoryLeaks.js.map +1 -0
- package/dist/tools/execution/runScenarioTest.d.ts +34 -0
- package/dist/tools/execution/runScenarioTest.d.ts.map +1 -0
- package/dist/tools/execution/runScenarioTest.js +334 -0
- package/dist/tools/execution/runScenarioTest.js.map +1 -0
- package/dist/tools/execution/runSimulation.d.ts +17 -0
- package/dist/tools/execution/runSimulation.d.ts.map +1 -0
- package/dist/tools/execution/runSimulation.js +250 -0
- package/dist/tools/execution/runSimulation.js.map +1 -0
- package/dist/tools/execution/runStressTest.d.ts +52 -0
- package/dist/tools/execution/runStressTest.d.ts.map +1 -0
- package/dist/tools/execution/runStressTest.js +176 -0
- package/dist/tools/execution/runStressTest.js.map +1 -0
- package/dist/tools/fixing/applyFix.d.ts +44 -0
- package/dist/tools/fixing/applyFix.d.ts.map +1 -0
- package/dist/tools/fixing/applyFix.js +399 -0
- package/dist/tools/fixing/applyFix.js.map +1 -0
- package/dist/tools/fixing/confirmFix.d.ts +31 -0
- package/dist/tools/fixing/confirmFix.d.ts.map +1 -0
- package/dist/tools/fixing/confirmFix.js +136 -0
- package/dist/tools/fixing/confirmFix.js.map +1 -0
- package/dist/tools/fixing/suggestFixes.d.ts +23 -0
- package/dist/tools/fixing/suggestFixes.d.ts.map +1 -0
- package/dist/tools/fixing/suggestFixes.js +349 -0
- package/dist/tools/fixing/suggestFixes.js.map +1 -0
- package/dist/types.d.ts +322 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/codeParser.d.ts +12 -0
- package/dist/utils/codeParser.d.ts.map +1 -0
- package/dist/utils/codeParser.js +487 -0
- package/dist/utils/codeParser.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platforms/android/index.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oCAAoC;AACpC,2CAA2C;AAC3C,+CAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6B/C,kCA4CC;AAED,sCAOC;AAED,sCAgBC;AAED,oCAOC;AAKD,wCA0CC;AAuCD,4CAqCC;AA6BD,wCAwBC;AAYD,kCAoBC;AAoJD,wDAsBC;AAKD,gC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U,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACxF,WAAW;YACX,MAAM,SAAS,CAAC,UAAU,MAAM,aAAa,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9E,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kBAAe;IACb,WAAW;IACX,aAAa;IACb,aAAa;IACb,YAAY;IACZ,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,sBAAsB;IACtB,UAAU;IACV,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;CACf,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface FlutterDevice {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
platform: 'android' | 'ios' | 'web' | 'macos' | 'windows' | 'linux';
|
|
5
|
+
emulator: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface FlutterTestConfig {
|
|
8
|
+
projectPath: string;
|
|
9
|
+
testPath?: string;
|
|
10
|
+
device?: string;
|
|
11
|
+
flavor?: string;
|
|
12
|
+
coverage?: boolean;
|
|
13
|
+
reporter?: 'compact' | 'expanded' | 'json';
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function listDevices(): Promise<FlutterDevice[]>;
|
|
17
|
+
export declare function runEmulator(platform: 'android' | 'ios'): Promise<boolean>;
|
|
18
|
+
export declare function runFlutterTest(config: FlutterTestConfig): Promise<{
|
|
19
|
+
success: boolean;
|
|
20
|
+
output: string;
|
|
21
|
+
tests: {
|
|
22
|
+
name: string;
|
|
23
|
+
passed: boolean;
|
|
24
|
+
duration: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
}[];
|
|
27
|
+
coverage?: number;
|
|
28
|
+
}>;
|
|
29
|
+
export declare function runIntegrationTest(config: FlutterTestConfig & {
|
|
30
|
+
driver?: string;
|
|
31
|
+
target?: string;
|
|
32
|
+
}): Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
output: string;
|
|
35
|
+
screenshots: string[];
|
|
36
|
+
duration: number;
|
|
37
|
+
performanceMetrics?: Record<string, number>;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function runGoldenTests(config: FlutterTestConfig & {
|
|
40
|
+
updateGoldens?: boolean;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
success: boolean;
|
|
43
|
+
output: string;
|
|
44
|
+
mismatches: {
|
|
45
|
+
name: string;
|
|
46
|
+
diffPath: string;
|
|
47
|
+
}[];
|
|
48
|
+
}>;
|
|
49
|
+
export interface FlutterProfileConfig {
|
|
50
|
+
projectPath: string;
|
|
51
|
+
device?: string;
|
|
52
|
+
duration: number;
|
|
53
|
+
target?: string;
|
|
54
|
+
}
|
|
55
|
+
export declare function runPerformanceProfile(config: FlutterProfileConfig): Promise<{
|
|
56
|
+
success: boolean;
|
|
57
|
+
tracePath: string;
|
|
58
|
+
metrics: {
|
|
59
|
+
avgFPS: number;
|
|
60
|
+
worstFPS: number;
|
|
61
|
+
avgFrameBuildTime: number;
|
|
62
|
+
avgFrameRasterTime: number;
|
|
63
|
+
jankFrames: number;
|
|
64
|
+
memoryMB: number;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
export declare function analyzeMemory(config: {
|
|
68
|
+
projectPath: string;
|
|
69
|
+
device?: string;
|
|
70
|
+
duration: number;
|
|
71
|
+
}): Promise<{
|
|
72
|
+
success: boolean;
|
|
73
|
+
heapUsage: {
|
|
74
|
+
time: number;
|
|
75
|
+
usedMB: number;
|
|
76
|
+
capacityMB: number;
|
|
77
|
+
}[];
|
|
78
|
+
leaks: string[];
|
|
79
|
+
recommendations: string[];
|
|
80
|
+
}>;
|
|
81
|
+
export declare function buildApp(projectPath: string, platform: 'apk' | 'appbundle' | 'ios' | 'ipa' | 'web', options?: {
|
|
82
|
+
release?: boolean;
|
|
83
|
+
flavor?: string;
|
|
84
|
+
target?: string;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
success: boolean;
|
|
87
|
+
outputPath: string;
|
|
88
|
+
output: string;
|
|
89
|
+
}>;
|
|
90
|
+
export declare function installApp(device: string, appPath: string): Promise<boolean>;
|
|
91
|
+
export declare function takeScreenshot(device: string, outputPath: string): Promise<boolean>;
|
|
92
|
+
declare const _default: {
|
|
93
|
+
listDevices: typeof listDevices;
|
|
94
|
+
runEmulator: typeof runEmulator;
|
|
95
|
+
runFlutterTest: typeof runFlutterTest;
|
|
96
|
+
runIntegrationTest: typeof runIntegrationTest;
|
|
97
|
+
runGoldenTests: typeof runGoldenTests;
|
|
98
|
+
runPerformanceProfile: typeof runPerformanceProfile;
|
|
99
|
+
analyzeMemory: typeof analyzeMemory;
|
|
100
|
+
buildApp: typeof buildApp;
|
|
101
|
+
installApp: typeof installApp;
|
|
102
|
+
takeScreenshot: typeof takeScreenshot;
|
|
103
|
+
};
|
|
104
|
+
export default _default;
|
|
105
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platforms/flutter/index.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACpE,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG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C,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA0CnE;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOlF;AAKD,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqBzF;;;;;;;;;;;;;AAED,wBAWE"}
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================
|
|
3
|
+
// Flutter Test Platform Integration
|
|
4
|
+
// flutter_test, flutter drive, integration_test
|
|
5
|
+
// ============================================
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.listDevices = listDevices;
|
|
41
|
+
exports.runEmulator = runEmulator;
|
|
42
|
+
exports.runFlutterTest = runFlutterTest;
|
|
43
|
+
exports.runIntegrationTest = runIntegrationTest;
|
|
44
|
+
exports.runGoldenTests = runGoldenTests;
|
|
45
|
+
exports.runPerformanceProfile = runPerformanceProfile;
|
|
46
|
+
exports.analyzeMemory = analyzeMemory;
|
|
47
|
+
exports.buildApp = buildApp;
|
|
48
|
+
exports.installApp = installApp;
|
|
49
|
+
exports.takeScreenshot = takeScreenshot;
|
|
50
|
+
const child_process_1 = require("child_process");
|
|
51
|
+
const util_1 = require("util");
|
|
52
|
+
const fs = __importStar(require("fs"));
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
55
|
+
// ============================================
|
|
56
|
+
// Device Management
|
|
57
|
+
// ============================================
|
|
58
|
+
async function listDevices() {
|
|
59
|
+
try {
|
|
60
|
+
const { stdout } = await execAsync('flutter devices --machine');
|
|
61
|
+
const devices = JSON.parse(stdout);
|
|
62
|
+
return devices.map((d) => ({
|
|
63
|
+
id: d.id,
|
|
64
|
+
name: d.name,
|
|
65
|
+
platform: d.targetPlatform?.split('.')[1] || 'unknown',
|
|
66
|
+
emulator: d.emulator || false,
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error('Failed to list Flutter devices:', error);
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function runEmulator(platform) {
|
|
75
|
+
try {
|
|
76
|
+
if (platform === 'android') {
|
|
77
|
+
await execAsync('flutter emulators --launch flutter_emulator');
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
await execAsync('open -a Simulator');
|
|
81
|
+
}
|
|
82
|
+
// Wait for emulator to boot
|
|
83
|
+
await new Promise(resolve => setTimeout(resolve, 10000));
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ============================================
|
|
91
|
+
// Unit & Widget Tests (flutter test)
|
|
92
|
+
// ============================================
|
|
93
|
+
async function runFlutterTest(config) {
|
|
94
|
+
const { projectPath, testPath = 'test', coverage = false, reporter = 'json', timeout = 300000, } = config;
|
|
95
|
+
const coverageArg = coverage ? '--coverage' : '';
|
|
96
|
+
const reporterArg = `--reporter=${reporter}`;
|
|
97
|
+
const command = `cd "${projectPath}" && flutter test ${testPath} ${coverageArg} ${reporterArg} 2>&1`;
|
|
98
|
+
try {
|
|
99
|
+
const { stdout } = await execAsync(command, { timeout, maxBuffer: 50 * 1024 * 1024 });
|
|
100
|
+
const tests = parseFlutterTestOutput(stdout, reporter);
|
|
101
|
+
const allPassed = tests.every(t => t.passed);
|
|
102
|
+
let coveragePercent;
|
|
103
|
+
if (coverage) {
|
|
104
|
+
coveragePercent = await getFlutterCoverage(projectPath);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
success: allPassed,
|
|
108
|
+
output: stdout,
|
|
109
|
+
tests,
|
|
110
|
+
coverage: coveragePercent,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return {
|
|
115
|
+
success: false,
|
|
116
|
+
output: error.stdout || error.message,
|
|
117
|
+
tests: parseFlutterTestOutput(error.stdout || '', reporter),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function parseFlutterTestOutput(output, reporter) {
|
|
122
|
+
const tests = [];
|
|
123
|
+
if (reporter === 'json') {
|
|
124
|
+
// Parse JSON lines
|
|
125
|
+
const lines = output.split('\n').filter(l => l.trim().startsWith('{'));
|
|
126
|
+
for (const line of lines) {
|
|
127
|
+
try {
|
|
128
|
+
const event = JSON.parse(line);
|
|
129
|
+
if (event.type === 'testDone') {
|
|
130
|
+
tests.push({
|
|
131
|
+
name: event.name || `Test ${event.testID}`,
|
|
132
|
+
passed: event.result === 'success',
|
|
133
|
+
duration: event.time || 0,
|
|
134
|
+
error: event.result !== 'success' ? event.error : undefined,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// Skip invalid JSON lines
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// Parse expanded/compact format
|
|
145
|
+
const testRegex = /(\d+:\d+)\s+(\+\d+(?:\s+-\d+)?)?:\s+(.*?)(?:\s+\((\d+)ms\))?$/gm;
|
|
146
|
+
let match;
|
|
147
|
+
while ((match = testRegex.exec(output)) !== null) {
|
|
148
|
+
const statusPart = match[2] || '';
|
|
149
|
+
const passed = !statusPart.includes('-');
|
|
150
|
+
tests.push({
|
|
151
|
+
name: match[3]?.trim() || 'Unknown',
|
|
152
|
+
passed,
|
|
153
|
+
duration: parseInt(match[4] || '0'),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return tests;
|
|
158
|
+
}
|
|
159
|
+
async function getFlutterCoverage(projectPath) {
|
|
160
|
+
try {
|
|
161
|
+
const lcovPath = path.join(projectPath, 'coverage', 'lcov.info');
|
|
162
|
+
if (!fs.existsSync(lcovPath)) {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
const content = fs.readFileSync(lcovPath, 'utf-8');
|
|
166
|
+
let totalLines = 0;
|
|
167
|
+
let coveredLines = 0;
|
|
168
|
+
const lines = content.split('\n');
|
|
169
|
+
for (const line of lines) {
|
|
170
|
+
if (line.startsWith('LF:')) {
|
|
171
|
+
totalLines += parseInt(line.substring(3)) || 0;
|
|
172
|
+
}
|
|
173
|
+
else if (line.startsWith('LH:')) {
|
|
174
|
+
coveredLines += parseInt(line.substring(3)) || 0;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return totalLines > 0 ? Math.round((coveredLines / totalLines) * 100) : undefined;
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// ============================================
|
|
184
|
+
// Integration Tests (flutter drive / integration_test)
|
|
185
|
+
// ============================================
|
|
186
|
+
async function runIntegrationTest(config) {
|
|
187
|
+
const { projectPath, device, driver = 'test_driver/integration_test.dart', target = 'integration_test/app_test.dart', timeout = 600000, } = config;
|
|
188
|
+
const deviceArg = device ? `-d ${device}` : '';
|
|
189
|
+
const screenshotDir = path.join(projectPath, '.test-genie', 'screenshots', `integration_${Date.now()}`);
|
|
190
|
+
if (!fs.existsSync(screenshotDir)) {
|
|
191
|
+
fs.mkdirSync(screenshotDir, { recursive: true });
|
|
192
|
+
}
|
|
193
|
+
// Check if using new integration_test package or old flutter_driver
|
|
194
|
+
const useNewIntegration = fs.existsSync(path.join(projectPath, 'integration_test'));
|
|
195
|
+
let command;
|
|
196
|
+
if (useNewIntegration) {
|
|
197
|
+
command = `cd "${projectPath}" && flutter test integration_test ${deviceArg} 2>&1`;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
command = `cd "${projectPath}" && flutter drive --driver=${driver} --target=${target} ${deviceArg} 2>&1`;
|
|
201
|
+
}
|
|
202
|
+
const startTime = Date.now();
|
|
203
|
+
try {
|
|
204
|
+
const { stdout } = await execAsync(command, { timeout, maxBuffer: 50 * 1024 * 1024 });
|
|
205
|
+
// Extract performance metrics if available
|
|
206
|
+
const performanceMetrics = extractPerformanceMetrics(stdout);
|
|
207
|
+
// Get screenshots from the directory
|
|
208
|
+
const screenshots = fs.existsSync(screenshotDir)
|
|
209
|
+
? fs.readdirSync(screenshotDir).map(f => path.join(screenshotDir, f))
|
|
210
|
+
: [];
|
|
211
|
+
return {
|
|
212
|
+
success: !stdout.includes('FAILED') && !stdout.includes('Some tests failed'),
|
|
213
|
+
output: stdout,
|
|
214
|
+
screenshots,
|
|
215
|
+
duration: Date.now() - startTime,
|
|
216
|
+
performanceMetrics,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
return {
|
|
221
|
+
success: false,
|
|
222
|
+
output: error.stdout || error.message,
|
|
223
|
+
screenshots: [],
|
|
224
|
+
duration: Date.now() - startTime,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
function extractPerformanceMetrics(output) {
|
|
229
|
+
const metrics = {};
|
|
230
|
+
// Parse timeline summary if available
|
|
231
|
+
const avgFrameMatch = output.match(/Average frame build time:\s*([\d.]+)ms/);
|
|
232
|
+
if (avgFrameMatch) {
|
|
233
|
+
metrics['avgFrameBuildTime'] = parseFloat(avgFrameMatch[1] || '0');
|
|
234
|
+
}
|
|
235
|
+
const worstFrameMatch = output.match(/Worst frame build time:\s*([\d.]+)ms/);
|
|
236
|
+
if (worstFrameMatch) {
|
|
237
|
+
metrics['worstFrameBuildTime'] = parseFloat(worstFrameMatch[1] || '0');
|
|
238
|
+
}
|
|
239
|
+
const missedFramesMatch = output.match(/Missed frames:\s*(\d+)/);
|
|
240
|
+
if (missedFramesMatch) {
|
|
241
|
+
metrics['missedFrames'] = parseInt(missedFramesMatch[1] || '0');
|
|
242
|
+
}
|
|
243
|
+
return metrics;
|
|
244
|
+
}
|
|
245
|
+
// ============================================
|
|
246
|
+
// Golden Tests (Snapshot Testing)
|
|
247
|
+
// ============================================
|
|
248
|
+
async function runGoldenTests(config) {
|
|
249
|
+
const { projectPath, testPath = 'test', updateGoldens = false, timeout = 300000, } = config;
|
|
250
|
+
const updateArg = updateGoldens ? '--update-goldens' : '';
|
|
251
|
+
const command = `cd "${projectPath}" && flutter test ${testPath} ${updateArg} --tags=golden 2>&1`;
|
|
252
|
+
try {
|
|
253
|
+
const { stdout } = await execAsync(command, { timeout, maxBuffer: 50 * 1024 * 1024 });
|
|
254
|
+
const mismatches = parseGoldenMismatches(stdout, projectPath);
|
|
255
|
+
return {
|
|
256
|
+
success: mismatches.length === 0,
|
|
257
|
+
output: stdout,
|
|
258
|
+
mismatches,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
return {
|
|
263
|
+
success: false,
|
|
264
|
+
output: error.stdout || error.message,
|
|
265
|
+
mismatches: parseGoldenMismatches(error.stdout || '', projectPath),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function parseGoldenMismatches(output, projectPath) {
|
|
270
|
+
const mismatches = [];
|
|
271
|
+
const mismatchRegex = /Golden file\s+([^\s]+)\s+does not match/g;
|
|
272
|
+
let match;
|
|
273
|
+
while ((match = mismatchRegex.exec(output)) !== null) {
|
|
274
|
+
const goldenName = match[1] || '';
|
|
275
|
+
const diffPath = path.join(projectPath, 'test', 'failures', `${goldenName}_diff.png`);
|
|
276
|
+
mismatches.push({
|
|
277
|
+
name: goldenName,
|
|
278
|
+
diffPath: fs.existsSync(diffPath) ? diffPath : '',
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return mismatches;
|
|
282
|
+
}
|
|
283
|
+
async function runPerformanceProfile(config) {
|
|
284
|
+
const { projectPath, device, duration, target = 'lib/main.dart', } = config;
|
|
285
|
+
const deviceArg = device ? `-d ${device}` : '';
|
|
286
|
+
const tracePath = path.join(projectPath, '.test-genie', 'traces', `profile_${Date.now()}.json`);
|
|
287
|
+
const traceDir = path.dirname(tracePath);
|
|
288
|
+
if (!fs.existsSync(traceDir)) {
|
|
289
|
+
fs.mkdirSync(traceDir, { recursive: true });
|
|
290
|
+
}
|
|
291
|
+
// Run with profiling
|
|
292
|
+
const command = `cd "${projectPath}" && flutter run --profile ${deviceArg} --trace-startup --endless-trace-buffer 2>&1`;
|
|
293
|
+
try {
|
|
294
|
+
// Start the app
|
|
295
|
+
const process = (0, child_process_1.exec)(command);
|
|
296
|
+
let output = '';
|
|
297
|
+
process.stdout?.on('data', (data) => {
|
|
298
|
+
output += data;
|
|
299
|
+
});
|
|
300
|
+
// Wait for specified duration
|
|
301
|
+
await new Promise(resolve => setTimeout(resolve, duration * 1000));
|
|
302
|
+
// Send 'q' to quit and get trace
|
|
303
|
+
process.stdin?.write('P'); // Capture performance overlay
|
|
304
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
305
|
+
process.stdin?.write('q');
|
|
306
|
+
await new Promise((resolve) => {
|
|
307
|
+
process.on('exit', () => resolve());
|
|
308
|
+
setTimeout(() => {
|
|
309
|
+
process.kill();
|
|
310
|
+
resolve();
|
|
311
|
+
}, 5000);
|
|
312
|
+
});
|
|
313
|
+
// Parse metrics from output
|
|
314
|
+
const metrics = parsePerformanceOutput(output);
|
|
315
|
+
return {
|
|
316
|
+
success: true,
|
|
317
|
+
tracePath,
|
|
318
|
+
metrics,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
return {
|
|
323
|
+
success: false,
|
|
324
|
+
tracePath,
|
|
325
|
+
metrics: {
|
|
326
|
+
avgFPS: 0,
|
|
327
|
+
worstFPS: 0,
|
|
328
|
+
avgFrameBuildTime: 0,
|
|
329
|
+
avgFrameRasterTime: 0,
|
|
330
|
+
jankFrames: 0,
|
|
331
|
+
memoryMB: 0,
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function parsePerformanceOutput(output) {
|
|
337
|
+
const metrics = {
|
|
338
|
+
avgFPS: 60,
|
|
339
|
+
worstFPS: 60,
|
|
340
|
+
avgFrameBuildTime: 0,
|
|
341
|
+
avgFrameRasterTime: 0,
|
|
342
|
+
jankFrames: 0,
|
|
343
|
+
memoryMB: 0,
|
|
344
|
+
};
|
|
345
|
+
// Parse DevTools-style metrics
|
|
346
|
+
const fpsMatch = output.match(/(\d+)\s*fps/i);
|
|
347
|
+
if (fpsMatch) {
|
|
348
|
+
metrics.avgFPS = parseInt(fpsMatch[1] || '60');
|
|
349
|
+
}
|
|
350
|
+
const memoryMatch = output.match(/Memory:\s*([\d.]+)\s*MB/i);
|
|
351
|
+
if (memoryMatch) {
|
|
352
|
+
metrics.memoryMB = parseFloat(memoryMatch[1] || '0');
|
|
353
|
+
}
|
|
354
|
+
const buildTimeMatch = output.match(/Build:\s*([\d.]+)ms/);
|
|
355
|
+
if (buildTimeMatch) {
|
|
356
|
+
metrics.avgFrameBuildTime = parseFloat(buildTimeMatch[1] || '0');
|
|
357
|
+
}
|
|
358
|
+
const rasterTimeMatch = output.match(/Raster:\s*([\d.]+)ms/);
|
|
359
|
+
if (rasterTimeMatch) {
|
|
360
|
+
metrics.avgFrameRasterTime = parseFloat(rasterTimeMatch[1] || '0');
|
|
361
|
+
}
|
|
362
|
+
return metrics;
|
|
363
|
+
}
|
|
364
|
+
// ============================================
|
|
365
|
+
// Memory Analysis
|
|
366
|
+
// ============================================
|
|
367
|
+
async function analyzeMemory(config) {
|
|
368
|
+
const { projectPath, device, duration } = config;
|
|
369
|
+
const deviceArg = device ? `-d ${device}` : '';
|
|
370
|
+
const command = `cd "${projectPath}" && flutter run --profile ${deviceArg} 2>&1`;
|
|
371
|
+
const heapUsage = [];
|
|
372
|
+
const startTime = Date.now();
|
|
373
|
+
try {
|
|
374
|
+
const process = (0, child_process_1.exec)(command);
|
|
375
|
+
let output = '';
|
|
376
|
+
process.stdout?.on('data', (data) => {
|
|
377
|
+
output += data;
|
|
378
|
+
// Parse memory info from output
|
|
379
|
+
const memMatch = data.toString().match(/Memory usage:\s*([\d.]+)\s*MB\s*\/\s*([\d.]+)\s*MB/);
|
|
380
|
+
if (memMatch) {
|
|
381
|
+
heapUsage.push({
|
|
382
|
+
time: Date.now() - startTime,
|
|
383
|
+
usedMB: parseFloat(memMatch[1] || '0'),
|
|
384
|
+
capacityMB: parseFloat(memMatch[2] || '0'),
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
// Monitor for specified duration
|
|
389
|
+
await new Promise(resolve => setTimeout(resolve, duration * 1000));
|
|
390
|
+
process.stdin?.write('q');
|
|
391
|
+
await new Promise((resolve) => {
|
|
392
|
+
process.on('exit', () => resolve());
|
|
393
|
+
setTimeout(() => {
|
|
394
|
+
process.kill();
|
|
395
|
+
resolve();
|
|
396
|
+
}, 5000);
|
|
397
|
+
});
|
|
398
|
+
// Analyze for potential leaks
|
|
399
|
+
const { leaks, recommendations } = analyzeHeapPattern(heapUsage);
|
|
400
|
+
return {
|
|
401
|
+
success: true,
|
|
402
|
+
heapUsage,
|
|
403
|
+
leaks,
|
|
404
|
+
recommendations,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
catch (error) {
|
|
408
|
+
return {
|
|
409
|
+
success: false,
|
|
410
|
+
heapUsage,
|
|
411
|
+
leaks: [],
|
|
412
|
+
recommendations: [],
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function analyzeHeapPattern(heapUsage) {
|
|
417
|
+
const leaks = [];
|
|
418
|
+
const recommendations = [];
|
|
419
|
+
if (heapUsage.length < 2) {
|
|
420
|
+
return { leaks, recommendations };
|
|
421
|
+
}
|
|
422
|
+
// Check for continuous memory growth
|
|
423
|
+
let growthCount = 0;
|
|
424
|
+
for (let i = 1; i < heapUsage.length; i++) {
|
|
425
|
+
const prev = heapUsage[i - 1];
|
|
426
|
+
const curr = heapUsage[i];
|
|
427
|
+
if (prev && curr && curr.usedMB > prev.usedMB) {
|
|
428
|
+
growthCount++;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
const growthRatio = growthCount / (heapUsage.length - 1);
|
|
432
|
+
if (growthRatio > 0.8) {
|
|
433
|
+
leaks.push('Continuous memory growth detected - potential memory leak');
|
|
434
|
+
recommendations.push('Review dispose() implementations in StatefulWidgets');
|
|
435
|
+
recommendations.push('Check for proper StreamSubscription cancellation');
|
|
436
|
+
recommendations.push('Verify AnimationController disposal');
|
|
437
|
+
}
|
|
438
|
+
// Check for high memory usage
|
|
439
|
+
const maxUsage = Math.max(...heapUsage.map(h => h.usedMB));
|
|
440
|
+
if (maxUsage > 500) {
|
|
441
|
+
recommendations.push('High memory usage detected - consider lazy loading');
|
|
442
|
+
recommendations.push('Review image caching strategy');
|
|
443
|
+
}
|
|
444
|
+
return { leaks, recommendations };
|
|
445
|
+
}
|
|
446
|
+
// ============================================
|
|
447
|
+
// App Build & Installation
|
|
448
|
+
// ============================================
|
|
449
|
+
async function buildApp(projectPath, platform, options) {
|
|
450
|
+
const { release = true, flavor, target } = options || {};
|
|
451
|
+
const modeArg = release ? '--release' : '--debug';
|
|
452
|
+
const flavorArg = flavor ? `--flavor ${flavor}` : '';
|
|
453
|
+
const targetArg = target ? `-t ${target}` : '';
|
|
454
|
+
const buildCommand = platform === 'web' ? 'web' : platform;
|
|
455
|
+
const command = `cd "${projectPath}" && flutter build ${buildCommand} ${modeArg} ${flavorArg} ${targetArg} 2>&1`;
|
|
456
|
+
try {
|
|
457
|
+
const { stdout } = await execAsync(command, { timeout: 600000, maxBuffer: 50 * 1024 * 1024 });
|
|
458
|
+
let outputPath = '';
|
|
459
|
+
switch (platform) {
|
|
460
|
+
case 'apk':
|
|
461
|
+
outputPath = path.join(projectPath, 'build', 'app', 'outputs', 'flutter-apk', 'app-release.apk');
|
|
462
|
+
break;
|
|
463
|
+
case 'appbundle':
|
|
464
|
+
outputPath = path.join(projectPath, 'build', 'app', 'outputs', 'bundle', 'release', 'app-release.aab');
|
|
465
|
+
break;
|
|
466
|
+
case 'ios':
|
|
467
|
+
case 'ipa':
|
|
468
|
+
outputPath = path.join(projectPath, 'build', 'ios', 'iphoneos', 'Runner.app');
|
|
469
|
+
break;
|
|
470
|
+
case 'web':
|
|
471
|
+
outputPath = path.join(projectPath, 'build', 'web');
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
return {
|
|
475
|
+
success: stdout.includes('Built') || stdout.includes('build succeeded'),
|
|
476
|
+
outputPath,
|
|
477
|
+
output: stdout,
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
catch (error) {
|
|
481
|
+
return {
|
|
482
|
+
success: false,
|
|
483
|
+
outputPath: '',
|
|
484
|
+
output: error.stdout || error.message,
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
async function installApp(device, appPath) {
|
|
489
|
+
try {
|
|
490
|
+
await execAsync(`flutter install --device-id=${device} 2>&1`);
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
catch {
|
|
494
|
+
return false;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
// ============================================
|
|
498
|
+
// Screenshot & Recording
|
|
499
|
+
// ============================================
|
|
500
|
+
async function takeScreenshot(device, outputPath) {
|
|
501
|
+
try {
|
|
502
|
+
// Use platform-specific screenshot command
|
|
503
|
+
const { stdout } = await execAsync('flutter devices --machine');
|
|
504
|
+
const devices = JSON.parse(stdout);
|
|
505
|
+
const targetDevice = devices.find((d) => d.id === device);
|
|
506
|
+
if (!targetDevice) {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
if (targetDevice.targetPlatform?.includes('android')) {
|
|
510
|
+
await execAsync(`adb -s ${device} exec-out screencap -p > "${outputPath}"`);
|
|
511
|
+
}
|
|
512
|
+
else if (targetDevice.targetPlatform?.includes('ios')) {
|
|
513
|
+
await execAsync(`xcrun simctl io ${device} screenshot "${outputPath}"`);
|
|
514
|
+
}
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
catch {
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
exports.default = {
|
|
522
|
+
listDevices,
|
|
523
|
+
runEmulator,
|
|
524
|
+
runFlutterTest,
|
|
525
|
+
runIntegrationTest,
|
|
526
|
+
runGoldenTests,
|
|
527
|
+
runPerformanceProfile,
|
|
528
|
+
analyzeMemory,
|
|
529
|
+
buildApp,
|
|
530
|
+
installApp,
|
|
531
|
+
takeScreenshot,
|
|
532
|
+
};
|
|
533
|
+
//# sourceMappingURL=index.js.map
|