I am trying to write a simple test that matches the binding in the repeater.
It works for me when I look at the CSS class, but I am "forbidden" to do this in our code. I cannot use HTML tags as a locator. I can only find attributes or direct binding.
I tried many different ways, including (but getting errors or no result):
var productPageUrl = element.all(by.repeater('product in products').row(0).column('{{product.productPageUrl}}'));
Not sure if this matters, but in the application the HTML template is included in ng-repeat.
This works (but cannot be used):
products.then(function(prods) {
prods[0].findElement(by.className('homepage-panel-link')).getAttribute('href').then(function(href){
expect(href).toMatch('/products/1');
});
});
HTML template repeated:
<div data-ng-repeat="product in products">
<div data-property-name="productItem-{{$index}}">
<a href="{{product.productPageUrl}}" class="homepage-panel-link" data-property-name="productPageUrl"></a>
</div>
</div>
In any case, just check the binding file. productPageUrl ??? From the above code, there seems to be a very long way to get this value.