Skip to content

Commit 8bcce0e

Browse files
refactor: rename browserstack_app_url to browserstackAppUrl for consistency
1 parent e7b971c commit 8bcce0e

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

src/tools/appautomate-utils/appautomate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ export function validateArgs(args: {
9292
desiredPlatformVersion: string;
9393
appPath?: string;
9494
desiredPhone: string;
95-
browserstack_app_url?: string;
95+
browserstackAppUrl?: string;
9696
}): void {
9797
const {
9898
desiredPlatform,
9999
desiredPlatformVersion,
100100
appPath,
101101
desiredPhone,
102-
browserstack_app_url,
102+
browserstackAppUrl,
103103
} = args;
104104

105105
if (!desiredPlatform || !desiredPhone) {
@@ -114,8 +114,8 @@ export function validateArgs(args: {
114114
);
115115
}
116116

117-
if (!appPath && !browserstack_app_url) {
118-
throw new Error("Either appPath or browserstack_app_url must be provided");
117+
if (!appPath && !browserstackAppUrl) {
118+
throw new Error("Either appPath or browserstackAppUrl must be provided");
119119
}
120120

121121
// Only validate app path format if appPath is provided

src/tools/appautomate.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function takeAppScreenshot(args: {
5555
desiredPlatformVersion: string;
5656
appPath?: string;
5757
desiredPhone: string;
58-
browserstack_app_url?: string;
58+
browserstackAppUrl?: string;
5959
config: BrowserStackConfig;
6060
}): Promise<CallToolResult> {
6161
let driver;
@@ -65,7 +65,7 @@ async function takeAppScreenshot(args: {
6565
desiredPlatform,
6666
desiredPhone,
6767
appPath,
68-
browserstack_app_url,
68+
browserstackAppUrl,
6969
config,
7070
} = args;
7171
let { desiredPlatformVersion } = args;
@@ -106,13 +106,13 @@ async function takeAppScreenshot(args: {
106106
const [username, password] = authString.split(":");
107107

108108
let app_url: string;
109-
if (browserstack_app_url) {
110-
app_url = browserstack_app_url;
109+
if (browserstackAppUrl) {
110+
app_url = browserstackAppUrl;
111111
logger.info(`Using provided BrowserStack app URL: ${app_url}`);
112112
} else {
113113
if (!appPath) {
114114
throw new Error(
115-
"appPath is required when browserstack_app_url is not provided",
115+
"appPath is required when browserstackAppUrl is not provided",
116116
);
117117
}
118118
app_url = await uploadApp(appPath, username, password);
@@ -177,7 +177,7 @@ async function runAppTestsOnBrowserStack(
177177
args: {
178178
appPath?: string;
179179
testSuitePath?: string;
180-
browserstack_app_url?: string;
180+
browserstackAppUrl?: string;
181181
browserstack_test_suite_url?: string;
182182
devices: string[];
183183
project: string;
@@ -186,9 +186,9 @@ async function runAppTestsOnBrowserStack(
186186
config: BrowserStackConfig,
187187
): Promise<CallToolResult> {
188188
// Validate that either paths or URLs are provided for both app and test suite
189-
if (!args.browserstack_app_url && !args.appPath) {
189+
if (!args.browserstackAppUrl && !args.appPath) {
190190
throw new Error(
191-
"appPath is required when browserstack_app_url is not provided",
191+
"appPath is required when browserstackAppUrl is not provided",
192192
);
193193
}
194194
if (!args.browserstack_test_suite_url && !args.testSuitePath) {
@@ -201,8 +201,8 @@ async function runAppTestsOnBrowserStack(
201201
case AppTestPlatform.ESPRESSO: {
202202
try {
203203
let app_url: string;
204-
if (args.browserstack_app_url) {
205-
app_url = args.browserstack_app_url;
204+
if (args.browserstackAppUrl) {
205+
app_url = args.browserstackAppUrl;
206206
logger.info(`Using provided BrowserStack app URL: ${app_url}`);
207207
} else {
208208
app_url = await uploadEspressoApp(args.appPath!, config);
@@ -246,8 +246,8 @@ async function runAppTestsOnBrowserStack(
246246
case AppTestPlatform.XCUITEST: {
247247
try {
248248
let app_url: string;
249-
if (args.browserstack_app_url) {
250-
app_url = args.browserstack_app_url;
249+
if (args.browserstackAppUrl) {
250+
app_url = args.browserstackAppUrl;
251251
logger.info(`Using provided BrowserStack app URL: ${app_url}`);
252252
} else {
253253
app_url = await uploadXcuiApp(args.appPath!, config);

src/tools/applive-utils/start-session.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface StartSessionArgs {
1818
desiredPlatform: "android" | "ios";
1919
desiredPhone: string;
2020
desiredPlatformVersion: string;
21-
browserstack_app_url?: string;
21+
browserstackAppUrl?: string;
2222
}
2323

2424
interface StartSessionOptions {
@@ -37,7 +37,7 @@ export async function startSession(
3737
desiredPlatform,
3838
desiredPhone,
3939
desiredPlatformVersion,
40-
browserstack_app_url,
40+
browserstackAppUrl,
4141
} = args;
4242
const { config } = options;
4343

@@ -79,13 +79,13 @@ export async function startSession(
7979

8080
// 6) Upload app or use provided URL
8181
let app_url: string;
82-
if (browserstack_app_url) {
83-
app_url = browserstack_app_url;
82+
if (browserstackAppUrl) {
83+
app_url = browserstackAppUrl;
8484
logger.info(`Using provided BrowserStack app URL: ${app_url}`);
8585
} else {
8686
if (!appPath) {
8787
throw new Error(
88-
"appPath is required when browserstack_app_url is not provided",
88+
"appPath is required when browserstackAppUrl is not provided",
8989
);
9090
}
9191
const authString = getBrowserStackAuth(config);

src/tools/applive.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ export async function startAppLiveSession(
1616
desiredPlatformVersion: string;
1717
appPath?: string;
1818
desiredPhone: string;
19-
browserstack_app_url?: string;
19+
browserstackAppUrl?: string;
2020
},
2121
config: BrowserStackConfig,
2222
): Promise<CallToolResult> {
2323
if (!args.desiredPlatform) {
2424
throw new Error("You must provide a desiredPlatform.");
2525
}
2626

27-
if (!args.appPath && !args.browserstack_app_url) {
28-
throw new Error("You must provide either appPath or browserstack_app_url.");
27+
if (!args.appPath && !args.browserstackAppUrl) {
28+
throw new Error("You must provide either appPath or browserstackAppUrl.");
2929
}
3030

3131
if (!args.desiredPhone) {
3232
throw new Error("You must provide a desiredPhone.");
3333
}
3434

35-
// Only validate app path if it's provided (not using browserstack_app_url)
35+
// Only validate app path if it's provided (not using browserstackAppUrl)
3636
if (args.appPath) {
3737
if (args.desiredPlatform === "android" && !args.appPath.endsWith(".apk")) {
3838
throw new Error("You must provide a valid Android app path.");
@@ -60,7 +60,7 @@ export async function startAppLiveSession(
6060
desiredPlatform: args.desiredPlatform as "android" | "ios",
6161
desiredPhone: args.desiredPhone,
6262
desiredPlatformVersion: args.desiredPlatformVersion,
63-
browserstack_app_url: args.browserstack_app_url,
63+
browserstackAppUrl: args.browserstackAppUrl,
6464
},
6565
{ config },
6666
);

tests/tools/appautomate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('appautomate utils', () => {
6666

6767
it('should fail if app path is not provided', () => {
6868
const args = { ...validAndroidArgs, appPath: '' };
69-
expect(() => validateArgs(args)).toThrow('Either appPath or browserstack_app_url must be provided');
69+
expect(() => validateArgs(args)).toThrow('Either appPath or browserstackAppUrl must be provided');
7070
});
7171

7272
it('should fail if phone is not provided', () => {

tests/tools/applive.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('startAppLiveSession', () => {
8989

9090
it('should fail if app path is not provided', async () => {
9191
const args = { ...validAndroidArgs, appPath: '' };
92-
await expect(startAppLiveSession(args, mockConfig)).rejects.toThrow('You must provide either appPath or browserstack_app_url.');
92+
await expect(startAppLiveSession(args, mockConfig)).rejects.toThrow('You must provide either appPath or browserstackAppUrl.');
9393
});
9494

9595
it('should fail if phone is not provided', async () => {

0 commit comments

Comments
 (0)