Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

by.repeater('item of items') not working with angular2 *ngFor #3205

Open
jquerygeek opened this issue May 8, 2016 · 21 comments
Open

by.repeater('item of items') not working with angular2 *ngFor #3205

jquerygeek opened this issue May 8, 2016 · 21 comments

Comments

@jquerygeek
Copy link

@jquerygeek jquerygeek commented May 8, 2016

Need to use by.repeater() with Angular2 repeater *ngFor, but seems its not working as working with angular 1.x ng-repeat.

Any suggestion please.

@juliemr
Copy link
Member

@juliemr juliemr commented May 10, 2016

This is not yet expected to work - custom locators aren't yet supported for angular 2.

Loading

@gazbert
Copy link

@gazbert gazbert commented Dec 18, 2016

@jquerygeek - current workaround for me is to use CSS locator:

// let dashboardItems = element.all(by.repeater('exchange in exchanges'));
let dashboardItems = element.all(by.css('bx-dashboard-item'));
expect(dashboardItems.count()).toBe(8);

Loading

@mahmoudmahdi24
Copy link

@mahmoudmahdi24 mahmoudmahdi24 commented Dec 19, 2016

Hello,

When are you willing to implement these features ?
Unfortunately, Protactor is losing its charm when we get elements with "by.css" ...

Thanks,

Loading

@juliemr
Copy link
Member

@juliemr juliemr commented Dec 22, 2016

This is still on the list - we're working with Angular to design the best way to create these angular specific locators going forward. It's difficult because the angular compiler does not export all the information we need (for important performance reasons), so this needs to be done carefully.

The recommendation continues to be using by.css, which I find to be versatile and concise in most situations :)

Loading

@juliemr juliemr self-assigned this Dec 22, 2016
@juliemr juliemr added this to the Upcoming milestone Dec 22, 2016
@mahmoudmahdi24
Copy link

@mahmoudmahdi24 mahmoudmahdi24 commented Dec 22, 2016

Thanks for your reply Julie !

Loading

@gazbert
Copy link

@gazbert gazbert commented Jan 17, 2017

+1 for by.model and by.repeater - makes for less brittle and more data-driven tests. Happy to help review stuff/doc stuff/test stuff...

Loading

@arunkalesh
Copy link

@arunkalesh arunkalesh commented Mar 8, 2017

Try this:
var data = element.all(by.css('table[name='' + TableName + '']')).all(by.css('tr td'));
expect(data.get(0).getText()).toEqual('0');

Loading

@nithinkrishnan
Copy link

@nithinkrishnan nithinkrishnan commented Apr 4, 2017

Any further updates regarding use of by.repeater() with Angular2 repeater *ngFor, or still we need to follow by.css?

Loading

@arunkalesh
Copy link

@arunkalesh arunkalesh commented Apr 4, 2017

@nithinkrishnan I think we need to continue using the .css as they do not have anything yet to support for ngFor like they have for repeater.

Loading

@AhmedRagheb
Copy link

@AhmedRagheb AhmedRagheb commented Jul 12, 2017

Any clue when this issue will be closed ?

Loading

@DMadrid
Copy link

@DMadrid DMadrid commented Jul 12, 2017

^

Loading

@AhmedRagheb
Copy link

@AhmedRagheb AhmedRagheb commented Jul 12, 2017

@DMadrid What do u means :) :) ?

Loading

@JeremyIglehart
Copy link

@JeremyIglehart JeremyIglehart commented Sep 26, 2017

bump

Loading

@liwonder
Copy link

@liwonder liwonder commented Nov 17, 2017

Guys, any updates?

Loading

@samrantmedia
Copy link

@samrantmedia samrantmedia commented Nov 17, 2017

With just 2 small releases since February, Protractor doesn't seem to be getting the attention that angular is getting.

Loading

@arunkalesh
Copy link

@arunkalesh arunkalesh commented Nov 17, 2017

As a reason even I do not prefer using protractor anymore.

Loading

@TetonRaven
Copy link

@TetonRaven TetonRaven commented Nov 28, 2017

Is Protractor just dead now? Without the Angular integration, it's just Web Driver and might as well use Selenium at that point. With all the headaches that comes with. :-(

Loading

@martintro
Copy link

@martintro martintro commented Dec 13, 2017

Is this planned to be fixed in any upcoming release?

Loading

@fr0
Copy link

@fr0 fr0 commented Dec 15, 2017

by.css is powerful but brittle. by.model and friends are superior in many cases -- is there any intent to implement this someday, or has the protractor team decided to drop support for these features for Angular 2+? Since this issue has been sitting untouched for 12 months, it would be nice to hear the team's current thoughts.

Loading

@vonNord
Copy link

@vonNord vonNord commented Mar 14, 2018

It seems to me that protractor gives us a lot in the waiting/timing area that we would have to sleep() us through without.

As long as I have control over the source code for the stuff I'm testing, I can always insert id's, names or css classes to hopefully uniquely identify fields.

But support for binding and model would sure be appreciated.

Loading

@ganqqwerty
Copy link

@ganqqwerty ganqqwerty commented Feb 20, 2019

Is protractor good only for angular 1? I'm kinda not sure, there's no good documentation about how to use it effectively for angular 2+

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet