I want to test that the items added to a list have some kind of value in them. My current test looks like:
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();
});
});
I've been googling for a good way to do this, but haven't come up with anything.
Aucun commentaire:
Enregistrer un commentaire