嗨,以下是我的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”,它是使用量角器的聚合物组件
答案 0 :(得分:1)
您可以通过获取元素的selected
属性来执行此操作:
var polymerPanel = $('#ndDrawerPanel');
expect(polymerPanel.getAttribute("selected")).toEqual("drawer");