@browserstack/mcp-server 1.1.8 → 1.2.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 +71 -35
- package/dist/config.d.ts +13 -0
- package/dist/config.js +10 -6
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -30
- package/dist/lib/api.d.ts +2 -0
- package/dist/lib/api.js +10 -5
- package/dist/lib/apiClient.d.ts +31 -0
- package/dist/lib/apiClient.js +108 -0
- package/dist/lib/constants.d.ts +17 -0
- package/dist/lib/device-cache.d.ts +9 -0
- package/dist/lib/device-cache.js +3 -3
- package/dist/lib/error.d.ts +7 -0
- package/dist/lib/fuzzy.d.ts +1 -0
- package/dist/lib/get-auth.d.ts +2 -0
- package/dist/lib/get-auth.js +8 -0
- package/dist/lib/inmemory-store.d.ts +1 -0
- package/dist/lib/instrumentation.d.ts +4 -0
- package/dist/lib/instrumentation.js +8 -7
- package/dist/lib/local.d.ts +3 -0
- package/dist/lib/local.js +12 -3
- package/dist/lib/types.d.ts +4 -0
- package/dist/lib/types.js +1 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/version-resolver.d.ts +6 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +20 -4
- package/dist/oninitialized.d.ts +2 -0
- package/dist/oninitialized.js +2 -7
- package/dist/server-factory.d.ts +3 -0
- package/dist/server-factory.js +37 -0
- package/dist/tools/accessibility.d.ts +3 -0
- package/dist/tools/accessibility.js +17 -10
- package/dist/tools/accessiblity-utils/accessibility-rag.d.ts +12 -0
- package/dist/tools/accessiblity-utils/accessibility-rag.js +22 -12
- package/dist/tools/accessiblity-utils/report-fetcher.d.ts +8 -0
- package/dist/tools/accessiblity-utils/report-fetcher.js +26 -16
- package/dist/tools/accessiblity-utils/report-parser.d.ts +23 -0
- package/dist/tools/accessiblity-utils/report-parser.js +3 -3
- package/dist/tools/accessiblity-utils/scanner.d.ts +25 -0
- package/dist/tools/accessiblity-utils/scanner.js +46 -24
- package/dist/tools/appautomate-utils/appautomate.d.ts +42 -0
- package/dist/tools/appautomate-utils/appautomate.js +95 -9
- package/dist/tools/appautomate-utils/types.d.ts +5 -0
- package/dist/tools/appautomate-utils/types.js +6 -0
- package/dist/tools/appautomate.d.ts +3 -0
- package/dist/tools/appautomate.js +109 -13
- package/dist/tools/applive-utils/device-search.d.ts +6 -0
- package/dist/tools/applive-utils/start-session.d.ts +15 -0
- package/dist/tools/applive-utils/start-session.js +11 -4
- package/dist/tools/applive-utils/types.d.ts +7 -0
- package/dist/tools/applive-utils/upload-app.d.ts +5 -0
- package/dist/tools/applive-utils/upload-app.js +8 -12
- package/dist/tools/applive-utils/version-utils.d.ts +4 -0
- package/dist/tools/applive.d.ts +13 -0
- package/dist/tools/applive.js +6 -6
- package/dist/tools/automate-utils/fetch-screenshots.d.ts +6 -0
- package/dist/tools/automate-utils/fetch-screenshots.js +16 -12
- package/dist/tools/automate.d.ts +9 -0
- package/dist/tools/automate.js +6 -6
- package/dist/tools/bstack-sdk.d.ts +17 -0
- package/dist/tools/bstack-sdk.js +47 -20
- package/dist/tools/failurelogs-utils/app-automate.d.ts +7 -0
- package/dist/tools/failurelogs-utils/app-automate.js +29 -11
- package/dist/tools/failurelogs-utils/automate.d.ts +6 -0
- package/dist/tools/failurelogs-utils/automate.js +27 -12
- package/dist/tools/failurelogs-utils/utils.d.ts +30 -0
- package/dist/tools/getFailureLogs.d.ts +14 -0
- package/dist/tools/getFailureLogs.js +11 -11
- package/dist/tools/live-utils/desktop-filter.d.ts +2 -0
- package/dist/tools/live-utils/mobile-filter.d.ts +2 -0
- package/dist/tools/live-utils/start-session.d.ts +6 -0
- package/dist/tools/live-utils/start-session.js +18 -5
- package/dist/tools/live-utils/types.d.ts +33 -0
- package/dist/tools/live.d.ts +3 -0
- package/dist/tools/live.js +11 -11
- package/dist/tools/observability.d.ts +5 -0
- package/dist/tools/observability.js +14 -11
- package/dist/tools/sdk-utils/commands.d.ts +3 -0
- package/dist/tools/sdk-utils/commands.js +20 -5
- package/dist/tools/sdk-utils/constants.d.ts +2 -0
- package/dist/tools/sdk-utils/constants.js +284 -160
- package/dist/tools/sdk-utils/instructions.d.ts +6 -0
- package/dist/tools/sdk-utils/instructions.js +28 -6
- package/dist/tools/sdk-utils/percy/constants.d.ts +3 -0
- package/dist/tools/sdk-utils/percy/constants.js +36 -25
- package/dist/tools/sdk-utils/percy/instructions.d.ts +10 -0
- package/dist/tools/sdk-utils/percy/types.d.ts +5 -0
- package/dist/tools/sdk-utils/types.d.ts +39 -0
- package/dist/tools/sdk-utils/types.js +3 -0
- package/dist/tools/selfheal-utils/selfheal.d.ts +11 -0
- package/dist/tools/selfheal-utils/selfheal.js +10 -6
- package/dist/tools/selfheal.d.ts +7 -0
- package/dist/tools/selfheal.js +6 -6
- package/dist/tools/testmanagement-utils/TCG-utils/api.d.ts +34 -0
- package/dist/tools/testmanagement-utils/TCG-utils/api.js +57 -44
- package/dist/tools/testmanagement-utils/TCG-utils/config.d.ts +5 -0
- package/dist/tools/testmanagement-utils/TCG-utils/helpers.d.ts +13 -0
- package/dist/tools/testmanagement-utils/TCG-utils/helpers.js +2 -1
- package/dist/tools/testmanagement-utils/TCG-utils/types.d.ts +26 -0
- package/dist/tools/testmanagement-utils/add-test-result.d.ts +42 -0
- package/dist/tools/testmanagement-utils/add-test-result.js +23 -10
- package/dist/tools/testmanagement-utils/create-lca-steps.d.ts +100 -0
- package/dist/tools/testmanagement-utils/create-lca-steps.js +64 -55
- package/dist/tools/testmanagement-utils/create-project-folder.d.ts +31 -0
- package/dist/tools/testmanagement-utils/create-project-folder.js +31 -21
- package/dist/tools/testmanagement-utils/create-testcase.d.ts +122 -0
- package/dist/tools/testmanagement-utils/create-testcase.js +13 -10
- package/dist/tools/testmanagement-utils/create-testrun.d.ts +82 -0
- package/dist/tools/testmanagement-utils/create-testrun.js +11 -8
- package/dist/tools/testmanagement-utils/list-testcases.d.ts +30 -0
- package/dist/tools/testmanagement-utils/list-testcases.js +9 -7
- package/dist/tools/testmanagement-utils/list-testruns.d.ts +22 -0
- package/dist/tools/testmanagement-utils/list-testruns.js +9 -7
- package/dist/tools/testmanagement-utils/poll-lca-status.d.ts +11 -0
- package/dist/tools/testmanagement-utils/poll-lca-status.js +12 -8
- package/dist/tools/testmanagement-utils/testcase-from-file.d.ts +4 -0
- package/dist/tools/testmanagement-utils/testcase-from-file.js +6 -6
- package/dist/tools/testmanagement-utils/update-testrun.d.ts +40 -0
- package/dist/tools/testmanagement-utils/update-testrun.js +11 -7
- package/dist/tools/testmanagement-utils/upload-file.d.ts +20 -0
- package/dist/tools/testmanagement-utils/upload-file.js +8 -6
- package/dist/tools/testmanagement.d.ts +60 -0
- package/dist/tools/testmanagement.js +51 -53
- package/package.json +1 -1
|
@@ -1,35 +1,47 @@
|
|
|
1
|
-
import config from "../../config.js";
|
|
2
1
|
/**
|
|
3
2
|
* ---------- PYTHON INSTRUCTIONS ----------
|
|
4
3
|
*/
|
|
5
|
-
const pythonInstructions = `
|
|
6
|
-
|
|
4
|
+
const pythonInstructions = (username, accessKey) => `
|
|
5
|
+
---STEP---
|
|
6
|
+
|
|
7
|
+
Install the BrowserStack SDK:
|
|
7
8
|
\`\`\`bash
|
|
8
9
|
python3 -m pip install browserstack-sdk
|
|
9
10
|
\`\`\`
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
---STEP---
|
|
13
|
+
|
|
14
|
+
Setup the BrowserStack SDK with your credentials:
|
|
12
15
|
\`\`\`bash
|
|
13
|
-
browserstack-sdk setup --username "${
|
|
16
|
+
browserstack-sdk setup --username "${username}" --key "${accessKey}"
|
|
14
17
|
\`\`\`
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
---STEP---
|
|
20
|
+
|
|
21
|
+
Run your tests on BrowserStack:
|
|
17
22
|
\`\`\`bash
|
|
18
23
|
browserstack-sdk python <path-to-test-file>
|
|
19
24
|
\`\`\`
|
|
20
25
|
`;
|
|
21
|
-
const generatePythonFrameworkInstructions = (framework) => `
|
|
22
|
-
|
|
26
|
+
const generatePythonFrameworkInstructions = (framework) => (username, accessKey) => `
|
|
27
|
+
---STEP---
|
|
28
|
+
|
|
29
|
+
Install the BrowserStack SDK:
|
|
30
|
+
|
|
23
31
|
\`\`\`bash
|
|
24
32
|
python3 -m pip install browserstack-sdk
|
|
25
33
|
\`\`\`
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
---STEP---
|
|
36
|
+
|
|
37
|
+
Setup the BrowserStack SDK with framework-specific configuration:
|
|
28
38
|
\`\`\`bash
|
|
29
|
-
browserstack-sdk setup --framework "${framework}" --username "${
|
|
39
|
+
browserstack-sdk setup --framework "${framework}" --username "${username}" --key "${accessKey}"
|
|
30
40
|
\`\`\`
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
---STEP---
|
|
43
|
+
|
|
44
|
+
Run your ${framework} tests on BrowserStack:
|
|
33
45
|
\`\`\`bash
|
|
34
46
|
browserstack-sdk ${framework} <path-to-test-files>
|
|
35
47
|
\`\`\`
|
|
@@ -41,8 +53,10 @@ const pytestInstructions = generatePythonFrameworkInstructions("pytest");
|
|
|
41
53
|
* ---------- JAVA INSTRUCTIONS ----------
|
|
42
54
|
*/
|
|
43
55
|
const argsInstruction = '<argLine>-javaagent:"${com.browserstack:browserstack-java-sdk:jar}"</argLine>';
|
|
44
|
-
const javaInstructions = `
|
|
45
|
-
|
|
56
|
+
const javaInstructions = (username, accessKey) => `
|
|
57
|
+
---STEP---
|
|
58
|
+
|
|
59
|
+
Add the BrowserStack Java SDK dependency to your \`pom.xml\`:
|
|
46
60
|
\`\`\`xml
|
|
47
61
|
<dependency>
|
|
48
62
|
<groupId>com.browserstack</groupId>
|
|
@@ -61,13 +75,17 @@ dependencies {
|
|
|
61
75
|
}
|
|
62
76
|
\`\`\`
|
|
63
77
|
|
|
64
|
-
|
|
78
|
+
---STEP---
|
|
79
|
+
|
|
80
|
+
Export your BrowserStack credentials as environment variables:
|
|
65
81
|
\`\`\`bash
|
|
66
|
-
export BROWSERSTACK_USERNAME=${
|
|
67
|
-
export BROWSERSTACK_ACCESS_KEY=${
|
|
82
|
+
export BROWSERSTACK_USERNAME=${username}
|
|
83
|
+
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
68
84
|
\`\`\`
|
|
69
85
|
|
|
70
|
-
|
|
86
|
+
---STEP---
|
|
87
|
+
|
|
88
|
+
Run your tests using Maven:
|
|
71
89
|
\`\`\`bash
|
|
72
90
|
mvn clean test
|
|
73
91
|
\`\`\`
|
|
@@ -77,168 +95,263 @@ Or for Gradle:
|
|
|
77
95
|
gradle clean test
|
|
78
96
|
\`\`\`
|
|
79
97
|
`;
|
|
98
|
+
const serenityInstructions = (username, accessKey) => `
|
|
99
|
+
---STEP---
|
|
100
|
+
|
|
101
|
+
Set BrowserStack credentials as environment variables:
|
|
102
|
+
For macOS/Linux:
|
|
103
|
+
\`\`\`bash
|
|
104
|
+
export BROWSERSTACK_USERNAME=${username}
|
|
105
|
+
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
106
|
+
\`\`\`
|
|
107
|
+
|
|
108
|
+
For Windows Command Prompt:
|
|
109
|
+
\`\`\`cmd
|
|
110
|
+
set BROWSERSTACK_USERNAME=${username}
|
|
111
|
+
set BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
112
|
+
\`\`\`
|
|
113
|
+
|
|
114
|
+
---STEP---
|
|
115
|
+
|
|
116
|
+
Add serenity-browserstack dependency in pom.xml:
|
|
117
|
+
Add the following dependency to your pom.xml file and save it:
|
|
118
|
+
\`\`\`xml
|
|
119
|
+
<dependency>
|
|
120
|
+
<groupId>net.serenity-bdd</groupId>
|
|
121
|
+
<artifactId>serenity-browserstack</artifactId>
|
|
122
|
+
<version>3.3.4</version>
|
|
123
|
+
</dependency>
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
---STEP---
|
|
127
|
+
|
|
128
|
+
Set up serenity.conf file:
|
|
129
|
+
Create or update your serenity.conf file in the project root with the following configuration:
|
|
130
|
+
\`\`\`
|
|
131
|
+
webdriver {
|
|
132
|
+
driver = remote
|
|
133
|
+
remote.url = "https://hub.browserstack.com/wd/hub"
|
|
134
|
+
}
|
|
135
|
+
browserstack.user="${username}"
|
|
136
|
+
browserstack.key="${accessKey}"
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
---STEP---
|
|
140
|
+
|
|
141
|
+
Run your Serenity tests:
|
|
142
|
+
You can continue running your tests as you normally would. For example:
|
|
143
|
+
|
|
144
|
+
Using Maven:
|
|
145
|
+
\`\`\`bash
|
|
146
|
+
mvn clean verify
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
Using Gradle:
|
|
150
|
+
\`\`\`bash
|
|
151
|
+
gradle clean test
|
|
152
|
+
\`\`\`
|
|
153
|
+
`;
|
|
80
154
|
/**
|
|
81
155
|
* ---------- CSharp INSTRUCTIONS ----------
|
|
82
156
|
*/
|
|
83
|
-
const csharpCommonInstructions = `
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
157
|
+
const csharpCommonInstructions = (username, accessKey) => `
|
|
158
|
+
---STEP---
|
|
159
|
+
|
|
160
|
+
Install BrowserStack TestAdapter NuGet package:
|
|
161
|
+
\`\`\`bash
|
|
162
|
+
dotnet add package BrowserStack.TestAdapter
|
|
163
|
+
\`\`\`
|
|
164
|
+
|
|
165
|
+
---STEP---
|
|
166
|
+
|
|
167
|
+
Build the project:
|
|
168
|
+
\`\`\`bash
|
|
169
|
+
dotnet build
|
|
170
|
+
\`\`\`
|
|
171
|
+
|
|
172
|
+
---STEP---
|
|
173
|
+
|
|
174
|
+
Set up BrowserStack SDK with your credentials:
|
|
175
|
+
\`\`\`bash
|
|
176
|
+
dotnet browserstack-sdk setup --userName ${username} --accessKey ${accessKey}
|
|
177
|
+
\`\`\`
|
|
178
|
+
|
|
179
|
+
---STEP---
|
|
180
|
+
|
|
181
|
+
Detect if you are running on Apple Silicon (macOS only):
|
|
182
|
+
Run this check to determine if Apple Silicon-specific setup is required:
|
|
183
|
+
\`\`\`bash
|
|
184
|
+
ARCH="$(uname -m)"
|
|
185
|
+
if [ "$ARCH" = "arm64" ]; then
|
|
186
|
+
echo "Detected arm64 architecture - running Apple-Silicon flow"
|
|
187
|
+
fi
|
|
188
|
+
\`\`\`
|
|
189
|
+
|
|
190
|
+
---STEP---
|
|
191
|
+
|
|
192
|
+
macOS (Apple Silicon) setup (Strictly follow if arm64 detected):
|
|
193
|
+
Install the x64 version of .NET for BrowserStack compatibility.
|
|
194
|
+
|
|
195
|
+
- Check your current .NET version:
|
|
196
|
+
\`\`\`bash
|
|
197
|
+
dotnet --version
|
|
198
|
+
\`\`\`
|
|
199
|
+
|
|
200
|
+
- Ensure the path exists strictly; if not, create it first and then run the setup:
|
|
201
|
+
This automatically installs the x64 version of .NET in the specified path. No need to install it from external sources.
|
|
202
|
+
\`\`\`bash
|
|
203
|
+
sudo dotnet browserstack-sdk setup-dotnet --dotnet-path "<your-chosen-path>" --dotnet-version "<your-dotnet-version>"
|
|
204
|
+
\`\`\`
|
|
205
|
+
Common paths: /usr/local/share/dotnet, ~/dotnet-x64, or /opt/dotnet-x64
|
|
206
|
+
|
|
207
|
+
---STEP---
|
|
208
|
+
|
|
209
|
+
Run the tests:
|
|
210
|
+
- For macOS (Apple Silicon), use the full path where the x64 version of .NET is installed:
|
|
211
|
+
\`\`\`bash
|
|
212
|
+
<your-chosen-path>/dotnet browserstack-sdk
|
|
213
|
+
\`\`\`
|
|
214
|
+
- For Windows, Intel Macs, or if dotnet alias is configured:
|
|
215
|
+
\`\`\`bash
|
|
216
|
+
dotnet test
|
|
217
|
+
\`\`\`
|
|
133
218
|
`;
|
|
134
|
-
const csharpPlaywrightCommonInstructions = `
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
219
|
+
const csharpPlaywrightCommonInstructions = (username, accessKey) => `
|
|
220
|
+
---STEP---
|
|
221
|
+
|
|
222
|
+
Install BrowserStack TestAdapter NuGet package:
|
|
223
|
+
\`\`\`bash
|
|
224
|
+
dotnet add package BrowserStack.TestAdapter
|
|
225
|
+
\`\`\`
|
|
226
|
+
|
|
227
|
+
---STEP---
|
|
228
|
+
|
|
229
|
+
Build the project:
|
|
230
|
+
\`\`\`bash
|
|
231
|
+
dotnet build
|
|
232
|
+
\`\`\`
|
|
233
|
+
|
|
234
|
+
---STEP---
|
|
235
|
+
|
|
236
|
+
Set up BrowserStack SDK with your credentials:
|
|
237
|
+
\`\`\`bash
|
|
238
|
+
dotnet browserstack-sdk setup --userName ${username} --accessKey ${accessKey}
|
|
239
|
+
\`\`\`
|
|
240
|
+
|
|
241
|
+
---STEP---
|
|
242
|
+
|
|
243
|
+
Choose supported browser:
|
|
244
|
+
Use exactly one of the following (case-sensitive):
|
|
245
|
+
\`chrome\`, \`edge\`, \`playwright-chromium\`, \`playwright-webkit\`, \`playwright-firefox\`
|
|
246
|
+
|
|
247
|
+
---STEP---
|
|
248
|
+
|
|
249
|
+
Detect if you are running on Apple Silicon (macOS only):
|
|
250
|
+
Run this check to determine if Apple Silicon-specific setup is required:
|
|
251
|
+
\`\`\`bash
|
|
252
|
+
ARCH="$(uname -m)"
|
|
253
|
+
if [ "$ARCH" = "arm64" ]; then
|
|
254
|
+
echo "Detected arm64 architecture - running Apple-Silicon flow"
|
|
255
|
+
fi
|
|
256
|
+
\`\`\`
|
|
257
|
+
|
|
258
|
+
---STEP---
|
|
259
|
+
|
|
260
|
+
macOS (Apple Silicon) setup (required only if arm64 detected):
|
|
261
|
+
Install the x64 version of .NET for compatibility with BrowserStack.
|
|
262
|
+
|
|
263
|
+
- Check your .NET version:
|
|
264
|
+
\`\`\`bash
|
|
265
|
+
dotnet --version
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
- Ensure the path exists strictly; if not, create it first and then run the setup:
|
|
269
|
+
This automatically installs the x64 version of .NET in the specified path. No need to install it from external sources.
|
|
270
|
+
\`\`\`bash
|
|
271
|
+
sudo dotnet browserstack-sdk setup-dotnet --dotnet-path "<your-chosen-path>" --dotnet-version "<your-dotnet-version>"
|
|
272
|
+
\`\`\`
|
|
273
|
+
Common paths: /usr/local/share/dotnet, ~/dotnet-x64, or /opt/dotnet-x64
|
|
274
|
+
|
|
275
|
+
---STEP---
|
|
276
|
+
|
|
277
|
+
Fix for Playwright architecture (macOS only):
|
|
278
|
+
If the folder exists:
|
|
279
|
+
\`<project-folder>/bin/Debug/net8.0/.playwright/node/darwin-arm64\`
|
|
280
|
+
Rename \`darwin-arm64\` to \`darwin-x64\`
|
|
281
|
+
|
|
282
|
+
---STEP---
|
|
283
|
+
|
|
284
|
+
Run the tests:
|
|
285
|
+
- For macOS (Apple Silicon), use the full path:
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
<your-chosen-path>/dotnet browserstack-sdk
|
|
288
|
+
\`\`\`
|
|
289
|
+
- For Windows, Intel Macs, or if dotnet alias is configured:
|
|
290
|
+
\`\`\`bash
|
|
291
|
+
dotnet test
|
|
292
|
+
\`\`\`
|
|
193
293
|
`;
|
|
194
294
|
/**
|
|
195
295
|
* ---------- NODEJS INSTRUCTIONS ----------
|
|
196
296
|
*/
|
|
197
|
-
const nodejsInstructions = `
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
297
|
+
const nodejsInstructions = (username, accessKey) => `
|
|
298
|
+
---STEP---
|
|
299
|
+
|
|
300
|
+
Ensure \`browserstack-node-sdk\` is present in package.json with the latest version:
|
|
301
|
+
\`\`\`json
|
|
302
|
+
"browserstack-node-sdk": "latest"
|
|
303
|
+
\`\`\`
|
|
304
|
+
|
|
305
|
+
---STEP---
|
|
306
|
+
|
|
307
|
+
Add new scripts to package.json for running tests on BrowserStack:
|
|
308
|
+
\`\`\`json
|
|
309
|
+
"scripts": {
|
|
310
|
+
"test:browserstack": "npx browserstack-node-sdk <framework-specific-test-execution-command>"
|
|
311
|
+
}
|
|
312
|
+
\`\`\`
|
|
313
|
+
|
|
314
|
+
---STEP---
|
|
315
|
+
|
|
316
|
+
Export BrowserStack credentials as environment variables:
|
|
317
|
+
Set the following environment variables before running tests.
|
|
318
|
+
\`\`\`bash
|
|
319
|
+
export BROWSERSTACK_USERNAME=${username}
|
|
320
|
+
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
321
|
+
\`\`\`
|
|
210
322
|
`;
|
|
211
323
|
/**
|
|
212
324
|
* ---------- EXPORT CONFIG ----------
|
|
213
325
|
*/
|
|
214
|
-
const webdriverioInstructions = `
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
**1. Set BrowserStack Credentials**
|
|
326
|
+
const webdriverioInstructions = (username, accessKey) => `
|
|
327
|
+
---STEP---
|
|
218
328
|
|
|
329
|
+
Set BrowserStack Credentials:
|
|
219
330
|
Export your BrowserStack username and access key as environment variables.
|
|
220
331
|
|
|
221
332
|
For macOS/Linux:
|
|
222
333
|
\`\`\`bash
|
|
223
|
-
export BROWSERSTACK_USERNAME
|
|
224
|
-
export BROWSERSTACK_ACCESS_KEY
|
|
334
|
+
export BROWSERSTACK_USERNAME=${username}
|
|
335
|
+
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
225
336
|
\`\`\`
|
|
226
337
|
|
|
227
338
|
For Windows PowerShell:
|
|
228
339
|
\`\`\`powershell
|
|
229
|
-
$env:BROWSERSTACK_USERNAME=${
|
|
230
|
-
$env:BROWSERSTACK_ACCESS_KEY=${
|
|
340
|
+
$env:BROWSERSTACK_USERNAME=${username}
|
|
341
|
+
$env:BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
231
342
|
\`\`\`
|
|
232
343
|
|
|
233
|
-
|
|
344
|
+
---STEP---
|
|
234
345
|
|
|
346
|
+
Install the BrowserStack WDIO Service:
|
|
235
347
|
Add the service to your project's dev dependencies.
|
|
236
348
|
\`\`\`bash
|
|
237
349
|
npm install @wdio/browserstack-service --save-dev
|
|
238
350
|
\`\`\`
|
|
239
351
|
|
|
240
|
-
|
|
352
|
+
---STEP---
|
|
241
353
|
|
|
354
|
+
Update your WebdriverIO Config File (e.g., wdio.conf.js):
|
|
242
355
|
Modify your configuration file to use the BrowserStack service and define the platforms you want to test on.
|
|
243
356
|
|
|
244
357
|
Here is an example configuration:
|
|
@@ -310,29 +423,31 @@ exports.config.capabilities.forEach(function (caps) {
|
|
|
310
423
|
});
|
|
311
424
|
\`\`\`
|
|
312
425
|
|
|
313
|
-
|
|
426
|
+
---STEP---
|
|
314
427
|
|
|
428
|
+
Run your tests:
|
|
315
429
|
You can now run your tests on BrowserStack using your standard WebdriverIO command.
|
|
316
430
|
`;
|
|
317
|
-
const cypressInstructions = `
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
**1. Install the BrowserStack Cypress CLI**
|
|
431
|
+
const cypressInstructions = (username, accessKey) => `
|
|
432
|
+
---STEP---
|
|
321
433
|
|
|
434
|
+
Install the BrowserStack Cypress CLI:
|
|
322
435
|
Install the CLI as a dev dependency in your project.
|
|
323
436
|
\`\`\`bash
|
|
324
437
|
npm install browserstack-cypress-cli --save-dev
|
|
325
438
|
\`\`\`
|
|
326
439
|
|
|
327
|
-
|
|
440
|
+
---STEP---
|
|
328
441
|
|
|
442
|
+
Create the Configuration File:
|
|
329
443
|
Generate the \`browserstack.json\` configuration file in your project's root directory by running the following command:
|
|
330
444
|
\`\`\`bash
|
|
331
445
|
npx browserstack-cypress init
|
|
332
446
|
\`\`\`
|
|
333
447
|
|
|
334
|
-
|
|
448
|
+
---STEP---
|
|
335
449
|
|
|
450
|
+
Configure \`browserstack.json\`:
|
|
336
451
|
Open the generated \`browserstack.json\` file and update it with your BrowserStack credentials and desired capabilities. Below is an example configuration.
|
|
337
452
|
|
|
338
453
|
* **auth**: Your BrowserStack username and access key.
|
|
@@ -342,8 +457,8 @@ Open the generated \`browserstack.json\` file and update it with your BrowserSta
|
|
|
342
457
|
\`\`\`json
|
|
343
458
|
{
|
|
344
459
|
"auth": {
|
|
345
|
-
"username": "${
|
|
346
|
-
"access_key": "${
|
|
460
|
+
"username": "${username}",
|
|
461
|
+
"access_key": "${accessKey}"
|
|
347
462
|
},
|
|
348
463
|
"browsers": [
|
|
349
464
|
{
|
|
@@ -372,10 +487,12 @@ Open the generated \`browserstack.json\` file and update it with your BrowserSta
|
|
|
372
487
|
}
|
|
373
488
|
}
|
|
374
489
|
\`\`\`
|
|
490
|
+
|
|
375
491
|
**Note:** For Cypress v9 or lower, use \`"cypress_config_file": "./cypress.json"\`. The \`testObservability: true\` flag enables the [Test Reporting & Analytics dashboard](https://www.browserstack.com/docs/test-management/test-reporting-and-analytics) for deeper insights into your test runs.
|
|
376
492
|
|
|
377
|
-
|
|
493
|
+
---STEP---
|
|
378
494
|
|
|
495
|
+
Run Your Tests on BrowserStack:
|
|
379
496
|
Execute your tests on BrowserStack using the following command:
|
|
380
497
|
\`\`\`bash
|
|
381
498
|
npx browserstack-cypress run --sync
|
|
@@ -395,12 +512,17 @@ export const SUPPORTED_CONFIGURATIONS = {
|
|
|
395
512
|
},
|
|
396
513
|
},
|
|
397
514
|
java: {
|
|
398
|
-
playwright: {
|
|
515
|
+
playwright: {
|
|
516
|
+
junit4: { instructions: javaInstructions },
|
|
517
|
+
junit5: { instructions: javaInstructions },
|
|
518
|
+
testng: { instructions: javaInstructions },
|
|
519
|
+
},
|
|
399
520
|
selenium: {
|
|
400
521
|
testng: { instructions: javaInstructions },
|
|
401
522
|
cucumber: { instructions: javaInstructions },
|
|
402
523
|
junit4: { instructions: javaInstructions },
|
|
403
524
|
junit5: { instructions: javaInstructions },
|
|
525
|
+
serenity: { instructions: serenityInstructions },
|
|
404
526
|
},
|
|
405
527
|
},
|
|
406
528
|
csharp: {
|
|
@@ -412,6 +534,8 @@ export const SUPPORTED_CONFIGURATIONS = {
|
|
|
412
534
|
xunit: { instructions: csharpCommonInstructions },
|
|
413
535
|
nunit: { instructions: csharpCommonInstructions },
|
|
414
536
|
mstest: { instructions: csharpCommonInstructions },
|
|
537
|
+
specflow: { instructions: csharpCommonInstructions },
|
|
538
|
+
reqnroll: { instructions: csharpCommonInstructions },
|
|
415
539
|
},
|
|
416
540
|
},
|
|
417
541
|
nodejs: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SDKSupportedLanguage } from "./types.js";
|
|
2
|
+
import { SDKSupportedBrowserAutomationFramework } from "./types.js";
|
|
3
|
+
import { SDKSupportedTestingFramework } from "./types.js";
|
|
4
|
+
export declare const getInstructionsForProjectConfiguration: (detectedBrowserAutomationFramework: SDKSupportedBrowserAutomationFramework, detectedTestingFramework: SDKSupportedTestingFramework, detectedLanguage: SDKSupportedLanguage, username: string, accessKey: string) => string;
|
|
5
|
+
export declare function generateBrowserStackYMLInstructions(desiredPlatforms: string[], enablePercy?: boolean): string;
|
|
6
|
+
export declare function formatInstructionsWithNumbers(instructionText: string, separator?: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SUPPORTED_CONFIGURATIONS } from "./constants.js";
|
|
2
2
|
const errorMessageSuffix = "Please open an issue at our Github repo: https://github.com/browserstack/browserstack-mcp-server/issues to request support for your project configuration";
|
|
3
|
-
export const getInstructionsForProjectConfiguration = (detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage) => {
|
|
3
|
+
export const getInstructionsForProjectConfiguration = (detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, username, accessKey) => {
|
|
4
4
|
const configuration = SUPPORTED_CONFIGURATIONS[detectedLanguage];
|
|
5
5
|
if (!configuration) {
|
|
6
6
|
throw new Error(`BrowserStack MCP Server currently does not support ${detectedLanguage}, ${errorMessageSuffix}`);
|
|
@@ -11,17 +11,19 @@ export const getInstructionsForProjectConfiguration = (detectedBrowserAutomation
|
|
|
11
11
|
if (!configuration[detectedBrowserAutomationFramework][detectedTestingFramework]) {
|
|
12
12
|
throw new Error(`BrowserStack MCP Server currently does not support ${detectedTestingFramework} for ${detectedBrowserAutomationFramework} on ${detectedLanguage}, ${errorMessageSuffix}`);
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
const instructionFunction = configuration[detectedBrowserAutomationFramework][detectedTestingFramework]
|
|
15
|
+
.instructions;
|
|
16
|
+
return instructionFunction(username, accessKey);
|
|
15
17
|
};
|
|
16
18
|
export function generateBrowserStackYMLInstructions(desiredPlatforms, enablePercy = false) {
|
|
17
19
|
let ymlContent = `
|
|
18
20
|
# ======================
|
|
19
21
|
# BrowserStack Reporting
|
|
20
22
|
# ======================
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
buildName:
|
|
23
|
+
# Project and build names help organize your test runs in BrowserStack dashboard and Percy.
|
|
24
|
+
# TODO: Replace these sample values with your actual project details
|
|
25
|
+
projectName: Sample Project
|
|
26
|
+
buildName: Sample Build
|
|
25
27
|
|
|
26
28
|
# =======================================
|
|
27
29
|
# Platforms (Browsers / Devices to test)
|
|
@@ -75,3 +77,23 @@ percyCaptureMode: manual`;
|
|
|
75
77
|
\`\`\`
|
|
76
78
|
\n`;
|
|
77
79
|
}
|
|
80
|
+
export function formatInstructionsWithNumbers(instructionText, separator = "---STEP---") {
|
|
81
|
+
// Split the instructions by the separator
|
|
82
|
+
const steps = instructionText
|
|
83
|
+
.split(separator)
|
|
84
|
+
.map((step) => step.trim())
|
|
85
|
+
.filter((step) => step.length > 0);
|
|
86
|
+
// If no separators found, treat the entire text as one step
|
|
87
|
+
if (steps.length === 1 && !instructionText.includes(separator)) {
|
|
88
|
+
return `**Step 1:**\n${instructionText.trim()}\n\n**✅ Verification:**\nPlease verify that you have completed all the steps above to ensure proper setup.`;
|
|
89
|
+
}
|
|
90
|
+
// Format each step with numbering
|
|
91
|
+
const formattedSteps = steps
|
|
92
|
+
.map((step, index) => {
|
|
93
|
+
return `**Step ${index + 1}:**\n${step.trim()}`;
|
|
94
|
+
})
|
|
95
|
+
.join("\n\n");
|
|
96
|
+
// Add verification statement at the end
|
|
97
|
+
const verificationText = `\n\n**✅ Verification:**\nPlease verify that you have completed all ${steps.length} steps above to ensure proper setup. If you encounter any issues, double-check each step and ensure all commands executed successfully.`;
|
|
98
|
+
return formattedSteps + verificationText;
|
|
99
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PercyConfigMapping } from "./types.js";
|
|
2
|
+
export declare const nodejsSeleniumInstructions = "\nImport the BrowserStack Percy SDK in your test script:\nAdd the Percy import to your test file.\n\n---STEP---\n\nAdd screenshot capture method at required points:\nUse the `percy.snapshot(driver, name)` method at points in your test script where you want to capture screenshots.\n\n```javascript\nconst { percy } = require('browserstack-node-sdk');\ndescribe(\"sample Test\", () => {\n // ... other imports and setup\n \n test(\"my test\", async () => {\n // ....\n await percy.snapshot(driver, \"My Snapshot\")\n // ....\n });\n})\n```\n";
|
|
3
|
+
export declare const PERCY_INSTRUCTIONS: PercyConfigMapping;
|