dimanche 10 mai 2015

Protractor find element with multiple div condition in AngularJS

I am trying to get list of items by checking multiple condition, example want to get file count

Example if I run below code, I get result 6:

element.all(by.repeater('releasenotefile in release.releasenotefiles')).count().then(function(count) {
      console.log(count);
});

But I want count of Release 1.4 only and I tried the code below, and it returns 0:

element.all(by.cssContainingText('.list_subhead',"1.04 Release Title")).all(by.repeater('releasenotefile in release.releasenotefiles')).count().then(function(count) {
                  console.log(count);
});

Here is my div structure:

------------
Release 1.4 <div class="accordion-section panel clearfix ng-scope" ng-repeat="release in app.releases" ng-class="{active: $first}">

Release note <div class="vz_list_container_01">

    File 1 <li class="bp ng-scope" ng-repeat="releasenotefile in release.releasenotefiles">
    File 2 
--------------

------------
Release 1.3

Release note

    File 3

--------------

------------
Release 1.2

Release note
    File 4 
    File 5
    File 6 
--------------

Aucun commentaire:

Enregistrer un commentaire