From 7c7477ce4561c8664a2270c19fd85b7bf9b04f29 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 14 Feb 2014 13:42:06 +0000 Subject: docs(ngHref): fix example that navigates away from the page --- src/ng/directive/booleanAttrs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js index 955b382d..10a98d15 100644 --- a/src/ng/directive/booleanAttrs.js +++ b/src/ng/directive/booleanAttrs.js @@ -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'); }); -- cgit v1.2.3