Skip to content

Commit

Permalink
fix: Accept reqBasePath proxy option (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Feb 21, 2025
1 parent 4c224d8 commit 3f7bf30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
keyAlias: this.opts.keyAlias,
keyPassword: this.opts.keyPassword,
disableSuppressAccessibilityService: this.opts.disableSuppressAccessibilityService,
reqBasePath: this.basePath,
});
this.proxyReqRes = this.espresso.proxyReqRes.bind(this.espresso);
this.proxyCommand = this.espresso.proxyCommand.bind(this.espresso);
Expand Down
16 changes: 12 additions & 4 deletions lib/espresso-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,29 @@ class EspressoRunner {
/**@type {boolean} */
forceEspressoRebuild;

/**
*
* @param {import('@appium/types').AppiumLogger} log
* @param {import('@appium/types').StringRecord} opts
*/
constructor (log, opts = {}) {
for (let req of REQUIRED_PARAMS) {
for (const req of REQUIRED_PARAMS) {
if (!opts || !util.hasValue(opts[req])) {
throw new Error(`Option '${req}' is required!`);
}
this[req] = opts[req];
}
this.log = log;
this.jwproxy = new EspressoProxy({
const proxyOpts = {
log,
server: this.host,
port: this.systemPort,
base: '',
keepAlive: true,
});
};
if (opts.reqBasePath) {
proxyOpts.reqBasePath = opts.reqBasePath;
}
this.jwproxy = new EspressoProxy(proxyOpts);
this.proxyReqRes = this.jwproxy.proxyReqRes.bind(this.jwproxy);
this.proxyCommand = this.jwproxy.command.bind(this.jwproxy);
this.jwproxy.instrumentationState = {
Expand Down

0 comments on commit 3f7bf30

Please sign in to comment.