mirror of
https://github.com/appium/appium.git
synced 2026-05-08 03:49:30 -05:00
Dont fix caps (will be done in inner drivers)
This commit is contained in:
+1
-2
@@ -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
|
||||
|
||||
@@ -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 };
|
||||
Reference in New Issue
Block a user