Looking through angular js tutorial, I do not understand where the repeater (function?) es from in a jasmine test. Is this a jasmine or an angular construct?
The page does have an ng-repeat attribute in a <li>
element - but I dont see how that translates to the reference to 'repeater' in the test
it('should be possible to control phone order via the drop down select box',
function() {
//let's narrow the dataset to make the test assertions shorter
input('query').enter('tablet');
//where does 'repeater' below e from?
expect(repeater('.phones li', 'Phone List').column('phone.name')).
toEqual(["Motorola XOOM\u2122 with Wi-Fi",
"MOTOROLA XOOM\u2122"]);
select('orderProp').option('Alphabetical');
expect(repeater('.phones li', 'Phone List').column('phone.name')).
toEqual(["MOTOROLA XOOM\u2122",
"Motorola XOOM\u2122 with Wi-Fi"]);
});
Looking through angular js tutorial, I do not understand where the repeater (function?) es from in a jasmine test. Is this a jasmine or an angular construct?
The page does have an ng-repeat attribute in a <li>
element - but I dont see how that translates to the reference to 'repeater' in the test
it('should be possible to control phone order via the drop down select box',
function() {
//let's narrow the dataset to make the test assertions shorter
input('query').enter('tablet');
//where does 'repeater' below e from?
expect(repeater('.phones li', 'Phone List').column('phone.name')).
toEqual(["Motorola XOOM\u2122 with Wi-Fi",
"MOTOROLA XOOM\u2122"]);
select('orderProp').option('Alphabetical');
expect(repeater('.phones li', 'Phone List').column('phone.name')).
toEqual(["MOTOROLA XOOM\u2122",
"Motorola XOOM\u2122 with Wi-Fi"]);
});
Share
Improve this question
edited Nov 3, 2012 at 20:30
Pete_ch
asked Nov 3, 2012 at 20:13
Pete_chPete_ch
1,3214 gold badges28 silver badges42 bronze badges
1 Answer
Reset to default 7The repeater
is not a Jasmine construct, it is AngularJS e2e scenario tester concept.
The repeater
function is defined in the DSL used by the AngularJS e2e scenario runner and its definition can be seen here: https://github./angular/angular.js/blob/master/src/ngScenario/dsl.js#L249
The corresponding documentation is located at: http://docs.angularjs/guide/dev_guide.e2e-testing
It should be noted that even if AngularJS uses Jasmine syntax for its end-to-end test, those e2e tests are not Jasmine tests, they just happen to use very similar syntax. The purpose of the AngularJS ngScenario
runner is to execute end-to-end tests in a browser and uses matchers are tight to the browser environment (DOM, location etc.) Jasmine is more focused on unit-tests and has matchers for JavaScript objects.
The mentioned repeater
is just a way of counting DOM object given a jQuery selector and it is true that is usually used to count DOM element produced by the ngRepeat
directive.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742339142a4425265.html
评论列表(0条)