diff --git a/lib/driver.js b/lib/driver.js index 512c3d0..66a7f6fb 100644 --- a/lib/driver.js +++ b/lib/driver.js @@ -126,8 +126,7 @@ export class Mac2Driver extends BaseDriver { log.info(`Prerun script output: ${output}`); } } - await this.wda.startSession({ - ...caps, + await this.wda.startSession(caps, { reqBasePath: this.basePath, }); } catch (e) { diff --git a/lib/wda-mac.js b/lib/wda-mac.js index 2dd804c..10ea28c 100644 --- a/lib/wda-mac.js +++ b/lib/wda-mac.js @@ -374,8 +374,9 @@ export class WDAMacServer { /** * * @param {import('@appium/types').StringRecord} caps + * @param {SessionOptions} [opts={}] */ - async startSession (caps) { + async startSession (caps, opts = {}) { this.serverStartupTimeoutMs = caps.serverStartupTimeout ?? this.serverStartupTimeoutMs; this.isProxyingToRemoteServer = !!caps.webDriverAgentMacUrl; @@ -406,7 +407,7 @@ export class WDAMacServer { keepAlive: true, }; if (caps.reqBasePath) { - proxyOpts.reqBasePath = caps.reqBasePath; + proxyOpts.reqBasePath = opts.reqBasePath; } this.proxy = new WDAMacProxy(proxyOpts); this.proxy.didProcessExit = false; @@ -480,3 +481,8 @@ export class WDAMacServer { const WDA_MAC_SERVER = new WDAMacServer(); export default WDA_MAC_SERVER; + +/** + * @typedef {Object} SessionOptions + * @property {string} [reqBasePath] + */ \ No newline at end of file