From 16301bed2838276b1d5f315bde621edb32f82c6c Mon Sep 17 00:00:00 2001 From: Julie Date: Thu, 6 Feb 2014 12:45:43 -0800 Subject: chore(testing): de-flake a ngHref test for navigating away from the Angular page --- src/ng/directive/booleanAttrs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ng/directive/booleanAttrs.js b/src/ng/directive/booleanAttrs.js index 79199925..6762ab2d 100644 --- a/src/ng/directive/booleanAttrs.js +++ b/src/ng/directive/booleanAttrs.js @@ -59,7 +59,14 @@ element(by.id('link-3')).click(); - expect(browser.driver.getCurrentUrl()).toMatch(/\/123$/); + // 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(/\/123$/); + }); + }, 1000, 'page should navigate to /123'); }); it('should execute ng-click but not reload when href empty string and name specified', function() { -- cgit v1.2.3