diff --git a/lib/driver.js b/lib/driver.js index 53697f59..4a49cb93 100644 --- a/lib/driver.js +++ b/lib/driver.js @@ -42,8 +42,14 @@ class AndroidDriver extends BaseDriver { this.sessionChromedrivers = {}; this.jwpProxyActive = false; this.jwpProxyAvoid = _.clone(NO_PROXY); - this.settings = new DeviceSettings({ignoreUnimportantViews: false}, - this.onSettingsUpdate.bind(this)); + this.settings = new DeviceSettings({ + ignoreUnimportantViews: false, + waitForIdleTimeout: 10000, + waitForSelectorTimeout: 10000, + keyInjectionDelay: 0, + actionAcknowledgmentTimeout: 3000, + scrollAcknowledgmentTimeout: 200 + }, this.onSettingsUpdate.bind(this)); this.chromedriver = null; this.apkStrings = {}; this.acceptSslCerts = !!opts.acceptSslCerts; @@ -154,6 +160,8 @@ class AndroidDriver extends BaseDriver { async onSettingsUpdate (key, value) { if (key === "ignoreUnimportantViews") { await this.setCompressedLayoutHierarchy(value); + } else { + await this.setConfiguratorConfig({key, value}); } } @@ -287,6 +295,12 @@ class AndroidDriver extends BaseDriver { await this.bootstrap.sendAction("compressedLayoutHierarchy", {compressLayout: compress}); } + // Set UiAutomator Configurator related configurations + // config should be like {key:"waitForIdleTimeout", value: 5000} + async setConfiguratorConfig (config) { + await this.bootstrap.sendAction("configurator", {config: config.key, value: config.value}); + } + async deleteSession () { log.debug("Shutting down Android driver"); await super.deleteSession();