如何使用量角器选择聚合物组件

时间:2017-04-21 12:29:31

标签: angular polymer protractor

嗨,以下是我的HTML

    <div class="ng-scope" ng-app="app" ng-controller="Todos">
<nd-uber-bar class="ng-isolate-scope" title="Title" subtitle="subtitle">
<nd-drawer-panel id="ndDrawerPanel" class="style-scope nd-uber-bar x-scope nd-drawer-panel-0" force-narrow="" disable-swipe="" style="touch-action: auto;" narrow="" selected="drawer">

我想验证selected =“drawer”,它是使用量角器的聚合物组件

1 个答案:

答案 0 :(得分:1)

您可以通过获取元素的selected属性来执行此操作:

var polymerPanel = $('#ndDrawerPanel');
expect(polymerPanel.getAttribute("selected")).toEqual("drawer");