我应该用量角器或噶我的终端到终端的测试? [英] Should I be using Protractor or Karma for my end-to-end testing?

查看:174
本文介绍了我应该用量角器或噶我的终端到终端的测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用量角器或噶我的终端到终端的测试?

角种子用量角器/硒的webdriver为E2E但角phonecat教程使用业。

我读,我应该使用噶单元测试和量角器的端到端,这似乎不错,但我想我会问在这里得到其他开发人员的意见。


解决方案

在AngularJS团队建议用量角器因为它要取代的角情景亚军:


  

角情景亚军处于维护模式 - 如果你开始一个新的角度项目,可以考虑使用量角器

AngularJs文档引用。

本教程角phonecat开发很久以前(2011年为主)和尚未更新,使用一些角新功能,如量角器。

修改

量角器文档 - 常见问题解答


  

为什么两者因果报应和量角器?什么时候使用它?


  
  

噶是单元测试一个伟大的工具,量角器是为
  端到端或集成测试。这意味着,小测试的
  您的个性化的控制器,指令和服务的逻辑应该
  使用噶运行。大测试中,你有一个运行实例
  整个应用程序应该用量角器运行。量角器
  为了运行从一个用户的角度测试 - 如果你的测试能
  写下来的说明与人相互作用的
  应用,它应该是一个端到端的测试用量角器写入


  
  

下面是一个精彩的博客贴子,提供更多的信息。


Should I be using Protractor or Karma for my end-to-end testing?

Angular-seed is using Protractor/Selenium WebDriver for E2E but the angular-phonecat tutorial uses karma.

I read that I should use Karma for unit tests and Protractor for E2E, which seems fine but I thought I would ask on here to get other dev's opinions.

解决方案

The AngularJS team recommends using Protractor as it's going to replace angular scenario runner:

Angular Scenario Runner is in maintenance mode - If you're starting a new Angular project, consider using Protractor.

quoted from AngularJs documentation.

The tutorial angular-phonecat was developed a long time ago (in 2011 mainly) and has not yet been updated to use some Angular new features like Protractor.

EDIT

In the Protractor Docs - FAQ:

Why both Karma and Protractor? When do I use which?

Karma is a great tool for unit testing, and Protractor is intended for end to end or integration testing. This means that small tests for the logic of your individual controllers, directives, and services should be run using Karma. Big tests in which you have a running instance of your entire application should be run using Protractor. Protractor is intended to run tests from a user's point of view - if your test could be written down as instructions for a human interacting with your application, it should be an end to end test written with Protractor.

Here's a great blog post with more info.

这篇关于我应该用量角器或噶我的终端到终端的测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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