我从未在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 definedThere is also that Protractor+Angular2 problem in Firefox (still unresolved), see:
Can't run Selenium via Protractor on Firefox after update to Angular 2Please refer following link
How to use Protractor with Angular 2?
更多推荐
发布评论