deprecate use of json page source

This commit is contained in:
Jonathan Lipps
2014-03-28 08:05:53 -07:00
parent 36fbeca8c1
commit ff0dcd4292

View File

@@ -17,6 +17,7 @@ var errors = require('../../server/errors.js')
, path = require('path')
, XMLDom = require("xmldom")
, helpers = require('../../helpers.js')
, warnDeprecatedCustom = helpers.logCustomDeprecationWarning
, warnDeprecated = helpers.logDeprecationWarning;
var androidController = {};
@@ -371,6 +372,14 @@ androidController.getPageSource = function (cb) {
],
// Top level cb
function () {
warnDeprecatedCustom('page source', 'json',
"You got the source of the app using the page source command. This " +
"command is undergoing a large change which will be released in " +
"Appium 1.0. The change will include returning an XML document " +
"instead of a JSON object. If you depend on the page source command " +
"you should try the new version, which is accessible by doing " +
"`driver.execute_script('mobile: source', [{type: 'xml'}])`, or " +
"the equivalent in your language bindings.");
cb(null, {
status: status.codes.Success.code
, value: json