I'm currently developing some e2e tests for an Angular App and I've run into some issues: There's a table, and every row contains a view, edit and delete button in it's last td as such:
<td>
<button ng-click="credentialDetail({id:credential.id})"/>
<button ng-click="update(credential.id)"/>
<button ng-click="delete(credential.id)"/>
</td>
Each row contains a value which is the ID of the displayed object. Is there a way to make protractor click a button in the correct row? I've tried the following with no success.
this.deleteCredential = (function(externalId){
$$('tr').each(function(rowElm, r) {
// Traverse cols
rowElm.$$('td').each(function(cellElm, c) {
// Workout cell
if (cellElm.getText() === externalId){
}
});
});
});
P.S. I did have a look at the following question: How to handle table data in Protractor I think the solution here was close, but the nested functions confused me