I'm having following simple paper-tabs
element and I'd like to be able to assert on this on a protractor test:
<paper-tabs>
<paper-tab ng-repeat='tab in tabs'>
{{tab.title}}
</paper-tab>
</paper-tabs>
On a protractor test I'd like to be able to do something like the following:
it('url to tab', function() {
browser.get('#/my/url');
var tabs = element(by.css('header paper-tabs'));
tabs.getElement()(function(elem) {
expect(elem.selected).toBe(0);
});
});
Please note that selected
is a JS property and not an HTML attribute, as stated in the polymer documentation as well:
Use selected property to get or set the selected tab.
And thus following is just returning null
:
tabs.getAttribute('selected')
Isn't there a way to get to the underlying JS object? For example just as I'd type in to the Chrome-Console:
> document.getElementsByTagName('paper-tabs')[0].selected
0
I could not find anything in Protractor's API that would serve my purpose and I wonder how others are doing this?
Thanks!