Skip to content

Commit

Permalink
make sure to start chromedrivers with reference to the correct adb se…
Browse files Browse the repository at this point in the history
…rver port
  • Loading branch information
jlipps committed Sep 18, 2015
1 parent 6368ef6 commit efcfcce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ helpers.startChromedriverProxy = async function (context) {
} else {
let opts = _.cloneDeep(this.opts);
opts.chromeUseRunningApp = true;
cd = await setupNewChromedriver(opts, this.adb.curDeviceId);
cd = await setupNewChromedriver(opts, this.adb.curDeviceId,
this.adb.getAdbServerPort());
// bind our stop/exit handler, passing in context so we know which
// one stopped unexpectedly
cd.on(Chromedriver.EVENT_CHANGED, (msg) => {
Expand Down Expand Up @@ -186,10 +187,11 @@ async function setupExistingChromedriver (chromedriver) {
return chromedriver;
}

async function setupNewChromedriver (opts, curDeviceId) {
async function setupNewChromedriver (opts, curDeviceId, adbPort) {
let chromeArgs = {
port: opts.chromeDriverPort,
executable: opts.chromedriverExecutable
executable: opts.chromedriverExecutable,
adbPort
};
let chromedriver = new Chromedriver(chromeArgs);
let caps = {
Expand Down
3 changes: 2 additions & 1 deletion lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ class AndroidDriver extends BaseDriver {
if (!_.contains(knownPackages, this.opts.appPackage)) {
opts.chromeAndroidActivity = this.opts.appActivity;
}
this.chromedriver = await setupNewChromedriver(opts, this.adb.curDeviceId);
this.chromedriver = await setupNewChromedriver(opts, this.adb.curDeviceId,
this.adb.getAdbServerPort());
this.chromedriver.on(Chromedriver.EVENT_CHANGED, (msg) => {
if (msg.state === Chromedriver.STATE_STOPPED) {
this.onChromedriverStop(CHROMIUM_WIN);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"appium-android-bootstrap": "^2.1.5",
"appium-android-ime": "^2.0.0",
"appium-base-driver": "^0.4.1",
"appium-chromedriver": "^2.3.0",
"appium-chromedriver": "^2.3.3",
"appium-express": "^0.0.5",
"appium-logger": "^1.1.7",
"appium-support": "2.0.0-beta21",
Expand Down

0 comments on commit efcfcce

Please sign in to comment.