Skip to content

Commit

Permalink
Fixed nightwatchjs#1034 - page urls evaluated at navigate, not init
Browse files Browse the repository at this point in the history
  • Loading branch information
senocular committed Jul 25, 2016
1 parent 2e9787d commit 8cd0155
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/page-object/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Page(options, commandLoader, api, client) {
this.api = api;
this.client = client;
this.name = options.name;
this.url = this.getUrl(options.url);
this.url = options.url;

PageUtils
.createProps(this, options.props || {})
Expand Down Expand Up @@ -53,7 +53,7 @@ Page.prototype = {
* @returns {*}
*/
navigate: function(url, callback) {
var goToUrl = url || this.url;
var goToUrl = this.getUrl(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');
Expand Down

0 comments on commit 8cd0155

Please sign in to comment.