Home » Javascript » Nightwatch not navigating to url

Nightwatch not navigating to url

Posted by: admin November 1, 2017 Leave a comment

Questions:

I have the following code and whats happening is that once the promise is resolved the browser doesn’t navigate to the url it just stay on the default page defined on the nightwatch.conf.js. So the test fails.

Given(/^I make a post request and retreive the Id i got the page + id$/, () => {
      //I make the post request 
      var transactionIdPromise = utils.getTransactionId(1);

      return transactionIdPromise.getBody('utf8').then(JSON.parse).done(function (result) {
          var id = result.transaction_id;
          var url = "https://mywebpage.com:8443/" + id;
          client.url(url)
      });
    });
Answers: