2014-10-16 1 views
1

에 루프를 중단는 신고가있는 경우 내 상태가반환 각도기의 값과 상태 목록에서 텍스트를 확인

this.verifyAddedItem = function (panelName, searchTerm) { 
    var addedList = element.all(by.xpath('//*[@ng-repeat="selectedTerm"]/div[1]')); 
      var listCount = addedList.count(); 
      //  length is 2  
      listCount.then(function (length) { 
       Flagg = 'NA'; 
       for (var i = 1; i <= length; i++) {    
        addedList.get(i - 1).getText().then(function (termText) { 
         if (termText == searchTerm) { 

          Flagg = 'true'; 
          console.log("FLAGGGGG:= " + Flagg); 
         } else { 

          Flagg = 'false'; 
      `verification`//console.log("FLAG:= " + Flagg); 
         } 
        }) 
       } 
      //validate the value of flag    
       expect(Flagg).toBe('true'); 
       }) 
      } 

답변

0

일치하는 경우 내가 루프의 탈옥 수있는 방법도 각도기 에서 작동하지 드롭 다운에 특정 텍스트가 있는지 확인 중입니다.

public verifyDropdownValue(dropdownListLocator, optionText) { 
    var allOptions =element(by.model(dropdownListLocator)). 
       all(by.tagName('option')).getAttribute('value'); 

    expect(allOptions).toContain(optionText); 
}