@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
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SDKSupportedTestingFrameworkEnum, SDKSupportedLanguageEnum } from "../sdk-utils/common/types.js";
|
|
2
|
-
export type ListTestFilesParams = {
|
|
3
|
-
dirs: string[];
|
|
4
|
-
language: SDKSupportedLanguageEnum;
|
|
5
|
-
framework?: SDKSupportedTestingFrameworkEnum;
|
|
6
|
-
};
|
|
7
|
-
export interface DetectionConfig {
|
|
8
|
-
extensions: string[];
|
|
9
|
-
namePatterns: RegExp[];
|
|
10
|
-
contentRegex: RegExp[];
|
|
11
|
-
uiDriverRegex: RegExp[];
|
|
12
|
-
uiIndicatorRegex: RegExp[];
|
|
13
|
-
backendRegex: RegExp[];
|
|
14
|
-
excludeRegex?: RegExp[];
|
|
15
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const content = [];
|
|
2
|
-
export async function updateFileAndStep(file, idx, total, instruction) {
|
|
3
|
-
content.length = 0;
|
|
4
|
-
const nextIndex = idx + 1;
|
|
5
|
-
content.push({
|
|
6
|
-
type: "text",
|
|
7
|
-
text: `Complete all steps in order. If a tool call is requested, update the file first, then call the tool. Follow instructions exactly— do not skip any steps to ensure all files are updated.`,
|
|
8
|
-
});
|
|
9
|
-
content.push({
|
|
10
|
-
type: "text",
|
|
11
|
-
text: `Step 1 : You need to add percy snapshot commands in some key test cases in the file ${file} use the following instructions: \n${instruction}`,
|
|
12
|
-
});
|
|
13
|
-
content.push({
|
|
14
|
-
type: "text",
|
|
15
|
-
text: `Step 2 : Confirm that Percy snapshot commands have been added at all key points of visual change in the file ${file}.`,
|
|
16
|
-
});
|
|
17
|
-
if (nextIndex < total) {
|
|
18
|
-
content.push({
|
|
19
|
-
type: "text",
|
|
20
|
-
text: `Step 3 : Call the tool updateTestFileWithInstructions with index as ${nextIndex} out of ${total}`,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
if (nextIndex === total) {
|
|
24
|
-
content.push({
|
|
25
|
-
type: "text",
|
|
26
|
-
text: `Step 4: Percy snapshot commands have been added to all files. You can now run the Percy build using the above command.`,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return content;
|
|
30
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Constants
|
|
2
|
-
const MAVEN_ARCHETYPE_GROUP_ID = "com.browserstack";
|
|
3
|
-
const MAVEN_ARCHETYPE_ARTIFACT_ID = "browserstack-sdk-archetype-integrate";
|
|
4
|
-
const MAVEN_ARCHETYPE_VERSION = "1.0";
|
|
5
|
-
// Mapping of test frameworks to their corresponding Maven archetype framework names
|
|
6
|
-
const JAVA_FRAMEWORK_MAP = {
|
|
7
|
-
testng: "testng",
|
|
8
|
-
junit5: "junit5",
|
|
9
|
-
junit4: "junit4",
|
|
10
|
-
cucumber: "cucumber-testng",
|
|
11
|
-
};
|
|
12
|
-
// Template for Node.js SDK setup instructions
|
|
13
|
-
const NODEJS_SDK_INSTRUCTIONS = (username, accessKey) => `---STEP---
|
|
14
|
-
Install BrowserStack Node SDK using command:
|
|
15
|
-
\`\`\`bash
|
|
16
|
-
npm i -D browserstack-node-sdk@latest
|
|
17
|
-
\`\`\`
|
|
18
|
-
---STEP---
|
|
19
|
-
Run the following command to setup browserstack sdk:
|
|
20
|
-
\`\`\`bash
|
|
21
|
-
npx setup --username ${username} --key ${accessKey}
|
|
22
|
-
\`\`\``;
|
|
23
|
-
// Template for Gradle setup instructions (platform-independent)
|
|
24
|
-
const GRADLE_SETUP_INSTRUCTIONS = `
|
|
25
|
-
**For Gradle setup:**
|
|
26
|
-
1. Add browserstack-java-sdk to dependencies:
|
|
27
|
-
compileOnly 'com.browserstack:browserstack-java-sdk:latest.release'
|
|
28
|
-
|
|
29
|
-
2. Add browserstackSDK path variable:
|
|
30
|
-
def browserstackSDKArtifact = configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.find { it.name == 'browserstack-java-sdk' }
|
|
31
|
-
|
|
32
|
-
3. Add javaagent to gradle tasks:
|
|
33
|
-
jvmArgs "-javaagent:\${browserstackSDKArtifact.file}"
|
|
34
|
-
`;
|
|
35
|
-
// Generates Maven archetype command for Windows platform
|
|
36
|
-
function getMavenCommandForWindows(framework, mavenFramework) {
|
|
37
|
-
return (`mvn archetype:generate -B ` +
|
|
38
|
-
`-DarchetypeGroupId="${MAVEN_ARCHETYPE_GROUP_ID}" ` +
|
|
39
|
-
`-DarchetypeArtifactId="${MAVEN_ARCHETYPE_ARTIFACT_ID}" ` +
|
|
40
|
-
`-DarchetypeVersion="${MAVEN_ARCHETYPE_VERSION}" ` +
|
|
41
|
-
`-DgroupId="${MAVEN_ARCHETYPE_GROUP_ID}" ` +
|
|
42
|
-
`-DartifactId="${MAVEN_ARCHETYPE_ARTIFACT_ID}" ` +
|
|
43
|
-
`-Dversion="${MAVEN_ARCHETYPE_VERSION}" ` +
|
|
44
|
-
`-DBROWSERSTACK_USERNAME="${process.env.BROWSERSTACK_USERNAME}" ` +
|
|
45
|
-
`-DBROWSERSTACK_ACCESS_KEY="${process.env.BROWSERSTACK_ACCESS_KEY}" ` +
|
|
46
|
-
`-DBROWSERSTACK_FRAMEWORK="${mavenFramework}"`);
|
|
47
|
-
}
|
|
48
|
-
// Generates Maven archetype command for Unix-like platforms (macOS/Linux)
|
|
49
|
-
function getMavenCommandForUnix(username, accessKey, mavenFramework) {
|
|
50
|
-
return `mvn archetype:generate -B -DarchetypeGroupId=${MAVEN_ARCHETYPE_GROUP_ID} \\
|
|
51
|
-
-DarchetypeArtifactId=${MAVEN_ARCHETYPE_ARTIFACT_ID} -DarchetypeVersion=${MAVEN_ARCHETYPE_VERSION} \\
|
|
52
|
-
-DgroupId=${MAVEN_ARCHETYPE_GROUP_ID} -DartifactId=${MAVEN_ARCHETYPE_ARTIFACT_ID} -Dversion=${MAVEN_ARCHETYPE_VERSION} \\
|
|
53
|
-
-DBROWSERSTACK_USERNAME="${username}" \\
|
|
54
|
-
-DBROWSERSTACK_ACCESS_KEY="${accessKey}" \\
|
|
55
|
-
-DBROWSERSTACK_FRAMEWORK="${mavenFramework}"`;
|
|
56
|
-
}
|
|
57
|
-
// Generates Java SDK setup instructions with Maven/Gradle options
|
|
58
|
-
function getJavaSDKInstructions(framework, username, accessKey) {
|
|
59
|
-
const mavenFramework = getJavaFrameworkForMaven(framework);
|
|
60
|
-
const isWindows = process.platform === "win32";
|
|
61
|
-
const platformLabel = isWindows ? "Windows" : "macOS/Linux";
|
|
62
|
-
const mavenCommand = isWindows
|
|
63
|
-
? getMavenCommandForWindows(framework, mavenFramework)
|
|
64
|
-
: getMavenCommandForUnix(username, accessKey, mavenFramework);
|
|
65
|
-
return `---STEP---
|
|
66
|
-
Install BrowserStack Java SDK
|
|
67
|
-
|
|
68
|
-
**Maven command for ${framework} (${platformLabel}):**
|
|
69
|
-
Run the command, it is required to generate the browserstack-sdk-archetype-integrate project:
|
|
70
|
-
${mavenCommand}
|
|
71
|
-
|
|
72
|
-
Alternative setup for Gradle users:
|
|
73
|
-
${GRADLE_SETUP_INSTRUCTIONS}`;
|
|
74
|
-
}
|
|
75
|
-
// Main function to get SDK setup commands based on language and framework
|
|
76
|
-
export function getSDKPrefixCommand(language, framework, username, accessKey) {
|
|
77
|
-
switch (language) {
|
|
78
|
-
case "nodejs":
|
|
79
|
-
return NODEJS_SDK_INSTRUCTIONS(username, accessKey);
|
|
80
|
-
case "java":
|
|
81
|
-
return getJavaSDKInstructions(framework, username, accessKey);
|
|
82
|
-
default:
|
|
83
|
-
return "";
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
export function getJavaFrameworkForMaven(framework) {
|
|
87
|
-
return JAVA_FRAMEWORK_MAP[framework] || framework;
|
|
88
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for generating BrowserStack configuration files.
|
|
3
|
-
*/
|
|
4
|
-
export function generateBrowserStackYMLInstructions(desiredPlatforms, enablePercy = false, projectName) {
|
|
5
|
-
let ymlContent = `
|
|
6
|
-
# ======================
|
|
7
|
-
# BrowserStack Reporting
|
|
8
|
-
# ======================
|
|
9
|
-
# A single name for your project to organize all your tests. This is required for Percy.
|
|
10
|
-
projectName: ${projectName}
|
|
11
|
-
# TODO: Replace these sample values with your actual project details
|
|
12
|
-
buildName: Sample-Build
|
|
13
|
-
|
|
14
|
-
# =======================================
|
|
15
|
-
# Platforms (Browsers / Devices to test)
|
|
16
|
-
# =======================================
|
|
17
|
-
# Platforms object contains all the browser / device combinations you want to test on.
|
|
18
|
-
# Generate this on the basis of the following platforms requested by the user:
|
|
19
|
-
# Requested platforms: ${desiredPlatforms}
|
|
20
|
-
platforms:
|
|
21
|
-
- os: Windows
|
|
22
|
-
osVersion: 11
|
|
23
|
-
browserName: chrome
|
|
24
|
-
browserVersion: latest
|
|
25
|
-
|
|
26
|
-
# =======================
|
|
27
|
-
# Parallels per Platform
|
|
28
|
-
# =======================
|
|
29
|
-
# The number of parallel threads to be used for each platform set.
|
|
30
|
-
# BrowserStack's SDK runner will select the best strategy based on the configured value
|
|
31
|
-
#
|
|
32
|
-
# Example 1 - If you have configured 3 platforms and set \`parallelsPerPlatform\` as 2, a total of 6 (2 * 3) parallel threads will be used on BrowserStack
|
|
33
|
-
#
|
|
34
|
-
# Example 2 - If you have configured 1 platform and set \`parallelsPerPlatform\` as 5, a total of 5 (1 * 5) parallel threads will be used on BrowserStack
|
|
35
|
-
parallelsPerPlatform: 1
|
|
36
|
-
|
|
37
|
-
# =================
|
|
38
|
-
# Local Testing
|
|
39
|
-
# =================
|
|
40
|
-
# Set to true to test local
|
|
41
|
-
browserstackLocal: true
|
|
42
|
-
|
|
43
|
-
# ===================
|
|
44
|
-
# Debugging features
|
|
45
|
-
# ===================
|
|
46
|
-
debug: true # Visual logs, text logs, etc.
|
|
47
|
-
testObservability: true # For Test Observability`;
|
|
48
|
-
if (enablePercy) {
|
|
49
|
-
ymlContent += `
|
|
50
|
-
|
|
51
|
-
# =====================
|
|
52
|
-
# Percy Visual Testing
|
|
53
|
-
# =====================
|
|
54
|
-
# Set percy to true to enable visual testing.
|
|
55
|
-
# Set percyCaptureMode to 'manual' to control when screenshots are taken.
|
|
56
|
-
percy: true
|
|
57
|
-
percyCaptureMode: manual`;
|
|
58
|
-
}
|
|
59
|
-
return `
|
|
60
|
-
---STEP---
|
|
61
|
-
Create a browserstack.yml file in the project root. The file should be in the following format:
|
|
62
|
-
|
|
63
|
-
\`\`\`yaml${ymlContent}
|
|
64
|
-
\`\`\`
|
|
65
|
-
\n`;
|
|
66
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ConfigMapping } from "../common/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* ---------- PYTHON INSTRUCTIONS ----------
|
|
4
|
-
*/
|
|
5
|
-
export declare const pythonInstructions: (username: string, accessKey: string) => {
|
|
6
|
-
setup: string;
|
|
7
|
-
run: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const generatePythonFrameworkInstructions: (framework: string) => (username: string, accessKey: string) => {
|
|
10
|
-
setup: string;
|
|
11
|
-
run: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const robotInstructions: (username: string, accessKey: string) => {
|
|
14
|
-
setup: string;
|
|
15
|
-
run: string;
|
|
16
|
-
};
|
|
17
|
-
export declare const behaveInstructions: (username: string, accessKey: string) => {
|
|
18
|
-
setup: string;
|
|
19
|
-
run: string;
|
|
20
|
-
};
|
|
21
|
-
export declare const pytestInstructions: (username: string, accessKey: string) => {
|
|
22
|
-
setup: string;
|
|
23
|
-
run: string;
|
|
24
|
-
};
|
|
25
|
-
export declare const javaInstructions: (username: string, accessKey: string) => {
|
|
26
|
-
setup: string;
|
|
27
|
-
run: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* ---------- CSharp INSTRUCTIONS ----------
|
|
31
|
-
*/
|
|
32
|
-
export declare const csharpCommonInstructions: (username: string, accessKey: string) => {
|
|
33
|
-
setup: string;
|
|
34
|
-
run: string;
|
|
35
|
-
};
|
|
36
|
-
export declare const csharpPlaywrightCommonInstructions: (username: string, accessKey: string) => {
|
|
37
|
-
setup: string;
|
|
38
|
-
run: string;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* ---------- NODEJS INSTRUCTIONS ----------
|
|
42
|
-
*/
|
|
43
|
-
export declare const nodejsInstructions: (username: string, accessKey: string) => {
|
|
44
|
-
setup: string;
|
|
45
|
-
run: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* ---------- EXPORT CONFIG ----------
|
|
49
|
-
*/
|
|
50
|
-
export declare const webdriverioInstructions: (username: string, accessKey: string) => {
|
|
51
|
-
setup: string;
|
|
52
|
-
run: string;
|
|
53
|
-
};
|
|
54
|
-
export declare const cypressInstructions: (username: string, accessKey: string) => {
|
|
55
|
-
setup: string;
|
|
56
|
-
run: string;
|
|
57
|
-
};
|
|
58
|
-
export declare const SUPPORTED_CONFIGURATIONS: ConfigMapping;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as constants from "./constants.js";
|
|
2
|
-
export const SUPPORTED_CONFIGURATIONS = {
|
|
3
|
-
python: {
|
|
4
|
-
playwright: {
|
|
5
|
-
pytest: { instructions: constants.pythonInstructions },
|
|
6
|
-
},
|
|
7
|
-
selenium: {
|
|
8
|
-
pytest: { instructions: constants.pytestInstructions },
|
|
9
|
-
robot: { instructions: constants.robotInstructions },
|
|
10
|
-
behave: { instructions: constants.behaveInstructions },
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
java: {
|
|
14
|
-
playwright: {
|
|
15
|
-
junit4: { instructions: constants.javaInstructions },
|
|
16
|
-
junit5: { instructions: constants.javaInstructions },
|
|
17
|
-
testng: { instructions: constants.javaInstructions },
|
|
18
|
-
},
|
|
19
|
-
selenium: {
|
|
20
|
-
testng: { instructions: constants.javaInstructions },
|
|
21
|
-
cucumber: { instructions: constants.javaInstructions },
|
|
22
|
-
junit4: { instructions: constants.javaInstructions },
|
|
23
|
-
junit5: { instructions: constants.javaInstructions },
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
csharp: {
|
|
27
|
-
playwright: {
|
|
28
|
-
nunit: { instructions: constants.csharpPlaywrightCommonInstructions },
|
|
29
|
-
mstest: { instructions: constants.csharpPlaywrightCommonInstructions },
|
|
30
|
-
},
|
|
31
|
-
selenium: {
|
|
32
|
-
xunit: { instructions: constants.csharpCommonInstructions },
|
|
33
|
-
nunit: { instructions: constants.csharpCommonInstructions },
|
|
34
|
-
mstest: { instructions: constants.csharpCommonInstructions },
|
|
35
|
-
specflow: { instructions: constants.csharpCommonInstructions },
|
|
36
|
-
reqnroll: { instructions: constants.csharpCommonInstructions },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
nodejs: {
|
|
40
|
-
playwright: {
|
|
41
|
-
jest: { instructions: constants.nodejsInstructions },
|
|
42
|
-
codeceptjs: { instructions: constants.nodejsInstructions },
|
|
43
|
-
playwright: { instructions: constants.nodejsInstructions },
|
|
44
|
-
},
|
|
45
|
-
selenium: {
|
|
46
|
-
jest: { instructions: constants.nodejsInstructions },
|
|
47
|
-
webdriverio: { instructions: constants.webdriverioInstructions },
|
|
48
|
-
mocha: { instructions: constants.nodejsInstructions },
|
|
49
|
-
cucumber: { instructions: constants.nodejsInstructions },
|
|
50
|
-
nightwatch: { instructions: constants.nodejsInstructions },
|
|
51
|
-
codeceptjs: { instructions: constants.nodejsInstructions },
|
|
52
|
-
},
|
|
53
|
-
cypress: {
|
|
54
|
-
cypress: { instructions: constants.cypressInstructions },
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// BrowserStack SDK utilities
|
|
2
|
-
export { runBstackSDKOnly } from "./sdkHandler.js";
|
|
3
|
-
export { getSDKPrefixCommand, getJavaFrameworkForMaven } from "./commands.js";
|
|
4
|
-
export { generateBrowserStackYMLInstructions } from "./configUtils.js";
|
|
5
|
-
export { SUPPORTED_CONFIGURATIONS } from "./frameworks.js";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RunTestsInstructionResult } from "../common/types.js";
|
|
2
|
-
import { RunTestsOnBrowserStackInput } from "../common/schema.js";
|
|
3
|
-
import { BrowserStackConfig } from "../../../lib/types.js";
|
|
4
|
-
export declare function runBstackSDKOnly(input: RunTestsOnBrowserStackInput, config: BrowserStackConfig, isPercyAutomate?: boolean): RunTestsInstructionResult;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { getBrowserStackAuth } from "../../../lib/get-auth.js";
|
|
2
|
-
import { getSDKPrefixCommand } from "./commands.js";
|
|
3
|
-
import { generateBrowserStackYMLInstructions } from "./configUtils.js";
|
|
4
|
-
import { getInstructionsForProjectConfiguration } from "../common/instructionUtils.js";
|
|
5
|
-
export function runBstackSDKOnly(input, config, isPercyAutomate = false) {
|
|
6
|
-
const steps = [];
|
|
7
|
-
const authString = getBrowserStackAuth(config);
|
|
8
|
-
const [username, accessKey] = authString.split(":");
|
|
9
|
-
// Handle frameworks with unique setup instructions that don't use browserstack.yml
|
|
10
|
-
if (input.detectedBrowserAutomationFramework === "cypress" ||
|
|
11
|
-
input.detectedTestingFramework === "webdriverio") {
|
|
12
|
-
const frameworkInstructions = getInstructionsForProjectConfiguration(input.detectedBrowserAutomationFramework, input.detectedTestingFramework, input.detectedLanguage, username, accessKey);
|
|
13
|
-
if (frameworkInstructions) {
|
|
14
|
-
if (frameworkInstructions.setup) {
|
|
15
|
-
steps.push({
|
|
16
|
-
type: "instruction",
|
|
17
|
-
title: "Framework-Specific Setup",
|
|
18
|
-
content: frameworkInstructions.setup,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (frameworkInstructions.run && !isPercyAutomate) {
|
|
22
|
-
steps.push({
|
|
23
|
-
type: "instruction",
|
|
24
|
-
title: "Run the tests",
|
|
25
|
-
content: frameworkInstructions.run,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
steps,
|
|
31
|
-
requiresPercy: false,
|
|
32
|
-
missingDependencies: [],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
// Default flow using browserstack.yml
|
|
36
|
-
const sdkSetupCommand = getSDKPrefixCommand(input.detectedLanguage, input.detectedTestingFramework, username, accessKey);
|
|
37
|
-
if (sdkSetupCommand) {
|
|
38
|
-
steps.push({
|
|
39
|
-
type: "instruction",
|
|
40
|
-
title: "Install BrowserStack SDK",
|
|
41
|
-
content: sdkSetupCommand,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const ymlInstructions = generateBrowserStackYMLInstructions(input.desiredPlatforms, false, input.projectName);
|
|
45
|
-
if (ymlInstructions) {
|
|
46
|
-
steps.push({
|
|
47
|
-
type: "instruction",
|
|
48
|
-
title: "Configure browserstack.yml",
|
|
49
|
-
content: ymlInstructions,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const frameworkInstructions = getInstructionsForProjectConfiguration(input.detectedBrowserAutomationFramework, input.detectedTestingFramework, input.detectedLanguage, username, accessKey);
|
|
53
|
-
if (frameworkInstructions) {
|
|
54
|
-
if (frameworkInstructions.setup) {
|
|
55
|
-
steps.push({
|
|
56
|
-
type: "instruction",
|
|
57
|
-
title: "Framework-Specific Setup",
|
|
58
|
-
content: frameworkInstructions.setup,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
if (frameworkInstructions.run && !isPercyAutomate) {
|
|
62
|
-
steps.push({
|
|
63
|
-
type: "instruction",
|
|
64
|
-
title: "Run the tests",
|
|
65
|
-
content: frameworkInstructions.run,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return {
|
|
70
|
-
steps,
|
|
71
|
-
requiresPercy: false,
|
|
72
|
-
missingDependencies: [],
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const IMPORTANT_SETUP_WARNING = "IMPORTANT: DO NOT SKIP ANY STEP. All the setup steps described below MUST be executed regardless of any existing configuration or setup. This ensures proper BrowserStack SDK setup.";
|
|
2
|
-
export declare const SETUP_PERCY_DESCRIPTION = "Set up Percy visual testing for your project. This supports both Percy Web Standalone and Percy Automate.";
|
|
3
|
-
export declare const LIST_TEST_FILES_DESCRIPTION = "Lists all test files for a given set of directories.";
|
|
4
|
-
export declare const PERCY_SNAPSHOT_COMMANDS_DESCRIPTION = "Adds Percy snapshot commands to the specified test files.";
|
|
5
|
-
export declare const RUN_ON_BROWSERSTACK_DESCRIPTION = "Set up and run automated web-based tests on BrowserStack using the BrowserStack SDK. Use this tool for functional or integration test setup on BrowserStack only. For any visual testing or Percy integration, use the dedicated Percy setup tool. Example prompts: run this test on browserstack; set up this project for browserstack.";
|
|
6
|
-
export declare const SIMULATE_PERCY_CHANGE_DESCRIPTION = "This tool helps new users simulate a Percy visual change by guiding them to make a visible UI modification, rerun Percy, and verify that the change is detected. Only Percy web is supported";
|
|
7
|
-
export declare const PERCY_REPLACE_REGEX: RegExp;
|
|
8
|
-
export declare const PERCY_SNAPSHOT_INSTRUCTION = "\nInvoke listTestFiles() with the provided directories from user to gather all test files in memory and obtain the generated UUID ---STEP---\nProcess files in STRICT sequential order using tool addPercySnapshotCommands() with below instructions:\n- Start with index 0\n- Then index 1 \n- Then index 2\n- Continue sequentially until the last index\n- DO NOT skip any index numbers\n- DO NOT jump to random indices like 10, 20, 30\n- DO NOT worry about time consuming and any constraints.\n- DO NOT STOP until you add commands in all the files or you reach end of the files.\n";
|
|
9
|
-
export declare const PERCY_SIMULATE_INSTRUCTION = "\nMANDATORY: Aggressive, Accurate Percy Snapshots Integration\n\nPrerequisite: Before making any code changes in the user's repo, switch to a branch named temp-percy (run git init first if the repo is not yet initialized).\n\nYou MUST follow these steps with NO EXCEPTIONS:\n1. Identify 4-5 key test files in the project that are critical for visual testing.\n2. For EACH identified test file, analyze the code to find EVERY location where a Percy snapshot should be called (e.g., after each navigation, UI change, or significant state in tests).\n3. Insert snapshot calls at ALL such points, not just the first or most obvious one.\n\nIteratively update every selected test file with percy snapshot calls at all identified points, ensuring comprehensive coverage of visual changes.";
|
|
10
|
-
export declare const PERCY_SIMULATION_DRIVER_INSTRUCTION = "\nMANDATORY: Step-by-Step Percy Visual Change Simulation\nYou MUST follow these steps with NO EXCEPTIONS:\n\nSTEP 1: At this case we have added Percy snapshot commands to the test files at the appropriate locations (e.g., after navigation, UI change, or significant state). \n- Use ONLY existing snapshot names.\n- Do NOT add any popup injection or visual changes yet.\n- Do NOT run any Percy builds at this stage.\n\nSTEP 2: Run ONE comprehensive baseline Percy build that executes ALL tests containing Percy snapshots in a SINGLE build. This creates one baseline build with all snapshots for comparison. Use a command like: npx percy exec -- python -m pytest tests/ -k 'test_name1 or test_name2 or test_name3' -v to run multiple specific tests in one build.\"\n\nSTEP 3: Modify your test to inject a visible UI change (such as a popup) IMMEDIATELY BEFORE an EXISTING snapshot command (e.g., before percy_snapshot(self.driver, \"screenshot name\")).\n- Do NOT add a new snapshot name for the popup.\n- The popup must appear in an existing snapshot, not a new one.\n- Add this popup code in some test files before the percy_snapshot command you've added, to display the visual changes.\n\n```Javascript\npopup_script = `\nvar popup = document.createElement('div');\npopup.id = 'percy-test-popup';\npopup.style.cssText = popup.style.cssText = `\n /* TODO: Add styles to make the popup large, centered, and visually noticeable.\n Suggested properties: position: fixed; top/left; transform; background; color; font-size; padding; z-index; animation, etc. */\n`;\npopup.innerHTML = 'PERCY TEST<br>VISUAL CHANGE<br>DETECTED!';\ndocument.body.appendChild(popup);\n`;\n\n# Insert this just before the EXISTING snapshot command:\ndriver.execute_script(popup_script)\npercy_snapshot(self.driver, \"Before Adding to Cart\") # (Do NOT change the snapshot name, keep existing one)\n```\n\nSTEP 4: Run a second Percy build.\n- The snapshot names must remain the same as in the baseline.\n- The visual change should now appear in the same snapshot as before.\n- Use the same build command you ran for the baseline.\n\nSTEP 5: Compare the two Percy builds to see the detected visual difference.\n\nSTEP 6: Now ask user if they want to setup percy for full project coverage? If yes, call the \"setupPercyVisualTesting\" tool to enable complete coverage for the entire project.\n\nCONSTRAINTS:\n- Do NOT run any builds until explicitly instructed in the steps.\n- Do NOT add new snapshot names\u2014only use existing ones.\n- Do NOT add popup injection until the baseline is established.\n- Visual changes must appear in EXISTING snapshots, not new ones.\n\nVALIDATION CHECKPOINTS (before proceeding to the next step):\n- Are you adding only snapshot commands (not running builds)?\n- Are you reusing existing snapshot names (not creating new ones)?\n- Have you established the baseline first (before adding visual changes)\n\nCRITICAL: \nDo NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total: (1) baseline build with all original snapshots, (2) modified build with the same tests but visual changes injected.\n";
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export const IMPORTANT_SETUP_WARNING = "IMPORTANT: DO NOT SKIP ANY STEP. All the setup steps described below MUST be executed regardless of any existing configuration or setup. This ensures proper BrowserStack SDK setup.";
|
|
2
|
-
export const SETUP_PERCY_DESCRIPTION = "Set up Percy visual testing for your project. This supports both Percy Web Standalone and Percy Automate.";
|
|
3
|
-
export const LIST_TEST_FILES_DESCRIPTION = "Lists all test files for a given set of directories.";
|
|
4
|
-
export const PERCY_SNAPSHOT_COMMANDS_DESCRIPTION = "Adds Percy snapshot commands to the specified test files.";
|
|
5
|
-
export const RUN_ON_BROWSERSTACK_DESCRIPTION = "Set up and run automated web-based tests on BrowserStack using the BrowserStack SDK. Use this tool for functional or integration test setup on BrowserStack only. For any visual testing or Percy integration, use the dedicated Percy setup tool. Example prompts: run this test on browserstack; set up this project for browserstack.";
|
|
6
|
-
export const SIMULATE_PERCY_CHANGE_DESCRIPTION = "This tool helps new users simulate a Percy visual change by guiding them to make a visible UI modification, rerun Percy, and verify that the change is detected. Only Percy web is supported";
|
|
7
|
-
export const PERCY_REPLACE_REGEX = /Invoke listTestFiles\(\) with the provided directories[\s\S]*?- DO NOT STOP until you add commands in all the files or you reach end of the files\./;
|
|
8
|
-
export const PERCY_SNAPSHOT_INSTRUCTION = `
|
|
9
|
-
Invoke listTestFiles() with the provided directories from user to gather all test files in memory and obtain the generated UUID ---STEP---
|
|
10
|
-
Process files in STRICT sequential order using tool addPercySnapshotCommands() with below instructions:
|
|
11
|
-
- Start with index 0
|
|
12
|
-
- Then index 1
|
|
13
|
-
- Then index 2
|
|
14
|
-
- Continue sequentially until the last index
|
|
15
|
-
- DO NOT skip any index numbers
|
|
16
|
-
- DO NOT jump to random indices like 10, 20, 30
|
|
17
|
-
- DO NOT worry about time consuming and any constraints.
|
|
18
|
-
- DO NOT STOP until you add commands in all the files or you reach end of the files.
|
|
19
|
-
`;
|
|
20
|
-
export const PERCY_SIMULATE_INSTRUCTION = `
|
|
21
|
-
MANDATORY: Aggressive, Accurate Percy Snapshots Integration
|
|
22
|
-
|
|
23
|
-
Prerequisite: Before making any code changes in the user's repo, switch to a branch named temp-percy (run git init first if the repo is not yet initialized).
|
|
24
|
-
|
|
25
|
-
You MUST follow these steps with NO EXCEPTIONS:
|
|
26
|
-
1. Identify 4-5 key test files in the project that are critical for visual testing.
|
|
27
|
-
2. For EACH identified test file, analyze the code to find EVERY location where a Percy snapshot should be called (e.g., after each navigation, UI change, or significant state in tests).
|
|
28
|
-
3. Insert snapshot calls at ALL such points, not just the first or most obvious one.
|
|
29
|
-
|
|
30
|
-
Iteratively update every selected test file with percy snapshot calls at all identified points, ensuring comprehensive coverage of visual changes.`;
|
|
31
|
-
export const PERCY_SIMULATION_DRIVER_INSTRUCTION = `
|
|
32
|
-
MANDATORY: Step-by-Step Percy Visual Change Simulation
|
|
33
|
-
You MUST follow these steps with NO EXCEPTIONS:
|
|
34
|
-
|
|
35
|
-
STEP 1: At this case we have added Percy snapshot commands to the test files at the appropriate locations (e.g., after navigation, UI change, or significant state).
|
|
36
|
-
- Use ONLY existing snapshot names.
|
|
37
|
-
- Do NOT add any popup injection or visual changes yet.
|
|
38
|
-
- Do NOT run any Percy builds at this stage.
|
|
39
|
-
|
|
40
|
-
STEP 2: Run ONE comprehensive baseline Percy build that executes ALL tests containing Percy snapshots in a SINGLE build. This creates one baseline build with all snapshots for comparison. Use a command like: npx percy exec -- python -m pytest tests/ -k 'test_name1 or test_name2 or test_name3' -v to run multiple specific tests in one build."
|
|
41
|
-
|
|
42
|
-
STEP 3: Modify your test to inject a visible UI change (such as a popup) IMMEDIATELY BEFORE an EXISTING snapshot command (e.g., before percy_snapshot(self.driver, "screenshot name")).
|
|
43
|
-
- Do NOT add a new snapshot name for the popup.
|
|
44
|
-
- The popup must appear in an existing snapshot, not a new one.
|
|
45
|
-
- Add this popup code in some test files before the percy_snapshot command you've added, to display the visual changes.
|
|
46
|
-
|
|
47
|
-
\`\`\`Javascript
|
|
48
|
-
popup_script = \`
|
|
49
|
-
var popup = document.createElement('div');
|
|
50
|
-
popup.id = 'percy-test-popup';
|
|
51
|
-
popup.style.cssText = popup.style.cssText = \`
|
|
52
|
-
/* TODO: Add styles to make the popup large, centered, and visually noticeable.
|
|
53
|
-
Suggested properties: position: fixed; top/left; transform; background; color; font-size; padding; z-index; animation, etc. */
|
|
54
|
-
\`;
|
|
55
|
-
popup.innerHTML = 'PERCY TEST<br>VISUAL CHANGE<br>DETECTED!';
|
|
56
|
-
document.body.appendChild(popup);
|
|
57
|
-
\`;
|
|
58
|
-
|
|
59
|
-
# Insert this just before the EXISTING snapshot command:
|
|
60
|
-
driver.execute_script(popup_script)
|
|
61
|
-
percy_snapshot(self.driver, "Before Adding to Cart") # (Do NOT change the snapshot name, keep existing one)
|
|
62
|
-
\`\`\`
|
|
63
|
-
|
|
64
|
-
STEP 4: Run a second Percy build.
|
|
65
|
-
- The snapshot names must remain the same as in the baseline.
|
|
66
|
-
- The visual change should now appear in the same snapshot as before.
|
|
67
|
-
- Use the same build command you ran for the baseline.
|
|
68
|
-
|
|
69
|
-
STEP 5: Compare the two Percy builds to see the detected visual difference.
|
|
70
|
-
|
|
71
|
-
STEP 6: Now ask user if they want to setup percy for full project coverage? If yes, call the "setupPercyVisualTesting" tool to enable complete coverage for the entire project.
|
|
72
|
-
|
|
73
|
-
CONSTRAINTS:
|
|
74
|
-
- Do NOT run any builds until explicitly instructed in the steps.
|
|
75
|
-
- Do NOT add new snapshot names—only use existing ones.
|
|
76
|
-
- Do NOT add popup injection until the baseline is established.
|
|
77
|
-
- Visual changes must appear in EXISTING snapshots, not new ones.
|
|
78
|
-
|
|
79
|
-
VALIDATION CHECKPOINTS (before proceeding to the next step):
|
|
80
|
-
- Are you adding only snapshot commands (not running builds)?
|
|
81
|
-
- Are you reusing existing snapshot names (not creating new ones)?
|
|
82
|
-
- Have you established the baseline first (before adding visual changes)
|
|
83
|
-
|
|
84
|
-
CRITICAL:
|
|
85
|
-
Do NOT run tests separately or create multiple builds during baseline establishment. The goal is to have exactly TWO builds total: (1) baseline build with all original snapshots, (2) modified build with the same tests but visual changes injected.
|
|
86
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function formatInstructionsWithNumbers(instructionText, separator = "---STEP---") {
|
|
2
|
-
// Split the instructions by the separator
|
|
3
|
-
const steps = instructionText
|
|
4
|
-
.split(separator)
|
|
5
|
-
.map((step) => step.trim())
|
|
6
|
-
.filter((step) => step.length > 0);
|
|
7
|
-
// If no separators found, treat the entire text as one step
|
|
8
|
-
if (steps.length === 1 && !instructionText.includes(separator)) {
|
|
9
|
-
return {
|
|
10
|
-
formattedSteps: `**Step 1:**\n${instructionText.trim()}`,
|
|
11
|
-
stepCount: 1,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
// Format each step with numbering
|
|
15
|
-
const formattedSteps = steps
|
|
16
|
-
.map((step, index) => {
|
|
17
|
-
return `**Step ${index + 1}:**\n${step.trim()}`;
|
|
18
|
-
})
|
|
19
|
-
.join("\n\n");
|
|
20
|
-
return {
|
|
21
|
-
formattedSteps,
|
|
22
|
-
stepCount: steps.length,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export function generateVerificationMessage(stepCount) {
|
|
26
|
-
return `**✅ Verification:**\nPlease verify that you have completed all ${stepCount} steps above to ensure proper setup. If you encounter any issues, double-check each step and ensure all commands executed successfully.`;
|
|
27
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core instruction configuration utilities for runTestsOnBrowserStack tool.
|
|
3
|
-
*/
|
|
4
|
-
import { SDKSupportedLanguage, SDKSupportedBrowserAutomationFramework, SDKSupportedTestingFramework } from "./types.js";
|
|
5
|
-
export declare const getInstructionsForProjectConfiguration: (detectedBrowserAutomationFramework: SDKSupportedBrowserAutomationFramework, detectedTestingFramework: SDKSupportedTestingFramework, detectedLanguage: SDKSupportedLanguage, username: string, accessKey: string) => {
|
|
6
|
-
setup: string;
|
|
7
|
-
run: string;
|
|
8
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core instruction configuration utilities for runTestsOnBrowserStack tool.
|
|
3
|
-
*/
|
|
4
|
-
import { SUPPORTED_CONFIGURATIONS } from "../bstack/frameworks.js";
|
|
5
|
-
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";
|
|
6
|
-
export const getInstructionsForProjectConfiguration = (detectedBrowserAutomationFramework, detectedTestingFramework, detectedLanguage, username, accessKey) => {
|
|
7
|
-
const configuration = SUPPORTED_CONFIGURATIONS[detectedLanguage];
|
|
8
|
-
if (!configuration) {
|
|
9
|
-
throw new Error(`BrowserStack MCP Server currently does not support ${detectedLanguage}, ${errorMessageSuffix}`);
|
|
10
|
-
}
|
|
11
|
-
if (!configuration[detectedBrowserAutomationFramework]) {
|
|
12
|
-
throw new Error(`BrowserStack MCP Server currently does not support ${detectedBrowserAutomationFramework} for ${detectedLanguage}, ${errorMessageSuffix}`);
|
|
13
|
-
}
|
|
14
|
-
if (!configuration[detectedBrowserAutomationFramework][detectedTestingFramework]) {
|
|
15
|
-
throw new Error(`BrowserStack MCP Server currently does not support ${detectedTestingFramework} for ${detectedBrowserAutomationFramework} on ${detectedLanguage}, ${errorMessageSuffix}`);
|
|
16
|
-
}
|
|
17
|
-
const instructionFunction = configuration[detectedBrowserAutomationFramework][detectedTestingFramework]
|
|
18
|
-
.instructions;
|
|
19
|
-
return instructionFunction(username, accessKey);
|
|
20
|
-
};
|