docs(ngHref): fix example that navigates away from the page

This commit is contained in:
Peter Bacon Darwin
2014-02-14 13:42:06 +00:00
parent 6f0503514f
commit 7c7477ce45

View File

@@ -87,7 +87,14 @@
expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/);
element(by.id('link-6')).click();
expect(browser.getCurrentUrl()).toMatch(/\/6$/);
// At this point, we navigate away from an Angular page, so we need
// to use browser.driver to get the base webdriver.
browser.wait(function() {
return browser.driver.getCurrentUrl().then(function(url) {
return url.match(/\/6$/);
});
}, 1000, 'page should navigate to /6');
});
</file>
</example>