In Protractor, how to handle duplicate content in, say, tables? For example, given the following code, it produces a table with three columns Index, Nameand Delete-Buttoneach line:
<table class="table table-striped">
<tr ng-repeat="row in rows | filter : search" ng-class="{'muted':isTemp($index)}">
<td>{{$index+1}}</td>
<td>{{row}}</td>
<td>
<button class="btn btn-danger btn-mini" ng-click="deleteRow(row)" ng-hide="isTemp($index)"><i class="icon-trash icon-white"></i></button>
</td>
</tr>
</table>
And in my test, I need to click the "Delete" button based on the name. What is the best way to find this in Protractor?
I know that I can take the text rows.colum({{row}}), get the index of this, and then click button[index], but I hope for a more elegant solution.
For example, in Geb, you can pass a row locator to a module, which will then accumulate each row with column indicators. And this decision makes me look at the cartographic method "Keepers" ...
Brine