Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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});
}
}

Expand Down Expand Up @@ -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();
Expand Down