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


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.

Problem courtesy of: screenm0nkey


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.


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.

Solution courtesy of: glepretre


There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.