Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between JASMINE_ADAPTER and ANGULAR_SCENARIO_ADAPTER in Karma

I want to know what's the difference between JASMINE_ADAPTER and ANGULAR_SCENARIO_ADAPTER ?

Because i'm using yeoman with angular and i've got two karma config files one with JASMINE_ADAPTER and other with ANGULAR_SCENARIO_ADAPTER.

Thanks for your answers.

Tom

like image 460
Thomas Pons Avatar asked Mar 23 '23 18:03

Thomas Pons


1 Answers

Jasmine and Angular Scenario are two different things. Angular Scenario is simply built to look like Jasmine testing code. They both use describe(), it(), and have similar "framework" styles.

The fundamental difference is that Jasmine is more Javascript-testing oriented while Angular Scenario is more DOM oriented.

For example, Angular Scenario can be used to test whether or not your AngularJs code correctly creates DOM objects, while Jasmine tests the Javascript itself.

A big difference between the two is that Angular Scenario allows you to open a "browser" (as a frame) and fully load the page, whereas Jasmine just loads Javascript.

browser().navigateTo("http://www.stackoverflow.com");

can only be done in Angular Scenario.

Similarly, Angular Scenario can manipulate DOM objects. You can fill out forms and select objects, like:

input("username").enter("my_username");
input("password").enter("my_password");
element(".submitButton").click();

I highly recommend you look at: http://docs.angularjs.org/guide/dev_guide.e2e-testing and http://pivotal.github.io/jasmine/

like image 154
Eric Zhang Avatar answered Apr 24 '23 23:04

Eric Zhang