Skip to content

Commit

Permalink
Fixed duplicated chrome startup (#266)
Browse files Browse the repository at this point in the history
Fixed startup for web execution. Currently chrome browser is started
twice: fristly by: ensureAppStarts and then by startChromeSession. It
can be skipped and done similarly to solution implemented in
AndroidDriver.
  • Loading branch information
AnnaWyrwal authored and mykola-mokhnach committed Dec 11, 2018
1 parent 162e370 commit d3d677f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ class AndroidUiautomator2Driver extends BaseDriver {
logger.debug(`'skipUnlock' capability set, so skipping device unlock`);
}

// rescue UiAutomator2 if it fails to start our AUT
if (this.opts.autoLaunch) {
if (this.isChromeSession) { // start a chromedriver session
await this.startChromeSession(this);
} else if (this.opts.autoLaunch) { // rescue UiAutomator2 if it fails to start our AUT
await this.ensureAppStarts();
}

Expand All @@ -354,10 +355,6 @@ class AndroidUiautomator2Driver extends BaseDriver {
await retryInterval(timeout / 500, 500, this.setContext.bind(this), viewName);
}

if (this.isChromeSession) {
await this.startChromeSession(this);
}

// now that everything has started successfully, turn on proxying so all
// subsequent session requests go straight to/from uiautomator2
this.jwpProxyActive = true;
Expand Down

0 comments on commit d3d677f

Please sign in to comment.