Skip to content

Commit

Permalink
Add getDeviceTime method
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Jan 20, 2016
1 parent a0f3562 commit 7c8f6e7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/commands.js
Expand Up @@ -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;
13 changes: 13 additions & 0 deletions test/specs/mjson-specs.js
Expand Up @@ -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);
});
});
});

Expand Down

0 comments on commit 7c8f6e7

Please sign in to comment.