微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

angularjs – 错误超时等待Protractor在11秒后与页面同步

我的量角器测试有问题.我的角应用程序使用$timeout来连续从服务器轮询某些内容.不幸的是,当我运行我的测试时,这会导致以下错误消息:

There was a webdriver error: Error Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protrac
tor/blob/master/docs/faq.md

如何处理这种持续的轮询超时?在我的情况下将browser.ignoreSynchronization设置为false不是一个好的解决方案(当我这样做时,我必须插入很多browser.sleep())

在我的应用程序中,目前无法按照建议here从$timeout切换到$interval.增加超时也是不可能的(正如我所说,服务不断从服务器轮询某些内容)

是否有可能更改waitForAngular例程,以便我的测试不会超时?

任何帮助将受到高度赞赏.

解决方法

protractor’s documentation开始:

Before performing any action,Protractor asks Angular to wait until the page is synchronized. This means that all timeouts and http requests are finished. If your application continuously polls $timeout or $http,it will never be registered as completely loaded. You should use the $interval service (07001) for anything that polls continuously (introduced in Angular 1.2rc3).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐