Skip to content

Commit 90784bd

Browse files
committed
fix(e2e): force e2e tests to wait for angular
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.
1 parent 307689f commit 90784bd

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Diff for: app/templates/e2e/account(auth)/login/login.spec(jasmine).js

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ describe('Login View', function() {
2626
if (filters.sequelizeModels) { %>return UserModel.create(testUser);<% } %>
2727
})
2828
.then(loadPage)
29-
.finally(done);
29+
.finally(function() {
30+
browser.wait(function() {
31+
//console.log('waiting for angular...');
32+
return browser.executeScript('return !!window.angular');
33+
34+
}, 5000).then(done);
35+
36+
});
3037
});
3138

3239
it('should include login form with correct inputs and submit button', function() {

Diff for: app/templates/e2e/account(auth)/logout/logout.spec(jasmine).js

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ describe('Logout View', function() {
2626
.then(function() {
2727
return login(testUser);
2828
})
29-
.finally(done);
29+
.finally(function() {
30+
browser.wait(function() {
31+
return browser.executeScript('return !!window.angular');
32+
}, 5000).then(done);
33+
});
3034
});
3135

3236
describe('with local auth', function() {

Diff for: app/templates/e2e/account(auth)/signup/signup.spec(jasmine).js

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ describe('Signup View', function() {
2020
confirmPassword: 'test'
2121
};
2222

23-
beforeEach(function() {
23+
beforeEach(function(done) {
2424
loadPage();
25+
browser.wait(function() {
26+
return browser.executeScript('return !!window.angular');
27+
}, 5000).then(done);
2528
});
2629

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

0 commit comments

Comments
 (0)