简体   繁体   English

量角器是否以某种方式依赖于AngularJS版本?

[英]Is protractor, in any way dependent on AngularJS version?

I have just started to use protractor. 我刚开始使用量角器。 I wanted to know it's limitation and specifically if it is dependent on version of AngularJS 我想知道它的局限性,特别是它是否取决于AngularJS的版本

I don't complete agree with @Zanon here. 我不完全同意@Zanon在这里。 Protractor actually relies on some Angular-specific things like getTestability test helper that helps to let Protractor know that Angular is stable, ready and there are no outstanding requests left ( source ). Protractor实际上依赖于某些特定于Angular的东西,例如getTestability测试助手,它可以帮助量角器知道Angular稳定,就绪并且没有未完成的请求( )。 This is actually what makes Protractor somewhat special and is recommended to use for testing Angular apps - the test flow becomes more natural, there is usually no need for extra waits - Protractor just works in sync with Angular application under test. 实际上,这就是使Protractor有些特殊的原因,建议将其用于测试Angular应用程序-测试流程变得更加自然,通常不需要额外的等待-量角器只是与被测Angular应用程序同步工作。

To answer your specific question: 要回答您的特定问题:

  • for testing Angular 1.x apps - you can use any Protractor version 用于测试Angular 1.x应用程序-您可以使用任何量角器版本
  • for testing Angular 2.x apps - Protractor >= 2.5.0 用于测试Angular 2.x应用-量角器> = 2.5.0

No , Protractor is not dependent on any specific Angular 1.x version. ,量角器不依赖于任何特定的Angular 1.x版本。

However , since Angular 2.x added big new and breaking changes, you need Protractor version 2.5 (or later) to use it (you can confirm this here ). 但是 ,由于Angular 2.x添加了新的重大更改,因此您需要使用Protractor版本2.5(或更高版本)才能使用它(可以在此处确认)。

Protractor is a Node.js program that uses browser drives to execute tests as a real user would. 量角器是一个Node.js程序,它使用浏览器驱动器来执行测试,就像真实用户一样。 It was designed thinking on Angular workflows, but it doesn't use Angular code, so its dependency is by design choices and not on specific code versions. 它是为考虑Angular工作流而设计的,但是它不使用Angular代码,因此其依赖性取决于设计选择,而不取决于特定的代码版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM