AngularJS/Karma端到端測試環境似乎很難在Rails後端工作。AngularJS e2e測試在Rails堆棧中:[object Object]沒有方法'resumeBootstrap'
我已經安裝了噶,並與下面的配置文件運行:
basePath = '../';
files = [
ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,
'test/e2e/**/*.js'
];
autoWatch = false;
browsers = ['Chrome'];
// singleRun = true;
proxies = {
'/': 'http://local.mywebsite.com:3000/'
};
urlRoot = 'e2e';
junitReporter = {
outputFile: 'test_out/e2e.xml',
suite: 'e2e'
};
哪裏http://local.mywebsite.com:3000/是我的Rails應用程序。
我嘗試一個非常簡單的測試:
it('should redirect to /', function() {
expect(browser().location().url()).toBe("/");
});
但我堅持了以下錯誤:
http://localhost:9876/base/test/e2e/scenarios.js:8:5
TypeError: Object [object Object] has no method 'resumeBootstrap'
at HTMLIFrameElement.<anonymous> (http://localhost:9876/adapter/lib/angular-scenario.js:26285:27)
at HTMLIFrameElement.jQuery.event.dispatch (http://localhost:9876/adapter/lib/angular-scenario.js:3064:9)
at HTMLIFrameElement.elemData.handle.eventHandle (http://localhost:9876/adapter/lib/angular-scenario.js:2682:28)
at k (http://connect.facebook.net/en_US/all.js:48:745)
凡scenarios.js來自https://github.com/angular/angular-seed。
任何想法如何使它工作?
只爲您的信息。此錯誤表示應用程序引導過程被延遲。您可以在頁面底部的以下鏈接閱讀它:http://docs.angularjs.org/guide/bootstrap。 Angular-scenario(e2e測試)對正在測試的應用程序使用延遲引導。也許你在某處修改window.name,以便NG_DEFER_BOOTSTRAP!國旗被抹去了?請注意,角情景在iframe中加載應用程序,所以您必須調試該應用程序的腳本。 – EvAlex 2014-02-03 07:22:33