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