【发布时间】:2018-08-20 13:32:50
【问题描述】:
我正在使用以下方法来验证表格所有页面中的某些表格数据。我已经尝试了所有的可能性,谁能分享你的想法。
下面的代码是我的页面,
this.isApplicationPresentUsingName = function (name) {
return this.pgnumCount.count().then(function(num){
if (num > 0) {
console.log(num);
for (var i = 0; i < num; i++) {
return this.pgnumCount.filter(function(pg){
pg.getText().then(function(text){
return text.toString()===i.toString();
}).then(function(number){
number.click();
}).then(function(){
this.checkApplication(name).then(function (found) {
console.log("Text1");
return found.length > 0;});
});
});
}
} else {
console.log('Pagination not exists');
}
});
});
this.checkApplication = function (text) { return element.all(by.cssContainingText("#application-auth-list-2 tbody tr td:first-child", text)); };
this.pgnumCount=$$('a.ui-paginator-page');
我在我的规范中这样称呼它,
expect(appAuth.isApplicationPresentUsingName(applicationName)).toBeFalsy();
我正面临以下问题,
失败:无法读取未定义的属性“过滤器”
但我可以在控制台中获得与 3 完全匹配的页码。
请帮忙
【问题讨论】:
标签: javascript protractor