From 7c8f6e7e93409f721fbc9853ed46b40a24c16ca4 Mon Sep 17 00:00:00 2001 From: Isaac Murchie Date: Wed, 20 Jan 2016 12:25:46 -0800 Subject: [PATCH] Add getDeviceTime method --- lib/commands.js | 14 ++++++++++++++ test/specs/mjson-specs.js | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/lib/commands.js b/lib/commands.js index 6c8f7521..9a8ff39f 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -3089,4 +3089,18 @@ commands.activeIMEEngine = function () { }); }; +/** + * getDeviceTime(cb) -> cb(err, deviceTime) + * + * @jsonWire GET /session/:sessionId/appium/device/system_time + */ +commands.getDeviceTime = function () { + var cb = findCallback(arguments); + this._jsonWireCall({ + method: 'GET' + , relPath: '/appium/device/system_time' + , cb: callbackWithData(cb, this) + }); +}; + module.exports = commands; diff --git a/test/specs/mjson-specs.js b/test/specs/mjson-specs.js index 8052b60b..5ca2b0ec 100644 --- a/test/specs/mjson-specs.js +++ b/test/specs/mjson-specs.js @@ -985,6 +985,19 @@ describe("mjson tests", function() { .activeIMEEngine() .nodeify(done); }); + + it("getDeviceTime", function (done) { + nock.cleanAll(); + server + .get('/session/1234/appium/device/system_time') + .reply(200, { + status: 0, + sessionId: '1234' + }); + browser + .getDeviceTime() + .nodeify(done); + }); }); });