Skip to content

Commit 0eff1e9

Browse files
committed
Refactor: Initialize WebDriverIO directly to streamline app automation
1 parent 3f12cad commit 0eff1e9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/tools/appautomate.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import logger from "../logger";
55
import config from "../config";
66
import { trackMCP } from "../lib/instrumentation";
77
import { maybeCompressBase64 } from "../lib/utils";
8+
const { remote } = require('webdriverio');
89

910
import {
1011
getDevicesAndBrowsers,
@@ -42,13 +43,6 @@ enum Platform {
4243
IOS = "ios",
4344
}
4445

45-
// Initialize WebDriverIO dynamically to avoid top-level import issues
46-
let wdio: WebDriver;
47-
(async () => {
48-
const { remote } = await import("webdriverio");
49-
wdio = { remote };
50-
})();
51-
5246
/**
5347
* Launches an app on a selected BrowserStack device and takes a screenshot.
5448
*/
@@ -114,7 +108,7 @@ async function takeAppScreenshot(args: {
114108
};
115109

116110
logger.info("Starting WebDriver session on BrowserStack...");
117-
driver = await wdio.remote({
111+
driver = await remote({
118112
protocol: "https",
119113
hostname: "hub.browserstack.com",
120114
port: 443,

0 commit comments

Comments
 (0)