Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Protractor and Karma be used together?

If Protractor is replacing Angular Scenario Runner for E2E testing, does that mean I will still be able to use it with Karma as my E2E testing framework ?

like image 782
holographic-principle Avatar asked Jun 12 '13 16:06

holographic-principle


People also ask

Which can be used to run end to end testing karma or 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.

What is Jasmine karma and Protractor?

Jasmine and Karma are usually used together to perform Unit testing or integration testing. Protractor is an end-to-end test framework for Angular and AngularJS applications.

Is Protractor end of life?

Earlier this year, the Angular team announced that they would cease development for open source end-to-end automated testing tool Protractor at the end of 2022. As a popular and long-established tool for automated web application testing, Protractor was an early pioneer in enabling behavior-driven end-to-end testing.


1 Answers

Not recommended by the current maintainer of Protractor:

https://github.com/angular/protractor/issues/9#issuecomment-19927049

Protractor and Karma should not be used together; instead they provide separate systems for running tests. Protractor and Karma cover different aspects of testing - Karma is intended mostly for unit tests, while Protractor should be used for end to end testing.

Protractor is built on top of WebDriverJS, which uses a Selenium/WebDriver server to provision browsers and drive test execution. Examples of pure WebDriverJS can be found here: http://code.google.com/p/selenium/wiki/WebDriverJs

And

https://github.com/angular/protractor/issues/9#issuecomment-19931154

Georgios - I think it makes sense to keep Protractor and Karma separate - for end to end tests, you want the native event driving and flexibility of webdriver, while for unit tests you want fast execution and autowatching of files.

like image 54
jack Avatar answered Sep 18 '22 00:09

jack