You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"No test files found. Please provide either specific file paths (files) or directory paths (dirs) containing test files.",
43
+
);
27
44
}
28
45
29
-
// Generate a UUID and store the test files in memory
30
-
constuuid=crypto.randomUUID();
31
-
testFilePathsMap.set(uuid,testFiles);
46
+
if(testFiles.length===1){
47
+
constresult=awaitupdateFileAndStep(
48
+
testFiles[0],
49
+
0,
50
+
1,
51
+
percyWebSetupInstructions,
52
+
);
53
+
return{
54
+
content: result,
55
+
};
56
+
}
57
+
58
+
// For multiple files, store directly in testFiles
59
+
constfileStatusMap: {[key: string]: boolean}={};
60
+
testFiles.forEach((file)=>{
61
+
fileStatusMap[file]=false;// false = not updated, true = updated
62
+
});
63
+
64
+
// Update storedPercyResults with test files
65
+
constupdatedStored={ ...storedResults};
66
+
updatedStored.testFiles=fileStatusMap;
67
+
storedPercyResults.set(updatedStored);
32
68
33
69
return{
34
70
content: [
35
71
{
36
72
type: "text",
37
-
text: `The Test files are stored in memory with id ${uuid}and the total number of tests files found is ${testFiles.length}. You can use this UUID to retrieve the tests file paths later.`,
73
+
text: `The Test files are stored in memory and the total number of tests files found is ${testFiles.length}.`,
38
74
},
39
75
{
40
76
type: "text",
41
-
text: `You can now use the tool addPercySnapshotCommands to update the test file with Percy commands for visual testing with the UUID ${uuid}`,
77
+
text: `You can now use the tool addPercySnapshotCommands to update the test file with Percy commands for visual testing.`,
"An array of absolute folder paths containing UI test files. If not provided, analyze codebase for UI test folders by scanning for test patterns which contain UI test cases as per framework. Return empty array if none found.",
41
42
),
43
+
filePaths: z
44
+
.array(z.string())
45
+
.optional()
46
+
.describe(
47
+
"An array of absolute file paths to specific UI test files. Use this when you want to target specific test files rather than entire folders. If not provided, will use folderPaths instead.",
0 commit comments