Skip to content

Commit

Permalink
fix(e2e): force e2e tests to wait for angular
Browse files Browse the repository at this point in the history
jasmine e2e tests will occasionally fail with a "failed to sync" error
declaring `window.angular is undefined.`. Update e2e tests to force them
to wait for angular to be declared.
  • Loading branch information
david-mohr committed Dec 18, 2015
1 parent 20460a5 commit 842ab55
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/templates/e2e/account(auth)/login/login.spec(jasmine).js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ describe('Login View', function() {
if (filters.sequelizeModels) { %>return UserModel.create(testUser);<% } %>
})
.then(loadPage)
.finally(done);
.finally(function() {
browser.wait(function() {
//console.log('waiting for angular...');
return browser.executeScript('return !!window.angular');

}, 5000).then(done);

});
});

it('should include login form with correct inputs and submit button', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ describe('Logout View', function() {
.then(function() {
return login(testUser);
})
.finally(done);
.finally(function() {
browser.wait(function() {
return browser.executeScript('return !!window.angular');
}, 5000).then(done);
});
});

describe('with local auth', function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ describe('Signup View', function() {
confirmPassword: 'test'
};

beforeEach(function() {
beforeEach(function(done) {
loadPage();
browser.wait(function() {
return browser.executeScript('return !!window.angular');
}, 5000).then(done);
});

it('should include signup form with correct inputs and submit button', function() {
Expand Down

0 comments on commit 842ab55

Please sign in to comment.