Skip to content

Commit 16301be

Browse files
committed
chore(testing): de-flake a ngHref test for navigating away from the Angular page
1 parent 95be253 commit 16301be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ng/directive/booleanAttrs.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@
5959
6060
element(by.id('link-3')).click();
6161
62-
expect(browser.driver.getCurrentUrl()).toMatch(/\/123$/);
62+
// At this point, we navigate away from an Angular page, so we need
63+
// to use browser.driver to get the base webdriver.
64+
65+
browser.wait(function() {
66+
return browser.driver.getCurrentUrl().then(function(url) {
67+
return url.match(/\/123$/);
68+
});
69+
}, 1000, 'page should navigate to /123');
6370
});
6471
6572
it('should execute ng-click but not reload when href empty string and name specified', function() {

0 commit comments

Comments
 (0)