Log a deprecation message when mobileSource is called with the JSON

type, asking users to use XML type instead.
This commit is contained in:
Dylan Lacey
2014-03-24 23:52:48 -07:00
parent 60e9aa7fd5
commit 0cbdb9b2d4
4 changed files with 79 additions and 4 deletions
+4
View File
@@ -14,6 +14,7 @@ var status = require('./status.js')
, respondSuccess = responses.respondSuccess
, checkMissingParams = responses.checkMissingParams
, notYetImplemented = responses.notYetImplemented
, logDeprecationWarning = require('../helpers.js').logDeprecationWarning
, _ = require('underscore');
@@ -370,6 +371,7 @@ exports.mobileSource = function (req, res) {
var type = req.body.type;
if (checkMissingParams(res, {type: type})) {
logDeprecationWarning('parameter', 'type');
if (type.toLowerCase() === "xml") {
req.device.getPageSourceXML(getResponseHandler(req, res));
} else {
@@ -645,6 +647,8 @@ exports.elementSelected = function (req, res) {
};
exports.getPageSource = function (req, res) {
logger.warn("This method will change to return XML in a future version " +
"of Appium.");
req.device.getPageSource(getResponseHandler(req, res));
};