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

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -