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');
})
}