test(e2e): workaround flaky e2e tests

This commit is contained in:
Victor Berchet 2016-05-25 17:03:34 -07:00
parent 352ee53202
commit 6da79673c2
1 changed files with 11 additions and 3 deletions

View File

@ -48,8 +48,16 @@ describe('WebWorkers Input', function() {
}); });
function waitForBootstrap() { function waitForBootstrap() {
browser.wait(protractor.until.elementLocated(by.css(selector + ' h2')), 15000); browser
let elem = element(by.css(selector + ' h2')); .wait(protractor.until.elementLocated(by.css(selector + ' h2')), 5000)
browser.wait(protractor.until.elementTextIs(elem, 'Input App'), 5000); .then(_ => {
let elem = element(by.css(selector + ' h2'));
browser.wait(protractor.until.elementTextIs(elem, 'Input App'), 5000);
}, _ => {
// jasmine will timeout if this gets called too many times
console.log('>> unexpected timeout -> browser.refresh()');
browser.refresh();
waitForBootstrap();
});
} }
}); });