mirror of
https://github.com/appium/appium.git
synced 2026-04-30 23:41:58 -05:00
Log a deprecation message when mobileSource is called with the JSON
type, asking users to use XML type instead.
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user