1

I need to verify the column count of a table based off of the security role of the logged in user. How can I verify that in some instances 5 columns are displayed but in other instances 4 or 3?

The columns all use a unique "ng-class="{ 'sortable': sortable }"

1 Answer 1

1

Generally speaking, .count() should do the job:

var columns = $$(".sortable");
expect(columns.count()).toEqual(5);

If some of the columns are visible or not, you can filter the visible columns only:

var columns = $$(".sortable").filter(function (column) {
    return column.isDisplayed().then(function (isDisplayed) {
        return isDisplayed;
    });
}); 
expect(columns.count()).toEqual(5);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.