Skip to content

Commit

Permalink
Merge pull request nightwatchjs#28 from remixz/refresh
Browse files Browse the repository at this point in the history
Add refresh command
  • Loading branch information
beatfactor committed Feb 10, 2014
2 parents 0515144 + 4c7db68 commit b558547
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/selenium/protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ Actions.window_handles = function(callback) {
return getRequest.call(this, "/window_handles", callback);
};

Actions.refresh = function(callback) {
return postRequest.call(this, "/refresh", callback);
};

/**
* GET /session/:sessionId/url - Retrieve the URL of the current page.
Expand Down
13 changes: 13 additions & 0 deletions tests/src/testProtocolActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,19 @@ module.exports = {
test.equal(command.request.path, '/wd/hub/session/1352110219202/moveto');
});
},

testRefresh : function(test) {
var client = this.client;

this.client.on('selenium:session_create', function(sessionId) {
var command = protocol.actions.refresh.call(client, function callback() {
test.done();
});

test.equal(command.request.method, "POST");
test.equal(command.request.path, '/wd/hub/session/1352110219202/refresh');
});
},

testScreenshot : function(test) {
var client = this.client;
Expand Down

0 comments on commit b558547

Please sign in to comment.