Imagine you have a todo application with tasks listed as follows: Walk the dog, Eat lunch, Go shopping. Each task has an associated 'complete' link.
If you are using Protractor, how can you click on the 'complete' link for the second task, which is 'Eat lunch'? Ideally, you want to achieve this without relying on indices in your test script.
The HTML structure of the tasks is structured like this...
<ul class="pending">
<li ng-repeat="task in tasks">
{{task.name}}
<a href='#'>Complete</a>
</li>
</ul>
This scenario appears to be common, leading me to believe that there must be a relatively straightforward solution that I'm currently failing to recognize. Thanks in advance!