Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed duplicated chrome startup #266

Merged
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
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