I have a protractor test that locates a URL on a page. The URL is then clicked and expected to contain specific text. The URL needs to be manipulated before the browser opens it, how can I change the URL before hand?
The URL to be clicked looks like app.company.com but needs to be changed to app-dev.company.com or app-staging.company.com to function correctly. If app.company.com is opened, the URL auto re-directs to an error page.
Edit - below is the test in question. When openURL is clicked, its automatically redirected to an error page because the URL is incorrect:
customizeWebsite.openURL.click();
browser.sleep(10000);
browser.getAllWindowHandles().then(function(handles){
browser.switchTo().window(handles[1]).then(function(){
expect(browser.getCurrentUrl()).toContain('gid=');