私のテストでは、最初に特定の製品を見つけて、その製品のいくつかのサブ要素にいくつかの操作を行う必要があります。多くの製品があります。分度器:要素の要素を見つけることができません
これは私の最初の分度器のスクリプトですので、私に同行してください。
var prod = element.all(by.css('singleproduct')).get(1);
singleproduct
ディレクティブです。 これは壊れたスクリプトの一部です:
prod.element(by.css(".product-ordering ul li")).each(function(elem) {
})
しかし、私はいつもelement(...).each is not a function
HTML取得:
<singleproduct ng-repeat="item in vm.products" item="::item" class="col-xs-12 col-sm-6 col-md-4 product_tile ng-scope ng-isolate-scope">
<article ng-class="{'product--active': isSelected}" class="product">
<section ng-click="toggleDetails()" class="product-content">
<!-- some prod info -->
</section>
<section>
<div class="product-ordering">
<ul class="product-quantities">
<!-- ngRepeat: option in ::priceList -->
<li ng-repeat="option in ::priceList" class="ng-scope">
<!-- this is the LI I want to catch...
</li>
<!-- end ngRepeat: option in ::priceList -->
<li ng-repeat="option in ::priceList" class="ng-scope">
<!-- this is the LI I want to catch...
</li>
<!-- end ngRepeat: option in ::priceList -->
<li ng-repeat="option in ::priceList" class="ng-scope">
<!-- this is the LI I want to catch...
</li>
<!-- end ngRepeat: option in ::priceList -->
</ul>
</div>
</section>
</article>
</singleproduct>
ニースの問題、それは興味を持っている場合githubの問題に従って、そのための新しいeslintルールを追加するために触発:https://github.com/alecxe/eslint-plugin-protractor/issues/57 。ありがとう。 – alecxe
@alecxe私はあなたのプラグインが存在するかどうかわからなかった、かなり便利に見えます! – faboolous
私はばかだ、私はこのルールが実装されていることに気づいた:https://github.com/alecxe/eslint-plugin-protractor/blob/master/docs/rules/no-array-finder-methodsを参照してください.md。ありがとう。 – alecxe