I'm having trouble with safariDriver running tests with Protractor. everything works fine on chrome and phantom.
so the problem is lets say i have a page i click on a link and it reroutes me to another page where it does something and then routes me back to where i was going.
so in chrome i do click on link and then get the url. url === expected url.
in safari though
click on link get url url === rerouted url and hasn't reached where i was going yet. i've tried doing browser.wait(function(){ return browser.getCurrentUrl}) doesn't work.
heres a snippet.
waitAndGetUrl: function(){
return browser.wait(function(){
return browser.getCurrentUrl().then(function(url){
return url
});
}, 1000)
}
describe("should click on link and add cookie", function(){
it('click the fragment link', function(){
testPageActions.clickOnFragmentLink();
expect(testPageActions.waitAndGetUrl()).toContain(fragmentPath);
});
it('should grab have the cookie set', function(){
expect(testPageActions.getCookie()).toBe(Cookie);
});
});
ps i tried doing browser.sleep() as well