I'm automating QA testing for a marketing sim. I'm using BrowserStack and Nightwatch in node.js
I want to jump to a specific webpage during a run - trouble is, there is a unique course code that will change with each test run within the URL (eg. .../8759309/...). This course code stays constant throughout all the pages I want to go to. In this example, I want to save the current URL (www.domain.com/8759309/page-i-have) to a string so that I can insert the course code and jump to the next page (www.domain.com/8675309/page-i-want).
There seems to be a function in protractor for this (browser.getCurrentUrl()) but I can't seem to find one for NightWatch.
My question is, does such a function exist in NightWatch, and if not, can you think of any workarounds?