如何在webpack的Angular 2应用程序中实现量角器?(How can I implement protractor in my Angular 2 app with webpack?)

编程入门 行业动态 更新时间:2024-10-27 14:18:16
如何在webpack的Angular 2应用程序中实现量角器?(How can I implement protractor in my Angular 2 app with webpack?)

我从未在Angular 2中使用过量角器。任何人都可以告诉我如何使用webpack在Angular 2中实现量角器?

I have never used protractor in Angular 2. Can anyone tell how can I implement protractor in Angular 2 with webpack?

最满意答案

您可以使用Protractor测试Angular 2应用程序 (从Protractor 2.5.0开始)。

对于Protractor 5.0.0+ ,您无需执行任何特定操作, Protractor将自动检测被测应用程序中使用的Angular版本

对于Protractor> = 2.5.0和<= 4.0.14,您只需要在配置中添加useAllAngular2AppRoots: true即可。 这是一个样本 。


请注意,几个内置的Protractor匹配器尚不能与Angular2一起使用,请参阅:

量角器角度2失败:未知错误:未定义角度

Firefox中还存在Protractor + Angular2问题(仍未解决),请参阅:

更新到Angular 2后,无法在Firefox上通过Protractor运行Selenium

请参考以下链接

如何在Angular 2中使用量角器?

You can test Angular 2 applications with Protractor (starting from Protractor 2.5.0).

For Protractor 5.0.0+, you don't have to do anything specific, Protractor will auto-detect the Angular version used in the application under test.

For Protractor >= 2.5.0 and <= 4.0.14, you would only need to add useAllAngular2AppRoots: true to your config. Here is a sample.


Note that several built-in Protractor matchers would not yet work with Angular2, see:

Protractor Angular 2 Failed: unknown error: angular is not defined

There is also that Protractor+Angular2 problem in Firefox (still unresolved), see:

Can't run Selenium via Protractor on Firefox after update to Angular 2

Please refer following link

How to use Protractor with Angular 2?

更多推荐

本文发布于:2023-07-14 17:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1106057.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:量角器   应用程序   如何在   webpack   app

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!