Merge pull request #2286 from jlipps/master

fix up some version handling issues
This commit is contained in:
Jonathan Lipps
2014-04-07 14:51:23 -07:00
3 changed files with 12 additions and 9 deletions
+5 -1
View File
@@ -34,7 +34,11 @@ Device.prototype.setArgFromCap = function (arg, cap) {
if (typeof this.capabilities[cap] !== "undefined") {
if (_.has(capConversion, cap)) {
var key = capConversion[cap];
this.args[key] = this.capabilities[cap];
if (!_.has(this.capabilities, key)) {
// if we have both 'version' and 'platformVersion' caps being sent,
// make sure 'platformVersion' isn't overwritten by 'version'
this.args[key] = this.capabilities[cap];
}
} else {
this.args[arg] = this.capabilities[cap];
}
+4 -5
View File
@@ -164,9 +164,9 @@ IOS.prototype.configureApp = function (cb) {
IOS.prototype.configurePreferences = function (cb) {
logger.info("Configuring settings app");
var prefsVer = null;
var caps = this.capabilities;
if (typeof caps.platformVersion !== "undefined" && caps.platformVersion) {
prefsVer = caps.platformVersion;
if (typeof this.args.platformVersion !== "undefined" &&
this.args.platformVersion) {
prefsVer = this.args.platformVersion;
}
var sdkNext = function (prefsVer) {
@@ -246,7 +246,7 @@ IOS.prototype.preCleanup = function (cb) {
};
IOS.prototype.getNumericVersion = function () {
return parseFloat(this.capabilities.platformVersion);
return parseFloat(this.args.platformVersion);
};
IOS.prototype.start = function (cb, onDie) {
@@ -433,7 +433,6 @@ IOS.prototype.setiOSSDKVersion = function (cb) {
logger.error("Could not determine iOS SDK version");
}
this.iOSSDKVersion = versionNumber;
this.capabilities.platformVersion = versionNumber;
logger.info("iOS SDK Version set to " + this.iOSSDKVersion);
cb();
}.bind(this));
+3 -3
View File
@@ -33,9 +33,9 @@ Safari.prototype.configure = function (args, caps, cb) {
Safari.prototype.configureSafari = function (cb) {
var safariVer = null;
var caps = this.capabilities;
if (typeof caps.platformVersion !== "undefined" && caps.platformVersion) {
safariVer = caps.platformVersion;
if (typeof this.args.platformVersion !== "undefined" &&
this.args.platformVersion) {
safariVer = this.args.platformVersion;
}
logger.info("Trying to use mobile safari, version " + safariVer);
var checkNext = function (attemptedApp, origApp, safariVer) {