4

After spending a day and a half of code battles, i've realized that the e2e tests hanged because i've bootstraped manually and not using ng-app directive

first, FYI.

second, any idea why? How can it be fixed?

thanks

Lior

-- EDIT: here're two plunks that show it, using phone-cat tutorial example:

works in both browser and e2e: http://plnkr.co/edit/AfLsug1LRi0euKf7TWJa

works interactively in browser, doesnt work in e2e runner: http://plnkr.co/edit/20OeZ5eV2ZbzgS1qDYfr

4

1 回答 1

4

场景跑步者似乎需要掌握 ng-app(对于 $injector)。我调整了 Vojta Jína 在此处确定的修复程序,它对我有用。

$(function() {
   var myApp = $('#appId'); // Use whatever selector is appropriate here. 
   angular.bootstrap(myApp, [modules]); // modules is optional - see http://docs.angularjs.org/api/angular.bootstrap
   myApp.addClass('ng-app'); // Adds the required ng-app
});

此外,您可能需要在您的中放置一个pause或,以便有足够的时间来完成手动引导,例如,waitbeforeAll

beforeEach(function() {
   browser().navigateTo('../../index.html');
   pause();
});

此修复程序有效,但恕我直言并不令人满意。有什么办法可以摆脱暂停/等待?

于 2013-05-13T14:24:45.933 回答