diff --git a/lib/page-object/page.js b/lib/page-object/page.js index 4f14b241a0..a3a67cbf7f 100644 --- a/lib/page-object/page.js +++ b/lib/page-object/page.js @@ -49,15 +49,16 @@ Page.prototype = { * * @method navigate * @param {Object} [url=this.url] Url to navigate to. + * @param {function} [callback] Optional callback function to be called when the command finishes. * @returns {*} */ - navigate: function(url) { + navigate: function(url, callback) { var goToUrl = url || this.url; if (goToUrl === null) { throw new Error('Invalid URL: You must either add a url property to "' + this.name + '" or provide a url as an argument'); } - this.api.url(goToUrl); + this.api.url(goToUrl, callback); return this; } };