javascript - Using Protractor with Angular2 -
i have little project in angular2 i'm trying write simple tests using protractor..
i using ngfor loop round list of 'foos' , display them on page (simple enough).
then want test text of 1st 1 , check see if it's 'bar':
element.all(by.repeater('foo of foos')).get(1).then(function(x){ expect(x.gettext()).toequal('bar'); });
but when run test get:
failed: element.all(...).get(...).then not function
any idea doing wrong?
the problem that:
element.all(by.repeater('foo of foos')).get(1)
elementfinder
- you cannot resolve
elementfinder
then()
(breaking change in protractor 2.0.0)
instead, do:
var elm = element.all(by.repeater('foo of foos')).get(1); expect(elm.gettext()).toequal('bar');
Comments
Post a Comment