Skip to content

Commit

Permalink
fix: Tune session startup (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Feb 21, 2025
1 parent 5fd6c5c commit 7dbdbe8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 8 additions & 2 deletions lib/wda-mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -480,3 +481,8 @@ export class WDAMacServer {
const WDA_MAC_SERVER = new WDAMacServer();

export default WDA_MAC_SERVER;

/**
* @typedef {Object} SessionOptions
* @property {string} [reqBasePath]
*/

0 comments on commit 7dbdbe8

Please sign in to comment.