javascript - angular chained orderby not updating when running protractor tests in browser -
i facing issue angular's ng-repeat directive containing multiple, piped filters when running during protractor test suite. although can see protractor click sort/toggle button, list not change should. expect sort list , show items when clicking special toggle buttons.
however, when execute commands manually (in same browser!), works fine!
please find how call protractor:
element(by.id('customers_sort_id')).click(); browser.driver.sleep(500); browser.waitforangular(); expect(element.all(by.repeater('c in list.customers')).get(0).all(by.tagname('td')).first().gettext()).toequal('500');
i have built in sleep() command waitforangular() call debugging reasons, change nothing.
these 2 toggle buttons whether display company customers, private customers, both types or none:
<label id="customers_show_company" ng-model="list.companyfilter.company" btn-checkbox>companies</label> <label id="customers_show_private" ng-model="list.companyfilter.private" btn-checkbox>private</label>
this 1 of table header rows sorting functionality:
<th id="customers_sort_id" ng-click="togglesort('id')">
this how filter variable set:
$scope.togglesort = function(column) { if($scope.list.orderby == column) { $scope.list.reverse = !$scope.list.reverse; } $scope.list.orderby = column; };
this table body:
<tr ng-repeat="c in list.customers | filter : list.companyfilter.visible | filter : list.searchfilter | orderby : list.orderby : list.reverse" ng-click="detailon(c.id)">
neither orderby nor reverse filter anything. sorting manually works expected. when running protractor tests, sort functionality doesn't work.
does have idea why?? input!
Comments
Post a Comment