【发布时间】:2014-10-16 09:59:43
【问题描述】:
验证列表中的文本,标记在量角器中不起作用 另外,如果我的条件匹配,我该如何跳出循环
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');
})
}
【问题讨论】:
标签: jasmine protractor