Dont fix caps (will be done in inner drivers)

This commit is contained in:
Isaac Murchie
2016-03-16 14:07:12 -07:00
parent ba0fe81f6b
commit c2ac161a9e
4 changed files with 2 additions and 34 deletions
+1 -2
View File
@@ -1,7 +1,6 @@
import _ from 'lodash';
import log from './logger';
import { getAppiumConfig } from './config';
import { fixCaps } from './helpers';
import { BaseDriver } from 'appium-base-driver';
import { FakeDriver } from 'appium-fake-driver';
import { AndroidDriver } from 'appium-android-driver';
@@ -103,7 +102,7 @@ class AppiumDriver extends BaseDriver {
throw new errors.SessionNotCreatedError(e.message);
}
let d = new InnerDriver(this.args);
let [innerSessionId, dCaps] = await d.createSession(fixCaps(caps), reqCaps, curSessions);
let [innerSessionId, dCaps] = await d.createSession(caps, reqCaps, curSessions);
this.sessions[innerSessionId] = d;
// Remove the session on unexpected shutdown, so that we are in a position
-22
View File
@@ -1,22 +0,0 @@
import _ from 'lodash';
import log from './logger';
function fixCaps (originalCaps) {
let caps = _.clone(originalCaps);
// boolean capabilities can be passed in as strings 'false' and 'true'
// which we want to translate into boolean values
for (let [cap, value] of _.pairs(caps)) {
if (_.isString(value)) {
value = value.toLowerCase();
if (value === 'true' || value === 'false') {
log.debug(`Capability '${cap}' changed from string to boolean. This may cause unexpected behavior`);
caps[cap] = (value === 'true');
}
}
}
return caps;
}
export { fixCaps };