Node.js 仅当ignoreSynchronization设置为false时,量角器超时

Node.js 仅当ignoreSynchronization设置为false时,量角器超时,node.js,jasmine,protractor,Node.js,Jasmine,Protractor,我不明白为什么量角器在到达ignoreSynchronization设置为false的代码时超时 this.countSubscribers=函数(){ this.subscriberCount().then(函数(count){ totalSubscribers=计数; }); };在函数之前保留对“this”的引用。然后你想叫什么就叫什么。 另外,如果您使用element.all(…),您将能够使用本机的.count(),这将为您解决这个问题 //关于这一点 var self=this /

我不明白为什么量角器在到达ignoreSynchronization设置为false的代码时超时

this.countSubscribers=函数(){
this.subscriberCount().then(函数(count){
totalSubscribers=计数;
});
};在函数之前保留对“this”的引用。然后你想叫什么就叫什么。
另外,如果您使用element.all(…),您将能够使用本机的.count(),这将为您解决这个问题

//关于这一点

var self=this

//element.all with.count()

this.subscriberCount=function(){return element.all(…).Count()}

//此方法返回列出的订阅服务器数

this.countSubscribers=函数(){
返回self.subscriberCount();
});

在函数之前保留“this”的引用。然后你想叫什么就叫什么。 另外,如果您使用element.all(…),您将能够使用本机的.count(),这将为您解决这个问题

//关于这一点

var self=this

//element.all with.count()

this.subscriberCount=function(){return element.all(…).Count()}

//此方法返回列出的订阅服务器数

this.countSubscribers=函数(){
返回self.subscriberCount();

});

同步部分与仍在加载的角度组件相关。这是我个人的看法,但我认为你的5秒超时时间太短了。我会扩展它,我发现了问题所在。我需要用以下内容包装countSubscribers函数体:browser.controlFlow().execute(function(){..}同步部分与角度组件仍在加载有关。这是个人观点,但我认为您的5秒超时时间太短了。我会扩展它。我发现了问题所在。我需要用以下内容包装countSubscribers函数体:browser.controlFlow().execute(function(){…}