我想测试添加到列表中的项目是否具有某种价值。我目前的测试看起来像:
containerDetail.openItemAddModal();
element(by.css('[ng-click="form.section = \'batch\'"]')).click();
element(by.model(batchModel)).sendKeys(batchEntry); // we insert the batch items here
element(by.buttonText('Add')).click();
expect(element.all(by.repeater('item in detail.container.items')).count()).toEqual(6);
// Would like to test that each item has some text
// thinking something like this:
element.all(by.repeater('item in detail.container.items')).each(function(item) {
item.getText().then(function(text) {
expect(text).toBeTruthy();
});
});
我一直在谷歌上寻找一个很好的方法来做到这一点,但还没有想出任何东西。