mercredi 23 décembre 2015

How to count invisible items with Protractor

I can count visible items by using filter like this:

it('should have correct number of visible columns', function () {
  expect(tableHeaders.filter(function (header) {
      return header.isDisplayed()
  }).count()).toBe(6);
});

But how do I better count invisible ones? This one doesn't work as the header.isDisplayed() returns a Promise, not just a boolean:

it('should have correct number of visible columns', function () {
  expect(tableHeaders.filter(function (header) {
      return !header.isDisplayed()
  }).count()).toBe(6);
});

So, how should I count invisible items the most Protractor way?

Aucun commentaire:

Enregistrer un commentaire