量角器等待角度应用稳定 [英] Protractor wait for angular application to be stable

查看:97
本文介绍了量角器等待角度应用稳定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用量角器运行e2e测试时出现问题.似乎whenStable被调用为时过早(一秒钟的一小部分).

I have an issue when running e2e tests with Protractor. It seems the whenStable is being called too early (a fraction of a second early).

我通过防护加载数据,填充存储,然后容器通过选择器接收此数据,然后将选择器中的数据传递给组件.

I load the data via guards, populate the store and then the containers receive this data via selectors which then pass the data down to the components.

我的应用程序是使用Angular 5和ngrx 4构建的.

My application is built with Angular 5 and ngrx 4.

是否有一种方法可以成功地在适当的时间成功触发whenStable而不创建我自己的用于检查元素是否存在的函数?

Is there a way to successfully get whenStable to trigger at the right time without creating my own function for checking if an element is present?

编辑了此信息,因为它不再是远程baseUrl问题.现在,它发生在本地.

Edited this post as it's no longer a remote baseUrl issue. I now have it happening locally.

我有一个测试应用程序,它似乎能按预期运行,但是在我的大型应用程序中,一切似乎都为时过早.

I have a test application that seems to work as expected, but in my larger application, everything seems to happen a little too early.

推荐答案

我不确定我是否正确理解了这个问题.但是使用browser.waitForAngular();将等待所有角度分量加载.

Im not sure if I understood the question correctly. But using browser.waitForAngular(); will wait for all angular components to load.

这篇关于量角器等待角度应用稳定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆