admin管理员组文章数量:1335380
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.
本文标签: javascriptIs 39repeater39 in this angular tutorial a jasmine conceptStack Overflow
版权声明:本文标题:javascript - Is 'repeater' in this angular tutorial a jasmine concept? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742339142a2456240.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论