我有本地运行良好的Protractor测试(directConnect:true),但是当我尝试在远程Selenium服务器(Grid)上运行它们时,我总是收到以下消息.
原文链接:https://www.f2er.com/angularjs/141078.htmlA Jasmine spec timed out. Resetting the WebDriver Control Flow.
查看故障,消息和堆栈显示以下所有测试用例:
Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. at Timer.listOnTimeout (timers.js:92:15)
我尝试了很多东西,例如增加jasmine超时间隔,将更早的超时(例如getPageTimeout和allScriptsTimeout)添加到conf,但它仍然会抛出jasmine超时错误.该日志显示以下错误:
00:03:18.328 INFO - Done: [execute async script: try { return (function (rootSelector,ng12Hybrid,callback) { var el = document.querySelector(rootSelector); try { if (!ng12Hybrid && window.getAngularTestability) { window.getAngularTestability(el).whenStable(callback); return; } if (!window.angular) { throw new Error('window.angular is undefined. This could be either ' + 'because this is a non-angular page or because your test involves ' + 'client-side navigation,which can interfere with Protractor\'s ' + 'bootstrapping. See http://git.io/v4gXM for details'); } if (angular.getTestability) { angular.getTestability(el).whenStable(callback); } else { if (!angular.element(el).injector()) { throw new Error('root element (' + rootSelector + ') has no injector.' + ' this may mean it is not inside ng-app.'); } angular.element(el).injector().get('$browser'). notifyWhenNoOutstandingRequests(callback); } } catch (err) { callback(err.message); } }).apply(this,arguments); } catch(e) { throw (e instanceof Error) ? e : new Error(e); },[body,false]])
我知道我的应用程序是有角度的,它在本地运行时运行成功.我试过设定
browser.ignoreSynchronization = true
,以及设置
rootElement='html#ng-app'
在conf(bc我的ng-app不在体内,而是在html标签内).框架被设置为’jasmine’虽然我尝试’jasmine2’但似乎没有任何区别.在远程服务器上,我可以启动firefox,UI会显示启动的firefox会话.然而它只是坐在那里直到超时发生.任何输入将不胜感激!