diff --git a/lib/appium.js b/lib/appium.js index b444437cf..0c9108fa6 100644 --- a/lib/appium.js +++ b/lib/appium.js @@ -116,7 +116,6 @@ Appium.prototype.start = function (desiredCaps, cb) { Appium.prototype.getDeviceType = function (args, caps) { var type = this.getDeviceFromMJSONWP(args, caps) || this.getDeviceTypeFromArgsOrNamedApp(args, caps) || - this.getDeviceTypePreMJSONWP(args, caps) || this.getDeviceTypeFromAppOrPackage(args, caps); if (type) { return type; @@ -126,12 +125,6 @@ Appium.prototype.getDeviceType = function (args, caps) { "'deviceName' capability"); }; -Appium.prototype.getDeviceTypePreMJSONWP = function (args, caps) { - var device = caps.device ? caps.device.toString().toLowerCase() : ''; - var type = this.getDeviceTypeFromDeviceCap(device); - if (type) return type; -}; - Appium.prototype.getDeviceFromMJSONWP = function (args, caps) { var platform = caps.platformName || args.platformName; platform = platform ? platform.toString().toLowerCase() : ''; diff --git a/lib/devices/ios/ios.js b/lib/devices/ios/ios.js index e19fa8e82..e9315e384 100644 --- a/lib/devices/ios/ios.js +++ b/lib/devices/ios/ios.js @@ -866,7 +866,6 @@ IOS.prototype.checkDeviceAvailable = function (cb) { } }; - IOS.prototype.setDeviceAndLaunchSimulator = function (cb) { var msg; if (this.args.udid) { diff --git a/lib/server/capabilities.js b/lib/server/capabilities.js index 31506c283..9b49f9d5e 100644 --- a/lib/server/capabilities.js +++ b/lib/server/capabilities.js @@ -4,8 +4,6 @@ var _ = require('underscore') , warnDeprecated = require('../helpers.js').logDeprecationWarning; var capsConversion = { - 'device': 'platformName', - 'version': 'platformVersion', 'launch': 'autoLaunch' }; diff --git a/test/unit/capabilities-specs.js b/test/unit/capabilities-specs.js index 74e06bcd4..30dd9fd19 100644 --- a/test/unit/capabilities-specs.js +++ b/test/unit/capabilities-specs.js @@ -22,34 +22,6 @@ describe('capabilities', function () { c.platformVersion.should.equal(7.0); (typeof c.platformVersion).should.equal("number"); }); - describe('with pre-mjsonwp capabilities', function () { - var capabilityConversion = [ - ['device', 'platformName'] - , ['version', 'platformVersion'] - ]; - - beforeEach(function () { - sinon.spy(logger, "warn"); - }); - afterEach(function () { - logger.warn.restore(); - }); - - _.each(capabilityConversion, function (item) { - var specName = "Should return a deprecation warning when given the " + - JSON.stringify(item[0]) + " capability"; - it(specName, function () { - var expected = "[DEPRECATED] The " + item[0] + " capability has " + - "been deprecated and will be removed. Please use " + - "the " + item[1] + " capability instead."; - var fakeCaps = {}; - fakeCaps[item[0]] = 'dontcare'; - new Capabilities(fakeCaps); - (logger.warn.args[0][0]).should.equal(expected); - }); - }); - }); - describe('with mjsonwp capabilities', function () { describe('deprecation warnings', function () { var newCapabilities = [ diff --git a/test/unit/common-device-specs.js b/test/unit/common-device-specs.js index e6c5a00f8..457634db6 100644 --- a/test/unit/common-device-specs.js +++ b/test/unit/common-device-specs.js @@ -7,13 +7,11 @@ var common = require('../../lib/devices/common.js') , logger = loggerjs.get('appium'); var _ = require('underscore') - , chai = require('chai') - , should = chai.should() , sinon = require('sinon'); describe('devices/common.js', function () { var null_cb = function () {}; - + var assertLocatorValidity = function (name, loc, includeWeb, expected) { var cb = function () {}; it(name, function () { @@ -123,4 +121,4 @@ describe('devices/common.js', function () { }); }); }); -}); \ No newline at end of file +}); diff --git a/test/unit/configuration-specs.js b/test/unit/configuration-specs.js index 588daa0ac..d13c995fa 100644 --- a/test/unit/configuration-specs.js +++ b/test/unit/configuration-specs.js @@ -1,8 +1,6 @@ "use strict"; var getAppium = require('../../lib/appium') - , chai = require('chai') - , should = chai.should() , _ = require('underscore'); var assertCapsGiveCorrectDevices = function (appium, args) { @@ -17,62 +15,6 @@ describe('Appium', function () { describe('#getDeviceType', function () { // test is [args, caps, device] var appium = getAppium({}); - describe('pre mjsonwp capabilities', function () { - describe('device capabilities', function () { - var happyTests = [ - [{}, {app: 'chromium', device: 'android'}, 'chrome'] - , [{}, {app: '/path/to/my.app', device: 'Android'}, 'android'] - , [{}, {browserName: "safari"}, 'safari'] - , [{app: '/path/to/my.app'}, {device: 'Android'}, 'android'] - , [{}, {device: 'iPhone Simulator'}, 'ios'] - , [{}, {device: 'iPhone Simulator', browserName: 'Safari'}, 'safari'] - , [{}, {device: 'iPhone Simulator', browserName: 'safari'}, 'safari'] - , [{}, {device: 'iPhone'}, 'ios'] - , [{}, {device: 'iphone'}, 'ios'] - , [{}, {device: 'ipad'}, 'ios'] - , [{}, {device: 'iPad Simulator'}, 'ios'] - , [{}, {device: 'Selendroid'}, 'selendroid'] - , [{}, {device: 'Android'}, 'android'] - , [{}, {device: 'FirefoxOS'}, 'firefoxos'] - , [{}, {device: 'firefox'}, 'firefoxos'] - , [{}, {device: 'firefox', 'app-package': 'com.android.chrome'}, 'firefoxos'] - , [{}, {device: 'iphone', 'app-package': 'lol'}, 'ios'] - ]; - _.each(happyTests, function (test) { - var spec = 'should turn ' + JSON.stringify(test[0]) + ' args and ' + - JSON.stringify(test[1]) + ' caps into ' + test[2] + ' device'; - it(spec, function () { - appium.getDeviceType(test[0], test[1]).should.equal(test[2]); - }); - }); - }); - - describe('negative cases', function () { - - var unhappyTests = [ - [{}, {}] - , [{}, {device: 'rando'}] - , [{}, {app: '/path/to/my.exe'}] - , [{ipa: '/path/to/my.exe'}, {}] - , [{}, {platformName: 'notarealdevice'}] - ]; - _.each(unhappyTests, function (test) { - var spec = 'should fail with args ' + JSON.stringify(test[0]) + - ' and caps ' + JSON.stringify(test[1]); - it(spec, function () { - var err; - try { - appium.getDeviceType(test[0], test[1]); - } catch (e) { - err = e; - } - should.exist(err); - err.message.should.contain("Could not determine your device"); - }); - }); - }); - }); - describe('mjsonwp spec capabilities', function () { describe('deviceName', function () {