@browserstack/mcp-server 1.2.2-beta.1 → 1.2.3-beta.1
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/dist/lib/inmemory-store.d.ts +0 -1
- package/dist/lib/inmemory-store.js +0 -1
- package/dist/server-factory.js +0 -2
- package/dist/tools/appautomate-utils/appium-sdk/config-generator.d.ts +1 -0
- package/dist/tools/appautomate-utils/appium-sdk/config-generator.js +50 -0
- package/dist/tools/appautomate-utils/appium-sdk/constants.d.ts +23 -0
- package/dist/tools/appautomate-utils/appium-sdk/constants.js +43 -0
- package/dist/tools/appautomate-utils/appium-sdk/formatter.d.ts +8 -0
- package/dist/tools/appautomate-utils/appium-sdk/formatter.js +59 -0
- package/dist/tools/appautomate-utils/appium-sdk/handler.d.ts +3 -0
- package/dist/tools/appautomate-utils/appium-sdk/handler.js +52 -0
- package/dist/tools/appautomate-utils/appium-sdk/index.d.ts +7 -0
- package/dist/tools/appautomate-utils/appium-sdk/index.js +8 -0
- package/dist/tools/appautomate-utils/appium-sdk/instructions.d.ts +3 -0
- package/dist/tools/appautomate-utils/appium-sdk/instructions.js +47 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/csharp.d.ts +2 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/csharp.js +78 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/java.d.ts +8 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/java.js +87 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/nodejs.d.ts +3 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/nodejs.js +194 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/python.d.ts +3 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/python.js +76 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/ruby.d.ts +2 -0
- package/dist/tools/appautomate-utils/appium-sdk/languages/ruby.js +85 -0
- package/dist/tools/appautomate-utils/appium-sdk/types.d.ts +57 -0
- package/dist/tools/appautomate-utils/appium-sdk/types.js +61 -0
- package/dist/tools/appautomate-utils/appium-sdk/utils.d.ts +17 -0
- package/dist/tools/appautomate-utils/appium-sdk/utils.js +61 -0
- package/dist/tools/appautomate-utils/{appautomate.d.ts → native-execution/appautomate.d.ts} +1 -1
- package/dist/tools/appautomate-utils/{appautomate.js → native-execution/appautomate.js} +2 -2
- package/dist/tools/appautomate-utils/native-execution/constants.d.ts +10 -0
- package/dist/tools/appautomate-utils/native-execution/constants.js +36 -0
- package/dist/tools/appautomate-utils/native-execution/types.d.ts +19 -0
- package/dist/tools/appautomate-utils/{types.js → native-execution/types.js} +5 -1
- package/dist/tools/appautomate.js +25 -40
- package/dist/tools/bstack-sdk.d.ts +15 -2
- package/dist/tools/bstack-sdk.js +124 -7
- package/dist/tools/sdk-utils/{bstack/commands.d.ts → commands.d.ts} +1 -1
- package/dist/tools/sdk-utils/commands.js +65 -0
- package/dist/tools/sdk-utils/{bstack/frameworks.d.ts → constants.d.ts} +1 -1
- package/dist/tools/sdk-utils/{bstack/constants.js → constants.js} +78 -117
- package/dist/tools/sdk-utils/instructions.d.ts +6 -0
- package/dist/tools/sdk-utils/instructions.js +99 -0
- package/dist/tools/sdk-utils/percy/constants.d.ts +3 -0
- package/dist/tools/sdk-utils/{percy-bstack → percy}/constants.js +39 -13
- package/dist/tools/sdk-utils/percy/instructions.d.ts +10 -0
- package/dist/tools/sdk-utils/{percy-bstack → percy}/instructions.js +9 -5
- package/dist/tools/sdk-utils/percy/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/tools/add-percy-snapshots.d.ts +0 -5
- package/dist/tools/add-percy-snapshots.js +0 -17
- package/dist/tools/appautomate-utils/types.d.ts +0 -5
- package/dist/tools/list-test-files.d.ts +0 -2
- package/dist/tools/list-test-files.js +0 -33
- package/dist/tools/percy-sdk.d.ts +0 -4
- package/dist/tools/percy-sdk.js +0 -88
- package/dist/tools/percy-snapshot-utils/constants.d.ts +0 -16
- package/dist/tools/percy-snapshot-utils/constants.js +0 -500
- package/dist/tools/percy-snapshot-utils/detect-test-files.d.ts +0 -10
- package/dist/tools/percy-snapshot-utils/detect-test-files.js +0 -194
- package/dist/tools/percy-snapshot-utils/types.d.ts +0 -15
- package/dist/tools/percy-snapshot-utils/utils.d.ts +0 -4
- package/dist/tools/percy-snapshot-utils/utils.js +0 -30
- package/dist/tools/sdk-utils/bstack/commands.js +0 -88
- package/dist/tools/sdk-utils/bstack/configUtils.d.ts +0 -4
- package/dist/tools/sdk-utils/bstack/configUtils.js +0 -66
- package/dist/tools/sdk-utils/bstack/constants.d.ts +0 -58
- package/dist/tools/sdk-utils/bstack/frameworks.js +0 -57
- package/dist/tools/sdk-utils/bstack/index.d.ts +0 -4
- package/dist/tools/sdk-utils/bstack/index.js +0 -5
- package/dist/tools/sdk-utils/bstack/sdkHandler.d.ts +0 -4
- package/dist/tools/sdk-utils/bstack/sdkHandler.js +0 -74
- package/dist/tools/sdk-utils/common/constants.d.ts +0 -10
- package/dist/tools/sdk-utils/common/constants.js +0 -86
- package/dist/tools/sdk-utils/common/formatUtils.d.ts +0 -5
- package/dist/tools/sdk-utils/common/formatUtils.js +0 -27
- package/dist/tools/sdk-utils/common/index.d.ts +0 -3
- package/dist/tools/sdk-utils/common/index.js +0 -4
- package/dist/tools/sdk-utils/common/instructionUtils.d.ts +0 -8
- package/dist/tools/sdk-utils/common/instructionUtils.js +0 -20
- package/dist/tools/sdk-utils/common/schema.d.ts +0 -61
- package/dist/tools/sdk-utils/common/schema.js +0 -28
- package/dist/tools/sdk-utils/common/types.d.ts +0 -66
- package/dist/tools/sdk-utils/common/types.js +0 -50
- package/dist/tools/sdk-utils/common/utils.d.ts +0 -25
- package/dist/tools/sdk-utils/common/utils.js +0 -84
- package/dist/tools/sdk-utils/handler.d.ts +0 -5
- package/dist/tools/sdk-utils/handler.js +0 -144
- package/dist/tools/sdk-utils/percy-automate/constants.d.ts +0 -11
- package/dist/tools/sdk-utils/percy-automate/constants.js +0 -365
- package/dist/tools/sdk-utils/percy-automate/frameworks.d.ts +0 -8
- package/dist/tools/sdk-utils/percy-automate/frameworks.js +0 -50
- package/dist/tools/sdk-utils/percy-automate/handler.d.ts +0 -3
- package/dist/tools/sdk-utils/percy-automate/handler.js +0 -30
- package/dist/tools/sdk-utils/percy-automate/index.d.ts +0 -1
- package/dist/tools/sdk-utils/percy-automate/index.js +0 -2
- package/dist/tools/sdk-utils/percy-automate/types.d.ts +0 -13
- package/dist/tools/sdk-utils/percy-automate/types.js +0 -1
- package/dist/tools/sdk-utils/percy-bstack/constants.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-bstack/frameworks.d.ts +0 -2
- package/dist/tools/sdk-utils/percy-bstack/frameworks.js +0 -27
- package/dist/tools/sdk-utils/percy-bstack/handler.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-bstack/handler.js +0 -99
- package/dist/tools/sdk-utils/percy-bstack/index.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-bstack/index.js +0 -4
- package/dist/tools/sdk-utils/percy-bstack/instructions.d.ts +0 -7
- package/dist/tools/sdk-utils/percy-bstack/types.d.ts +0 -13
- package/dist/tools/sdk-utils/percy-bstack/types.js +0 -5
- package/dist/tools/sdk-utils/percy-web/constants.d.ts +0 -41
- package/dist/tools/sdk-utils/percy-web/constants.js +0 -941
- package/dist/tools/sdk-utils/percy-web/fetchPercyToken.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-web/fetchPercyToken.js +0 -28
- package/dist/tools/sdk-utils/percy-web/frameworks.d.ts +0 -7
- package/dist/tools/sdk-utils/percy-web/frameworks.js +0 -103
- package/dist/tools/sdk-utils/percy-web/handler.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-web/handler.js +0 -27
- package/dist/tools/sdk-utils/percy-web/index.d.ts +0 -4
- package/dist/tools/sdk-utils/percy-web/index.js +0 -4
- package/dist/tools/sdk-utils/percy-web/types.d.ts +0 -12
- package/dist/tools/sdk-utils/percy-web/types.js +0 -1
- /package/dist/tools/{percy-snapshot-utils → sdk-utils/percy}/types.js +0 -0
|
@@ -4,14 +4,13 @@ import { getBrowserStackAuth } from "../lib/get-auth.js";
|
|
|
4
4
|
import { trackMCP } from "../lib/instrumentation.js";
|
|
5
5
|
import { maybeCompressBase64 } from "../lib/utils.js";
|
|
6
6
|
import { remote } from "webdriverio";
|
|
7
|
-
import { AppTestPlatform } from "./appautomate-utils/types.js";
|
|
7
|
+
import { AppTestPlatform } from "./appautomate-utils/native-execution/types.js";
|
|
8
|
+
import { setupAppAutomateHandler } from "./appautomate-utils/appium-sdk/handler.js";
|
|
9
|
+
import { SETUP_APP_AUTOMATE_DESCRIPTION, SETUP_APP_AUTOMATE_SCHEMA, } from "./appautomate-utils/appium-sdk/constants.js";
|
|
10
|
+
import { Platform, } from "./appautomate-utils/native-execution/types.js";
|
|
8
11
|
import { getDevicesAndBrowsers, BrowserStackProducts, } from "../lib/device-cache.js";
|
|
9
|
-
import { findMatchingDevice, getDeviceVersions, resolveVersion, validateArgs, uploadApp, uploadEspressoApp, uploadEspressoTestSuite, triggerEspressoBuild, uploadXcuiApp, uploadXcuiTestSuite, triggerXcuiBuild, } from "./appautomate-utils/appautomate.js";
|
|
10
|
-
|
|
11
|
-
(function (Platform) {
|
|
12
|
-
Platform["ANDROID"] = "android";
|
|
13
|
-
Platform["IOS"] = "ios";
|
|
14
|
-
})(Platform || (Platform = {}));
|
|
12
|
+
import { findMatchingDevice, getDeviceVersions, resolveVersion, validateArgs, uploadApp, uploadEspressoApp, uploadEspressoTestSuite, triggerEspressoBuild, uploadXcuiApp, uploadXcuiTestSuite, triggerXcuiBuild, } from "./appautomate-utils/native-execution/appautomate.js";
|
|
13
|
+
import { RUN_APP_AUTOMATE_DESCRIPTION, RUN_APP_AUTOMATE_SCHEMA, } from "./appautomate-utils/native-execution/constants.js";
|
|
15
14
|
/**
|
|
16
15
|
* Launches an app on a selected BrowserStack device and takes a screenshot.
|
|
17
16
|
*/
|
|
@@ -214,39 +213,7 @@ export default function addAppAutomationTools(server, config) {
|
|
|
214
213
|
};
|
|
215
214
|
}
|
|
216
215
|
});
|
|
217
|
-
tools.runAppTestsOnBrowserStack = server.tool("runAppTestsOnBrowserStack",
|
|
218
|
-
appPath: z
|
|
219
|
-
.string()
|
|
220
|
-
.describe("Path to your application file:\n" +
|
|
221
|
-
"If in development IDE directory:\n" +
|
|
222
|
-
"• For Android: 'gradle assembleDebug'\n" +
|
|
223
|
-
"• For iOS:\n" +
|
|
224
|
-
" xcodebuild clean -scheme YOUR_SCHEME && \\\n" +
|
|
225
|
-
" xcodebuild archive -scheme YOUR_SCHEME -configuration Release -archivePath build/app.xcarchive && \\\n" +
|
|
226
|
-
" xcodebuild -exportArchive -archivePath build/app.xcarchive -exportPath build/ipa -exportOptionsPlist exportOptions.plist\n\n" +
|
|
227
|
-
"If in other directory, provide existing app path"),
|
|
228
|
-
testSuitePath: z
|
|
229
|
-
.string()
|
|
230
|
-
.describe("Path to your test suite file:\n" +
|
|
231
|
-
"If in development IDE directory:\n" +
|
|
232
|
-
"• For Android: 'gradle assembleAndroidTest'\n" +
|
|
233
|
-
"• For iOS:\n" +
|
|
234
|
-
" xcodebuild test-without-building -scheme YOUR_SCHEME -destination 'generic/platform=iOS' && \\\n" +
|
|
235
|
-
" cd ~/Library/Developer/Xcode/DerivedData/*/Build/Products/Debug-iphonesimulator/ && \\\n" +
|
|
236
|
-
" zip -r Tests.zip *.xctestrun *-Runner.app\n\n" +
|
|
237
|
-
"If in other directory, provide existing test file path"),
|
|
238
|
-
devices: z
|
|
239
|
-
.array(z.string())
|
|
240
|
-
.describe("List of devices to run the test on, e.g., ['Samsung Galaxy S20-10.0', 'iPhone 12 Pro-16.0']."),
|
|
241
|
-
project: z
|
|
242
|
-
.string()
|
|
243
|
-
.optional()
|
|
244
|
-
.default("BStack-AppAutomate-Suite")
|
|
245
|
-
.describe("Project name for organizing test runs on BrowserStack."),
|
|
246
|
-
detectedAutomationFramework: z
|
|
247
|
-
.string()
|
|
248
|
-
.describe("The automation framework used in the project, such as 'espresso' (Android) or 'xcuitest' (iOS)."),
|
|
249
|
-
}, async (args) => {
|
|
216
|
+
tools.runAppTestsOnBrowserStack = server.tool("runAppTestsOnBrowserStack", RUN_APP_AUTOMATE_DESCRIPTION, RUN_APP_AUTOMATE_SCHEMA, async (args) => {
|
|
250
217
|
try {
|
|
251
218
|
trackMCP("runAppTestsOnBrowserStack", server.server.getClientVersion(), undefined, config);
|
|
252
219
|
return await runAppTestsOnBrowserStack(args, config);
|
|
@@ -265,5 +232,23 @@ export default function addAppAutomationTools(server, config) {
|
|
|
265
232
|
};
|
|
266
233
|
}
|
|
267
234
|
});
|
|
235
|
+
tools.setupBrowserStackAppAutomateTests = server.tool("setupBrowserStackAppAutomateTests", SETUP_APP_AUTOMATE_DESCRIPTION, SETUP_APP_AUTOMATE_SCHEMA, async (args) => {
|
|
236
|
+
try {
|
|
237
|
+
return await setupAppAutomateHandler(args, config);
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
const error_message = error instanceof Error ? error.message : "Unknown error";
|
|
241
|
+
return {
|
|
242
|
+
content: [
|
|
243
|
+
{
|
|
244
|
+
type: "text",
|
|
245
|
+
text: `Failed to bootstrap project with BrowserStack App Automate SDK. Error: ${error_message}. Please open an issue on GitHub if the problem persists`,
|
|
246
|
+
isError: true,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
isError: true,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
});
|
|
268
253
|
return tools;
|
|
269
254
|
}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
3
|
+
import { SDKSupportedBrowserAutomationFramework, SDKSupportedLanguage, SDKSupportedTestingFramework } from "./sdk-utils/types.js";
|
|
2
4
|
import { BrowserStackConfig } from "../lib/types.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* BrowserStack SDK hooks into your test framework to seamlessly run tests on BrowserStack.
|
|
7
|
+
* This tool gives instructions to setup a browserstack.yml file in the project root and installs the necessary dependencies.
|
|
8
|
+
*/
|
|
9
|
+
export declare function bootstrapProjectWithSDK({ detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, desiredPlatforms, enablePercy, config, }: {
|
|
10
|
+
detectedBrowserAutomationFramework: SDKSupportedBrowserAutomationFramework;
|
|
11
|
+
detectedTestingFramework: SDKSupportedTestingFramework;
|
|
12
|
+
detectedLanguage: SDKSupportedLanguage;
|
|
13
|
+
desiredPlatforms: string[];
|
|
14
|
+
enablePercy: boolean;
|
|
15
|
+
config: BrowserStackConfig;
|
|
16
|
+
}): Promise<CallToolResult>;
|
|
17
|
+
export default function addSDKTools(server: McpServer, config: BrowserStackConfig): Record<string, any>;
|
package/dist/tools/bstack-sdk.js
CHANGED
|
@@ -1,11 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { trackMCP } from "../lib/instrumentation.js";
|
|
3
|
+
import { getSDKPrefixCommand } from "./sdk-utils/commands.js";
|
|
4
|
+
import { SDKSupportedLanguageEnum, SDKSupportedBrowserAutomationFrameworkEnum, SDKSupportedTestingFrameworkEnum, } from "./sdk-utils/types.js";
|
|
5
|
+
import { generateBrowserStackYMLInstructions, getInstructionsForProjectConfiguration, formatInstructionsWithNumbers, } from "./sdk-utils/instructions.js";
|
|
6
|
+
import { formatPercyInstructions, getPercyInstructions, } from "./sdk-utils/percy/instructions.js";
|
|
7
|
+
import { getBrowserStackAuth } from "../lib/get-auth.js";
|
|
8
|
+
/**
|
|
9
|
+
* BrowserStack SDK hooks into your test framework to seamlessly run tests on BrowserStack.
|
|
10
|
+
* This tool gives instructions to setup a browserstack.yml file in the project root and installs the necessary dependencies.
|
|
11
|
+
*/
|
|
12
|
+
export async function bootstrapProjectWithSDK({ detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, desiredPlatforms, enablePercy, config, }) {
|
|
13
|
+
// Get credentials from config
|
|
14
|
+
const authString = getBrowserStackAuth(config);
|
|
15
|
+
const [username, accessKey] = authString.split(":");
|
|
16
|
+
// Handle frameworks with unique setup instructions that don't use browserstack.yml
|
|
17
|
+
if (detectedBrowserAutomationFramework === "cypress" ||
|
|
18
|
+
detectedTestingFramework === "webdriverio") {
|
|
19
|
+
let combinedInstructions = getInstructionsForProjectConfiguration(detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, username, accessKey);
|
|
20
|
+
if (enablePercy) {
|
|
21
|
+
const percyInstructions = getPercyInstructions(detectedLanguage, detectedBrowserAutomationFramework, detectedTestingFramework);
|
|
22
|
+
if (percyInstructions) {
|
|
23
|
+
combinedInstructions +=
|
|
24
|
+
"\n\n" + formatPercyInstructions(percyInstructions);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw new Error(`Percy is currently not supported through MCP for ${detectedLanguage} with ${detectedTestingFramework}. If you want to run the test cases without Percy, disable Percy and run it again.`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// Apply consistent formatting for all configurations
|
|
31
|
+
return formatFinalInstructions(combinedInstructions);
|
|
32
|
+
}
|
|
33
|
+
// Handle default flow using browserstack.yml
|
|
34
|
+
const sdkSetupCommand = getSDKPrefixCommand(detectedLanguage, detectedTestingFramework, username, accessKey);
|
|
35
|
+
const ymlInstructions = generateBrowserStackYMLInstructions(desiredPlatforms, enablePercy);
|
|
36
|
+
const instructionsForProjectConfiguration = getInstructionsForProjectConfiguration(detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, username, accessKey);
|
|
37
|
+
let combinedInstructions = "";
|
|
38
|
+
// Step 1: Add SDK setup command
|
|
39
|
+
if (sdkSetupCommand) {
|
|
40
|
+
combinedInstructions += sdkSetupCommand;
|
|
41
|
+
}
|
|
42
|
+
// Step 2: Add browserstack.yml setup
|
|
43
|
+
if (ymlInstructions) {
|
|
44
|
+
combinedInstructions += "\n\n---STEP---\n" + ymlInstructions;
|
|
45
|
+
}
|
|
46
|
+
// Step 3: Add language/framework-specific setup
|
|
47
|
+
if (instructionsForProjectConfiguration) {
|
|
48
|
+
combinedInstructions += "\n\n" + instructionsForProjectConfiguration;
|
|
49
|
+
}
|
|
50
|
+
// Step 4: Add Percy setup if applicable
|
|
51
|
+
if (enablePercy) {
|
|
52
|
+
const percyInstructions = getPercyInstructions(detectedLanguage, detectedBrowserAutomationFramework, detectedTestingFramework);
|
|
53
|
+
if (percyInstructions) {
|
|
54
|
+
combinedInstructions +=
|
|
55
|
+
"\n\n" + formatPercyInstructions(percyInstructions);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
throw new Error(`Percy is currently not supported through MCP for ${detectedLanguage} with ${detectedTestingFramework}. If you want to run the test cases without Percy, disable Percy and run it again.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Apply consistent formatting for all configurations
|
|
62
|
+
return formatFinalInstructions(combinedInstructions);
|
|
63
|
+
}
|
|
64
|
+
// Helper function to apply consistent formatting to all instruction types
|
|
65
|
+
function formatFinalInstructions(combinedInstructions) {
|
|
66
|
+
const fullInstructions = `⚠️ IMPORTANT: DO NOT SKIP ANY STEP
|
|
67
|
+
All the setup steps described in this file MUST be executed regardless of any existing configuration or setup.
|
|
68
|
+
This ensures proper BrowserStack SDK setup.
|
|
69
|
+
|
|
70
|
+
${formatInstructionsWithNumbers(combinedInstructions)}`;
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{
|
|
74
|
+
type: "text",
|
|
75
|
+
text: fullInstructions,
|
|
76
|
+
isError: false,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export default function addSDKTools(server, config) {
|
|
5
82
|
const tools = {};
|
|
6
|
-
tools.setupBrowserStackAutomateTests = server.tool("setupBrowserStackAutomateTests",
|
|
7
|
-
|
|
83
|
+
tools.setupBrowserStackAutomateTests = server.tool("setupBrowserStackAutomateTests", "Set up and run automated web-based tests on BrowserStack using the BrowserStack SDK. Use for functional or integration tests on BrowserStack, with optional Percy visual testing for supported frameworks. Example prompts: run this test on browserstack; run this test on browserstack with Percy; set up this project for browserstack with Percy. Integrate BrowserStack SDK into your project", {
|
|
84
|
+
detectedBrowserAutomationFramework: z
|
|
85
|
+
.nativeEnum(SDKSupportedBrowserAutomationFrameworkEnum)
|
|
86
|
+
.describe("The automation framework configured in the project. Example: 'playwright', 'selenium'"),
|
|
87
|
+
detectedTestingFramework: z
|
|
88
|
+
.nativeEnum(SDKSupportedTestingFrameworkEnum)
|
|
89
|
+
.describe("The testing framework used in the project. Be precise with framework selection Example: 'webdriverio', 'jest', 'pytest', 'junit4', 'junit5', 'mocha'"),
|
|
90
|
+
detectedLanguage: z
|
|
91
|
+
.nativeEnum(SDKSupportedLanguageEnum)
|
|
92
|
+
.describe("The programming language used in the project. Example: 'nodejs', 'python', 'java', 'csharp'"),
|
|
93
|
+
desiredPlatforms: z
|
|
94
|
+
.array(z.enum(["windows", "macos", "android", "ios"]))
|
|
95
|
+
.describe("The platforms the user wants to test on. Always ask this to the user, do not try to infer this."),
|
|
96
|
+
enablePercy: z
|
|
97
|
+
.boolean()
|
|
98
|
+
.optional()
|
|
99
|
+
.default(false)
|
|
100
|
+
.describe("Set to true if the user wants to enable Percy for visual testing. Defaults to false."),
|
|
101
|
+
}, async (args) => {
|
|
102
|
+
try {
|
|
103
|
+
trackMCP("runTestsOnBrowserStack", server.server.getClientVersion(), undefined, config);
|
|
104
|
+
return await bootstrapProjectWithSDK({
|
|
105
|
+
detectedBrowserAutomationFramework: args.detectedBrowserAutomationFramework,
|
|
106
|
+
detectedTestingFramework: args.detectedTestingFramework,
|
|
107
|
+
detectedLanguage: args.detectedLanguage,
|
|
108
|
+
desiredPlatforms: args.desiredPlatforms,
|
|
109
|
+
enablePercy: args.enablePercy,
|
|
110
|
+
config,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
trackMCP("runTestsOnBrowserStack", server.server.getClientVersion(), error, config);
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: `Failed to bootstrap project with BrowserStack SDK. Error: ${error}. Please open an issue on GitHub if the problem persists`,
|
|
120
|
+
isError: true,
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
isError: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
8
126
|
});
|
|
9
127
|
return tools;
|
|
10
128
|
}
|
|
11
|
-
export default registerRunBrowserStackTestsTool;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SDKSupportedLanguage } from "
|
|
1
|
+
import { SDKSupportedLanguage } from "./types.js";
|
|
2
2
|
export declare function getSDKPrefixCommand(language: SDKSupportedLanguage, framework: string, username: string, accessKey: string): string;
|
|
3
3
|
export declare function getJavaFrameworkForMaven(framework: string): string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Framework mapping for Java Maven archetype generation
|
|
2
|
+
const JAVA_FRAMEWORK_MAP = {
|
|
3
|
+
testng: "testng",
|
|
4
|
+
junit5: "junit5",
|
|
5
|
+
junit4: "junit4",
|
|
6
|
+
cucumber: "cucumber-testng",
|
|
7
|
+
serenity: "serenity",
|
|
8
|
+
};
|
|
9
|
+
// Common Gradle setup instructions (platform-independent)
|
|
10
|
+
const GRADLE_SETUP_INSTRUCTIONS = `
|
|
11
|
+
**For Gradle setup:**
|
|
12
|
+
1. Add browserstack-java-sdk to dependencies:
|
|
13
|
+
compileOnly 'com.browserstack:browserstack-java-sdk:latest.release'
|
|
14
|
+
|
|
15
|
+
2. Add browserstackSDK path variable:
|
|
16
|
+
def browserstackSDKArtifact = configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.find { it.name == 'browserstack-java-sdk' }
|
|
17
|
+
|
|
18
|
+
3. Add javaagent to gradle tasks:
|
|
19
|
+
jvmArgs "-javaagent:\${browserstackSDKArtifact.file}"
|
|
20
|
+
`;
|
|
21
|
+
export function getSDKPrefixCommand(language, framework, username, accessKey) {
|
|
22
|
+
switch (language) {
|
|
23
|
+
case "nodejs":
|
|
24
|
+
return `---STEP---
|
|
25
|
+
Install BrowserStack Node SDK using command:
|
|
26
|
+
\`\`\`bash
|
|
27
|
+
npm i -D browserstack-node-sdk@latest
|
|
28
|
+
\`\`\`
|
|
29
|
+
---STEP---
|
|
30
|
+
Run the following command to setup browserstack sdk:
|
|
31
|
+
\`\`\`bash
|
|
32
|
+
npx setup --username ${username} --key ${accessKey}
|
|
33
|
+
\`\`\`
|
|
34
|
+
---STEP---
|
|
35
|
+
Edit the browserstack.yml file that was created in the project root to add your desired platforms and browsers.`;
|
|
36
|
+
case "java": {
|
|
37
|
+
const mavenFramework = getJavaFrameworkForMaven(framework);
|
|
38
|
+
const isWindows = process.platform === "win32";
|
|
39
|
+
const mavenCommand = isWindows
|
|
40
|
+
? `mvn archetype:generate -B -DarchetypeGroupId="com.browserstack" -DarchetypeArtifactId="browserstack-sdk-archetype-integrate" -DarchetypeVersion="1.0" -DgroupId="com.browserstack" -DartifactId="browserstack-sdk-archetype-integrate" -Dversion="1.0" -DBROWSERSTACK_USERNAME="${process.env.BROWSERSTACK_USERNAME}" -DBROWSERSTACK_ACCESS_KEY="${process.env.BROWSERSTACK_ACCESS_KEY}" -DBROWSERSTACK_FRAMEWORK="${mavenFramework}"`
|
|
41
|
+
: `mvn archetype:generate -B -DarchetypeGroupId=com.browserstack \\
|
|
42
|
+
-DarchetypeArtifactId=browserstack-sdk-archetype-integrate -DarchetypeVersion=1.0 \\
|
|
43
|
+
-DgroupId=com.browserstack -DartifactId=browserstack-sdk-archetype-integrate -Dversion=1.0 \\
|
|
44
|
+
-DBROWSERSTACK_USERNAME="${username}" \\
|
|
45
|
+
-DBROWSERSTACK_ACCESS_KEY="${accessKey}" \\
|
|
46
|
+
-DBROWSERSTACK_FRAMEWORK="${mavenFramework}"`;
|
|
47
|
+
const platformLabel = isWindows ? "Windows" : "macOS/Linux";
|
|
48
|
+
return `---STEP---
|
|
49
|
+
Install BrowserStack Java SDK
|
|
50
|
+
|
|
51
|
+
**Maven command for ${framework} (${platformLabel}):**
|
|
52
|
+
Run the command, it is required to generate the browserstack-sdk-archetype-integrate project:
|
|
53
|
+
${mavenCommand}
|
|
54
|
+
|
|
55
|
+
Alternative setup for Gradle users:
|
|
56
|
+
${GRADLE_SETUP_INSTRUCTIONS}`;
|
|
57
|
+
}
|
|
58
|
+
// Add more languages as needed
|
|
59
|
+
default:
|
|
60
|
+
return "";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function getJavaFrameworkForMaven(framework) {
|
|
64
|
+
return JAVA_FRAMEWORK_MAP[framework] || framework;
|
|
65
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConfigMapping } from "
|
|
1
|
+
import { ConfigMapping } from "./types.js";
|
|
2
2
|
export declare const SUPPORTED_CONFIGURATIONS: ConfigMapping;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ---------- PYTHON INSTRUCTIONS ----------
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
const setup = `
|
|
4
|
+
const pythonInstructions = (username, accessKey) => `
|
|
6
5
|
---STEP---
|
|
7
6
|
|
|
8
7
|
Install the BrowserStack SDK:
|
|
@@ -16,8 +15,7 @@ Setup the BrowserStack SDK with your credentials:
|
|
|
16
15
|
\`\`\`bash
|
|
17
16
|
browserstack-sdk setup --username "${username}" --key "${accessKey}"
|
|
18
17
|
\`\`\`
|
|
19
|
-
|
|
20
|
-
const run = `
|
|
18
|
+
|
|
21
19
|
---STEP---
|
|
22
20
|
|
|
23
21
|
Run your tests on BrowserStack:
|
|
@@ -25,10 +23,7 @@ Run your tests on BrowserStack:
|
|
|
25
23
|
browserstack-sdk python <path-to-test-file>
|
|
26
24
|
\`\`\`
|
|
27
25
|
`;
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
export const generatePythonFrameworkInstructions = (framework) => (username, accessKey) => {
|
|
31
|
-
const setup = `
|
|
26
|
+
const generatePythonFrameworkInstructions = (framework) => (username, accessKey) => `
|
|
32
27
|
---STEP---
|
|
33
28
|
|
|
34
29
|
Install the BrowserStack SDK:
|
|
@@ -43,8 +38,7 @@ Setup the BrowserStack SDK with framework-specific configuration:
|
|
|
43
38
|
\`\`\`bash
|
|
44
39
|
browserstack-sdk setup --framework "${framework}" --username "${username}" --key "${accessKey}"
|
|
45
40
|
\`\`\`
|
|
46
|
-
|
|
47
|
-
const run = `
|
|
41
|
+
|
|
48
42
|
---STEP---
|
|
49
43
|
|
|
50
44
|
Run your ${framework} tests on BrowserStack:
|
|
@@ -52,17 +46,14 @@ Run your ${framework} tests on BrowserStack:
|
|
|
52
46
|
browserstack-sdk ${framework} <path-to-test-files>
|
|
53
47
|
\`\`\`
|
|
54
48
|
`;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export const behaveInstructions = generatePythonFrameworkInstructions("behave");
|
|
59
|
-
export const pytestInstructions = generatePythonFrameworkInstructions("pytest");
|
|
49
|
+
const robotInstructions = generatePythonFrameworkInstructions("robot");
|
|
50
|
+
const behaveInstructions = generatePythonFrameworkInstructions("behave");
|
|
51
|
+
const pytestInstructions = generatePythonFrameworkInstructions("pytest");
|
|
60
52
|
/**
|
|
61
53
|
* ---------- JAVA INSTRUCTIONS ----------
|
|
62
54
|
*/
|
|
63
55
|
const argsInstruction = '<argLine>-javaagent:"${com.browserstack:browserstack-java-sdk:jar}"</argLine>';
|
|
64
|
-
|
|
65
|
-
const setup = `
|
|
56
|
+
const javaInstructions = (username, accessKey) => `
|
|
66
57
|
---STEP---
|
|
67
58
|
|
|
68
59
|
Add the BrowserStack Java SDK dependency to your \`pom.xml\`:
|
|
@@ -91,8 +82,7 @@ Export your BrowserStack credentials as environment variables:
|
|
|
91
82
|
export BROWSERSTACK_USERNAME=${username}
|
|
92
83
|
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
93
84
|
\`\`\`
|
|
94
|
-
|
|
95
|
-
const run = `
|
|
85
|
+
|
|
96
86
|
---STEP---
|
|
97
87
|
|
|
98
88
|
Run your tests using Maven:
|
|
@@ -105,13 +95,66 @@ Or for Gradle:
|
|
|
105
95
|
gradle clean test
|
|
106
96
|
\`\`\`
|
|
107
97
|
`;
|
|
108
|
-
|
|
109
|
-
|
|
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
|
+
`;
|
|
110
154
|
/**
|
|
111
155
|
* ---------- CSharp INSTRUCTIONS ----------
|
|
112
156
|
*/
|
|
113
|
-
|
|
114
|
-
const setup = `
|
|
157
|
+
const csharpCommonInstructions = (username, accessKey) => `
|
|
115
158
|
---STEP---
|
|
116
159
|
|
|
117
160
|
Install BrowserStack TestAdapter NuGet package:
|
|
@@ -160,8 +203,7 @@ Install the x64 version of .NET for BrowserStack compatibility.
|
|
|
160
203
|
sudo dotnet browserstack-sdk setup-dotnet --dotnet-path "<your-chosen-path>" --dotnet-version "<your-dotnet-version>"
|
|
161
204
|
\`\`\`
|
|
162
205
|
Common paths: /usr/local/share/dotnet, ~/dotnet-x64, or /opt/dotnet-x64
|
|
163
|
-
|
|
164
|
-
const run = `
|
|
206
|
+
|
|
165
207
|
---STEP---
|
|
166
208
|
|
|
167
209
|
Run the tests:
|
|
@@ -174,10 +216,7 @@ Run the tests:
|
|
|
174
216
|
dotnet test
|
|
175
217
|
\`\`\`
|
|
176
218
|
`;
|
|
177
|
-
|
|
178
|
-
};
|
|
179
|
-
export const csharpPlaywrightCommonInstructions = (username, accessKey) => {
|
|
180
|
-
const setup = `
|
|
219
|
+
const csharpPlaywrightCommonInstructions = (username, accessKey) => `
|
|
181
220
|
---STEP---
|
|
182
221
|
|
|
183
222
|
Install BrowserStack TestAdapter NuGet package:
|
|
@@ -239,8 +278,7 @@ Fix for Playwright architecture (macOS only):
|
|
|
239
278
|
If the folder exists:
|
|
240
279
|
\`<project-folder>/bin/Debug/net8.0/.playwright/node/darwin-arm64\`
|
|
241
280
|
Rename \`darwin-arm64\` to \`darwin-x64\`
|
|
242
|
-
|
|
243
|
-
const run = `
|
|
281
|
+
|
|
244
282
|
---STEP---
|
|
245
283
|
|
|
246
284
|
Run the tests:
|
|
@@ -253,13 +291,10 @@ Run the tests:
|
|
|
253
291
|
dotnet test
|
|
254
292
|
\`\`\`
|
|
255
293
|
`;
|
|
256
|
-
return { setup, run };
|
|
257
|
-
};
|
|
258
294
|
/**
|
|
259
295
|
* ---------- NODEJS INSTRUCTIONS ----------
|
|
260
296
|
*/
|
|
261
|
-
|
|
262
|
-
const setup = `
|
|
297
|
+
const nodejsInstructions = (username, accessKey) => `
|
|
263
298
|
---STEP---
|
|
264
299
|
|
|
265
300
|
Ensure \`browserstack-node-sdk\` is present in package.json with the latest version:
|
|
@@ -295,21 +330,10 @@ export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
|
295
330
|
Run your tests:
|
|
296
331
|
You can now run your tests on BrowserStack using your standard command or Use the commands defined in your package.json file to run the tests.
|
|
297
332
|
`;
|
|
298
|
-
const run = `
|
|
299
|
-
---STEP---
|
|
300
|
-
|
|
301
|
-
Run your tests on BrowserStack:
|
|
302
|
-
\`\`\`bash
|
|
303
|
-
npm run test:browserstack
|
|
304
|
-
\`\`\`
|
|
305
|
-
`;
|
|
306
|
-
return { setup, run };
|
|
307
|
-
};
|
|
308
333
|
/**
|
|
309
334
|
* ---------- EXPORT CONFIG ----------
|
|
310
335
|
*/
|
|
311
|
-
|
|
312
|
-
const setup = `
|
|
336
|
+
const webdriverioInstructions = (username, accessKey) => `
|
|
313
337
|
---STEP---
|
|
314
338
|
|
|
315
339
|
Set BrowserStack Credentials:
|
|
@@ -408,17 +432,13 @@ exports.config.capabilities.forEach(function (caps) {
|
|
|
408
432
|
caps[i] = { ...caps[i], ...exports.config.commonCapabilities[i]};
|
|
409
433
|
});
|
|
410
434
|
\`\`\`
|
|
411
|
-
|
|
412
|
-
const run = `
|
|
435
|
+
|
|
413
436
|
---STEP---
|
|
414
437
|
|
|
415
438
|
Run your tests:
|
|
416
439
|
You can now run your tests on BrowserStack using your standard WebdriverIO command or Use the commands defined in your package.json file to run the tests.
|
|
417
440
|
`;
|
|
418
|
-
|
|
419
|
-
};
|
|
420
|
-
export const cypressInstructions = (username, accessKey) => {
|
|
421
|
-
const setup = `
|
|
441
|
+
const cypressInstructions = (username, accessKey) => `
|
|
422
442
|
---STEP---
|
|
423
443
|
|
|
424
444
|
Install the BrowserStack Cypress CLI:
|
|
@@ -479,8 +499,7 @@ Open the generated \`browserstack.json\` file and update it with your BrowserSta
|
|
|
479
499
|
\`\`\`
|
|
480
500
|
|
|
481
501
|
**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.
|
|
482
|
-
|
|
483
|
-
const run = `
|
|
502
|
+
|
|
484
503
|
---STEP---
|
|
485
504
|
|
|
486
505
|
Run Your Tests on BrowserStack:
|
|
@@ -489,69 +508,8 @@ Execute your tests on BrowserStack using the following command:
|
|
|
489
508
|
npx browserstack-cypress run --sync
|
|
490
509
|
\`\`\`
|
|
491
510
|
|
|
492
|
-
After the tests complete, you can view the results on your [BrowserStack Automate Dashboard](https://automate.browserstack.com/dashboard/)
|
|
493
|
-
return { setup, run };
|
|
494
|
-
};
|
|
495
|
-
const serenityInstructions = (username, accessKey) => {
|
|
496
|
-
const setup = `
|
|
497
|
-
---STEP---
|
|
498
|
-
|
|
499
|
-
Set BrowserStack credentials as environment variables:
|
|
500
|
-
For macOS/Linux:
|
|
501
|
-
\`\`\`bash
|
|
502
|
-
export BROWSERSTACK_USERNAME=${username}
|
|
503
|
-
export BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
504
|
-
\`\`\`
|
|
505
|
-
|
|
506
|
-
For Windows Command Prompt:
|
|
507
|
-
\`\`\`cmd
|
|
508
|
-
set BROWSERSTACK_USERNAME=${username}
|
|
509
|
-
set BROWSERSTACK_ACCESS_KEY=${accessKey}
|
|
510
|
-
\`\`\`
|
|
511
|
-
|
|
512
|
-
---STEP---
|
|
513
|
-
|
|
514
|
-
Add serenity-browserstack dependency in pom.xml:
|
|
515
|
-
Add the following dependency to your pom.xml file and save it:
|
|
516
|
-
\`\`\`xml
|
|
517
|
-
<dependency>
|
|
518
|
-
<groupId>net.serenity-bdd</groupId>
|
|
519
|
-
<artifactId>serenity-browserstack</artifactId>
|
|
520
|
-
<version>3.3.4</version>
|
|
521
|
-
</dependency>
|
|
522
|
-
\`\`\`
|
|
523
|
-
|
|
524
|
-
---STEP---
|
|
525
|
-
|
|
526
|
-
Set up serenity.conf file:
|
|
527
|
-
Create or update your serenity.conf file in the project root with the following configuration:
|
|
528
|
-
\`\`\`
|
|
529
|
-
webdriver {
|
|
530
|
-
driver = remote
|
|
531
|
-
remote.url = "https://hub.browserstack.com/wd/hub"
|
|
532
|
-
}
|
|
533
|
-
browserstack.user="${username}"
|
|
534
|
-
browserstack.key="${accessKey}"
|
|
535
|
-
\`\`\`
|
|
511
|
+
After the tests complete, you can view the results on your [BrowserStack Automate Dashboard](https://automate.browserstack.com/dashboard/).
|
|
536
512
|
`;
|
|
537
|
-
const run = `
|
|
538
|
-
---STEP---
|
|
539
|
-
|
|
540
|
-
Run your Serenity tests:
|
|
541
|
-
You can continue running your tests as you normally would. For example:
|
|
542
|
-
|
|
543
|
-
Using Maven:
|
|
544
|
-
\`\`\`bash
|
|
545
|
-
mvn clean verify
|
|
546
|
-
\`\`\`
|
|
547
|
-
|
|
548
|
-
Using Gradle:
|
|
549
|
-
\`\`\`bash
|
|
550
|
-
gradle clean test
|
|
551
|
-
\`\`\`
|
|
552
|
-
`;
|
|
553
|
-
return { setup, run };
|
|
554
|
-
};
|
|
555
513
|
export const SUPPORTED_CONFIGURATIONS = {
|
|
556
514
|
python: {
|
|
557
515
|
playwright: {
|
|
@@ -607,5 +565,8 @@ export const SUPPORTED_CONFIGURATIONS = {
|
|
|
607
565
|
cypress: {
|
|
608
566
|
cypress: { instructions: cypressInstructions },
|
|
609
567
|
},
|
|
568
|
+
webdriverio: {
|
|
569
|
+
mocha: { instructions: webdriverioInstructions },
|
|
570
|
+
},
|
|
610
571
|
},
|
|
611
572
|
};
|
|
@@ -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;
|