E2E Testing Views with ng-grid

374 views
Skip to first unread message

Matt Madhavan

unread,
Jun 24, 2013, 5:52:01 PM6/24/13
to ang...@googlegroups.com
Hello,
I am having hard time testing the ng-grid in my view template. After the page is loaded (from a search) I would like to perform the following tests:

  • Check to see the expected number of (Say 5 rows) are loaded into the grid.
  • The first row (Primary member) is selected.

And few more tests.

Any ideas please? I cannot find any documentation on this. Also I looked at the ng-grid project site for E2E examples.I do not see any.

Any pointers would be greatly appreciated.

Thanks

Matt'M


Ramesh Kumar

unread,
Jun 26, 2013, 12:41:04 AM6/26/13
to ang...@googlegroups.com
expect(repeater('.ngCanvas div.ng-scope[ng-row=""]').count()).toBe(5)
expect(repeater('.ngCanvas div.ng-scope[ng-row=""]').row(7))assertpoint








--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matt Madhavan

unread,
Jun 26, 2013, 2:58:08 PM6/26/13
to ang...@googlegroups.com
Hi Ramesh,
Thank you very much for the reply. Can you please explain the syntax or point me to some documentation?

Thanks
Matt

Ramesh Kumar

unread,
Jun 26, 2013, 11:58:39 PM6/26/13
to ang...@googlegroups.com

Matt Madhavan

unread,
Jul 2, 2013, 2:14:53 PM7/2/13
to ang...@googlegroups.com
H Ramesh,
Thanks again for the reply. But the link you gave ma does not have any information on the DOM element selection for Grids.

After spending some time on the JQuery Selectors etc your code fragment below made more sense:


expect(repeater('.ngCanvas div.ng-scope[ng-row=""]').count()).toBe(5)

I still have the following questions:
ng-row="  can just be ng-row right?

In the generated DOM

<div ng-style="rowStyle(row)" ng-repeat="row in renderedRows" ng-click="row.toggleSelected($event)" ng-class="row.alternatingRowClass()" ng-row="" class="ng-scope ngRow selected even ui-state-default" style="top: 0px; height: 30px;">

considering the above DOM element, your syntax of : div.ng-scope[ng-row=""], what does ng-row mean? Is it the ng-row="" element attribute or the ngRow attribute of the class attribute? I presume it denotes the ngRow of the class attribute. If so why athe Square brackets?

I am still confused. Can you either explain or point me to some more documentations please? The link you sent just do mnot have any info on DOM element selection for the Grids.

Thanks
Matt'M
Reply all
Reply to author
Forward
0 new messages