I thought Done would make things run synchronously, meaning after I click a link, the click call back would happen after the click, apparently not as this doesn't work.
browser.ignoreSynchronization = true;
var firstURL = "https://www.google.com/?gws_rd=ssl";
describe("test", function () {
browser.get("http://www.google.com");
it("Should be on google url", function () {
expect(browser.getCurrentUrl()).toBe(firstURL);
});
it("Should be able to type in text and click", function (done) {
var ele = element.all(by.name("q")).first();
ele.sendKeys("Protractor API");
ele.click().then(function () {
expect(true).toBe(true);
done();
});
});
it("Should be on new page", function (done) {
browser.driver.getCurrentUrl().then(function (url) {
debugger;
done();
});
});
});
The getCurrentUrl() at bottom of code returns the URL of the first page. How do I get the current URL when I can see it's changed in the browser from the test?