appium-uiautomator2-driver 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/driver.ts CHANGED
@@ -701,6 +701,7 @@ class AndroidUiautomator2Driver
701
701
  disableWindowAnimation: !!this.opts.disableWindowAnimation,
702
702
  disableSuppressAccessibilityService: this.opts.disableSuppressAccessibilityService,
703
703
  readTimeout: this.opts.uiautomator2ServerReadTimeout,
704
+ basePath: this.basePath,
704
705
  };
705
706
  // now that we have package and activity, we can create an instance of
706
707
  // uiautomator2 with the appropriate options
@@ -61,7 +61,7 @@ class UiAutomator2Server {
61
61
  * @param {UiAutomator2ServerOptions} opts
62
62
  */
63
63
  constructor (log, opts) {
64
- for (let req of REQD_PARAMS) {
64
+ for (const req of REQD_PARAMS) {
65
65
  if (!opts || !util.hasValue(opts[req])) {
66
66
  throw new Error(`Option '${req}' is required!`);
67
67
  }
@@ -75,6 +75,9 @@ class UiAutomator2Server {
75
75
  port: this.systemPort,
76
76
  keepAlive: true,
77
77
  };
78
+ if (opts.basePath) {
79
+ proxyOpts.reqBasePath = opts.basePath;
80
+ }
78
81
  if (opts.readTimeout && opts.readTimeout > 0) {
79
82
  proxyOpts.timeout = opts.readTimeout;
80
83
  }
@@ -453,4 +456,5 @@ export default UiAutomator2Server;
453
456
  * @property {number} [readTimeout]
454
457
  * @property {boolean} [disableSuppressAccessibilityService]
455
458
  * @property {string} [apk]
459
+ * @property {string} [basePath]
456
460
  */