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:

instead, do:

var elm = element.all(by.repeater('foo of foos')).get(1); expect(elm.gettext()).toequal('bar'); 

Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -