Skip to content

Commit 7e3d764

Browse files
committed
Linting ++
1 parent 8da4c98 commit 7e3d764

File tree

7 files changed

+14
-66
lines changed

7 files changed

+14
-66
lines changed

src/lib/version-resolver.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
* Else if exact match, returns that
44
* Else picks the numerically closest (or first)
55
*/
6-
export function resolveVersion(
7-
requested: string,
8-
available: string[],
9-
): string {
6+
export function resolveVersion(requested: string, available: string[]): string {
107
// strip duplicates & sort
118
const uniq = Array.from(new Set(available));
129

src/tools/appautomate-utils/appium-sdk/config-generator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ platforms:
4242
${platformConfigs}
4343
parallelsPerPlatform: 1
4444
browserstackLocal: true
45-
buildName: ${buildName}
45+
// TODO: replace projectName and buildName according to actual project
4646
projectName: ${projectName}
47+
buildName: ${buildName}
4748
debug: true
4849
networkLogs: true
4950
percy: false

src/tools/appautomate-utils/appium-sdk/constants.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,3 @@ export const SETUP_APP_AUTOMATE_SCHEMA = {
9191
.default("BStack-AppAutomate-Suite")
9292
.describe("Project name for organizing test runs on BrowserStack."),
9393
};
94-
95-
export const SETUP_APP_AUTOMATE_SCHEMA_LEGACY = {
96-
detectedFramework: z
97-
.nativeEnum(AppSDKSupportedFrameworkEnum)
98-
.describe(
99-
"The mobile automation framework configured in the project. Example: 'appium'",
100-
),
101-
102-
detectedTestingFramework: z
103-
.nativeEnum(AppSDKSupportedTestingFrameworkEnum)
104-
.describe(
105-
"The testing framework used in the project. Be precise with framework selection Example: 'testng', 'behave', 'pytest', 'robot'",
106-
),
107-
108-
detectedLanguage: z
109-
.nativeEnum(AppSDKSupportedLanguageEnum)
110-
.describe(
111-
"The programming language used in the project. Supports Java and C#. Example: 'java', 'csharp'",
112-
),
113-
114-
desiredPlatforms: z
115-
.array(z.nativeEnum(AppSDKSupportedPlatformEnum))
116-
.describe(
117-
"The mobile platforms the user wants to test on. Always ask this to the user, do not try to infer this. Example: ['android', 'ios']",
118-
),
119-
120-
appPath: z
121-
.string()
122-
.describe(
123-
"Path to the mobile app file (.apk for Android, .ipa for iOS). Can be a local file path or a BrowserStack app URL (bs://)",
124-
),
125-
project: z
126-
.string()
127-
.optional()
128-
.default("BStack-AppAutomate-Suite")
129-
.describe("Project name for organizing test runs on BrowserStack."),
130-
};

src/tools/appautomate-utils/appium-sdk/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { z } from "zod";
22
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
33
import { BrowserStackConfig } from "../../../lib/types.js";
44
import { getBrowserStackAuth } from "../../../lib/get-auth.js";
5+
import { validateAppAutomateDevices } from "../../sdk-utils/common/device-validator.js";
6+
57
import {
68
getAppUploadInstruction,
79
validateSupportforAppAutomate,
@@ -13,8 +15,6 @@ import {
1315
generateAppBrowserStackYMLInstructions,
1416
} from "./index.js";
1517

16-
import { validateAppAutomateDevices } from "../../sdk-utils/common/device-validator.js";
17-
1818
import {
1919
AppSDKSupportedLanguage,
2020
AppSDKSupportedTestingFramework,

src/tools/appautomate-utils/native-execution/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const RUN_APP_AUTOMATE_SCHEMA = {
2929
" zip -r Tests.zip *.xctestrun *-Runner.app\n\n" +
3030
"If in other directory, provide existing test file path",
3131
),
32-
devices: z
32+
devices: z
3333
.array(
3434
z.union([
3535
// Android: [android, deviceName, osVersion]

src/tools/sdk-utils/bstack/configUtils.ts

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,33 @@ export function generateBrowserStackYMLInstructions(config: {
77
projectName: string;
88
}): string {
99
const enablePercy = config.enablePercy || false;
10-
const projectName = config.projectName;
10+
const projectName = config.projectName || "BrowserStack Automate Build";
1111

1212
// Generate platform configurations using the utility function
1313
const platformConfigs = generatePlatformConfigs(config);
1414

15-
// Determine build name and step title
16-
const buildName =
17-
config.validatedEnvironments && config.validatedEnvironments.length > 0
18-
? `${projectName}-Build`
19-
: "Sample-Build";
20-
2115
const stepTitle =
22-
config.validatedEnvironments && config.validatedEnvironments.length > 0
23-
? "Create a browserstack.yml file in the project root with your validated device configurations:"
24-
: "Create a browserstack.yml file in the project root. The file should be in the following format:";
16+
"Create a browserstack.yml file in the project root with your validated device configurations:";
17+
18+
const buildName = `${projectName}-Build`;
2519

2620
let ymlContent = `
2721
# ======================
2822
# BrowserStack Reporting
2923
# ======================
24+
25+
# TODO: Replace these sample values with your actual project details
3026
projectName: ${projectName}
3127
buildName: ${buildName}
3228
3329
# =======================================
3430
# Platforms (Browsers / Devices to test)
3531
# =======================================`;
3632

37-
if (config.validatedEnvironments && config.validatedEnvironments.length > 0) {
38-
ymlContent += `
39-
# Auto-generated from validated device configurations
40-
platforms:
41-
${platformConfigs}`;
42-
} else {
43-
ymlContent += `
33+
ymlContent += `
4434
# Platforms object contains all the browser / device combinations you want to test on.
45-
# Generate this on the basis of the following platforms requested by the user:
46-
# Requested platforms: ${config.platforms || []}
4735
platforms:
4836
${platformConfigs}`;
49-
}
5037

5138
ymlContent += `
5239
@@ -55,6 +42,7 @@ ${platformConfigs}`;
5542
# =======================
5643
# The number of parallel threads to be used for each platform set.
5744
# BrowserStack's SDK runner will select the best strategy based on the configured value
45+
# The number of parallel threads to be used for each platform set.
5846
parallelsPerPlatform: 1
5947
6048
# =================

src/tools/sdk-utils/percy-bstack/handler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ export function runPercyWithBrowserstackSDK(
107107
}
108108

109109
const ymlInstructions = generateBrowserStackYMLInstructions({
110-
// For now, feed a normalized summary string from devices for the comment
111110
platforms:
112111
((input as any).devices as string[][] | undefined)?.map((t) =>
113112
t.join(" "),

0 commit comments

Comments
 (0)