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
fullInstructions+=`\n\nNote: Percy SDK instructions for ${detectedLanguage} with ${detectedTestingFramework} are not yet available through this tool. Please refer to the official BrowserStack Percy documentation.`;
95
+
}
96
+
}
97
+
98
+
fullInstructions+=`\n\nAfter setting up the files above, follow these final steps:\n${instructionsForProjectConfiguration}`;
99
+
38
100
return{
39
101
content: [
40
102
{
41
103
type: "text",
42
-
text: `${instructions}\n\n After creating the browserstack.yml file above, do the following: ${instructionsForProjectConfiguration}`,
104
+
text: fullInstructions,
43
105
isError: false,
44
106
},
45
107
],
@@ -49,20 +111,20 @@ export async function bootstrapProjectWithSDK({
"The automation framework configured in the project. Example: 'playwright', 'selenium'",
58
120
),
59
121
detectedTestingFramework: z
60
-
.string()
122
+
.nativeEnum(SDKSupportedTestingFrameworkEnum)
61
123
.describe(
62
-
"The testing framework used in the project. Be precise with framework selection Example: 'jest', 'pytest', 'junit4', 'junit5', 'mocha'",
124
+
"The testing framework used in the project. Be precise with framework selection Example: 'webdriverio', 'jest', 'pytest', 'junit4', 'junit5', 'mocha'",
63
125
),
64
126
detectedLanguage: z
65
-
.string()
127
+
.nativeEnum(SDKSupportedLanguageEnum)
66
128
.describe(
67
129
"The programming language used in the project. Example: 'nodejs', 'python', 'java', 'csharp'",
68
130
),
@@ -71,6 +133,13 @@ export default function addSDKTools(server: McpServer) {
71
133
.describe(
72
134
"The platforms the user wants to test on. Always ask this to the user, do not try to infer this.",
73
135
),
136
+
enablePercy: z
137
+
.boolean()
138
+
.optional()
139
+
.default(false)
140
+
.describe(
141
+
"Set to true if the user wants to enable Percy for visual testing. Defaults to false.",
142
+
),
74
143
},
75
144
async(args)=>{
76
145
try{
@@ -83,6 +152,7 @@ export default function addSDKTools(server: McpServer) {
// Utility to get the language-dependent prefix command for BrowserStack SDK setup
2
+
import{SDKSupportedLanguage}from"./types.js";
3
+
4
+
// Framework mapping for Java Maven archetype generation
5
+
constJAVA_FRAMEWORK_MAP: Record<string,string>={
6
+
testng: "testng",
7
+
junit: "junit5",// Map generic junit to junit5 as default
8
+
cucumber: "cucumber-testng",// Map generic cucumber to cucumber-testng as default
9
+
};
10
+
11
+
exportfunctiongetSDKPrefixCommand(
12
+
language: SDKSupportedLanguage,
13
+
framework: string,
14
+
): string{
15
+
switch(language){
16
+
case"nodejs":
17
+
return`Install BrowserStack Node SDK\nusing command | npm i -D browserstack-node-sdk@latest\n| and then run following command to setup browserstack sdk:\n npx setup --username ${process.env.BROWSERSTACK_USERNAME} --key ${process.env.BROWSERSTACK_ACCESS_KEY}\n\n. This will create browserstack.yml file in the project root. Edit the file to add your desired platforms and browsers. If the file is not created :\n`;
0 commit comments